Package net.time4j.format.expert
Class ElementPosition
java.lang.Object
net.time4j.format.expert.ElementPosition
Represents a position information of a chronological element with a formatted text.
- Since:
- 3.0
- Author:
- Meno Hochschild
-
Constructor Summary
ConstructorsConstructorDescriptionElementPosition(ChronoElement<?> element, int startIndex, int endIndex)Creates a new instance of anElementPosition. -
Method Summary
-
Constructor Details
-
ElementPosition
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.- Parameters:
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)- Throws:
IllegalArgumentException- if the start index is negative or after the end index
-
-
Method Details
-
getElement
Yields the formatted chronolocial element.
- Returns:
ChronoElement
-
getStartIndex
public int getStartIndex()Yields the start index of associated formatted text.
- Returns:
- int
-
getEndIndex
public int getEndIndex()Yields the end index of associated formatted text.
- Returns:
- int
-
equals
Compares element, start index and end index.
-
hashCode
public int hashCode() -
toString
For debugging purposes.
-