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 aCollection
ofScalarMap
s.ScalarMapSet
(ScalarMapSet that) Constructs from another instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(Collection col) Adds the contents of aCollection
to this instance's set ofScalarMap
s.void
add
(ScalarMapSet that) Adds the contents of anotherScalarMapSet
to this instance's set ofScalarMap
s.Adds aScalarMap
to this set.void
clear()
Clears the set ofScalarMap
s.static ScalarMapSet
combine
(ScalarMapSet set1, ScalarMapSet set2) Combines theScalarMap
s of two sets.boolean
Indicates if this instance equals an object.Returns theScalarMap
in this instance that matches a template.int
hashCode()
Returns the hash code of this instance.iterator()
Returns an iterator for this instance.void
remove
(ScalarMapSet that) Removes the contents of anotherScalarMapSet
from this instance's set ofScalarMap
s.boolean
Removes a ScalarMap from this set.void
Removes allScalarMap
s from this instance.int
size()
Returns the number ofScalarMap
s in this set.toString()
Returns a string representation of this instance.
-
Constructor Details
-
ScalarMapSet
public ScalarMapSet()Constructs from nothing. -
ScalarMapSet
Constructs from another instance. TheScalarMap
s 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 anotherScalarMapSet
to this instance's set ofScalarMap
s.- Parameters:
that
- The other set ofScalarMap
s.- Throws:
NullPointerException
- if the other set isnull
.
-
add
Adds the contents of aCollection
to this instance's set ofScalarMap
s.- 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 theScalarMap
in this instance that matches a template. Returnsnull
is no suchScalarMap
exists.- 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:
true
if and only if the ScalarMap existed.
-
remove
Removes the contents of another
ScalarMapSet
from this instance's set ofScalarMap
s.- Parameters:
that
- The other set ofScalarMap
s.- Throws:
NullPointerException
- if the other set isnull
.
-
removeAll
public void removeAll()Removes all
ScalarMap
s from this instance. -
size
public int size()Returns the number ofScalarMap
s in this set.- Returns:
- The number of
ScalarMap
s in this set.
-
clear
public void clear()Clears the set ofScalarMap
s. -
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
ScalarMap
s of two sets.ScalarMap
s in the second set overrideScalarMap
s for the sameDisplayRealType
in 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.
-