Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

recoin.util
Class DurationStamp  view DurationStamp download DurationStamp.java

java.lang.Object
  extended byrecoin.util.DurationStamp
All Implemented Interfaces:
java.io.Serializable

public class DurationStamp
extends java.lang.Object
implements java.io.Serializable

A DurationStamp can be used to measure a process that has a starting point and an end point.

The DurationStamp is given a name to identify the object or process that whose context this DurationStamp was created. This name is supposed to be used as a label for this DurationStamp.
Start and end of the process are stored internally as the number of milliseconds since January 1, 1970, 00:00:00 GMT.

Version:
0.2.9

Field Summary
private  long endTime
          The end time of the process in milliseconds.
private  java.lang.String name
          The name of the process represented by this DurationStamp.
private  long startTime
          The start time of the process in milliseconds.
 
Constructor Summary
DurationStamp(long initTime)
          Creates a DurationStamp with the specified start time.
 
Method Summary
 long getDurationInMillis()
          Returns the duration of this DurationStamp in milliseconds.
 java.util.Date getEndDate()
          Returns the end time of this DurationStamp as a java.util.Date.
 long getEndTimeInMillis()
          Returns the end time of this DurationStamp in milliseconds.
 java.lang.String getName()
          Returns the name of this DurationStamp.
 java.util.Date getStartDate()
          Returns the start time of this DurationStamp as a java.util.Date.
 long getStartTimeInMillis()
          Returns the start time of this DurationStamp in milliseconds.
 void setEndTime(long end)
          Sets the end time of this DurationStamp to the specified time.
 void setName(java.lang.String n)
          Sets the name of the DurationStamp to the specified name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

startTime

private long startTime
The start time of the process in milliseconds.


endTime

private long endTime
The end time of the process in milliseconds.


name

private java.lang.String name
The name of the process represented by this DurationStamp.

Constructor Detail

DurationStamp

public DurationStamp(long initTime)
Creates a DurationStamp with the specified start time.

Method Detail

getDurationInMillis

public long getDurationInMillis()
Returns the duration of this DurationStamp in milliseconds. If the end time of the DurationStamp has not been set, 0 is returned.


getEndDate

public java.util.Date getEndDate()
Returns the end time of this DurationStamp as a java.util.Date.


getStartDate

public java.util.Date getStartDate()
Returns the start time of this DurationStamp as a java.util.Date.


getStartTimeInMillis

public long getStartTimeInMillis()
Returns the start time of this DurationStamp in milliseconds.


getEndTimeInMillis

public long getEndTimeInMillis()
Returns the end time of this DurationStamp in milliseconds.


setEndTime

public void setEndTime(long end)
Sets the end time of this DurationStamp to the specified time.


setName

public void setName(java.lang.String n)
Sets the name of the DurationStamp to the specified name.


getName

public java.lang.String getName()
Returns the name of this DurationStamp.