public class Position
extends java.lang.Object
Constructor and Description |
---|
Position()
Creates a new and empty position.
|
Position(int simplePosition)
Creates a new position based on a single item address.
|
Position(java.util.List<java.lang.Integer> basePosition)
Creates a new position from the prepared sequence of numbers.
|
Modifier and Type | Method and Description |
---|---|
void |
applyRootCutting()
Removes the first item in the position sequence.
|
void |
applyRootPrepending(java.lang.Integer prefixItem)
Prepends a new item at the beginning of the position sequence.
|
void |
applyRootShifting(int incrementValue)
Increments the first item in the position sequence.
|
Position |
cloneIdenticalPosition()
Creates an independent clone of the position operation.
|
Position |
cloneShiftedPosition(int incrementValue)
Creates a new independent clone with applied root shifting.
|
int |
getPositionDepth()
Returns the depth of the position.
|
java.lang.String |
getPositionString()
Serializes the position into a readable string.
|
boolean |
isEmptyPosition()
Detects whether the position is trivial, i.e.
|
public Position()
public Position(int simplePosition)
simplePosition
- Integer representing simple number of node.public Position(java.util.List<java.lang.Integer> basePosition)
basePosition
- Sequence of simple positions to be seized.public java.lang.String getPositionString()
public int getPositionDepth()
public boolean isEmptyPosition()
public void applyRootPrepending(java.lang.Integer prefixItem)
prefixItem
- Simple position to be prepended.public void applyRootShifting(int incrementValue)
incrementValue
- Value to be added to the first simple position.public void applyRootCutting()
public Position cloneIdenticalPosition()
public Position cloneShiftedPosition(int incrementValue)
incrementValue
- Size of the root incrementation.