Class AbstractClock

java.lang.Object
net.time4j.clock.AbstractClock
All Implemented Interfaces:
TimeSource<Moment>
Direct Known Subclasses:
AdjustableClock, FixedClock, NetTimeConnector

public abstract class AbstractClock extends Object implements TimeSource<Moment>

Abstract base clock implementation which allows local views within any timezone.

Since:
2.1
Author:
Meno Hochschild
  • Constructor Details

    • AbstractClock

      public AbstractClock()
  • Method Details

    • inPlatformView

      public ZonalClock inPlatformView()

      Creates a local clock in platform timezone.

      Returns:
      local clock in system timezone (using the platform timezone data)
      Since:
      3.3/4.2
      See Also:
      Timezone.ofPlatform()
    • inLocalView

      public ZonalClock inLocalView()

      Creates a local clock in system timezone.

      Returns:
      local clock in system timezone (using the best available timezone data)
      Since:
      2.1
      See Also:
      Timezone.ofSystem()
    • inZonalView

      public ZonalClock inZonalView(TZID tzid)

      Creates a local clock in given timezone.

      Parameters:
      tzid - timezone id
      Returns:
      local clock in given timezone
      Throws:
      IllegalArgumentException - if given timezone cannot be loaded
      Since:
      2.1
    • inZonalView

      public ZonalClock inZonalView(String tzid)

      Creates a local clock in given timezone.

      Parameters:
      tzid - timezone id
      Returns:
      local clock in given timezone
      Throws:
      IllegalArgumentException - if given timezone cannot be loaded
      Since:
      2.1