V - generic type of element valuespublic abstract class BasicElement<V extends Comparable<V>> extends Object implements ChronoElement<V>, 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(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.
|
String |
name()
Returns the name which is unique within the context of a given
chronology.
|
String |
toString()
Serves mainly for debugging support.
|
getDefaultMaximum, getDefaultMinimum, getType, isDateElement, isTimeElementcomparing, comparing, comparingDouble, comparingInt, comparingLong, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongpublic final 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 Comparable<V>>public int compare(ChronoDisplay o1, ChronoDisplay o2)
Compares the values of this element based on their natural order.
compare in interface Comparator<ChronoDisplay>compare in interface ChronoElement<V extends 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 Comparable<V>>FormattableElementpublic boolean isLenient()
Chronological elements are strict by default.
isLenient in interface ChronoElement<V extends 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(Object obj)
Based on equality of element names AND element classes.
equals in interface Comparator<ChronoDisplay>equals in class Objecttrue if this instance and the argument are of same
class and have same names else falsepublic int hashCode()
Based on the element name.
Copyright © 2014–2015. All rights reserved.