public class PrefixDBImpl extends java.lang.Object implements PrefixDB, java.io.Serializable
Constructor and Description |
---|
PrefixDBImpl()
Constructs from nothing.
|
Modifier and Type | Method and Description |
---|---|
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.
|
java.lang.String |
toString()
Returns a string representation of this database.
|
public void addName(java.lang.String name, double value) throws PrefixExistsException
addName
in interface PrefixDB
name
- 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 PrefixDB
symbol
- 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 PrefixDB
string
- The name to be matched.public Prefix getPrefixBySymbol(java.lang.String string)
getPrefixBySymbol
in interface PrefixDB
string
- The symbol to be matched.public Prefix getPrefixByValue(double value)
getPrefixByValue
in interface PrefixDB
value
- The value to be matched.public java.lang.String toString()