T
- the value typepublic final class Timed<T>
extends java.lang.Object
Constructor and Description |
---|
Timed(T value,
long time,
java.util.concurrent.TimeUnit unit)
Constructs a Timed instance with the given value and time information.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object other) |
int |
hashCode() |
long |
time()
Returns the time value.
|
long |
time(java.util.concurrent.TimeUnit unit)
Returns the contained time value in the time unit specified.
|
java.lang.String |
toString() |
java.util.concurrent.TimeUnit |
unit()
Returns the time unit of the contained time.
|
T |
value()
Returns the contained value.
|
public Timed(T value, long time, java.util.concurrent.TimeUnit unit)
value
- the value to holdtime
- the time to holdunit
- the time unit, not nulljava.lang.NullPointerException
- if unit is nullpublic T value()
public java.util.concurrent.TimeUnit unit()
public long time()
public long time(java.util.concurrent.TimeUnit unit)
unit
- the time untpublic boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object