com.thinkaurelius.titan.diskstorage.util.time

## Class StandardTimepoint

- java.lang.Object
- - com.thinkaurelius.titan.diskstorage.util.time.StandardTimepoint

- All Implemented Interfaces:
    Timepoint, Comparable<Timepoint>

      public class StandardTimepoint
      extends Object
      implements Timepoint

  An instant in time

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `StandardTimepoint(long sinceEpoch, TimestampProvider provider)` Number of time units elapsed between the UNIX Epoch and this instant.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `StandardTimepoint` | `add(Duration addend)` Returns a new Timepoint which is the given duration later in time.
    `int` | `compareTo(Timepoint other)`
    `boolean` | `equals(Object obj)`
    `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 returnUnit)` Returns this timepoint as the elapsed time since UNIX epoch in the given time unit.
    `int` | `hashCode()`
    `Timepoint` | `sleepPast()` Causes this thread to sleep past this time point.
    `StandardTimepoint` | `sub(Duration subtrahend)` Returns a new Timepoint that is the given duration earlier in time.
    `String` | `toString()`

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### StandardTimepoint

          public StandardTimepoint(long sinceEpoch,
                           TimestampProvider provider)

      Number of time units elapsed between the UNIX Epoch and this instant. `sinceEpoch` may by any value in the representable range of `long`.
      Parameters:
        `sinceEpoch` - time units since UNIX Epoch
        `provider` - the underlying `TimestampProvider` that the timestamp is based off of

  - ### Method Detail

    - #### getTimestamp

          public long getTimestamp(TimeUnit returnUnit)

      Description copied from interface: `Timepoint`
      Returns this timepoint as the elapsed time since UNIX epoch in the given time unit.
      Specified by:
        `getTimestamp` in interface `Timepoint`
      Returns:

    - #### add

          public StandardTimepoint add(Duration addend)

      Description copied from interface: `Timepoint`
      Returns a new Timepoint which is the given duration later in time.
      Specified by:
        `add` in interface `Timepoint`
      Returns:

    - #### sub

          public StandardTimepoint sub(Duration subtrahend)

      Description copied from interface: `Timepoint`
      Returns a new Timepoint that is the given duration earlier in time.
      Specified by:
        `sub` in interface `Timepoint`
      Returns:

    - #### getNativeUnit

          public TimeUnit getNativeUnit()

      Description copied from interface: `Timepoint`
      Returns the native time unit of this time point as given by the backing `TimestampProvider`. Equivalent to `getProvider().getUnit()`.
      Specified by:
        `getNativeUnit` in interface `Timepoint`
      Returns:

    - #### getNativeTimestamp

          public long getNativeTimestamp()

      Description copied from interface: `Timepoint`
      Returns the elapsed time since UNIX epoch of this time point in the native unit. Equivalent to `getTimestamp(getNativeUnit())`
      Specified by:
        `getNativeTimestamp` in interface `Timepoint`
      Returns:

    - #### getProvider

          public TimestampProvider getProvider()

      Description copied from interface: `Timepoint`
      Returns the backing `TimestampProvider`.
      Specified by:
        `getProvider` in interface `Timepoint`
      Returns:

    - #### sleepPast

          public Timepoint sleepPast()
                              throws InterruptedException

      Description copied from interface: `Timepoint`
      Causes this thread to sleep past this time point.
      Specified by:
        `sleepPast` in interface `Timepoint`
      Returns:
      Throws:
        `InterruptedException`

    - #### compareTo

          public int compareTo(Timepoint other)

      Specified by:
        `compareTo` in interface `Comparable<Timepoint>`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2012–2014. All rights reserved.