Package net.time4j

Class ElementOperator<T>

java.lang.Object
net.time4j.ElementOperator<T>
Type Parameters:
T - generic target type this operator is applied to
All Implemented Interfaces:
Function<T,​T>, UnaryOperator<T>, ChronoOperator<T>

public abstract class ElementOperator<T> extends Object implements ChronoOperator<T>

Defines any manipulation of date or wall time objects following the strategy design pattern.

Author:
Meno Hochschild
  • Method Details

    • inStdTimezone

      public ChronoOperator<Moment> inStdTimezone()

      Creates an operator which can adjust a Moment in the system timezone.

      Note: Usually the operator converts the given Moment to a PlainTimestamp then processes this local timestamp and finally converts the result back to a new Moment. A special case are incrementing and decrementing of (sub-)second elements which eventually operate directly on the UTC timeline.

      Returns:
      operator with the default system timezone reference, applicable on instances of Moment
    • inTimezone

      public final ChronoOperator<Moment> inTimezone(TZID tzid)

      Creates an operator which can adjust a Moment in the given timezone.

      Note: Usually the operator converts the given Moment to a PlainTimestamp then processes this local timestamp and finally converts the result back to a new Moment. A special case are incrementing and decrementing of (sub-)second elements which eventually operate directly on the UTC timeline.

      Parameters:
      tzid - timezone id
      Returns:
      operator with the given timezone reference, applicable on instances of Moment
      Throws:
      IllegalArgumentException - if given timezone cannot be loaded
    • in

      public final ChronoOperator<Moment> in(Timezone tz)

      Creates an operator which can adjust a Moment in the given timezone.

      Note: Usually the operator converts the given Moment to a PlainTimestamp then processes this local timestamp and finally converts the result back to a new Moment. A special case are incrementing and decrementing of (sub-)second elements which eventually operate directly on the UTC timeline.

      Parameters:
      tz - timezone
      Returns:
      operator with the given timezone reference, applicable on instances of Moment
    • atUTC

      public final ChronoOperator<Moment> atUTC()

      Equivalent to at(ZonalOffset.UTC).

      Returns:
      operator for UTC+00:00, applicable on instances of Moment
      Since:
      1.2
      See Also:
      at(ZonalOffset)
    • at

      public final ChronoOperator<Moment> at(ZonalOffset offset)

      Creates an operator which can adjust a Moment at the given timezone offset.

      Note: Usually the operator converts the given Moment to a PlainTimestamp then processes this local timestamp and finally converts the result back to a new Moment. A special case are incrementing and decrementing of (sub-)second elements which eventually operate directly on the UTC timeline.

      Parameters:
      offset - timezone offset
      Returns:
      operator with the given timezone offset, applicable on instances of Moment
      Since:
      1.2