com.ibm.websphere.fabric.da.types
Class Duration

java.lang.Object
  extended by com.ibm.websphere.fabric.da.types.Duration
All Implemented Interfaces:
java.io.Serializable

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

Represents a duration of time. Durations are comparable to one-another, and independent of beginning moment, locale or timezone. A duration is the difference between two moments. The current implementation has a maximum precision of 1 millisecond, but future versions may support finer granularity.

Instances of this type are immutable, and therefore thread-safe.

Version:
$Id: $, $Id: $
Author:
dranatunga, arichardson
See Also:
Serialized Form

Constructor Summary
Duration(long durationInMillis)
          Creates an object representing a duration that spans the specified number of milliseconds.
 
Method Summary
 long getDurationInMillis()
          Returns this duration in milliseconds.
 java.lang.String toString()
          Current implementation prints the duration in milliseconds.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Duration

public Duration(long durationInMillis)
Creates an object representing a duration that spans the specified number of milliseconds.

Parameters:
durationInMillis - a non-negative duration in milliseconds. A zero simply indicates that the duration spans less that 500 microseconds.
Method Detail

getDurationInMillis

public long getDurationInMillis()
Returns this duration in milliseconds. When durations have finer precision than a millisecond, the method will return the millisecond part of the duration without any rounding.

Returns:
a non-negative duration.

toString

public java.lang.String toString()
Current implementation prints the duration in milliseconds. See Object.toString()

Overrides:
toString in class java.lang.Object


Copyright © 2002-2009 IBM. All Rights Reserved.