|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.epics.pvmanager.util.TimeDuration
public class TimeDuration
A duration of time (such as 3 sec, 30ms, 1nsec) at the nanosecond precision. The duration is stored a (signed) long, which makes the maximum valid duration to around 292 years. No checks for overflows are done.
Note that while TimeStamp are usually created according to system clocks which takes into account leap seconds, all the math operations on TimeStamps do not take leap seconds into account.
Method Summary | |
---|---|
TimeInterval |
after(TimeStamp reference)
Returns a time interval that lasts this duration and starts from the given timestamp. |
TimeInterval |
around(TimeStamp reference)
Returns a time interval that lasts this duration and is centered around the given timestamp. |
TimeInterval |
before(TimeStamp reference)
Returns a time interval that lasts this duration and ends at the given timestamp. |
TimeDuration |
divideBy(int factor)
Returns a new duration which is smaller by the given factor. |
boolean |
equals(java.lang.Object obj)
|
long |
getNanoSec()
Duration in nanoseconds. |
int |
hashCode()
|
static TimeDuration |
ms(int ms)
A new duration in milliseconds. |
TimeDuration |
multiplyBy(int factor)
Returns a new duration which is bigger by the given factor. |
static TimeDuration |
nanos(long nanoSec)
A new duration in nanoseconds. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public long getNanoSec()
public static TimeDuration ms(int ms)
ms
- milliseconds of the duration
java.lang.IllegalArgumentException
- if the duration is negativepublic static TimeDuration nanos(long nanoSec)
nanoSec
- nanoseconds of the duration
java.lang.IllegalArgumentException
- if the duration is negativepublic TimeDuration divideBy(int factor)
factor
- constant to divide
java.lang.IllegalArgumentException
- if factor is negativepublic TimeDuration multiplyBy(int factor)
factor
- constant to multiply
java.lang.IllegalArgumentException
- if factor is negativepublic TimeInterval around(TimeStamp reference)
reference
- a timestamp
public TimeInterval after(TimeStamp reference)
reference
- a timestamp
public TimeInterval before(TimeStamp reference)
reference
- a timestamp
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |