public interface UnitsDB
| Modifier and Type | Method and Description |
|---|---|
Unit |
get(java.lang.String name)
Get a unit.
|
java.util.Enumeration |
getNameEnumeration()
Get an enumeration of the unit names in the database.
|
java.util.Enumeration |
getSymbolEnumeration()
Get an enumeration of the unit symbols in the database.
|
java.util.Enumeration |
getUnitEnumeration()
Get an enumeration of the units in the database.
|
void |
list()
List the units in the database.
|
void |
put(BaseUnit unit)
Adds a base unit.
|
void |
putName(java.lang.String name,
Unit unit)
Adds a name and a unit to the name table.
|
void |
putSymbol(java.lang.String symbol,
Unit unit)
Adds a symbol and a unit to the symbol table.
|
void put(BaseUnit unit) throws java.lang.IllegalArgumentException
unit - The base unit to be added.java.lang.IllegalArgumentException - The base unit argument is invalid.void putName(java.lang.String name,
Unit unit)
throws java.lang.IllegalArgumentException
name - The name to be added.unit - The unit to be added.java.lang.IllegalArgumentException - Different unit with the same name is
already in the table.void putSymbol(java.lang.String symbol,
Unit unit)
throws java.lang.IllegalArgumentException
symbol - The symbol to be added.unit - The unit to be added.java.lang.IllegalArgumentException - Different unit with the same symbol is
already in the table.Unit get(java.lang.String name)
name - The name of the unit to be retrieved from the database.name shall be non-null.java.util.Enumeration getNameEnumeration()
java.util.Enumeration getSymbolEnumeration()
java.util.Enumeration getUnitEnumeration()
void list()