public class OffsetMap extends java.lang.Object implements Disposable
Disposable.Parent
Modifier and Type | Method and Description |
---|---|
void |
addOffset(OffsetKey key,
int offset)
Register key-offset binding.
|
boolean |
containsOffset(OffsetKey key) |
OffsetMap |
copyOffsets(Document anotherDocument) |
void |
dispose()
Usually not invoked directly, see class javadoc.
|
java.util.List<OffsetKey> |
getAllOffsets() |
Document |
getDocument() |
int |
getOffset(OffsetKey key) |
OffsetMap |
mapOffsets(Document anotherDocument,
java.util.function.Function<java.lang.Integer,java.lang.Integer> mapping) |
void |
removeOffset(OffsetKey key) |
java.lang.String |
toString() |
boolean |
wasModified(OffsetKey key) |
public OffsetMap(Document document)
public int getOffset(OffsetKey key)
key
- keypublic boolean containsOffset(OffsetKey key)
public void addOffset(OffsetKey key, int offset)
Document
editing operations
unless an operation replaces completely the offset vicinity.key
- offset keyoffset
- offset in the documentpublic void removeOffset(OffsetKey key)
public java.util.List<OffsetKey> getAllOffsets()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean wasModified(OffsetKey key)
public void dispose()
Disposable
dispose
in interface Disposable
public Document getDocument()