ucar.units
Interface PrefixDB

All Known Implementing Classes:
PrefixDBImpl, StandardPrefixDB

public interface PrefixDB

Interface for a database of unit prefixes.

Version:
$Id: PrefixDB.java 64 2006-07-12 22:30:50Z edavis $
Author:
Steven R. Emmerson

Method Summary
 void addName(String name, double value)
          Adds a prefix to the database by name.
 void addSymbol(String symbol, double value)
          Adds a prefix to the database by symbol.
 Prefix getPrefixByName(String name)
          Gets a prefix from the database by name.
 Prefix getPrefixBySymbol(String symbol)
          Gets a prefix from the database by symbol.
 Prefix getPrefixByValue(double value)
          Gets a prefix from the database by value.
 Iterator<?> iterator()
          Gets an iterator over the entries in the database.
 String toString()
          Gets a string representation of this database.
 

Method Detail

addName

void addName(String name,
             double value)
             throws PrefixExistsException,
                    PrefixDBAccessException
Adds a prefix to the database by name.

Parameters:
name - The name of the prefix.
value - The value of the prefix.
Throws:
PrefixExistsException - A prefix with the same name already exists in the database.
PrefixDBAccessException - Prefix database access failure.

addSymbol

void addSymbol(String symbol,
               double value)
               throws PrefixExistsException,
                      PrefixDBAccessException
Adds a prefix to the database by symbol.

Parameters:
symbol - The symbol for the prefix.
value - The value of the prefix.
Throws:
PrefixExistsException - A prefix with the same symbol already exists in the database.
PrefixDBAccessException - Prefix database access failure.

getPrefixByName

Prefix getPrefixByName(String name)
                       throws PrefixDBAccessException
Gets a prefix from the database by name.

Parameters:
name - The name of the prefix.
Returns:
prefix The prefix or null.
Throws:
PrefixDBAccessException - Prefix database access failure.

getPrefixBySymbol

Prefix getPrefixBySymbol(String symbol)
                         throws PrefixDBAccessException
Gets a prefix from the database by symbol.

Parameters:
symbol - The symbol for the prefix.
Returns:
prefix The prefix or null.
Throws:
PrefixDBAccessException - Prefix database access failure.

getPrefixByValue

Prefix getPrefixByValue(double value)
                        throws PrefixDBAccessException
Gets a prefix from the database by value.

Parameters:
value - The value for the prefix.
Returns:
prefix The prefix or null.
Throws:
PrefixDBAccessException - Prefix database access failure.

toString

String toString()
Gets a string representation of this database.

Overrides:
toString in class Object
Returns:
A string representation of this database.

iterator

Iterator<?> iterator()
Gets an iterator over the entries in the database.

Returns:
An iterator over the database.


Copyright © 1999-2011 UCAR/Unidata. All Rights Reserved.