Package net.time4j.tz.model
Class TransitionModel
java.lang.Object
net.time4j.tz.model.TransitionModel
- All Implemented Interfaces:
Serializable
,TransitionHistory
Factory class for creating zonal transition histories.
- Since:
- 2.2
- Author:
- Meno Hochschild
-
Method Summary
Modifier and TypeMethodDescriptionboolean
This method is only a performance indicator and determines if negative daylight savings exist at all in this model.boolean
isEmpty()
Determines if this history does not have any transitions.static TransitionHistory
of(List<ZonalTransition> transitions)
Creates a new array-based and finite transition history.static TransitionHistory
of(ZonalOffset standardOffset, List<DaylightSavingRule> rules)
Creates a new rule-based transition history.static TransitionHistory
of(ZonalOffset initialOffset, List<ZonalTransition> transitions, List<DaylightSavingRule> rules)
Creates a transition history of both history transitions and rules for future transitions as well.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.time4j.tz.TransitionHistory
dump, findConflictTransition, findNextTransition, findPreviousTransition, findStartTransition, getConflictTransition, getInitialOffset, getStartTransition, getStdTransitions, getTransitions, getValidOffsets
-
Method Details
-
of
Creates a new array-based and finite transition history.
- Parameters:
transitions
- list of zonal transitions- Returns:
- new transition history
- Throws:
IllegalArgumentException
- in any case of inconsistencies or if there are no transitions at all- Since:
- 2.2
-
of
Creates a new rule-based transition history.
- Parameters:
standardOffset
- standard offsetrules
- list of daylight saving rules- Returns:
- new transition history
- Throws:
IllegalArgumentException
- in any case of inconsistencies or if there are more than 127 rules- Since:
- 2.2
-
of
public static TransitionHistory of(ZonalOffset initialOffset, List<ZonalTransition> transitions, List<DaylightSavingRule> rules)Creates a transition history of both history transitions and rules for future transitions as well.
- Parameters:
initialOffset
- initial offsettransitions
- list of zonal transitionsrules
- list of daylight saving rules- Returns:
- new transition history
- Throws:
IllegalArgumentException
- in any case of inconsistencies or if there are more than 127 rules- Since:
- 2.2
-
isEmpty
public boolean isEmpty()Description copied from interface:TransitionHistory
Determines if this history does not have any transitions.
- Specified by:
isEmpty
in interfaceTransitionHistory
- Returns:
true
if there are no transitions elsefalse
-
hasNegativeDST
public boolean hasNegativeDST()This method is only a performance indicator and determines if negative daylight savings exist at all in this model.
The standard implementation obtains the value
false
.- Returns:
- boolean
- Since:
- 5.0
-