Class FixedClock

All Implemented Interfaces:
TimeSource<Moment>

public final class FixedClock extends AbstractClock

Represents a fixed clock which always display the same current time.

Since:
2.1
Author:
Meno Hochschild
  • Method Details

    • of

      public static FixedClock of(UnixTime ut)

      Creates a new fixed clock.

      Parameters:
      ut - fixed clock time
      Returns:
      new clock instance with fixed time
      Since:
      2.1
    • currentTime

      public Moment currentTime()
      Description copied from interface: TimeSource

      Yields the current time.

      Returns:
      current time in seconds (as UnixTime object or derivate)
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()

      For debugging purposes.

      Overrides:
      toString in class Object
      Returns:
      description of clock state