V - generic type of element valuespublic abstract class BasicElement<V extends java.lang.Comparable<V>> extends java.lang.Object implements ChronoElement<V>, java.io.Serializable
Abstract base implementation of a chronological element which has a name and can also define an (unregistered) element rule.
| Modifier and Type | Method and Description |
|---|---|
int |
compare(ChronoDisplay o1,
ChronoDisplay o2)
Compares the values of this element based on their natural order.
|
boolean |
equals(java.lang.Object obj)
Based on equality of element names AND element classes.
|
char |
getSymbol()
There is no format symbol by default.
|
int |
hashCode()
Based on the element name.
|
boolean |
isLenient()
Chronological elements are strict by default.
|
boolean |
isLocal()
Elements are local by default and can therefore not be used
in a global context.
|
java.lang.String |
name()
Returns the name which is unique within the context of a given
chronology.
|
java.lang.String |
toString()
Serves mainly for debugging support.
|
getDefaultMaximum, getDefaultMinimum, getType, isDateElement, isTimeElementpublic final java.lang.String name()
ChronoElementReturns the name which is unique within the context of a given chronology.
The name can also serve as resource key together with the name of a chronology for a localized description.
name in interface ChronoElement<V extends java.lang.Comparable<V>>public int compare(ChronoDisplay o1, ChronoDisplay o2)
Compares the values of this element based on their natural order.
compare in interface java.util.Comparator<ChronoDisplay>compare in interface ChronoElement<V extends java.lang.Comparable<V>>o1 - the first object to be comparedo2 - the second object to be comparedChronoException - if this element is not registered in any entity
and/or if no element rule exists to extract the element valuepublic char getSymbol()
There is no format symbol by default.
In order to define a format symbol subclasses must override this
methode. In that case such an element instance should be annotated
with the annotation FormattableElement for documentation
support.
getSymbol in interface ChronoElement<V extends java.lang.Comparable<V>>FormattableElementpublic boolean isLenient()
Chronological elements are strict by default.
isLenient in interface ChronoElement<V extends java.lang.Comparable<V>>falseElementRule.withValue(T, V, boolean)public boolean isLocal()
Elements are local by default and can therefore not be used in a global context.
truegetVeto(Chronology)public boolean equals(java.lang.Object obj)
Based on equality of element names AND element classes.
equals in interface java.util.Comparator<ChronoDisplay>equals in class java.lang.Objecttrue if this instance and the argument are of same
class and have same names else falsepublic int hashCode()
Based on the element name.
hashCode in class java.lang.Objectpublic java.lang.String toString()
Serves mainly for debugging support.
For display purpose the method name() is to be
preferred.
toString in class java.lang.Object