|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object eShopper.eShopperUnit
This class implements units and unit conversion for the Ingredients.
Constructor Summary | |
eShopperUnit(int aUnitID,
eShopperDB db)
constructor |
Method Summary | |
float |
convertFromBase(float value)
Converts a value expressed in the unit type's base unit to a value expressed in this unit's unit |
float |
convertToBase(float value)
Converts a value to this unit's base unit |
float |
express(float value,
eShopperUnit origUnit)
Expresses a value of the same type in this unit |
java.lang.String |
getAbbrvString()
Returns the set abbreviation for this unit |
int |
getID()
This returns the unit's ID. |
java.lang.String |
getName()
The name of this unit |
java.lang.String |
getType()
The type of this unit. |
boolean |
isAuth()
Determines whether this unit is set as authoritative. |
boolean |
isLargerThan(eShopperUnit aUnit)
Compares the relative size of a unit to this unit |
boolean |
isSameType(eShopperUnit aUnit)
Compares the type of units to see if they are combinable. |
java.lang.String |
toString()
Gets the abbrviation of a string, for use in various combo boxes |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public eShopperUnit(int aUnitID, eShopperDB db)
aUnitID
- the database id of the desired unitdb
- the databaseMethod Detail |
public java.lang.String toString()
public int getID()
public float convertFromBase(float value)
value
- a value expressed in the unit types base unit
public float convertToBase(float value)
value
- a value expessed in this unit's unit
public float express(float value, eShopperUnit origUnit) throws java.util.zip.DataFormatException
value
- a value expressed in the original unitorigUnit
- the original unit
java.util.zip.DataFormatException
- throws exception when the units are not the same typepublic java.lang.String getAbbrvString()
public boolean isLargerThan(eShopperUnit aUnit) throws java.util.zip.DataFormatException
aUnit
- a unit to compare to
java.util.zip.DataFormatException
- if the units are not the same typepublic boolean isSameType(eShopperUnit aUnit)
aUnit
- the unit in question
public boolean isAuth()
public java.lang.String getType()
public java.lang.String getName()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |