|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.liquidatom.derbyscore.domain.Duration
@Immutable @ThreadSafe public class Duration
A basic immutable data structure which holds a scalar and a unit for measuring the duration of time.
Constructor Summary | |
---|---|
Duration(long time,
java.util.concurrent.TimeUnit unit)
Construct a new Duration instance with the provided length and unit. |
Method Summary | |
---|---|
int |
compareTo(Duration o)
|
boolean |
equals(java.lang.Object o)
|
long |
getTime()
Get the length represented by this duration. |
long |
getTimeInMilliseconds()
Get the length of time represented in milliseconds. |
java.util.concurrent.TimeUnit |
getUnit()
Get the unit that the length of this duration is represented in. |
int |
hashCode()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Duration(long time, java.util.concurrent.TimeUnit unit)
time
- The number of units of duration this instance will represent.unit
- The unit of time this duration will represent.Method Detail |
---|
public long getTime()
getUnit()
.
public java.util.concurrent.TimeUnit getUnit()
public long getTimeInMilliseconds()
public int compareTo(Duration o)
compareTo
in interface java.lang.Comparable<Duration>
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |