org.omnaest.utils.time
Class DurationCapture.Interval

java.lang.Object
  extended by org.omnaest.utils.time.DurationCapture.Interval
All Implemented Interfaces:
Serializable
Enclosing class:
DurationCapture

public static class DurationCapture.Interval
extends Object
implements Serializable

Saves the interval points and their data like name and time.

Author:
Omnaest
See Also:
Serialized Form

Field Summary
protected  long duration
           
protected  Object key
           
protected  long startTime
           
protected  long stopTime
           
 
Constructor Summary
DurationCapture.Interval()
           
 
Method Summary
protected  void calculateDurationInMilliseconds()
          Calculates the duration field based on the startTime and stopTime.
 long getDurationInMilliseconds()
           
 long getInterimTimeInMilliseconds()
          Returns the duration in milliseconds which has passed since the start of the time measurement and now.
 Object getKey()
           
 void reset()
          Resets the internal timer of this time measurement for this DurationCapture.Interval.
protected  DurationCapture.Interval setKey(Object key)
           
 void startMeasurement()
          Starts the measurement of time for this DurationCapture.Interval.
 void stopMeasurement()
          Stops the time measurement for this DurationCapture.Interval.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

key

protected Object key

duration

protected long duration

startTime

protected long startTime

stopTime

protected long stopTime
Constructor Detail

DurationCapture.Interval

public DurationCapture.Interval()
Method Detail

getInterimTimeInMilliseconds

public long getInterimTimeInMilliseconds()
Returns the duration in milliseconds which has passed since the start of the time measurement and now.


startMeasurement

public void startMeasurement()
Starts the measurement of time for this DurationCapture.Interval.


stopMeasurement

public void stopMeasurement()
Stops the time measurement for this DurationCapture.Interval.


reset

public void reset()
Resets the internal timer of this time measurement for this DurationCapture.Interval.


calculateDurationInMilliseconds

protected void calculateDurationInMilliseconds()
Calculates the duration field based on the startTime and stopTime.


setKey

protected DurationCapture.Interval setKey(Object key)
Parameters:
key -
Returns:
this

getDurationInMilliseconds

public long getDurationInMilliseconds()

getKey

public Object getKey()


Copyright © 2013. All Rights Reserved.