visad.data.netcdf
Class QuantityDB
- java.lang.Object
-
- visad.data.netcdf.QuantityDB
-
- Direct Known Subclasses:
- NetcdfQuantityDB, QuantityDBImpl
public abstract class QuantityDB extends java.lang.ObjectProvides support for a database of quantities.
-
-
Field Summary
Fields Modifier and Type Field and Description static QuantityDBemptyDBThe empty quantity database.
-
Constructor Summary
Constructors Constructor and Description QuantityDB()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description voidadd(Quantity quantity)Adds a given Quantity to the database.abstract voidadd(java.lang.String name, Quantity quantity)Adds a given Quantity to the database under a given name.abstract Quantityget(java.lang.String name)Returns the quantity in the database whose name matches a given name.Quantityget(java.lang.String name, java.lang.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 java.util.IteratornameIterator()Returns an iterator of the names in the database.abstract java.util.IteratorquantityIterator()Returns an iterator of the quantities in the database.
-
-
-
Field Detail
-
emptyDB
public static final QuantityDB emptyDB
The empty quantity database. This is useful if, for example, you do not want the netCDF import package to map incoming netCDF variables to canonical ones by, effectively, altering their names and units. This database cannot be altered.
-
-
Method Detail
-
get
public abstract Quantity get(java.lang.String name)
Returns the quantity in the database whose name matches a given name.- Parameters:
name- The name of the quantity.- Returns:
- The quantity in the loal database that matches
name. Note that RETURN_VALUE.getName().equals(name)can befalsedue to aliasing.
-
get
public abstract Quantity[] get(Unit unit)
Returns all quantities in the database whose default unit is convertible with a given unit.- Parameters:
unit- The unit of the quantity.- Returns:
- The quantities in the database whose unit is
convertible with
unit.
-
get
public Quantity get(java.lang.String name, java.lang.String unitSpec) throws ParseException, NoSuchUnitException, UnitException, VisADException
Returns the quantity that matches the given name and unit. If necessary, it creates the quantity and adds it to the database.- Parameters:
name- The name of the quantity.unitSpec- The unit of the quantity.- Returns:
- The quantity in the database that matches
nameandunit. Note that RETURN_VALUE.getName().equals(name)can befalsedue to aliasing and RETURN_VALUE. getDefaultUnit().equals(unit)can befalsedue to allowable unit conversion. - Throws:
ParseException- Couldn't decodeunitSpec.NoSuchUnitException-unitSpecnot in unit database.UnitException- The quantity already exists with an incompatible unit.VisADException- Couldn't create necessary VisAD object.
-
add
public abstract void add(java.lang.String name, Quantity quantity) throws VisADExceptionAdds a given Quantity to the database under a given name.- Parameters:
name- The name under which the quantity is to be added. May be an alias.quantity- The quantity to be added.- Throws:
VisADException- Couldn't create necessary VisAD object.
-
add
public void add(Quantity quantity) throws VisADException
Adds a given Quantity to the database.- Parameters:
quantity- The quantity to be added. The quantity will be added under it own name.- Throws:
VisADException- Couldn't create necessary VisAD object.
-
quantityIterator
public abstract java.util.Iterator quantityIterator()
Returns an iterator of the quantities in the database.
-
nameIterator
public abstract java.util.Iterator nameIterator()
Returns an iterator of the names in the database.
-
-
DMelt 3.0 © DataMelt by jWork.ORG