org.jagatoo.util.timing
Class Time
java.lang.Object
org.jagatoo.util.timing.Time
public class Time
- extends java.lang.Object
Represents a Timestamp in the desired units.
Also handles conversions.
|
Constructor Summary |
Time(double value,
double unit)
Create a new timestamp |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NANOSECOND
public static final double NANOSECOND
- See Also:
- Constant Field Values
MICROSECOND
public static final double MICROSECOND
- See Also:
- Constant Field Values
MILLISECOND
public static final double MILLISECOND
- See Also:
- Constant Field Values
SECOND
public static final double SECOND
- See Also:
- Constant Field Values
MINUTE
public static final double MINUTE
- See Also:
- Constant Field Values
HOUR
public static final double HOUR
- See Also:
- Constant Field Values
DAY
public static final double DAY
- See Also:
- Constant Field Values
WEEK
public static final double WEEK
- See Also:
- Constant Field Values
MONTH
public static final double MONTH
- See Also:
- Constant Field Values
YEAR
public static final double YEAR
- See Also:
- Constant Field Values
Time
public Time(double value,
double unit)
- Create a new timestamp
- Parameters:
value - The value of the timestampunit - The unit of the time stamp, e.g. TimeStamp.NANOSECOND,
TimeStamp.MICROSECOND, TimeStamp.MILLISECOND, TimeStamp.SECOND
getValue
public double getValue()
- Returns:
- the value of this timestamp, in the
unit specified.
- See Also:
getUnit()
setValue
public void setValue(double value)
- Set the value of this timestamp, in the unit
specified.
- Parameters:
value -
getMilliseconds
public double getMilliseconds()
- Returns:
- the number of milliseconds this TimeStamp
represents.
getUnit
public double getUnit()
- Returns:
- the unit of this timestamp, = the number
of milliseconds ONE unit represents.
convertTo
public Time convertTo(double newUnit)
- Returns:
- the converted value to the new unit