org.epics.pvmanager.util
Class TimeDuration

java.lang.Object
  extended by org.epics.pvmanager.util.TimeDuration

Deprecated. This class is being retired in favor of org.epics.util.time.TimeDuration

@Deprecated
public class TimeDuration
extends java.lang.Object

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.

Author:
carcassi

Method Summary
 TimeInterval after(TimeStamp reference)
          Deprecated. Returns a time interval that lasts this duration and starts from the given timestamp.
 TimeInterval around(TimeStamp reference)
          Deprecated. Returns a time interval that lasts this duration and is centered around the given timestamp.
static org.epics.util.time.TimeDuration asTimeDuration(TimeDuration duration)
          Deprecated.  
 TimeInterval before(TimeStamp reference)
          Deprecated. Returns a time interval that lasts this duration and ends at the given timestamp.
 TimeDuration divideBy(int factor)
          Deprecated. Returns a new duration which is smaller by the given factor.
static TimeDuration durationOf(org.epics.util.time.TimeDuration duration)
          Deprecated.  
 boolean equals(java.lang.Object obj)
          Deprecated.  
 long getNanoSec()
          Deprecated. Duration in nanoseconds.
 int hashCode()
          Deprecated.  
static TimeDuration hour(double hour)
          Deprecated. A new duration in hours.
static TimeDuration hz(double hz)
          Deprecated. A new duration in hertz, will convert to the length of the period.
static TimeDuration min(double min)
          Deprecated. A new duration in minutes.
static TimeDuration ms(double ms)
          Deprecated. A new duration in milliseconds.
static TimeDuration ms(int ms)
          Deprecated. A new duration in milliseconds.
 TimeDuration multiplyBy(int factor)
          Deprecated. Returns a new duration which is bigger by the given factor.
static TimeDuration nanos(long nanoSec)
          Deprecated. A new duration in nanoseconds.
static TimeDuration sec(double sec)
          Deprecated. A new duration in seconds.
 java.lang.String toString()
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

getNanoSec

public long getNanoSec()
Deprecated. 
Duration in nanoseconds.

Returns:
duration in nanoseconds.

hour

public static TimeDuration hour(double hour)
Deprecated. 
A new duration in hours.

Parameters:
hour - hours
Returns:
a new duration

min

public static TimeDuration min(double min)
Deprecated. 
A new duration in minutes.

Parameters:
min - minutes
Returns:
a new duration

sec

public static TimeDuration sec(double sec)
Deprecated. 
A new duration in seconds.

Parameters:
sec - seconds
Returns:
a new duration

hz

public static TimeDuration hz(double hz)
Deprecated. 
A new duration in hertz, will convert to the length of the period.

Parameters:
hz - frequency to be converted to a duration
Returns:
a new duration

ms

public static TimeDuration ms(int ms)
Deprecated. 
A new duration in milliseconds.

Parameters:
ms - milliseconds of the duration
Returns:
a new duration
Throws:
java.lang.IllegalArgumentException - if the duration is negative

ms

public static TimeDuration ms(double ms)
Deprecated. 
A new duration in milliseconds.

Parameters:
ms - milliseconds of the duration
Returns:
a new duration
Throws:
java.lang.IllegalArgumentException - if the duration is negative

nanos

public static TimeDuration nanos(long nanoSec)
Deprecated. 
A new duration in nanoseconds.

Parameters:
nanoSec - nanoseconds of the duration
Returns:
a new duration
Throws:
java.lang.IllegalArgumentException - if the duration is negative

divideBy

public TimeDuration divideBy(int factor)
Deprecated. 
Returns a new duration which is smaller by the given factor.

Parameters:
factor - constant to divide
Returns:
a new duration
Throws:
java.lang.IllegalArgumentException - if factor is negative

multiplyBy

public TimeDuration multiplyBy(int factor)
Deprecated. 
Returns a new duration which is bigger by the given factor.

Parameters:
factor - constant to multiply
Returns:
a new duration
Throws:
java.lang.IllegalArgumentException - if factor is negative

around

public TimeInterval around(TimeStamp reference)
Deprecated. 
Returns a time interval that lasts this duration and is centered around the given timestamp.

Parameters:
reference - a timestamp
Returns:
a new time interval

after

public TimeInterval after(TimeStamp reference)
Deprecated. 
Returns a time interval that lasts this duration and starts from the given timestamp.

Parameters:
reference - a timestamp
Returns:
a new time interval

before

public TimeInterval before(TimeStamp reference)
Deprecated. 
Returns a time interval that lasts this duration and ends at the given timestamp.

Parameters:
reference - a timestamp
Returns:
a new time interval

toString

public java.lang.String toString()
Deprecated. 
Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Deprecated. 
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Deprecated. 
Overrides:
equals in class java.lang.Object

durationOf

public static TimeDuration durationOf(org.epics.util.time.TimeDuration duration)
Deprecated. 

asTimeDuration

public static org.epics.util.time.TimeDuration asTimeDuration(TimeDuration duration)
Deprecated.