|
BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--theory.smart.foundation.EntityImpl | +--theory.smart.foundation.ConfigurableEntityImpl | +--theory.smart.axiom.units.UnitConversionImpl
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
UnitConversion
,
UnitConversionHome
,
UnitConversionValue
, Serialized FormField Summary | |
Unit |
atomic
atomic [UnitConversion] <*>------> [ theory.smart.axiom.units.Unit ]
|
java.lang.String |
category
category [UnitConversion] <*>------> [ String ] (Primary Key)
|
com.sun.java.util.collections.TreeMap |
tos
to (Map) [UnitConversion] <*>------> [ theory.smart.axiom.units.Quantity ]
0..*
|
Fields inherited from class theory.smart.foundation.EntityImpl |
ctx,
isDirty,
isLoaded |
Constructor Summary | |
UnitConversionImpl()
|
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. |
void |
ejbActivate()
ejbActivate method. |
UnitConversionPk |
ejbCreate(UnitConversionPk unitConversionPk)
|
java.util.Enumeration |
ejbFindAll()
|
UnitConversionPk |
ejbFindByPrimaryKey(UnitConversionPk pk)
|
void |
ejbLoad()
ejbLoad method. |
void |
ejbPassivate()
ejbPassivate method. |
void |
ejbPostCreate(UnitConversionPk unitConversionPk)
|
void |
ejbRemove()
ejbRemove method. |
void |
ejbStore()
ejbStore method. |
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 |
setEntityContext(javax.ejb.EntityContext ctx)
setEntityContext method. |
void |
setUnitConversionByValue(UnitConversionValue value)
Set all of UnitConversion's attributes to the passed in value. |
void |
unsetEntityContext()
unsetEntityContext method. |
Methods inherited from class theory.smart.foundation.ConfigurableEntityImpl |
addBusinessPolicy,
addProperty,
ejbCreate,
ejbPostCreate,
getBusinessPolicy,
getProperty,
removeBusinessPolicy,
removeProperty,
setSuccessorAtClassLevel,
setSuccessorAtInstanceLevel |
Methods inherited from class theory.smart.foundation.EntityImpl |
getEntityContext,
isModified |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public java.lang.String category
category
[UnitConversion] <*>------> [String
] (Primary Key)
public Unit atomic
atomic
[UnitConversion] <*>------> [theory.smart.axiom.units.Unit
]
public com.sun.java.util.collections.TreeMap tos
to (Map)
[UnitConversion] <*>------> [theory.smart.axiom.units.Quantity
]
0..*
Constructor Detail |
public UnitConversionImpl() throws javax.ejb.CreateException
Method Detail |
public UnitConversionValue getUnitConversionByValue() throws java.rmi.RemoteException
public void setUnitConversionByValue(UnitConversionValue value) throws java.rmi.RemoteException
UnitConversionValue
- the UnitConversion value objectpublic UnitConversionPk ejbCreate(UnitConversionPk unitConversionPk) throws javax.ejb.CreateException, java.rmi.RemoteException
public void ejbPostCreate(UnitConversionPk unitConversionPk) throws javax.ejb.CreateException, java.rmi.RemoteException
public void ejbLoad() throws java.rmi.RemoteException
public void ejbStore() throws java.rmi.RemoteException
public void ejbRemove() throws java.rmi.RemoteException, javax.ejb.RemoveException
public void ejbActivate() throws java.rmi.RemoteException
public void ejbPassivate() throws java.rmi.RemoteException
public void setEntityContext(javax.ejb.EntityContext ctx) throws java.rmi.RemoteException
public void unsetEntityContext() throws java.rmi.RemoteException
public UnitConversionPk ejbFindByPrimaryKey(UnitConversionPk pk) throws javax.ejb.FinderException, java.rmi.RemoteException
public java.util.Enumeration ejbFindAll() throws javax.ejb.FinderException, java.rmi.RemoteException
public java.lang.String getCategory() throws java.rmi.RemoteException
public Unit getAtomic() throws java.rmi.RemoteException
public void setAtomic(Unit atomic) throws java.rmi.RemoteException
atomic
- 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 |