com.thinkaurelius.titan.diskstorage.util.time

## Enum Timestamps

- java.lang.Object
- - java.lang.Enum<Timestamps>
  - - com.thinkaurelius.titan.diskstorage.util.time.Timestamps

- All Implemented Interfaces:
    TimestampProvider, Serializable, Comparable<Timestamps>

      public enum Timestamps
      extends Enum<Timestamps>
      implements TimestampProvider

  Implementations of `TimestampProvider` for different resolutions of time:
  - NANO: nano-second time resolution based on System.nanoTime using a base-time established by System.currentTimeMillis(). The exact resolution depends on the particular JVM and host machine.
  - MICRO: micro-second time which is actually at milli-second resolution.
  - MILLI: milli-second time resolution

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant and Description
    `MICRO`
    `MILLI`
    `NANO`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `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
    `void` | `sleepFor(Duration duration)` Sleep for the given duration of time.
    `Timepoint` | `sleepPast(Timepoint futureTime)` Block until the current time as returned by `TimestampProvider.getTime()` is greater than the given timepoint.
    `String` | `toString()`
    `static Timestamps` | `valueOf(String name)` Returns the enum constant of this type with the specified name.
    `static Timestamps[]` | `values()` Returns an array containing the constants of this enum type, in the order they are declared.

    - ### Methods inherited from class java.lang.Enum

      `clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface com.thinkaurelius.titan.diskstorage.util.time.TimestampProvider

      `getTime, getUnit`

- - ### Enum Constant Detail

    - #### NANO

          public static final Timestamps NANO

    - #### MICRO

          public static final Timestamps MICRO

    - #### MILLI

          public static final Timestamps MILLI

  - ### Method Detail

    - #### values

          public static Timestamps[] values()

      Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

          for (Timestamps c : Timestamps.values())
              System.out.println(c);

      Returns:
        an array containing the constants of this enum type, in the order they are declared

    - #### valueOf

          public static Timestamps valueOf(String name)

      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
        `name` - the name of the enum constant to be returned.
      Returns:
        the enum constant with the specified name
      Throws:
        `IllegalArgumentException` - if this enum type has no constant with the specified name
        `NullPointerException` - if the argument is null

    - #### sleepPast

          public Timepoint sleepPast(Timepoint futureTime)
                              throws InterruptedException

      Description copied from interface: `TimestampProvider`
      Block until the current time as returned by `TimestampProvider.getTime()` is greater than the given timepoint.
      Specified by:
        `sleepPast` in interface `TimestampProvider`
      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

          public void sleepFor(Duration duration)
                        throws InterruptedException

      Description copied from interface: `TimestampProvider`
      Sleep for the given duration of time.
      Specified by:
        `sleepFor` in interface `TimestampProvider`
      Throws:
        `InterruptedException`

    - #### getTimer

          public Timer getTimer()

      Description copied from interface: `TimestampProvider`
      Returns a `Timer` based on this timestamp provider
      Specified by:
        `getTimer` in interface `TimestampProvider`
      Returns:

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Enum<Timestamps>`

    - #### getTime

          public Timepoint getTime(long sinceEpoch,
                          TimeUnit unit)

      Description copied from interface: `TimestampProvider`
      Returns the given time as a `Timepoint` based off of this timestamp provider
      Specified by:
        `getTime` in interface `TimestampProvider`
      Returns:

Copyright © 2012–2014. All rights reserved.