Constructor and Description |
---|
SoftWrapsStorage() |
Modifier and Type | Method and Description |
---|---|
void |
addAll(java.util.List<? extends SoftWrapImpl> softWraps)
Adds soft wraps to storage.
|
boolean |
addSoftWrapChangeListener(SoftWrapChangeListener listener)
Registers given listener within the current model
|
java.lang.String |
dumpState() |
int |
getNumberOfSoftWrapsInRange(int startOffset,
int endOffset)
Allows to answer how many soft wraps which
start offsets belong to given
[start; end] interval are registered withing the current storage. |
SoftWrap |
getSoftWrap(int offset) |
int |
getSoftWrapIndex(int offset)
Tries to find index of the target soft wrap stored at
myWraps collection. |
java.util.List<SoftWrapImpl> |
getSoftWraps() |
boolean |
isEmpty() |
void |
notifyListenersAboutChange() |
void |
remove(SoftWrapImpl softWrap) |
void |
removeAll()
Removes all soft wraps registered at the current storage.
|
java.util.List<SoftWrapImpl> |
removeStartingFrom(int offset)
Removes soft wraps with offsets equal or larger than a given offset from storage.
|
void |
storeOrReplace(SoftWrapImpl softWrap)
Inserts given soft wrap to
myWraps collection at the given index. |
public boolean isEmpty()
true
if there is at least one soft wrap registered at the current storage; false
otherwisepublic SoftWrap getSoftWrap(int offset)
public java.util.List<SoftWrapImpl> getSoftWraps()
public int getSoftWrapIndex(int offset)
myWraps
collection. 'Target'
soft wrap is the one
that starts at the given offset.offset
- target offsetCollections.binarySearch(List, Object)
contract, i.e. non-negative returned
index points to soft wrap that starts at the given offset; '-(negative value) - 1'
points
to position at myWraps
collection where soft wrap for the given index should be insertedpublic int getNumberOfSoftWrapsInRange(int startOffset, int endOffset)
start offsets
belong to given
[start; end]
interval are registered withing the current storage.startOffset
- target start offset (inclusive)endOffset
- target end offset (inclusive)start offsets
belong to the target rangepublic void storeOrReplace(SoftWrapImpl softWrap)
myWraps
collection at the given index.softWrap
- soft wrap to storepublic void remove(SoftWrapImpl softWrap)
public java.util.List<SoftWrapImpl> removeStartingFrom(int offset)
public void addAll(java.util.List<? extends SoftWrapImpl> softWraps)
public void removeAll()
public boolean addSoftWrapChangeListener(SoftWrapChangeListener listener)
listener
- listener to registertrue
if given listener was not registered before; false
otherwisepublic void notifyListenersAboutChange()