public class PrefixDBImpl extends Object implements PrefixDB, Serializable
Constructor and Description |
---|
PrefixDBImpl()
Constructs from nothing.
|
Modifier and Type | Method and Description |
---|---|
void |
addName(String name,
double value)
Adds a prefix to the database by name.
|
void |
addSymbol(String symbol,
double value)
Adds a prefix symbol to the database.
|
Prefix |
getPrefixByName(String string)
Gets a prefix by name.
|
Prefix |
getPrefixBySymbol(String string)
Gets a prefix by symbol.
|
Prefix |
getPrefixByValue(double value)
Gets a prefix by value.
|
Iterator |
iterator()
Gets an iterator over the prefixes in the database.
|
static void |
main(String[] args)
Tests this class.
|
String |
toString()
Returns a string representation of this database.
|
public void addName(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(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(String string)
getPrefixByName
in interface PrefixDB
string
- The name to be matched.public Prefix getPrefixBySymbol(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 String toString()
public Iterator iterator()
Copyright © 1999–2013 UCAR/Unidata. All rights reserved.