BEA Systems, Inc.

theory.smart.axiom.units
Class UnitConverterImpl

java.lang.Object
  |
  +--theory.smart.foundation.SessionImpl
        |
        +--theory.smart.axiom.units.UnitConverterImpl

public class UnitConverterImpl
extends SessionImpl

The Unit Converter provides intelligent conversion of Quantities between various units.

See Also:
UnitConverter, UnitConverterHome, Serialized Form

Fields inherited from class theory.smart.foundation.SessionImpl
ctx
 
Constructor Summary
UnitConverterImpl()
           
 
Method Summary
 Quantity convert(Quantity qty, Unit unit)
          Convert the input quanity into a new Quanity with the specified Unit.
 Quantity convert(Quantity qty, Unit unit, java.lang.String category)
          Convert the input quanity into a new Quanity with the specified Unit.
 void ejbActivate()
           
 void ejbCreate()
           
 void ejbPassivate()
           
 void ejbPostCreate()
           
 void ejbRemove()
           
 void setSessionContext(javax.ejb.SessionContext ctx)
           
 
Methods inherited from class theory.smart.foundation.SessionImpl
getSessionContext
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnitConverterImpl

public UnitConverterImpl()
                  throws javax.ejb.CreateException
Method Detail

ejbCreate

public void ejbCreate()
               throws javax.ejb.CreateException,
                      java.rmi.RemoteException
Overrides:
ejbCreate in class SessionImpl

ejbPostCreate

public void ejbPostCreate()
                   throws javax.ejb.CreateException,
                          java.rmi.RemoteException
Overrides:
ejbPostCreate in class SessionImpl

ejbActivate

public void ejbActivate()
                 throws java.rmi.RemoteException
Overrides:
ejbActivate in class SessionImpl

ejbPassivate

public void ejbPassivate()
                  throws java.rmi.RemoteException
Overrides:
ejbPassivate in class SessionImpl

ejbRemove

public void ejbRemove()
               throws java.rmi.RemoteException
Overrides:
ejbRemove in class SessionImpl

setSessionContext

public void setSessionContext(javax.ejb.SessionContext ctx)
                       throws java.rmi.RemoteException
Overrides:
setSessionContext in class SessionImpl

convert

public Quantity convert(Quantity qty,
                        Unit unit)
                 throws java.rmi.RemoteException
Convert the input quanity into a new Quanity with the specified Unit. The category of the unit is first determined and the appropriate Unit Conversion is retrieved. The Quantity is the converted first to the atomic unit and then to the requested unit.

convert

public Quantity convert(Quantity qty,
                        Unit unit,
                        java.lang.String category)
                 throws java.rmi.RemoteException
Convert the input quanity into a new Quanity with the specified Unit. The caller specifes the category of the unit so that the appropriate Unit Conversion can be more quickly retrieved. The Quantity is converted first to the atomic unit and then into the requested unit.

BEA Systems, Inc.

Copyright © 2000 BEA Systems, Inc. All Rights Reserved