public interface Location extends Comparable<Location>
TextSource.
This interface exists so that sources may potentially include location info
that are not just suitable for plain text.| Modifier and Type | Method and Description |
|---|---|
Location |
copy()
Create a copy of this location.
|
default boolean |
isAfter(Location other)
Get if this location comes after another location.
|
default boolean |
isBefore(Location other)
Get if this location comes before another location.
|
default boolean |
isSameOrAfter(Location other)
Get if this location is the same or after another location.
|
default boolean |
isSameOrBefore(Location other)
Get if this location is the same or before another location.
|
Location |
moveTextIndex(CharSequence sequence)
Move the text index according to the given sequence of characters.
|
Location |
moveTextIndex(CharSequence sequence,
int offset,
int length)
Move the text index according to the given sequence of characters.
|
static OffsetLocation |
offset(int index)
Quickly create a new
MutableOffsetLocation. |
static TextLocation |
text(int offset,
int line,
int column)
Quickly create a new
MutableTextOffsetLocation. |
String |
toString()
Return a string representation of this location suitable for debugging
output, such as in log messages.
|
compareToString toString()
Location copy()
default boolean isAfter(Location other)
other - default boolean isSameOrAfter(Location other)
other - default boolean isBefore(Location other)
other - default boolean isSameOrBefore(Location other)
other - Location moveTextIndex(CharSequence sequence)
sequence - Location moveTextIndex(CharSequence sequence, int offset, int length)
sequence - offset - length - static TextLocation text(int offset, int line, int column)
MutableTextOffsetLocation.line - column - static OffsetLocation offset(int index)
MutableOffsetLocation.index - Copyright © 2018. All rights reserved.