com.thinkaurelius.titan.diskstorage.util.time

## Interface Timepoint

- All Superinterfaces:
    Comparable<Timepoint>
  All Known Implementing Classes:
    StandardTimepoint

      public interface Timepoint
      extends Comparable<Timepoint>

  An instant in time backed by a `TimestampProvider`

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Timepoint` | `add(Duration addend)` Returns a new Timepoint which is the given duration later in time.
    `long` | `getNativeTimestamp()` Returns the elapsed time since UNIX epoch of this time point in the native unit.
    `TimeUnit` | `getNativeUnit()` Returns the native time unit of this time point as given by the backing `TimestampProvider`.
    `TimestampProvider` | `getProvider()` Returns the backing `TimestampProvider`.
    `long` | `getTimestamp(TimeUnit targetUnit)` Returns this timepoint as the elapsed time since UNIX epoch in the given time unit.
    `Timepoint` | `sleepPast()` Causes this thread to sleep past this time point.
    `Timepoint` | `sub(Duration subtrahend)` Returns a new Timepoint that is the given duration earlier in time.

    - ### Methods inherited from interface java.lang.Comparable

      `compareTo`

- - ### Method Detail

    - #### getTimestamp

          long getTimestamp(TimeUnit targetUnit)

      Returns this timepoint as the elapsed time since UNIX epoch in the given time unit.
      Parameters:
        `targetUnit` -
      Returns:

    - #### add

          Timepoint add(Duration addend)

      Returns a new Timepoint which is the given duration later in time.
      Parameters:
        `addend` -
      Returns:

    - #### sub

          Timepoint sub(Duration subtrahend)

      Returns a new Timepoint that is the given duration earlier in time.
      Parameters:
        `subtrahend` -
      Returns:

    - #### getNativeUnit

          TimeUnit getNativeUnit()

      Returns the native time unit of this time point as given by the backing `TimestampProvider`. Equivalent to `getProvider().getUnit()`.
      Returns:

    - #### getNativeTimestamp

          long getNativeTimestamp()

      Returns the elapsed time since UNIX epoch of this time point in the native unit. Equivalent to `getTimestamp(getNativeUnit())`
      Returns:

    - #### getProvider

          TimestampProvider getProvider()

      Returns the backing `TimestampProvider`.
      Returns:

    - #### sleepPast

          Timepoint sleepPast()
                              throws InterruptedException

      Causes this thread to sleep past this time point.
      Returns:
      Throws:
        `InterruptedException`

Copyright © 2012–2014. All rights reserved.