net.agmodel.physical
Class AbstractQuantity

java.lang.Object
  |
  +--net.agmodel.physical.AbstractQuantity
All Implemented Interfaces:
Cloneable, Serializable
Direct Known Subclasses:
Acceleration, Angle, Area, Composite, Duration, Frequency, Length, Mass, Proportion, Radiation, Speed, Temperature, Volume, VolumetricDensity

public abstract class AbstractQuantity
extends Object
implements Serializable, Cloneable

This abstract class represents a measurable amount. This class defines abstract methods to get the value of a quantity using the "Syst?me International d'Unit?s" (SI) and to get the associated SI dimension.

See Also:
Serialized Form

Field Summary
protected static int AMOUNT_OF_SUBSTANCE
          SI base unit for amount of substance.
static float COMPLETE
           
protected  int derivation
           
static float DEVOID
           
protected static int DIMENSIONLESS
          SI base unit dimensionless.
protected static int ELECTRIC_CURRENT
          SI base unit for electric current.
protected static int LENGTH
          SI base unit for length.
protected static int LUMINOUS_INTENSITY
          SI base unit for luminous intensity.
protected static int MASS
          SI base unit for mass.
static int SPATIALLYINTERPOLATED
           
static int TEMPORALLYINTERPOLATED
           
protected static int THERMODYNAMIC_TEMPERATURE
          SI base unit for thermodynamic temperature.
protected static int TIME
          SI base unit for time
static int UNINTERPOLATED
           
 
Constructor Summary
AbstractQuantity()
           
 
Method Summary
 Object clone()
           
 Composite divide(AbstractQuantity x)
          Returns the Composite whose value is (this / x).
protected abstract  int getDimensionSI()
          Gets the SI dimension of this quantity.
protected  String getSymbolSI()
          Returns the String representation of the symbol associated to this quantity (1/s, m/s^2, molxK^3/ca/Kg^3, for example)
protected abstract  double getValueSI()
          Gets the quantity in the SI unit.
 boolean isSpatiallyInterpolated()
           
 boolean isTemporallyInterpolated()
           
 Composite multiply(AbstractQuantity x)
          Returns the Composite whose value is (this * x).
 Composite toComposite()
          Converts a simple quantity to Composite.
 String toString()
          Returns the decimal String representation of this quantity in SI units.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DIMENSIONLESS

protected static final int DIMENSIONLESS
SI base unit dimensionless.

See Also:
Constant Field Values

LUMINOUS_INTENSITY

protected static final int LUMINOUS_INTENSITY
SI base unit for luminous intensity.

See Also:
Constant Field Values

AMOUNT_OF_SUBSTANCE

protected static final int AMOUNT_OF_SUBSTANCE
SI base unit for amount of substance.

See Also:
Constant Field Values

THERMODYNAMIC_TEMPERATURE

protected static final int THERMODYNAMIC_TEMPERATURE
SI base unit for thermodynamic temperature.

See Also:
Constant Field Values

ELECTRIC_CURRENT

protected static final int ELECTRIC_CURRENT
SI base unit for electric current.

See Also:
Constant Field Values

TIME

protected static final int TIME
SI base unit for time

See Also:
Constant Field Values

MASS

protected static final int MASS
SI base unit for mass.

See Also:
Constant Field Values

LENGTH

protected static final int LENGTH
SI base unit for length.

See Also:
Constant Field Values

UNINTERPOLATED

public static final int UNINTERPOLATED
See Also:
Constant Field Values

TEMPORALLYINTERPOLATED

public static final int TEMPORALLYINTERPOLATED
See Also:
Constant Field Values

SPATIALLYINTERPOLATED

public static final int SPATIALLYINTERPOLATED
See Also:
Constant Field Values

COMPLETE

public static final float COMPLETE
See Also:
Constant Field Values

DEVOID

public static final float DEVOID
See Also:
Constant Field Values

derivation

protected int derivation
Constructor Detail

AbstractQuantity

public AbstractQuantity()
Method Detail

multiply

public Composite multiply(AbstractQuantity x)
Returns the Composite whose value is (this * x).

Parameters:
x - the quantity multiplier.
Returns:
(this * x)

divide

public Composite divide(AbstractQuantity x)
Returns the Composite whose value is (this / x).

Parameters:
x - the quantity divisor.
Returns:
(this / x)
Throws:
ArithmeticException - x.getValueSI() == 0.0

toComposite

public Composite toComposite()
Converts a simple quantity to Composite.

Returns:
the composite corresponding to the specified quantity.

toString

public String toString()
Returns the decimal String representation of this quantity in SI units.

Overrides:
toString in class Object
Returns:
decimal String representation of this quantity in SI units followed by its SI symbol.

getSymbolSI

protected String getSymbolSI()
Returns the String representation of the symbol associated to this quantity (1/s, m/s^2, molxK^3/ca/Kg^3, for example)

Returns:
decimal String representation of the SI symbol.

getValueSI

protected abstract double getValueSI()
Gets the quantity in the SI unit.

Returns:
quantity in the SI unit.

getDimensionSI

protected abstract int getDimensionSI()
Gets the SI dimension of this quantity.

Returns:
SI dimension of this quantity.

isTemporallyInterpolated

public boolean isTemporallyInterpolated()

isSpatiallyInterpolated

public boolean isSpatiallyInterpolated()

clone

public Object clone()
Overrides:
clone in class Object