public abstract class BasicUnit extends Object implements ChronoUnit
Abstract time unit class which can define its own rule.
| Modifier | Constructor and Description |
|---|---|
protected |
BasicUnit()
Subclasses usually define a singleton and have no public
constructors.
|
| Modifier and Type | Method and Description |
|---|---|
protected <T extends ChronoEntity<T>> |
derive(Chronology<T> chronology)
Derives an optional unit rule for given chronology.
|
boolean |
isCalendrical()
Queries if this time unit is calendrical respective is at least
as long as a calendar day.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetLengthprotected BasicUnit()
Subclasses usually define a singleton and have no public constructors.
public boolean isCalendrical()
ChronoUnitQueries if this time unit is calendrical respective is at least as long as a calendar day.
Implementation note: The method must be consistent with the typical
length of the unit. The expression
Double.compare(unit.getLength(), 86400.0) >= 0 is
equivalent to unit.isCalendrical().
isCalendrical in interface ChronoUnittrue if at least as long as a day else falseprotected <T extends ChronoEntity<T>> UnitRule<T> derive(Chronology<T> chronology)
Derives an optional unit rule for given chronology.
This implementation yields null so that a chronology
must register this unit. Specialized subclasses can define a rule
however if the chronology has not registered this unit.
T - generic type of time contextchronology - chronology an unit rule is searched fornull if given chronology is
not supportedCopyright © 2014–2015. All rights reserved.