org.glite.rgma
Class TimeInterval

java.lang.Object
  extended by org.glite.rgma.TimeInterval

public class TimeInterval
extends java.lang.Object

Encapsulates a time value and the units being used.


Constructor Summary
TimeInterval(long value, Units units)
          Creates a new TimeInterval object.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Compares this object with the specified object.
 long getValueAs(Units units)
          Gets the length of the time interval in the specified units.
 int hashCode()
          Returns a hash code value for the object.
 java.lang.String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TimeInterval

public TimeInterval(long value,
                    Units units)
Creates a new TimeInterval object.

Parameters:
value - The number of time units.
units - The time units: MILLIS, SECONDS, MINUTES, HOURS, DAYS.
Method Detail

getValueAs

public long getValueAs(Units units)
Gets the length of the time interval in the specified units.

Parameters:
units - The time units: MILLIS, SECONDS, MINUTES, HOURS, DAYS.
Returns:
The time interval in the given units.

equals

public boolean equals(java.lang.Object obj)
Compares this object with the specified object.

Overrides:
equals in class java.lang.Object
Parameters:
obj - Object to compare.
Returns:
true if this object and the specified object are equal.
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()
Returns a hash code value for the object.

Overrides:
hashCode in class java.lang.Object
Returns:
A hash code value for this object.
See Also:
Object.hashCode()

toString

public java.lang.String toString()
Returns a string representation of the object.

Overrides:
toString in class java.lang.Object
Returns:
A string representation of the object.
See Also:
Object.toString()