public class MutableTextOffsetLocation extends Object implements TextOffsetLocation
TextOffsetLocation for use in cases where both offset, line
and column is important.| Constructor and Description |
|---|
MutableTextOffsetLocation(int offset,
int line,
int column)
Create a new location representing the given line and column.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Location o) |
MutableTextOffsetLocation |
copy()
Copy this location.
|
MutableTextOffsetLocation |
copyFrom(MutableTextOffsetLocation location) |
boolean |
equals(Object obj) |
int |
get()
Get the offset.
|
int |
getColumn()
Get the column this location represents.
|
int |
getLine()
Get the line this location represents.
|
int |
hashCode() |
MutableTextOffsetLocation |
moveTextIndex(CharSequence sequence)
Move the text index according to the given sequence of characters.
|
MutableTextOffsetLocation |
moveTextIndex(CharSequence sequence,
int offset,
int length)
Move the text index according to the given sequence of characters.
|
MutableTextOffsetLocation |
moveTextIndex(int amount)
Create a version of this
Location that has moved a number of
positions in a text. |
MutableTextOffsetLocation |
moveTo(int line,
int column)
Move the line and column of this location, returning either itself if
utable or a copy if this instance is immutable.
|
MutableTextOffsetLocation |
moveTo(int offset,
int line,
int column)
Move the offset, line and column of this location, returning either
itself if mutable or a copy if this instance is immutable.
|
String |
toString()
Return a string representation of this location suitable for debugging
output, such as in log messages.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, waitisAfter, isBefore, isSameOrAfter, isSameOrBefore, offset, textpublic MutableTextOffsetLocation(int offset,
int line,
int column)
line - zero-indexed linecolumn - zero-indexed columnpublic int get()
OffsetLocationget in interface OffsetLocationpublic int getLine()
TextLocationgetLine in interface TextLocationpublic int getColumn()
TextLocationgetColumn in interface TextLocationpublic MutableTextOffsetLocation moveTo(int offset, int line, int column)
TextOffsetLocationmoveTo in interface TextOffsetLocationpublic MutableTextOffsetLocation moveTo(int line, int column)
TextLocationmoveTo in interface TextLocationpublic MutableTextOffsetLocation copyFrom(MutableTextOffsetLocation location)
public MutableTextOffsetLocation copy()
TextOffsetLocationcopy in interface Locationcopy in interface OffsetLocationcopy in interface TextLocationcopy in interface TextOffsetLocationpublic MutableTextOffsetLocation moveTextIndex(int amount)
OffsetLocationLocation that has moved a number of
positions in a text.moveTextIndex in interface OffsetLocationpublic MutableTextOffsetLocation moveTextIndex(CharSequence sequence)
TextOffsetLocationmoveTextIndex in interface LocationmoveTextIndex in interface OffsetLocationmoveTextIndex in interface TextLocationmoveTextIndex in interface TextOffsetLocationpublic MutableTextOffsetLocation moveTextIndex(CharSequence sequence, int offset, int length)
TextOffsetLocationmoveTextIndex in interface LocationmoveTextIndex in interface OffsetLocationmoveTextIndex in interface TextLocationmoveTextIndex in interface TextOffsetLocationpublic int compareTo(Location o)
compareTo in interface Comparable<Location>Copyright © 2018. All rights reserved.