public final class StandardQuantityDB extends QuantityDBImpl
QuantityDBImpl.Iterator, QuantityDBImpl.NameIterator, QuantityDBImpl.NameKey, QuantityDBImpl.QuantityIterator, QuantityDBImpl.UnitKey
emptyDB
Modifier and Type | Method and Description |
---|---|
QuantityDB |
add(String[] definitions,
String[] aliases)
Adds the given quantities and aliases to the database.
|
void |
add(String name,
String unitSpec)
Adds a quantity to the database given a name and a display unit
specification.
|
static StandardQuantityDB |
instance()
Returns an instance of this class.
|
static void |
main(String[] args)
Tests this class.
|
add, add, get, get, nameIterator, quantityIterator
add, get
public static StandardQuantityDB instance()
VisADException
- Couldn't instantiate.public QuantityDB add(String[] definitions, String[] aliases) throws ParseException, TypeException, VisADException
add
in class QuantityDBImpl
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, String unitSpec)
add
in class QuantityDBImpl
name
- The name of the quantity (e.g. "length").unitSpec
- The preferred display unit for the
quantity (e.g. "feet").UnsupportedOperationException
- Always thrown because a standard database
must be unmodifiable.public static void main(String[] args) throws Exception
Exception
Copyright © 1996–2023 The SSEC Visualization Project. All rights reserved.