org.jppf.utils
Class JPPFTimeout

java.lang.Object
  extended by org.jppf.utils.Pair<TimeUnit,Long>
      extended by org.jppf.utils.JPPFTimeout
All Implemented Interfaces:
Serializable

public class JPPFTimeout
extends Pair<TimeUnit,Long>

Convenience class used to express a timeout in various units of time.

Author:
Laurent Cohen
See Also:
TimeUnit, Serialized Form

Constructor Summary
JPPFTimeout(TimeUnit unit, Long value)
          Initialize this timeout with the specfied time unit and value.
 
Method Summary
 TimeUnit unit()
          Get the time unit used to measure the time.
 Long value()
          Get the value expressed in getUnit() units.
 
Methods inherited from class org.jppf.utils.Pair
equals, first, hashCode, second
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JPPFTimeout

public JPPFTimeout(TimeUnit unit,
                   Long value)
Initialize this timeout with the specfied time unit and value.

Parameters:
unit - the time unit to use to measure the time.
value - the value expressed in timeUnit units.
Throws:
IllegalArgumentException - if the time unit is null, the value is null or the value is less than zero.
Method Detail

unit

public TimeUnit unit()
Get the time unit used to measure the time.

Returns:
a TimeUnit enum value.

value

public Long value()
Get the value expressed in getUnit() units.

Returns:
the timeout value as a Long.


Copyright © 2005-2010 JPPF Team.