Package wt.part
Class Quantity
java.lang.Object
wt.part._Quantity
wt.part.Quantity
- All Implemented Interfaces:
Externalizable,Serializable,wt.fc._NetFactor,wt.fc._ObjectMappable,NetFactor,ObjectMappable
@GenAsObjectMappable(versions=-7293939132854124688L,properties={@GeneratedProperty(name="amount",type=double.class,initialValue="1",supportedAPI=PUBLIC,javaDoc="The amount attributes represents the amount portion of the Quantity.",accessors=@PropertyAccessors(setExceptions={}),columnProperties=@ColumnProperties(defaultValue="1")),@GeneratedProperty(name="unit",type=QuantityUnit.class,initialValue="QuantityUnit.EA",supportedAPI=PUBLIC,accessors=@PropertyAccessors(setExceptions={}),constraints=@PropertyConstraints(upperLimit=30,required=true),columnProperties=@ColumnProperties(defaultValue="ea"))})
public final class Quantity
extends _Quantity
This structured attribute class represents the concept of quantity as
an
_Quantity.amount and a QuantityUnit (unit of measure).
Use the newQuantity static factory method(s), not the Quantity
constructor, to construct instances of this class. Instances must be
constructed using the static factory(s), in order to ensure proper initialization
of the instance.
Supported API: true
Extendable: false
- See Also:
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true if the amount and QuantityUnit are equivalent.protected voidSupports initialization, following construction of an instance.protected voidinitialize(double an_Amount, QuantityUnit a_Unit) Supports initialization, following construction of an instance.static QuantityDefault factory for Quantity.static QuantitynewQuantity(double an_Amount, QuantityUnit a_Unit) Quantity factory, allowing construction with a specified amount and unit.
-
Method Details
-
newQuantity
Quantity factory, allowing construction with a specified amount and unit.
Supported API: true- Parameters:
an_Amount-a_Unit-- Returns:
- Quantity
- Throws:
WTException
-
initialize
Supports initialization, following construction of an instance. Invoked by "new" factory having the same signature.
Supported API: true- Parameters:
an_Amount-a_Unit-- Throws:
WTException
-
newQuantity
Default factory for Quantity. Defaults the amount to 1 and the unit to "ea".
Supported API: true- Returns:
- Quantity
- Throws:
WTException
-
initialize
Supports initialization, following construction of an instance. Invoked by "new" factory having the same signature.
Supported API: true- Throws:
WTException
-
equals
Returns true if the amount and QuantityUnit are equivalent. Does not convert from one unit to another.
Supported API: true
-