com.thinkaurelius.titan.diskstorage.util.time

## Interface TimestampProvider

- All Known Implementing Classes:
    Timestamps

      public interface TimestampProvider

  System time interface that abstracts time units, resolution, and measurements of time.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Timepoint` | `getTime()` Returns the current time based on this timestamp provider as a `Timepoint`.
    `Timepoint` | `getTime(long sinceEpoch, TimeUnit unit)` Returns the given time as a `Timepoint` based off of this timestamp provider
    `Timer` | `getTimer()` Returns a `Timer` based on this timestamp provider
    `TimeUnit` | `getUnit()` Return the units of `getTime()`.
    `void` | `sleepFor(Duration duration)` Sleep for the given duration of time.
    `Timepoint` | `sleepPast(Timepoint futureTime)` Block until the current time as returned by `getTime()` is greater than the given timepoint.

- - ### Method Detail

    - #### getTime

          Timepoint getTime()

      Returns the current time based on this timestamp provider as a `Timepoint`.
      Returns:

    - #### getTime

          Timepoint getTime(long sinceEpoch,
                          TimeUnit unit)

      Returns the given time as a `Timepoint` based off of this timestamp provider
      Parameters:
        `sinceEpoch` -
        `unit` -
      Returns:

    - #### getUnit

          TimeUnit getUnit()

      Return the units of `getTime()`. This method's return value must be constant over at least the life of the object implementing this interface.
      Returns:
        this instance's time unit

    - #### sleepPast

          Timepoint sleepPast(Timepoint futureTime)
                              throws InterruptedException

      Block until the current time as returned by `getTime()` is greater than the given timepoint.
      Parameters:
        `futureTime` - The time to sleep past
      Returns:
        the current time in the same units as the `unit` argument
      Throws:
        `InterruptedException` - if externally interrupted

    - #### sleepFor

          void sleepFor(Duration duration)
                        throws InterruptedException

      Sleep for the given duration of time.
      Parameters:
        `duration` -
      Throws:
        `InterruptedException`

    - #### getTimer

          Timer getTimer()

      Returns a `Timer` based on this timestamp provider
      Returns:

Copyright © 2012–2014. All rights reserved.