Class TransitionModel

java.lang.Object
net.time4j.tz.model.TransitionModel
All Implemented Interfaces:
Serializable, TransitionHistory

public abstract class TransitionModel extends Object implements TransitionHistory, Serializable

Factory class for creating zonal transition histories.

Since:
2.2
Author:
Meno Hochschild
  • Method Details

    • of

      public static TransitionHistory of(List<ZonalTransition> transitions)

      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

      public static TransitionHistory of(ZonalOffset standardOffset, List<DaylightSavingRule> rules)

      Creates a new rule-based transition history.

      Parameters:
      standardOffset - standard offset
      rules - 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 offset
      transitions - list of zonal transitions
      rules - 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 interface TransitionHistory
      Returns:
      true if there are no transitions else false
    • 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