|
Jeospace API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jeospace.measure.Mass
An object that represents a unit of mass.
For reference see: http://ts.nist.gov/ts/htdocs/230/235/h4402/appenc.pdf
Mult,
MassUnit| Field Summary | |
protected double |
magnitude
The magnitude |
protected Mult |
multiplier
The multiplier |
protected MassUnit |
units
The units |
| Constructor Summary | |
Mass()
Construct a Mass object initialized to the default value (1 kilogram). |
|
Mass(double magnitude,
MassUnit units)
Construct a Mass object. |
|
Mass(double magnitude,
Mult multiplier,
MassUnit units)
Construct a Mass object. |
|
Mass(Mass mass)
Construct a Mass object. |
|
| Method Summary | |
void |
add(Mass mass)
Add to this object the argument Mass object. |
void |
clear()
Set the value of this Mass object to 0 kilograms. |
java.lang.Object |
clone()
Return a copy of this Mass object. |
int |
compareTo(Mass 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 Masss for equality. |
double |
getMagnitude()
Return the value of the magnitude of this Mass object. |
double |
getMagnitude(MassUnit inUnits)
Return the double value of the magnitude of this Mass object
in the specified units. |
double |
getMagnitude(Mult inMultiplier,
MassUnit inUnits)
Return the double value of the magnitude of this Mass object
in the specified multiplier and units. |
Mult |
getMultiplier()
Return the Mult component of this Mass object. |
MassUnit |
getUnits()
Return the MassUnit component of this Mass object. |
int |
hashcode()
Return the hash code |
void |
set(double magnitude,
MassUnit units)
Set this Mass object to the specified value. |
void |
set(double magnitude,
Mult inMultiplier,
MassUnit inUnits)
Set this Mass object to the specified value. |
void |
set(Mass mass)
Set this Mass object to the specified value. |
void |
setMagnitude(double value)
Set the value of the magnitude of this Mass object. |
void |
subtract(Mass mass)
Subtract from this object the argument Mass object. |
java.lang.String |
toString()
Return a String representation of this Mass 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 MassUnit units
| Constructor Detail |
public Mass()
Mass object initialized to the default value (1 kilogram).
public Mass(double magnitude,
MassUnit units)
Mass object.
magnitude - the magnitude value.units - the units identifier.
public Mass(double magnitude,
Mult multiplier,
MassUnit units)
Mass object.
magnitude - the magnitude value.multiplier - the multiplier identifier.units - the units identifier.public Mass(Mass mass)
Mass object.
mass - the Mass object to duplicate.| Method Detail |
public void set(Mass mass)
Mass object to the specified value.
mass - the Mass object to duplicate
public void set(double magnitude,
MassUnit units)
Mass object to the specified value.
magnitude - the magnitude value.units - the units identifier.
public void set(double magnitude,
Mult inMultiplier,
MassUnit inUnits)
Mass object to the specified value.
magnitude - the magnitude value.inMultiplier - the multiplier identifier.inUnits - the units identifier.public void add(Mass mass)
Mass object.
mass - a Mass object.public void subtract(Mass mass)
Mass object.
mass - a Mass object.public void setMagnitude(double value)
Mass object.
public double getMagnitude()
Mass object.
double value of the magnitudepublic double getMagnitude(MassUnit inUnits)
Mass object
in the specified units.
inUnits - the units identifier.
double value of the magnitude
public double getMagnitude(Mult inMultiplier,
MassUnit inUnits)
Mass 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 Mass object.
Mult component of this Mass object.public MassUnit getUnits()
MassUnit component of this Mass object.
MassUnit component of this Mass object.public void clear()
Mass object to 0 kilograms.
public java.lang.Object clone()
Mass object. Overrides Cloneable.
Mass object.public int hashcode()
public boolean equals(java.lang.Object obj)
Masss for equality. The result is true
if and only if the argument object is not null, is a Mass object
and represents a mass of the same magnitude as this Mass.
Two Mass 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 Masss are equivalent;
false otherwise.public java.lang.String toString()
Mass object.
Mass objectpublic int compareTo(Mass that)
that - The Mass 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
Mass.
|
Jeospace API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||