ucar.visad.display
Class ConstantMapSet

java.lang.Object
  extended by ucar.visad.display.ConstantMapSet

public class ConstantMapSet
extends Object

Provides support for a set of ConstantMap-s.

Version:
$Revision: 1.15 $
Author:
Steven R. Emmerson

Constructor Summary
ConstantMapSet()
          Constructs from nothing.
 
Method Summary
 Object clone()
          Returns a clone of this instance.
static ConstantMapSet combine(ConstantMapSet set1, ConstantMapSet set2)
          Combines the ConstantMap-s of two sets.
 ConstantMap[] getConstantMaps()
          Gets clones of the ConstantMap-s of this set as an array.
 ConstantMap put(ConstantMap map)
          Adds a ConstantMap to this set.
 ConstantMap remove(DisplayRealType type)
          Removes a ConstantMap from this set.
 void removeAll()
          Removes all ConstantMaps from this set.
 int size()
          Gets the number of elements in this set of ConstantMap-s.
 String toString()
          Returns a String representation of this ConstantMapSet.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConstantMapSet

public ConstantMapSet()
Constructs from nothing.

Method Detail

put

public ConstantMap put(ConstantMap map)
Adds a ConstantMap to this set.

Parameters:
map - The ConstantMap to be added to this set.
Returns:
The previous ConstantMap if it exists; otherwise, NULL.

remove

public ConstantMap remove(DisplayRealType type)
Removes a ConstantMap from this set.

Parameters:
type - The DisplayRealType associated with the ConstantMap to be removed.
Returns:
The ConstantMap associated with type that was removed from this set if it exists; otherwise, NULL.

removeAll

public void removeAll()
Removes all ConstantMaps from this set.


combine

public static ConstantMapSet combine(ConstantMapSet set1,
                                     ConstantMapSet set2)
Combines the ConstantMap-s of two sets.

Parameters:
set1 - The first set.
set2 - The second set.
Returns:
The union of the two sets. ConstantMap-s in set2 override ConstantMap-s for the same DisplayRealType in set1.

size

public int size()
Gets the number of elements in this set of ConstantMap-s.

Returns:
The number of ConstantMap-s in this set.

getConstantMaps

public ConstantMap[] getConstantMaps()
Gets clones of the ConstantMap-s of this set as an array.

Returns:
An array of clones of the ConstantMap-s of this set.

clone

public Object clone()
Returns a clone of this instance.

Overrides:
clone in class Object
Returns:
A clone of this instance.

toString

public String toString()
Returns a String representation of this ConstantMapSet.

Overrides:
toString in class Object
Returns:
string representation of the set