public abstract class QuantityDB extends Object
Modifier and Type | Field and Description |
---|---|
static QuantityDB |
emptyDB
The empty quantity database.
|
Constructor and Description |
---|
QuantityDB() |
Modifier and Type | Method and Description |
---|---|
void |
add(Quantity quantity)
Adds a given Quantity to the database.
|
abstract void |
add(String name,
Quantity quantity)
Adds a given Quantity to the database under a given name.
|
abstract Quantity |
get(String name)
Returns the quantity in the database whose name matches a
given name.
|
Quantity |
get(String name,
String unitSpec)
Returns the quantity that matches the given name and unit.
|
abstract Quantity[] |
get(Unit unit)
Returns all quantities in the database whose default unit is
convertible with a given unit.
|
abstract Iterator |
nameIterator()
Returns an iterator of the names in the database.
|
abstract Iterator |
quantityIterator()
Returns an iterator of the quantities in the database.
|
public static final QuantityDB emptyDB
public abstract Quantity get(String name)
name
- The name of the quantity.name
. Note that
RETURN_VALUE.getName().equals(name)
can
be false
due to aliasing.public abstract Quantity[] get(Unit unit)
unit
- The unit of the quantity.unit
.public Quantity get(String name, String unitSpec) throws ParseException, NoSuchUnitException, UnitException, VisADException
name
- The name of the quantity.unitSpec
- The unit of the quantity.name
and unit
. Note
that RETURN_VALUE.getName().equals(name)
can be false
due to
aliasing and RETURN_VALUE.
getDefaultUnit().equals(unit)
can be
false
due to allowable unit
conversion.ParseException
- Couldn't decode unitSpec
.NoSuchUnitException
- unitSpec
not in unit database.UnitException
- The quantity already exists with an
incompatible unit.VisADException
- Couldn't create necessary VisAD object.public abstract void add(String name, Quantity quantity) throws VisADException
name
- The name under which the quantity is to be
added. May be an alias.quantity
- The quantity to be added.VisADException
- Couldn't create necessary VisAD object.public void add(Quantity quantity) throws VisADException
quantity
- The quantity to be added. The quantity will
be added under it own name.VisADException
- Couldn't create necessary VisAD object.public abstract Iterator quantityIterator()
public abstract Iterator nameIterator()
Copyright © 1996–2023 The SSEC Visualization Project. All rights reserved.