org.jppf.utils
Class JPPFTimeout
java.lang.Object
org.jppf.utils.Pair<TimeUnit,Long>
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. |
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.
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.