|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectucar.units.PrefixDBImpl
public class PrefixDBImpl
Provides a concrete implementation of a database of unit prefixes. Instances of this class are modifiable.
| Constructor Summary | |
|---|---|
PrefixDBImpl()
Constructs from nothing. |
|
| Method Summary | |
|---|---|
void |
addName(java.lang.String name,
double value)
Adds a prefix to the database by name. |
void |
addSymbol(java.lang.String symbol,
double value)
Adds a prefix symbol to the database. |
Prefix |
getPrefixByName(java.lang.String string)
Gets a prefix by name. |
Prefix |
getPrefixBySymbol(java.lang.String string)
Gets a prefix by symbol. |
Prefix |
getPrefixByValue(double value)
Gets a prefix by value. |
java.util.Iterator |
iterator()
Gets an iterator over the prefixes in the database. |
static void |
main(java.lang.String[] args)
Tests this class. |
java.lang.String |
toString()
Returns a string representation of this database. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public PrefixDBImpl()
| Method Detail |
|---|
public void addName(java.lang.String name,
double value)
throws PrefixExistsException
addName in interface PrefixDBname - The name of the prefix to be added.value - The value of the prefix.
PrefixExistsException - Another prefix with the same name
or value already exists in the database.
public void addSymbol(java.lang.String symbol,
double value)
throws PrefixExistsException
addSymbol in interface PrefixDBsymbol - The symbol of the prefix to be added.value - The value of the prefix.
PrefixExistsException - Another prefix with the same symbol
or value already exists in the database.public Prefix getPrefixByName(java.lang.String string)
getPrefixByName in interface PrefixDBstring - The name to be matched.
public Prefix getPrefixBySymbol(java.lang.String string)
getPrefixBySymbol in interface PrefixDBstring - The symbol to be matched.
public Prefix getPrefixByValue(double value)
getPrefixByValue in interface PrefixDBvalue - The value to be matched.
public java.lang.String toString()
toString in interface PrefixDBtoString in class java.lang.Objectpublic java.util.Iterator iterator()
iterator in interface PrefixDBPrefix.
public static void main(java.lang.String[] args)
throws java.lang.Exception
java.lang.Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||