visad.data.units
Interface UnitsDB
-
- All Known Subinterfaces:
- UnitsDB
- All Known Implementing Classes:
- DefaultUnitsDB, DefaultUnitsDB, UnitTable
public interface UnitsDBThe units database interface. This class exists to allow the user to construct their own units database.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description Unitget(java.lang.String name)Get a unit.java.util.EnumerationgetNameEnumeration()Get an enumeration of the unit names in the database.java.util.EnumerationgetSymbolEnumeration()Get an enumeration of the unit symbols in the database.java.util.EnumerationgetUnitEnumeration()Get an enumeration of the units in the database.voidlist()List the units in the database.voidput(BaseUnit unit)Adds a base unit.voidputName(java.lang.String name, Unit unit)Adds a name and a unit to the name table.voidputSymbol(java.lang.String symbol, Unit unit)Adds a symbol and a unit to the symbol table.
-
-
-
Method Detail
-
put
void put(BaseUnit unit) throws java.lang.IllegalArgumentException
Adds a base unit.- Parameters:
unit- The base unit to be added.- Throws:
java.lang.IllegalArgumentException- The base unit argument is invalid.
-
putName
void putName(java.lang.String name, Unit unit) throws java.lang.IllegalArgumentExceptionAdds a name and a unit to the name table.- Parameters:
name- The name to be added.unit- The unit to be added.- Throws:
java.lang.IllegalArgumentException- Different unit with the same name is already in the table.
-
putSymbol
void putSymbol(java.lang.String symbol, Unit unit) throws java.lang.IllegalArgumentExceptionAdds a symbol and a unit to the symbol table.- Parameters:
symbol- The symbol to be added.unit- The unit to be added.- Throws:
java.lang.IllegalArgumentException- Different unit with the same symbol is already in the table.
-
get
Unit get(java.lang.String name)
Get a unit.- Parameters:
name- The name of the unit to be retrieved from the database.- Returns:
- The matching unit entry in the database.
-
getNameEnumeration
java.util.Enumeration getNameEnumeration()
Get an enumeration of the unit names in the database.
-
getSymbolEnumeration
java.util.Enumeration getSymbolEnumeration()
Get an enumeration of the unit symbols in the database.
-
getUnitEnumeration
java.util.Enumeration getUnitEnumeration()
Get an enumeration of the units in the database.
-
list
void list()
List the units in the database.
-
-
DMelt 3.0 © DataMelt by jWork.ORG