com.h3c.util

## Interface Clock.WarpingTimeSource

- Enclosing class:
    Clock

      public static interface Clock.WarpingTimeSource

  Facade for implementing a time source capable of being warped with respect to real time.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `currentTimeMillis()` Get the current time in milliseconds since start of epoch.
    `void` | `setCurrentTimeMillis(long ms)` Set the current time in milliseconds since start of epoch.
    `void` | `setTimeOffset(long ms)` Set the milliseconds of time offset relative to current time.
    `boolean` | `supportsWarping()` Predicate that allows callers to determine whether the time-source supports warping operations.

- - ### Method Detail

    - #### currentTimeMillis

          long currentTimeMillis()

      Get the current time in milliseconds since start of epoch.
      Returns:
        number of milliseconds elapsed since start of epoch
      See Also:
        `System.currentTimeMillis()`

    - #### supportsWarping

          boolean supportsWarping()

      Predicate that allows callers to determine whether the time-source supports warping operations.
      Returns:
        true if time warping is supported; false otherwise

    - #### setCurrentTimeMillis

          void setCurrentTimeMillis(long ms)

      Set the current time in milliseconds since start of epoch. This number will be recorded as a current offset and any time elapsed from this time will be considered relative to this offset.
      Parameters:
        `ms` - number of milliseconds elapsed since start of epoch that comprises the current time
      Throws:
        `UnsupportedOperationException` - thrown if the source does not support time warping
      See Also:
        `System.currentTimeMillis()`

    - #### setTimeOffset

          void setTimeOffset(long ms)

      Set the milliseconds of time offset relative to current time.
      Parameters:
        `ms` - number of milliseconds of offset from the current time
      Throws:
        `UnsupportedOperationException` - thrown if the source does not support time warping

Copyright © 2014. All Rights Reserved.