|
BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The Unit Conversion provides the ability to convert from one unit of measurement to any other in the same classification. The category of a unit describes what type quality the unit is measuring (e.g. height, weight, product packaging sizes). For each quantity being converted "to" the count can be used to simplify the implementation of the most common conversions based on a simple ratio. It also provides support the use of individual instance methods so that more complex calculations can be implemented.
Primary Key = theory.smart.axiom.units.UnitConversionPk
category
[UnitConversion] <*>------> [String
] (Primary Key)
atomic
[UnitConversion] <*>------> [theory.smart.axiom.units.Unit
]
to (Map)
[UnitConversion] <*>------> [theory.smart.axiom.units.Quantity
]
0..*
UnitConversionPk
,
UnitConversionHome
,
UnitConversionImpl
,
UnitConversionValue
Method Summary | |
boolean |
containsToKey(java.lang.String key)
Returns true if the to map contains a to for the specified key. |
boolean |
containsToValue(Quantity to)
Returns true if the to map maps one or more keys to the specified to. |
Quantity |
convert(ConversionFunction policy,
Quantity qty,
Unit unit)
|
Quantity |
convert(Quantity qty,
Unit unit)
Convert the specified quantity to the atomic unit and then into the specified units. |
Unit |
getAtomic()
Get the value of atomic |
java.lang.String |
getCategory()
|
ConversionFunction |
getDefaultConversionPolicy()
|
int |
getNumberOfTos()
Returns the number of key-value mappings in the to map. |
Quantity |
getToByKey(java.lang.String key)
Returns the to to which the to map maps the specified key. |
com.sun.java.util.collections.TreeMap |
getTos()
Returns a copy all of the tos from the specified map to the to map. |
UnitConversionValue |
getUnitConversionByValue()
Get all of UnitConversion's attributes. |
boolean |
isTosEmpty()
Returns true if the to map contains no key-value mappings. |
void |
putTo(java.lang.String key,
Quantity to)
Associates the specified to with the specified key in the to map. |
void |
putTos(com.sun.java.util.collections.TreeMap tos)
Copies all of the tos from the specified to map to this to map. |
void |
removeAllTos()
Removes all tos from this to map. |
Quantity |
removeToByKey(java.lang.String key)
Removes the to for this key from this to map if present. |
void |
setAtomic(Unit atomic)
Set the value of atomic |
void |
setDefaultConversionPolicy(ConversionFunction cvt)
|
void |
setUnitConversionByValue(UnitConversionValue value)
Set all of UnitConversion's attributes to the passed in value. |
Methods inherited from interface theory.smart.foundation.ConfigurableEntity |
setSuccessorAtClassLevel,
setSuccessorAtInstanceLevel |
Methods inherited from interface theory.smart.foundation.Configurable |
addProperty,
getProperty,
removeProperty |
Methods inherited from interface theory.smart.foundation.BusinessPolicyManager |
addBusinessPolicy,
getBusinessPolicy,
removeBusinessPolicy |
Methods inherited from interface javax.ejb.EJBObject |
getEJBHome,
getHandle,
getPrimaryKey,
isIdentical,
remove |
Method Detail |
public UnitConversionValue getUnitConversionByValue() throws java.rmi.RemoteException
public void setUnitConversionByValue(UnitConversionValue value) throws java.rmi.RemoteException
UnitConversionValue
- the UnitConversion value objectpublic java.lang.String getCategory() throws java.rmi.RemoteException
public Unit getAtomic() throws java.rmi.RemoteException
public void setAtomic(Unit atomic) throws java.rmi.RemoteException
atomics
- atomic to be addedpublic boolean containsToKey(java.lang.String key) throws java.rmi.RemoteException
key
- key whose presence in the to map is to be tested.public boolean containsToValue(Quantity to) throws java.rmi.RemoteException
to
- value of to whose presence in the to map is to be tested.public Quantity getToByKey(java.lang.String key) throws java.rmi.RemoteException
key
- key whose associated to is to be returned.#containsKey(Object)
public com.sun.java.util.collections.TreeMap getTos() throws java.rmi.RemoteException
tos
- a copy of the tos.public int getNumberOfTos() throws java.rmi.RemoteException
public boolean isTosEmpty() throws java.rmi.RemoteException
public void putTo(java.lang.String key, Quantity to) throws java.rmi.RemoteException
key
- key with which the specified to is to be associated.to
- to to be associated with the specified key.public void putTos(com.sun.java.util.collections.TreeMap tos) throws java.rmi.RemoteException
to
- Tos to be stored in the to map.public void removeAllTos() throws java.rmi.RemoteException
public Quantity removeToByKey(java.lang.String key) throws java.rmi.RemoteException
key
- key with which the specified to is associated.public Quantity convert(Quantity qty, Unit unit) throws java.rmi.RemoteException, UnitConversionException
public Quantity convert(ConversionFunction policy, Quantity qty, Unit unit) throws java.rmi.RemoteException, UnitConversionException
public void setDefaultConversionPolicy(ConversionFunction cvt) throws java.rmi.RemoteException
public ConversionFunction getDefaultConversionPolicy() throws java.rmi.RemoteException
|
BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |