visad.data.netcdf
Class StandardQuantityDB
- java.lang.Object
-
- visad.data.netcdf.QuantityDB
-
- visad.data.netcdf.QuantityDBImpl
-
- visad.data.netcdf.StandardQuantityDB
-
- All Implemented Interfaces:
- java.io.Serializable
public final class StandardQuantityDB extends QuantityDBImpl
The following class implements a database of standard quantities. It is implemented as a singleton. Instances of the class are modifiable.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class visad.data.netcdf.QuantityDB
emptyDB
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description QuantityDBadd(java.lang.String[] definitions, java.lang.String[] aliases)Adds the given quantities and aliases to the database.voidadd(java.lang.String name, java.lang.String unitSpec)Adds a quantity to the database given a name and a display unit specification.static StandardQuantityDBinstance()Returns an instance of this class.static voidmain(java.lang.String[] args)Tests this class.-
Methods inherited from class visad.data.netcdf.QuantityDBImpl
add, add, get, get, nameIterator, quantityIterator
-
Methods inherited from class visad.data.netcdf.QuantityDB
add, get
-
-
-
-
Method Detail
-
instance
public static StandardQuantityDB instance()
Returns an instance of this class.- Throws:
VisADException- Couldn't instantiate.
-
add
public QuantityDB add(java.lang.String[] definitions, java.lang.String[] aliases) throws ParseException, TypeException, VisADException
Adds the given quantities and aliases to the database.- Overrides:
addin classQuantityDBImpl- Parameters:
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 indefinitions[2*i+1].aliases- Aliases for quantities.aliases[2*i]contains the alias for the quantity named inaliases[2*i+1].- Returns:
- The database resulting from the addition. Will not be the original object.
- Throws:
ParseException- A unit specification couldn't be parsed.TypeException- An incompatible version of the quantity already exists.VisADException- Couldn't create necessary VisAD object.
-
add
public void add(java.lang.String name, java.lang.String unitSpec)Adds a quantity to the database given a name and a display unit specification.- Parameters:
name- The name of the quantity (e.g. "length").unitSpec- The preferred display unit for the quantity (e.g. "feet").- Throws:
UnsupportedOperationException- Always thrown because a standard database must be unmodifiable.
-
main
public static void main(java.lang.String[] args) throws java.lang.ExceptionTests this class. If the only argument is "list", then this method will print the list of standard quantities -- one per line -- in the following format: name "(" CannonicalName ")" " in " PreferredUnit e.g. VolumicElectricCharge (ElectricChargeDensity) in C/m3- Throws:
java.lang.Exception
-
-
DMelt 3.0 © DataMelt by jWork.ORG