|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--net.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. |
protected static double[] |
factors
Conversion table. |
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. |
static int |
OUNCE_AVOIRDUPOIS
Used to specify avoirdupois ounce unit (US). |
static int |
OUNCE_TROY
Used to specify troy ounce unit. |
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 |
AMOUNT_OF_SUBSTANCE, COMPLETE, derivation, DEVOID, DIMENSIONLESS, ELECTRIC_CURRENT, LENGTH, LUMINOUS_INTENSITY, MASS, SPATIALLYINTERPOLATED, TEMPORALLYINTERPOLATED, THERMODYNAMIC_TEMPERATURE, TIME, 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). |
protected int |
getDimensionSI()
Gets the SI dimension of this Mass. |
double |
getValue(int unit)
Gets the mass in the specified unit. |
protected double |
getValueSI()
Gets the mass in kilograms. |
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, getSymbolSI, isSpatiallyInterpolated, isTemporallyInterpolated, multiply, toComposite, toString |
| Methods inherited from class java.lang.Object |
equals, finalize, 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
protected static final double[] factors
| 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),
Comparableprotected double getValueSI()
getValueSI in class AbstractQuantityprotected int getDimensionSI()
getDimensionSI in class AbstractQuantity
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||