net.agmodel.physical
Class Radiation

java.lang.Object
  |
  +--net.agmodel.physical.AbstractQuantity
        |
        +--net.agmodel.physical.Radiation
All Implemented Interfaces:
Cloneable, Comparable, Serializable

public final class Radiation
extends AbstractQuantity
implements Comparable

This class represents rate at which radiant energy is incident on an area.

See Also:
Serialized Form

Field Summary
 
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
Radiation(Composite c)
          Radiation constructor from Composite quantity.
Radiation(double value, RadiationUnit unit)
          Radiation constructor.
 
Method Summary
 Radiation add(Radiation x)
          Returns an Radiation whose value is (this + x).
 int compareTo(Object o)
          Compares this Radiation with the specified Object.
 int compareTo(Radiation x)
          Compares this Radiation with the specified Radiation.
 Radiation divide(double coefficient)
          Returns an Radiation whose value is (this / coefficient).
protected  int getDimensionSI()
          Gets the SI dimension of this Radiation.
 double getValue(RadiationUnit unit)
          Gets the Radiation in the specified unit.
protected  double getValueSI()
          Gets the Radiation in SI units.
 Radiation multiply(double coefficient)
          Returns an Radiation whose value is (this * coefficient).
 void setValue(double value, RadiationUnit unit)
          Sets this Radiation using the specified unit.
 Radiation substract(Radiation x)
          Returns an Radiation 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
 

Constructor Detail

Radiation

public Radiation(double value,
                 RadiationUnit unit)
Radiation constructor.

Parameters:
value - the Radiation in the specified unit.
unit - the measurement unit being used.
Throws:
ArrayIndexOutOfBoundsException - unknown measurement unit

Radiation

public Radiation(Composite c)
Radiation constructor from Composite quantity.

Parameters:
c - the quantity to convert.
Throws:
UnitDimensionException - composite is not an Radiation.
See Also:
Composite
Method Detail

getValue

public double getValue(RadiationUnit unit)
Gets the Radiation in the specified unit.

Parameters:
unit - the measurement unit being used.
Returns:
Radiation in the specified measurement unit.
Throws:
ArrayIndexOutOfBoundsException - unknown measurement unit

setValue

public void setValue(double value,
                     RadiationUnit unit)
Sets this Radiation using the specified unit.

Parameters:
value - the new Radiation in the specified unit.
unit - the measurement unit being used.
Throws:
ArrayIndexOutOfBoundsException - unknown measurement unit

add

public Radiation add(Radiation x)
Returns an Radiation whose value is (this + x).

Parameters:
x - the Radiation to be added.
Returns:
(this + x)

substract

public Radiation substract(Radiation x)
Returns an Radiation whose value is (this - x).

Parameters:
x - the Radiation to be substracted.
Returns:
(this - x)

multiply

public Radiation multiply(double coefficient)
Returns an Radiation whose value is (this * coefficient).

Parameters:
coefficient - the dimensionless multiplier.
Returns:
(this * coefficient)

divide

public Radiation divide(double coefficient)
Returns an Radiation whose value is (this / coefficient).

Parameters:
coefficient - the dimensionless divisor.
Returns:
(this / coefficient)
Throws:
ArithmeticException - coefficient == 0.0

compareTo

public int compareTo(Radiation x)
Compares this Radiation with the specified Radiation. This method is provided in preference to individual methods for each of the six boolean comparison operators (<, ==, >, >=, !=, <=). The suggested idiom for performing these comparisons is: (x.compareTo(y) <op> 0), where <op> is one of the six comparison operators.

Parameters:
x - Radiation to which this Radiation is to be compared.
Returns:
-1, 0 or 1 as this Radiation is numerically less than, equal to, or greater than x.

compareTo

public int compareTo(Object o)
Compares this Radiation with the specified Object. If the Object is a Radiation, this method behaves like compareTo(Radiation). Otherwise, it throws a ClassCastException (as Radiations are comparable only to other Radiations).

Specified by:
compareTo in interface Comparable
Parameters:
o - Object to which this Radiation is to be compared.
Returns:
a negative number, zero, or a positive number as this Radiation is numerically less than, equal to, or greater than o, which must be a Radiation.
Throws:
ClassCastException - o is not a Radiation.
See Also:
compareTo(Radiation), Comparable

getValueSI

protected double getValueSI()
Gets the Radiation in SI units.

Specified by:
getValueSI in class AbstractQuantity
Returns:
Radiation in SI units.

getDimensionSI

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

Specified by:
getDimensionSI in class AbstractQuantity
Returns:
2 * LENGTH + MASS - 2 * TIME