public final class PositionInfo
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static PositionInfo |
FIRST
The
PositionInfo which represent an insert at the beginning of
the list. |
static PositionInfo |
LAST
The
PositionInfo which represent an insert at the end of the
list. |
| Constructor and Description |
|---|
PositionInfo(Position position,
java.lang.String positionReference)
Creates an instance of the PositionInfo.
|
| Modifier and Type | Method and Description |
|---|---|
Position |
getPosition()
Returns the kind/type of positioning which should be used.
|
java.lang.String |
getPositionReference()
Returns additional information which is needed to place an element.
|
int |
getPositionReferenceAsInteger()
Returns the additional information which is needed to place an element as
an int.
|
static PositionInfo |
parse(java.lang.String positionInfo)
Creates a
PositionInfo object out of the given positioning
string. |
java.lang.String |
toString() |
public static final PositionInfo FIRST
PositionInfo which represent an insert at the beginning of
the list.public static final PositionInfo LAST
PositionInfo which represent an insert at the end of the
list.public PositionInfo(Position position, java.lang.String positionReference)
position - the kind of the positioningpositionReference - additional information which is need to position an element
(e.g.: index, ID of another element)java.lang.NullPointerException - if the position is nullpublic Position getPosition()
public java.lang.String getPositionReference()
null if no additional information is givenpublic int getPositionReferenceAsInteger()
java.lang.NumberFormatException - if the positionReference can't be parsed to an intjava.lang.NullPointerException - if the positionReference is nullpublic static PositionInfo parse(java.lang.String positionInfo)
PositionInfo object out of the given positioning
string.
Examples for a positioning string:
last - place an element to the end of a listfirst - place an element to the beginning of a listindex:3 - place an element at the provided index 3 in a
listbefore:org.eclipse.test.id - place an element in a list
in front of the element with the ID "org.eclipse.test.id"after:org.eclipse.test.id - place an element in a list
after the element with the ID "org.eclipse.test.id"positionInfo - the positioning stringPositionInfo which holds all the data mentioned in the
positioning string, or null if the positioning
string doesn't hold a positioning informationpublic java.lang.String toString()
toString in class java.lang.Object