V - generic type of element values (will be adjusted to enum-supertype in next major release)public interface NumericalElement<V> extends ChronoElement<V>
A chronological element which allows a numerical representation.
This element interface is only relevant for enum-like elements.
| Modifier and Type | Method and Description |
|---|---|
int |
numerical(V value)
Translates given element value to a numerical integer.
|
default boolean |
parseFromInt(ChronoEntity<?> entity,
int value)
Converts and stores given integer into the result buffer.
|
default int |
printToInt(V value,
ChronoDisplay context,
AttributeQuery attributes)
Translates given element value to a numerical integer.
|
compare, getDefaultMaximum, getDefaultMinimum, getDisplayName, getSymbol, getType, isDateElement, isLenient, isTimeElement, namecomparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongint numerical(V value)
Translates given element value to a numerical integer.
Will be called by the default methods parseFromInt(ChronoEntity, int)
or printToInt(Object, ChronoDisplay, AttributeQuery). The integer Integer.MIN_VALUE
must be avoided in this conversion.
value - value to be converted to intdefault int printToInt(V value, ChronoDisplay context, AttributeQuery attributes)
Translates given element value to a numerical integer.
Will be called when element values need to be printed as numbers. The default
implementation just delegates to numerical(V).
value - value to be converted to intcontext - the object to be formattedattributes - format attributesdefault boolean parseFromInt(ChronoEntity<?> entity, int value)
Converts and stores given integer into the result buffer.
Will be called when int values need to be interpreted as enums. The default
implementation just delegates to numerical(V).
entity - mutable result buffer for parsed valuesvalue - parsed integertrue if the integer can be interpreted else falseCopyright © 2014–2017. All rights reserved.