public class QuantityDBImpl extends QuantityDB implements Serializable
Modifier and Type | Class and Description |
---|---|
protected class |
QuantityDBImpl.Iterator
Provides support for iterating over the database.
|
protected class |
QuantityDBImpl.NameIterator
Provides support for iterating over the names in the database.
|
protected static class |
QuantityDBImpl.NameKey
Provides support for keys to the name map.
|
protected class |
QuantityDBImpl.QuantityIterator
Provides support for iterating over the quantities in the database.
|
protected static class |
QuantityDBImpl.UnitKey
Provides support for keys to the unit map.
|
emptyDB
Constructor and Description |
---|
QuantityDBImpl(QuantityDB nextDB)
Constructs with another quantity database as the successor database.
|
Modifier and Type | Method and Description |
---|---|
QuantityDB |
add(Quantity[] quantities)
Adds given Quantity-s to the database.
|
QuantityDB |
add(String[] definitions,
String[] aliases)
Adds the given quantities and aliases to the database.
|
void |
add(String name,
Quantity quantity)
Adds a quantity to the database under a given name.
|
protected void |
add(String name,
String unitSpec)
Adds a quantity to the database given a name and a display unit
specification.
|
Quantity |
get(String name)
Returns the quantity in the database whose name matches a
given name.
|
Quantity[] |
get(Unit unit)
Returns all quantities in the database whose default unit is
convertible with a given unit.
|
Iterator |
nameIterator()
Returns an iterator of the names in the database.
|
Iterator |
quantityIterator()
Returns an iterator of the quantities in the database.
|
add, get
public QuantityDBImpl(QuantityDB nextDB)
nextDB
- The quantity database to search after this one.
May be null
.public QuantityDB add(String[] definitions, String[] aliases) throws ParseException, TypeException, VisADException
definitions
- New quantities and their definitions.
definitions[2*i]
contains the
name (e.g. "speed") of the quantity whose
preferred unit specification (e.g. "m/s") is
in definitions[2*i+1]
.aliases
- Aliases for quantities. aliases[2*i]
contains the alias for the quantity
named in aliases[2*i+1]
.ParseException
- A unit specification couldn't be parsed.TypeException
- An incompatible version of the quantity already
exists.VisADException
- Couldn't create necessary VisAD object.public void add(String name, Quantity quantity) throws VisADException
add
in class QuantityDB
name
- The name of the quantity (e.g. "length").
May be an alias for the quantity.quantity
- The quantity.VisADException
- Couldn't create necessary VisAD object.public QuantityDB add(Quantity[] quantities) throws VisADException
quantities
- The quantities to be added. The quantity will
be added under it own name.VisADException
- Couldn't create necessary VisAD object.protected void add(String name, String unitSpec) throws ParseException, TypeException, VisADException
name
- The name of the quantity (e.g. "length").unitSpec
- The preferred display unit for the
quantity (e.g. "feet").ParseException
- Couldn't decode unit specification.TypeException
- Incompatible ScalarType of same name already
exists.VisADException
- Couldn't create necessary VisAD object.public Iterator quantityIterator()
quantityIterator
in class QuantityDB
public Iterator nameIterator()
nameIterator
in class QuantityDB
public Quantity get(String name)
get
in class QuantityDB
name
- The name of the quantity.name
.public Quantity[] get(Unit unit)
get
in class QuantityDB
unit
- The unit of the quantity.unit
.Copyright © 1996–2023 The SSEC Visualization Project. All rights reserved.