T - generic type compatible to ChronoEntitypublic class Chronology<T extends ChronoEntity<T>> extends Object implements ChronoMerger<T>
Represents a system of chronological elements which form any kind of temporal value.
| Modifier and Type | Class and Description |
|---|---|
static class |
Chronology.Builder<T extends ChronoEntity<T>>
Builder for creating a new chronology without any time axis.
|
| Modifier and Type | Method and Description |
|---|---|
T |
createFrom(ChronoEntity<?> entity,
AttributeQuery attributes,
boolean preparsing)
Konstruiert eine neue Entität basierend auf den angegebenen
chronologischen Daten.
|
T |
createFrom(TimeSource<?> clock,
AttributeQuery attributes)
Creates a new entity which reflects current time.
|
CalendarSystem<T> |
getCalendarSystem()
Returns the associated calendar system if available.
|
Class<T> |
getChronoType()
Returns the chronological type.
|
List<ChronoExtension> |
getExtensions()
Returns all registered chronological extensions.
|
Set<ChronoElement<?>> |
getRegisteredElements()
Returns all registered chronological elements.
|
boolean |
hasCalendarSystem()
Queries if this chronology has a calendar system.
|
boolean |
isRegistered(ChronoElement<?> element)
Queries if given chronological element is registered together
with its element rule.
|
boolean |
isSupported(ChronoElement<?> element)
Queries if given chronological element is supported by this
chronology.
|
static <T extends ChronoEntity<T>> |
lookup(Class<T> chronoType)
Returns a typed singleton per
ChronoEntity-class. |
ChronoDisplay |
preformat(T context,
AttributeQuery attributes)
Transforms the current context/entity into another set of chronological
values which finally shall be formatted using given attributes.
|
Chronology<?> |
preparser()
This method defines a child chronology which can preparse
a chronological text.
|
public Class<T> getChronoType()
Returns the chronological type.
public Set<ChronoElement<?>> getRegisteredElements()
Returns all registered chronological elements.
public boolean isRegistered(ChronoElement<?> element)
Queries if given chronological element is registered together with its element rule.
element - element to be asked (optional)true if registered else falsepublic boolean isSupported(ChronoElement<?> element)
Queries if given chronological element is supported by this chronology.
The element will be supported if it is either registered or defines a suitable element rule for this chronology.
element - element to be asked (optional)true if supported else falsepublic T createFrom(TimeSource<?> clock, AttributeQuery attributes)
ChronoMergerCreates a new entity which reflects current time.
In a date-only chronology this method will create the current date using the necessary timezone contained in given attributes.
createFrom in interface ChronoMerger<T extends ChronoEntity<T>>clock - source for current timeattributes - configuration attributes which might contain
the timezone to translate current time to
local timenull if given data are insufficientpublic T createFrom(ChronoEntity<?> entity, AttributeQuery attributes, boolean preparsing)
ChronoMergerKonstruiert eine neue Entität basierend auf den angegebenen chronologischen Daten.
Typischerweise wird mit verschiedenen Prioritäten das Argument
entity nach Elementen abgefragt, die gruppenweise einen
Zeitwert konstruieren. Zum Beispiel kann ein Datum entweder über
die Epochentage, die Gruppe Jahr-Monat-Tag oder die Gruppe Jahr und Tag
des Jahres konstruiert werden.
Ein Textinterpretierer ruft diese Methode auf, nachdem ein Text elementweise in chronologische Elemente und Werte aufgelöst wurde.
createFrom in interface ChronoMerger<T extends ChronoEntity<T>>entity - any chronological entity like parsed
elements with their valuesattributes - configuration attributes given by parserpreparsing - preparsing phase active?null if given data are insufficientpublic ChronoDisplay preformat(T context, AttributeQuery attributes)
ChronoMergerTransforms the current context/entity into another set of chronological values which finally shall be formatted using given attributes.
preformat in interface ChronoMerger<T extends ChronoEntity<T>>attributes - controls attributes during formattingpublic Chronology<?> preparser()
ChronoMergerThis method defines a child chronology which can preparse a chronological text.
preparser in interface ChronoMerger<T extends ChronoEntity<T>>nullpublic List<ChronoExtension> getExtensions()
Returns all registered chronological extensions.
This method will be called by format-API in order to collect all extension elements which are relevant for formatting.
public boolean hasCalendarSystem()
Queries if this chronology has a calendar system.
true if this chronology has a calendar system
else falsegetCalendarSystem()public CalendarSystem<T> getCalendarSystem()
Returns the associated calendar system if available.
nullChronoException - if the calendar system is unavailablehasCalendarSystem()public static <T extends ChronoEntity<T>> Chronology<T> lookup(Class<T> chronoType)
Returns a typed singleton per ChronoEntity-class.
T - generic type of time contextchronoType - chronological typenull if not foundCopyright © 2014. All rights reserved.