|
Jeospace API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jeospace.measure.Length
An object that represents a linear unit of measure.
For reference see: http://ts.nist.gov/ts/htdocs/230/235/h4402/appenc.pdf
Mult,
LengthUnit| Field Summary | |
protected double |
magnitude
The magnitude |
protected Mult |
multiplier
The multiplier |
protected LengthUnit |
units
The units |
| Constructor Summary | |
Length()
Construct a Length object initialized to the default value (1 meter). |
|
Length(double magnitude)
Construct a Length object initialized to the specified number of meters. |
|
Length(double magnitude,
LengthUnit units)
Construct a Length object. |
|
Length(double magnitude,
Mult multiplier,
LengthUnit units)
Construct a Length object. |
|
Length(Length length)
Construct a Length object. |
|
| Method Summary | |
void |
add(Length inLength)
Add to this object the argument Length object. |
void |
changeSign()
Change the sign of the magnitude of this Length object. |
void |
clear()
Set the value of this Length object to 0 meters. |
java.lang.Object |
clone()
Return a copy of this Length object. |
int |
compareTo(Length that)
Compare this object with the argument for order. |
int |
compareTo(java.lang.Object obj)
Compare this object with the argument for order. |
boolean |
equals(java.lang.Object obj)
Compare two Lengths for equality. |
double |
getMagnitude()
Return the double value of the magnitude of this Length object. |
double |
getMagnitude(LengthUnit units)
Return the double value of the magnitude of this Length object
in the specified units. |
double |
getMagnitude(Mult inMultiplier,
LengthUnit inUnits)
Return the double value of the magnitude of this Length object
in the specified multiplier and units. |
Mult |
getMultiplier()
Return the Mult component of this Length object. |
double |
getScaledMagnitude(Length scale)
Return the double value of the magnitude of this Length object
scaled by the input Length object. |
LengthUnit |
getUnits()
Return the units identifier of this Length object. |
int |
hashcode()
Return the hash code |
void |
set(double magnitude,
LengthUnit units)
Set this Length object to the specified value. |
void |
set(double magnitude,
Mult inMultiplier,
LengthUnit inUnits)
Set this Length object to the specified value. |
void |
set(Length length)
Set this Length object to the specified value. |
void |
setMagnitude(double value)
Set the value of the magnitude of this Length object. |
void |
subtract(Length inLength)
Subtract from this object the argument Length object. |
java.lang.String |
toString()
Return a String representation of this Length 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 LengthUnit units
| Constructor Detail |
public Length()
Length object initialized to the default value (1 meter).
public Length(double magnitude)
Length object initialized to the specified number of meters.
magnitude - The magnitude value.
public Length(double magnitude,
LengthUnit units)
Length object.
magnitude - The magnitude value.units - The units identifier.
public Length(double magnitude,
Mult multiplier,
LengthUnit units)
Length object.
magnitude - The magnitude value.multiplier - The multiplier identifier.units - The units identifier.public Length(Length length)
Length object.
length - The Length object to duplicate.| Method Detail |
public void set(Length length)
Length object to the specified value.
length - The Length object to duplicate
public void set(double magnitude,
LengthUnit units)
Length object to the specified value.
magnitude - The magnitude value.units - The units identifier.
public void set(double magnitude,
Mult inMultiplier,
LengthUnit inUnits)
Length object to the specified value.
magnitude - The magnitude value.inMultiplier - The multiplier identifier.inUnits - The units identifier.public void changeSign()
Length object.
public void add(Length inLength)
Length object.
inLength - A Length object.public void subtract(Length inLength)
Length object.
inLength - A Length object.public void setMagnitude(double value)
Length object.
value - The double value of the magnitude.public double getMagnitude()
double value of the magnitude of this Length object.
double value of the magnitudepublic double getMagnitude(LengthUnit units)
double value of the magnitude of this Length object
in the specified units.
units - The units identifier.
double value of the magnitude
public double getMagnitude(Mult inMultiplier,
LengthUnit inUnits)
double value of the magnitude of this Length object
in the specified multiplier and units.
inMultiplier - The multiplier identifier.inUnits - The units identifier.
double value of the magnitudepublic double getScaledMagnitude(Length scale)
Length object
scaled by the input Length object. The returned value is
converted to the multiplier and units of the passed scalor and divided by
the scalor's magnitude.
scale - The Length object to be used as a scalor.
double value of the magnitudepublic Mult getMultiplier()
Mult component of this Length object.
Mult component of this Length object.public LengthUnit getUnits()
Length object.
Length object.public void clear()
Length object to 0 meters.
public java.lang.Object clone()
Length object. Overrides Cloneable.
Length object.public int hashcode()
public boolean equals(java.lang.Object obj)
Lengths for equality. The result is true
if and only if the argument object is not null, is a Length object
and represents a length of the same magnitude as this Length.
Two Length 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 Lengths are equivalent;
false otherwise.public java.lang.String toString()
Length object.
Length objectpublic int compareTo(Length that)
that - The Length 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
Length.
|
Jeospace API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||