| java.lang.Object org.cougaar.planning.ldm.measure.AbstractMeasure org.cougaar.planning.ldm.measure.Capacity
Capacity | public class Capacity extends AbstractMeasure (Code) | | A generic Scalar per Duration class that can be interpreted in a
variety of ways depending on context.
|
Constructor Summary | |
public | Capacity(Scalar quantity, Duration period) Construct a capacity object which represents
a Scalar Measure (e.g. | public | Capacity(String s) String constructor. | public | Capacity(Scalar quantity) Construct an "instantaneous" capacity object - e.g. |
Capacity | public Capacity(Scalar quantity, Duration period)(Code) | | Construct a capacity object which represents
a Scalar Measure (e.g. Volume, Distance, etc) divided by a
Duration (time). Example: Miles per hour, hours per day, gallons per second.
May also be used
|
Capacity | public Capacity(String s)(Code) | | String constructor. Allowed syntax is:
"Scalarmeasure=ValueUnits Duration=ValueUnits"
Example: "Count=20units Duration=1weeks"
For instantaneous: "Count=20units"
|
Capacity | public Capacity(Scalar quantity)(Code) | | Construct an "instantaneous" capacity object - e.g.
the capactity of "holding 10000 Gallons" or "having 48 Het-equivalents".
|
getCommonUnit | public int getCommonUnit()(Code) | | an illegal value, since Capacity is a tuple * |
getMaxUnit | public int getMaxUnit()(Code) | | |
getNativeUnit | public int getNativeUnit()(Code) | | |
getNativeValue | public double getNativeValue()(Code) | | |
getPeriod | public Duration getPeriod()(Code) | | the denominator of the Capacty * |
getQuantity | public Scalar getQuantity()(Code) | | the numerator of the Capacity * |
getRate | public double getRate(int quantityUnits, int periodUnits)(Code) | | compute the figure that the capacity represents. E.g.
Capacity cap = new Capacity(new Volume("10 liters"), new Duration("1 seconds"));
double rate = cap.getCapacity(Volume.GALLONS, Duration.HOURS);
Note that to get the quantityUnits correct, you need to know
what the concrete type of the quantity is.
exception: UnknownUnitException - if a bad unit in either argument. exception: NullPointerException - if duration is null. |
getUnitName | public String getUnitName(int i)(Code) | | null, since Capacity is a tuple * |
getValue | public double getValue(int unit)(Code) | | |
hashCode | public int hashCode()(Code) | | |
isInstantaneous | public boolean isInstantaneous()(Code) | | is this a representation of instantaneous capacity? *
|
|
|