|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectnet.agmodel.physical.AbstractQuantity
net.agmodel.physical.Mass
This class represents the measure of the quantity of matter that a body or an object contains.  The mass of the body is not dependent on gravity and therefore is different from but proportional to its weight
| Field Summary | |
static int |
CARAT
Used to specify carat unit. |
static int |
GRAIN
Used to specify grain unit. |
static int |
GRAM
Used to specify gram unit. |
static int |
HUNDREDWEIGHT_UK
Used to specify UK hundredweight unit (= 112 pounds). |
static int |
HUNDREDWEIGHT_US
Used to specify US hundredweight unit (= 100 pounds). |
static int |
KILOGRAM
Used to specify kilogram unit.  The kilogram is equal to the mass of an international prototype in the form of a platinum-iridium cylinder kept at Sevres in France |
static int |
OUNCE_AVOIRDUPOIS
Used to specify avoirdupois ounce unit (US).  The avoirdupois system of weights and measures is based on a pound containing 16 ounces or 7,000 grains and equal to 453.59 grams. |
static int |
OUNCE_TROY
Used to specify troy ounce unit.  The troy system of weight and measures is based on a grain which is the same as in the avoirdupois system and a pound contains 12 ounces, 240 pennyweights, or 5,760 grains. |
static int |
POUND
Used to specify pound unit. |
static int |
QUINTAL
Used to specify metric quintal unit. |
static int |
SLUG
Used to specify slug unit. |
static int |
STONE
Used to specify stone unit. |
static int |
TON_UK
Used to specify UK ton unit. |
static int |
TON_US
Used to specify US ton unit. |
static int |
TONNE
Used to specify metric ton unit. |
| Fields inherited from class net.agmodel.physical.AbstractQuantity |
COMPLETE, DEVOID, SPATIALLYINTERPOLATED, TEMPORALLYINTERPOLATED, UNINTERPOLATED |
| Constructor Summary | |
Mass(Composite c)
Mass constructor from Composite quantity. |
|
Mass(double value,
int unit)
Mass constructor. |
|
| Method Summary | |
Mass |
add(Mass x)
Returns a Mass whose value is (this + x). |
int |
compareTo(Mass x)
Compares this Mass with the specified Mass. |
int |
compareTo(Object o)
Compares this Mass with the specified Object. |
Mass |
divide(double coefficient)
Returns a Mass whose value is (this / coefficient). |
VolumetricDensity |
divide(Volume v)
Returns a VolumetricDensity whose value is (this / v). |
double |
getValue(int unit)
Gets the mass in the specified unit. |
Mass |
multiply(double coefficient)
Returns a Mass whose value is (this * coefficient). |
void |
setValue(double value,
int unit)
Sets this Mass using the specified unit. |
Mass |
substract(Mass x)
Returns a Mass whose value is (this - x). |
| Methods inherited from class net.agmodel.physical.AbstractQuantity |
clone, divide, isSpatiallyInterpolated, isTemporallyInterpolated, multiply, toComposite, toString |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int KILOGRAM
public static final int CARAT
public static final int GRAIN
public static final int GRAM
public static final int HUNDREDWEIGHT_US
public static final int HUNDREDWEIGHT_UK
public static final int QUINTAL
public static final int OUNCE_AVOIRDUPOIS
public static final int OUNCE_TROY
public static final int POUND
public static final int SLUG
public static final int STONE
public static final int TON_US
public static final int TON_UK
public static final int TONNE
| Constructor Detail |
public Mass(double value,
int unit)
value - the mass in the specified unit.unit - the measurement unit being used.
ArrayIndexOutOfBoundsException - unknown measurement unitpublic Mass(Composite c)
c - the quantity to convert.
UnitDimensionException - composite is not a mass.Composite| Method Detail |
public double getValue(int unit)
unit - the measurement unit being used.
ArrayIndexOutOfBoundsException - unknown measurement unit
public void setValue(double value,
int unit)
value - the new mass in the specified unit.unit - the measurement unit being used.
ArrayIndexOutOfBoundsException - unknown measurement unitpublic Mass add(Mass x)
x - the Mass to be added.
public Mass substract(Mass x)
x - the Mass to be substracted.
public Mass multiply(double coefficient)
coefficient - the dimensionless multiplier.
public Mass divide(double coefficient)
coefficient - the dimensionless divisor.
ArithmeticException - coefficient == 0.0public VolumetricDensity divide(Volume v)
v - the volume divisor.
public int compareTo(Mass x)
x - Mass to which this Mass is to be compared.
public int compareTo(Object o)
compareTo in interface Comparableo - Object to which this Mass is to be compared.
ClassCastException - o is not a Mass.compareTo(Mass),
Comparable
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||