visad.data.netcdf
Class QuantityDBImpl
- java.lang.Object
-
- visad.data.netcdf.QuantityDB
-
- visad.data.netcdf.QuantityDBImpl
-
- All Implemented Interfaces:
- java.io.Serializable
- Direct Known Subclasses:
- StandardQuantityDB
public class QuantityDBImpl extends QuantityDB implements java.io.Serializable
Provides support for a database of quantities. Instances are modifiable.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class visad.data.netcdf.QuantityDB
emptyDB
-
-
Constructor Summary
Constructors Constructor and Description QuantityDBImpl(QuantityDB nextDB)Constructs with another quantity database as the successor database.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description QuantityDBadd(Quantity[] quantities)Adds given Quantity-s to the database.QuantityDBadd(java.lang.String[] definitions, java.lang.String[] aliases)Adds the given quantities and aliases to the database.voidadd(java.lang.String name, Quantity quantity)Adds a quantity to the database under a given name.Quantityget(java.lang.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.java.util.IteratornameIterator()Returns an iterator of the names in the database.java.util.IteratorquantityIterator()Returns an iterator of the quantities in the database.-
Methods inherited from class visad.data.netcdf.QuantityDB
add, get
-
-
-
-
Constructor Detail
-
QuantityDBImpl
public QuantityDBImpl(QuantityDB nextDB)
Constructs with another quantity database as the successor database.- Parameters:
nextDB- The quantity database to search after this one. May benull.
-
-
Method Detail
-
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.- 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. May or may 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, Quantity quantity) throws VisADExceptionAdds a quantity to the database under a given name.- Specified by:
addin classQuantityDB- Parameters:
name- The name of the quantity (e.g. "length"). May be an alias for the quantity.quantity- The quantity.- Throws:
VisADException- Couldn't create necessary VisAD object.
-
add
public QuantityDB add(Quantity[] quantities) throws VisADException
Adds given Quantity-s to the database.- Parameters:
quantities- The quantities to be added. The quantity will be added under it own name.- Returns:
- The database resulting from the addition. May or may not be the original object.
- Throws:
VisADException- Couldn't create necessary VisAD object.
-
quantityIterator
public java.util.Iterator quantityIterator()
Returns an iterator of the quantities in the database.- Specified by:
quantityIteratorin classQuantityDB- Returns:
- An iterator of the quantities in the database.
-
nameIterator
public java.util.Iterator nameIterator()
Returns an iterator of the names in the database.- Specified by:
nameIteratorin classQuantityDB- Returns:
- An iterator of the names in the database.
-
get
public Quantity get(java.lang.String name)
Returns the quantity in the database whose name matches a given name.- Specified by:
getin classQuantityDB- Parameters:
name- The name of the quantity.- Returns:
- The quantity in the loal database with name
name.
-
get
public Quantity[] get(Unit unit)
Returns all quantities in the database whose default unit is convertible with a given unit.- Specified by:
getin classQuantityDB- Parameters:
unit- The unit of the quantity.- Returns:
- The quantities in the database whose unit is
convertible with
unit.
-
-
DMelt 3.0 © DataMelt by jWork.ORG