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.
|
boolean |
parseFromInt(ChronoEntity<?> entity,
int value)
Converts and stores given integer into the result buffer.
|
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, nameequalsint numerical(V value)
Translates given element value to a numerical integer.
Will be called by the default methods NumericalElement.parseFromInt(ChronoEntity, int)
or NumericalElement.printToInt(Object, ChronoDisplay, AttributeQuery). The integer Integer.MIN_VALUE
must be avoided in this conversion.
value - value to be converted to intint 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 attributesboolean 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–2018. All rights reserved.