Package ucar.visad.display
Class ScalarMapSet
java.lang.Object
ucar.visad.display.ScalarMapSet
- Direct Known Subclasses:
NavigatedDisplay.VerticalMapSet
Provides support for a set of ScalarMap-s.
- Version:
- $Revision: 1.17 $
- Author:
- Steven R. Emmerson
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs from nothing.ScalarMapSet(Collection col) Constructs from aCollectionofScalarMaps.ScalarMapSet(ScalarMapSet that) Constructs from another instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(Collection col) Adds the contents of aCollectionto this instance's set ofScalarMaps.voidadd(ScalarMapSet that) Adds the contents of anotherScalarMapSetto this instance's set ofScalarMaps.Adds aScalarMapto this set.voidclear()Clears the set ofScalarMaps.static ScalarMapSetcombine(ScalarMapSet set1, ScalarMapSet set2) Combines theScalarMaps of two sets.booleanIndicates if this instance equals an object.Returns theScalarMapin this instance that matches a template.inthashCode()Returns the hash code of this instance.iterator()Returns an iterator for this instance.voidremove(ScalarMapSet that) Removes the contents of anotherScalarMapSetfrom this instance's set ofScalarMaps.booleanRemoves a ScalarMap from this set.voidRemoves allScalarMaps from this instance.intsize()Returns the number ofScalarMaps in this set.toString()Returns a string representation of this instance.
-
Constructor Details
-
ScalarMapSet
public ScalarMapSet()Constructs from nothing. -
ScalarMapSet
Constructs from another instance. TheScalarMaps of the other instance are not cloned.- Parameters:
that- The other instance.
-
ScalarMapSet
- Parameters:
col- The collection of ScalarMap-s.- Throws:
ClassCastException- if an element in the collection is not a ScalarMap.
-
-
Method Details
-
add
-
add
Adds the contents of anotherScalarMapSetto this instance's set ofScalarMaps.- Parameters:
that- The other set ofScalarMaps.- Throws:
NullPointerException- if the other set isnull.
-
add
Adds the contents of aCollectionto this instance's set ofScalarMaps.- Parameters:
col- The Collection of ScalarMap-s to be added.- Throws:
NullPointerException- if the Collection isnull.ClassCastException- if an element of the Collection isn't a ScalarMap.
-
get
Returns theScalarMapin this instance that matches a template. Returnsnullis no suchScalarMapexists.- Parameters:
template- The template.- Returns:
- The ScalarMap in this instance that matches the template or null.
-
remove
Removes a ScalarMap from this set.- Parameters:
map- The ScalarMap to be removed.- Returns:
trueif and only if the ScalarMap existed.
-
remove
Removes the contents of another
ScalarMapSetfrom this instance's set ofScalarMaps.- Parameters:
that- The other set ofScalarMaps.- Throws:
NullPointerException- if the other set isnull.
-
removeAll
public void removeAll()Removes all
ScalarMaps from this instance. -
size
public int size()Returns the number ofScalarMaps in this set.- Returns:
- The number of
ScalarMaps in this set.
-
clear
public void clear()Clears the set ofScalarMaps. -
iterator
Returns an iterator for this instance. Objects returned by theIterator.next()method have typeScalarMap.- Returns:
- An iterator for this instance.
-
equals
Indicates if this instance equals an object. -
hashCode
public int hashCode()Returns the hash code of this instance. -
toString
Returns a string representation of this instance.
-
combine
Combines the
ScalarMaps of two sets.ScalarMaps in the second set overrideScalarMaps for the sameDisplayRealTypein the first set. The input sets are not modified.- Parameters:
set1- The first set.set2- The second set.- Returns:
- The union of the two sets.
-