public final class ElementPosition
extends java.lang.Object
Represents a position information of a chronological element with a formatted text.
| Constructor and Description |
|---|
ElementPosition(ChronoElement<?> element,
int startIndex,
int endIndex)
Creates a new instance of an
ElementPosition. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj)
Compares element, start index and end index.
|
ChronoElement<?> |
getElement()
Yields the formatted chronolocial element.
|
int |
getEndIndex()
Yields the end index of associated formatted text.
|
int |
getStartIndex()
Yields the start index of associated formatted text.
|
int |
hashCode() |
java.lang.String |
toString()
For debugging purposes.
|
public ElementPosition(ChronoElement<?> element, int startIndex, int endIndex)
Creates a new instance of an ElementPosition.
The section text.substring(startIndex, endIndex) of the
formatted text referring to given element denotes the
element-specific text.
element - chronological elementstartIndex - index in formatted text which indicates the
starting position of associated element (inclusive)endIndex - index in formatted text which indicates the
end position of associated element (exclusive)java.lang.IllegalArgumentException - if the start index is negative or
after the end indexpublic ChronoElement<?> getElement()
Yields the formatted chronolocial element.
ChronoElementpublic int getStartIndex()
Yields the start index of associated formatted text.
public int getEndIndex()
Yields the end index of associated formatted text.
public boolean equals(java.lang.Object obj)
Compares element, start index and end index.
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
For debugging purposes.
toString in class java.lang.Object