public class SyntaxPosition extends ParsePosition
Constructor and Description |
---|
SyntaxPosition()
Constructs a new syntax position object using the offset of -1.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
SyntaxNode |
getSyntaxNode()
Gets the syntax node with which this position is associated.
|
int |
hashCode() |
void |
update(ParsePosition position,
SyntaxNode node)
This method updates the error offset of this syntax position and it
will also update it's own syntax node reference with the specified one,
if the specified parse position's error offset is larger than its
own.
|
void |
update(ParsePosition position,
SyntaxNode node,
boolean overrideIfIndicesEqual)
This method updates the error offset of this syntax position and it
will also update it's own syntax node reference with the specified one,
if the specified parse position's error offset is larger than its own.
|
void |
update(SyntaxPosition position)
This method updates the error offset of this syntax position and it
will also update it's own syntax node reference with the specified one,
if the specified position's error offset is larger than its own.
|
boolean |
wasUpdated()
Determines if the position was updated and resets the update flag to
false, thus operating as a reset-on-read latch.
|
getErrorIndex, getIndex, setErrorIndex, setIndex, toString
public SyntaxPosition()
public SyntaxNode getSyntaxNode()
SyntaxNode
instance associated with this exception.public void update(SyntaxPosition position)
position
- Original position whose state should be cloned.public void update(ParsePosition position, SyntaxNode node)
position
- Original position whose state should be cloned.node
- Node to associate with this position as part of the update.public void update(ParsePosition position, SyntaxNode node, boolean overrideIfIndicesEqual)
position
- Original position whose state should be cloned.node
- Node to associate with this position as part of the update.overrideIfIndicesEqual
- True if the update should occur even if
the indices are equal to each other; false if the update should occur
only if the new index is greater than the old one.public boolean wasUpdated()
public boolean equals(Object o)
equals
in class ParsePosition
public int hashCode()
hashCode
in class ParsePosition
Copyright © 2015. All Rights Reserved.