public class VisualPosition
extends java.lang.Object
Visual position corresponds to a boundary between two characters and can be associated with either a preceding or succeeding character
(see leansRight
). This association makes a difference in a bidirectional text, where a mapping from visual to logical position
is not continuous.
Modifier and Type | Field and Description |
---|---|
int |
column |
boolean |
leansRight
If
true , this position is associated with succeeding character (in visual order), otherwise it's associated with
preceding character. |
int |
line |
Constructor and Description |
---|
VisualPosition(int line,
int column) |
VisualPosition(int line,
int column,
boolean leansRight) |
Modifier and Type | Method and Description |
---|---|
boolean |
after(VisualPosition other)
Allows to answer if current visual position is located after the given one.
|
boolean |
equals(java.lang.Object o) |
int |
getColumn() |
int |
getLine() |
int |
hashCode() |
VisualPosition |
leanRight(boolean value)
Constructs a new
VisualPosition instance with a given value of leansRight flag. |
java.lang.String |
toString() |
public final int line
public final int column
public final boolean leansRight
true
, this position is associated with succeeding character (in visual order), otherwise it's associated with
preceding character. This can make difference in bidirectional text, where visual positions which differ only in this flag's value
can correspond to a different logical positions.
This field has no impact on equality and comparison relationships between VisualPosition
instances.
public VisualPosition(int line, int column)
public VisualPosition(int line, int column, boolean leansRight)
public boolean after(VisualPosition other)
other
- visual position to compare with the current onetrue
if current position is 'after' the given one; false
otherwisepublic VisualPosition leanRight(boolean value)
VisualPosition
instance with a given value of leansRight
flag.public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public int getLine()
public int getColumn()