Package ucar.unidata.metdata
Class Ensemble
java.lang.Object
ucar.unidata.metdata.Ensemble
- All Implemented Interfaces:
Serializable
A class for holding an ensemble of
Quantitys and
Values. Each Quantity can have only one associated
Value.- Version:
- $Revision: 1.7 $
- Author:
- Glenn Davis
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionentrySet()Get the set ofValues in the Ensemble.booleanSee if the Object in question is equal to this Ensemble.format(StringBuffer buf) Format the entire Ensemble.protected StringBufferformatEntry(StringBuffer buf, Map.Entry entry) Format the Entry.Get the Value of aQuantityfrom the EnsembleinthashCode()Return the hash code for this object.booleanisEmpty()See if this ensemble is emptykeySet()Get the set ofQuantitys in the Ensemble.Pust aQuantityinto the Ensemble.Put aQuantityin the Ensembleintsize()Get the size of the ensemble.toString()Return a String representation of this Ensemble
-
Constructor Details
-
Ensemble
public Ensemble()Create a new Ensemble
-
-
Method Details
-
put
Pust aQuantityinto the Ensemble.- Parameters:
qstr- quantity namevv- quantity valueuStr- unit name- Returns:
- the new Value or null if it is not already there
-
put
Put aQuantityin the Ensemble- Parameters:
qq- Quantityvv- Value- Returns:
- vv or null if it is not already there
-
get
Get the Value of aQuantityfrom the Ensemble- Parameters:
qq- Quantity to look up- Returns:
- associated value
-
get
- Parameters:
qstr- quantity name- Returns:
- associated value or null if it does not exist
-
isEmpty
public boolean isEmpty()See if this ensemble is empty- Returns:
- true if it has not entries
-
size
public int size()Get the size of the ensemble.- Returns:
- number of entries
-
keySet
Get the set ofQuantitys in the Ensemble.- Returns:
- set of Quantities
-
entrySet
Get the set ofValues in the Ensemble.- Returns:
- set of Values
-
hashCode
public int hashCode()Return the hash code for this object. -
equals
See if the Object in question is equal to this Ensemble. -
formatEntry
Format the Entry.- Parameters:
buf- StringBuffer for formattingentry- Entry to format- Returns:
- formatted Entry
-
format
Format the entire Ensemble. Iterates through all entries and returns the StringBuffer containing them.- Parameters:
buf- StringBuffer to put formatted entries into- Returns:
- buf
-
toString
Return a String representation of this Ensemble
-