Package ucar.unidata.metdata
Class Ensemble
java.lang.Object
ucar.unidata.metdata.Ensemble
- All Implemented Interfaces:
Serializable
A class for holding an ensemble of
Quantity
s and
Value
s. 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 ofValue
s in the Ensemble.boolean
See if the Object in question is equal to this Ensemble.format
(StringBuffer buf) Format the entire Ensemble.protected StringBuffer
formatEntry
(StringBuffer buf, Map.Entry entry) Format the Entry.Get the Value of aQuantity
from the Ensembleint
hashCode()
Return the hash code for this object.boolean
isEmpty()
See if this ensemble is emptykeySet()
Get the set ofQuantity
s in the Ensemble.Pust aQuantity
into the Ensemble.Put aQuantity
in the Ensembleint
size()
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 aQuantity
into the Ensemble.- Parameters:
qstr
- quantity namevv
- quantity valueuStr
- unit name- Returns:
- the new Value or null if it is not already there
-
put
Put aQuantity
in the Ensemble- Parameters:
qq
- Quantityvv
- Value- Returns:
- vv or null if it is not already there
-
get
Get the Value of aQuantity
from 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 ofQuantity
s in the Ensemble.- Returns:
- set of Quantities
-
entrySet
Get the set ofValue
s 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
-