com.h3c.sdn.metric

## Class TimeStampManager

- java.lang.Object
- - com.h3c.sdn.metric.TimeStampManager

-     public class TimeStampManager
      extends Object

  Utility for tracking time stamps.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TimeStampManager()` Constructs a `TimeStampManager` using the current time to initialize both the previous and update time stamps.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `getMsSpanned()` Determines the number of milliseconds spanned between the latest (update) time stamp and the oldest (previous) time stamp, accounting for roll-over of the time stamp.
    `long` | `getPreviousTimeStamp()` Gets the previous time stamp.
    `long` | `getUpdateTimeStamp()` Gets the update time stamp.
    `void` | `setPreviousTimeStamp(long time)` Sets the previous time stamp.
    `void` | `setUpdateTimeStamp(long time)` Sets the update time stamp.
    `String` | `toDebugString()` Gets a detailed representation of this object to facilitate debugging.
    `String` | `toString()`
    `void` | `updateTimeStamp()` Convenience method that sets the update time stamp to the current time.

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

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

- - ### Constructor Detail

    - #### TimeStampManager

          public TimeStampManager()

      Constructs a `TimeStampManager` using the current time to initialize both the previous and update time stamps.

  - ### Method Detail

    - #### getPreviousTimeStamp

          public long getPreviousTimeStamp()

      Gets the previous time stamp.
      Returns:
        previous time stamp

    - #### getMsSpanned

          public long getMsSpanned()

      Determines the number of milliseconds spanned between the latest (update) time stamp and the oldest (previous) time stamp, accounting for roll-over of the time stamp.
      Returns:
        milliseconds spanned between the update and previous time stamps

    - #### getUpdateTimeStamp

          public long getUpdateTimeStamp()

      Gets the update time stamp.
      Returns:
        update time stamp

    - #### setPreviousTimeStamp

          public void setPreviousTimeStamp(long time)

      Sets the previous time stamp.
      Parameters:
        `time` - previous time stamp

    - #### setUpdateTimeStamp

          public void setUpdateTimeStamp(long time)

      Sets the update time stamp.
      Parameters:
        `time` - update time stamp

    - #### toDebugString

          public String toDebugString()

      Gets a detailed representation of this object to facilitate debugging.
      Returns:
        debug representation of object

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### updateTimeStamp

          public void updateTimeStamp()

      Convenience method that sets the update time stamp to the current time.

Copyright © 2014. All Rights Reserved.