com.thinkaurelius.titan.diskstorage.util.time

## Class ZeroDuration

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

- All Implemented Interfaces:
    Duration, Comparable<Duration>

      public class ZeroDuration
      extends Object
      implements Duration

  A zero-length `Duration` singleton.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static Duration` | `INSTANCE`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Duration` | `add(Duration addend)` Returns a new duration that equals the combined length of this and the given duration in the unit of this duration.
    `int` | `compareTo(Duration o)`
    `long` | `getLength(TimeUnit unit)` Returns the length of this duration in the given `TimeUnit`.
    `TimeUnit` | `getNativeUnit()` Returns the native unit used by this duration.
    `boolean` | `isZeroLength()` Whether this duration is of zero length.
    `Duration` | `multiply(double multiplier)` Multiplies the length of this duration by the given multiplier.
    `Duration` | `sub(Duration subtrahend)` Returns a new duration that equals the length of this duration minus the length of the given duration in the unit of this duration.

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### INSTANCE

          public static Duration INSTANCE

  - ### Method Detail

    - #### compareTo

          public int compareTo(Duration o)

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

    - #### getLength

          public long getLength(TimeUnit unit)

      Description copied from interface: `Duration`
      Returns the length of this duration in the given `TimeUnit`.
      Specified by:
        `getLength` in interface `Duration`
      Returns:

    - #### getNativeUnit

          public TimeUnit getNativeUnit()

      Description copied from interface: `Duration`
      Returns the native unit used by this duration. The actual time length is specified in this unit of time.
      Specified by:
        `getNativeUnit` in interface `Duration`
      Returns:

    - #### sub

          public Duration sub(Duration subtrahend)

      Description copied from interface: `Duration`
      Returns a new duration that equals the length of this duration minus the length of the given duration in the unit of this duration.
      Specified by:
        `sub` in interface `Duration`
      Returns:

    - #### add

          public Duration add(Duration addend)

      Description copied from interface: `Duration`
      Returns a new duration that equals the combined length of this and the given duration in the unit of this duration.
      Specified by:
        `add` in interface `Duration`
      Returns:

    - #### isZeroLength

          public boolean isZeroLength()

      Description copied from interface: `Duration`
      Whether this duration is of zero length.
      Specified by:
        `isZeroLength` in interface `Duration`
      Returns:

    - #### multiply

          public Duration multiply(double multiplier)

      Description copied from interface: `Duration`
      Multiplies the length of this duration by the given multiplier. The multiplier must be a non-negative number.
      Specified by:
        `multiply` in interface `Duration`
      Returns:

Copyright © 2012–2014. All rights reserved.