|
Jeospace API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jeospace.measure.Time
An object that represents a unit of time.
For reference see: http://ts.nist.gov/ts/htdocs/230/235/h4402/appenc.pdf
Mult,
TimeUnit| Field Summary | |
protected double |
magnitude
The magnitude |
protected Mult |
multiplier
The multiplier |
protected TimeUnit |
units
The units |
| Constructor Summary | |
Time()
Construct a Time object initialized to the default value (1 second). |
|
Time(double magnitude,
Mult multiplier,
TimeUnit units)
Construct a Time object. |
|
Time(double magnitude,
TimeUnit units)
Construct a Time object. |
|
Time(Time time)
Construct a Time object. |
|
| Method Summary | |
void |
add(Time time)
Add to this object the argument Time object. |
void |
clear()
Set the value of this Time object to 0 seconds. |
java.lang.Object |
clone()
Return a copy of this Time object. |
int |
compareTo(java.lang.Object obj)
Compare this object with the argument for order. |
int |
compareTo(Time that)
Compare this object with the argument for order. |
boolean |
equals(java.lang.Object obj)
Compare two Times for equality. |
double |
getMagnitude()
Return the value of the magnitude of this Time object. |
double |
getMagnitude(Mult inMultiplier,
TimeUnit inUnits)
Return the double value of the magnitude of this Time object
in the specified multiplier and units. |
double |
getMagnitude(TimeUnit inUnits)
Return the double value of the magnitude of this Time object
in the specified units. |
Mult |
getMultiplier()
Return the Mult component of this Time object. |
TimeUnit |
getUnits()
Return the TimeUnit component of this Time object. |
int |
hashcode()
Return the hash code |
void |
set(double magnitude,
Mult inMultiplier,
TimeUnit inUnits)
Set this Time object to the specified value. |
void |
set(double magnitude,
TimeUnit units)
Set this Time object to the specified value. |
void |
set(Time time)
Set this Time object to the specified value. |
void |
setMagnitude(double value)
Set the value of the magnitude of this Time object. |
void |
subtract(Time time)
Subtract from this object the argument Time object. |
java.lang.String |
toString()
Return a String representation of this Time object. |
| Methods inherited from class java.lang.Object |
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected double magnitude
protected Mult multiplier
protected TimeUnit units
| Constructor Detail |
public Time()
Time object initialized to the default value (1 second).
public Time(double magnitude,
TimeUnit units)
Time object.
magnitude - the magnitude value.units - the units identifier.
public Time(double magnitude,
Mult multiplier,
TimeUnit units)
Time object.
magnitude - the magnitude value.multiplier - the multiplier identifier.units - the units identifier.public Time(Time time)
Time object.
time - the Time object to duplicate.| Method Detail |
public void set(Time time)
Time object to the specified value.
time - the Time object to duplicate
public void set(double magnitude,
TimeUnit units)
Time object to the specified value.
magnitude - the magnitude value.units - the units identifier.
public void set(double magnitude,
Mult inMultiplier,
TimeUnit inUnits)
Time object to the specified value.
magnitude - the magnitude value.inMultiplier - the multiplier identifier.inUnits - the units identifier.public void add(Time time)
Time object.
time - a Time object.public void subtract(Time time)
Time object.
time - a Time object.public void setMagnitude(double value)
Time object.
public double getMagnitude()
Time object.
double value of the magnitudepublic double getMagnitude(TimeUnit inUnits)
Time object
in the specified units.
inUnits - the units identifier.
double value of the magnitude
public double getMagnitude(Mult inMultiplier,
TimeUnit inUnits)
Time object
in the specified multiplier and units.
inMultiplier - the multiplier identifier.inUnits - the units identifier.
double value of the magnitudepublic Mult getMultiplier()
Mult component of this Time object.
Mult component of this Time object.public TimeUnit getUnits()
TimeUnit component of this Time object.
TimeUnit component of this Time object.public void clear()
Time object to 0 seconds.
public java.lang.Object clone()
Time object. Overrides Cloneable.
Time object.public int hashcode()
public boolean equals(java.lang.Object obj)
Times for equality. The result is true
if and only if the argument object is not null, is a Time object
and represents a time of the same magnitude as this Time.
Two Time objects are equal only if the getMagnitude
method returns the same value for both with identical multiplier and unit
identifiers.
obj - the object to compare with
true if the Times are equivalent;
false otherwise.public java.lang.String toString()
Time object.
Time objectpublic int compareTo(Time that)
that - The Time to compare
public int compareTo(java.lang.Object obj)
compareTo in interface java.lang.Comparableobj - The Object to compare
ClassCastException - if the argument is not a
Time.
|
Jeospace API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||