Package ucar.visad.display
Class ConstantMapAdapter
java.lang.Object
ucar.visad.display.MapAdapter
ucar.visad.display.ConstantMapAdapter
- All Implemented Interfaces:
Comparable,ConstantMaps,Propertied
Provides support for adapting VisAD ConstantMap-s into something that is
(hopefully) easier to use. Unlike instances of VisAD
ConstantMap, the underlying ConstantMap of
an instance of this class may change.
(Yes, I know, a modifiable ConstantMap is something of an oxymoron -- yet
it's still useful.)
Instances of this class have the following, bound, JavaBean
properties:
| Name | Type | Access | Default | Description |
|---|---|---|---|---|
| constantMap | ConstantMap |
set/get | construction-dependent |
The underlying ConstantMap of this instance |
- Version:
- $Revision: 1.10 $
- Author:
- Steven R. Emmerson
-
Nested Class Summary
Nested classes/interfaces inherited from interface ucar.visad.display.ConstantMaps
ConstantMaps.Visitor -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstantMapAdapter(double value, DisplayRealType drt) Constructs.Constructs.ConstantMapAdapter(Real value, DisplayRealType drt) Constructs. -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(ConstantMaps.Visitor visitor) Accepts a visitor for this instance.intCompares this instance to another object.booleanIndicates if this instance is semantically identical to another object.Returns the constant-map property.Returns the constant-map properties.static ConstantMap[]getConstantMaps(ConstantMapAdapter[] constantMapAdapters) Returns theConstantMaps of this instance.inthashCode()Returns the hash code of this instance.voidsetDisplay(Display display) This method should be package private because it is expected that only a DisplayAdapter will invoke this method.voidsetValue(double value) Set the constant value of the associated DisplayRealType.voidSet the constant value of the associated DisplayRealType.toString()Returns the string representation of this instance.Methods inherited from class ucar.visad.display.MapAdapter
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, getDisplayRealType, removePropertyChangeListener, removePropertyChangeListenerMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface ucar.visad.display.Propertied
addPropertyChangeListener, addPropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener
-
Field Details
-
CONSTANT_MAP
The name of the constant-map property.- See Also:
-
-
Constructor Details
-
ConstantMapAdapter
Constructs. The numeric value of the underlying ConstantMap will be NaN.- Parameters:
drt- The DisplayRealType to be associated with this adapter.- Throws:
VisADException- VisAD failure.
-
ConstantMapAdapter
Constructs.- Parameters:
value- The initial value for the DisplayRealType in units of the default unit of the DisplayRealType.drt- The DisplayRealType to be associated with this adapter.- Throws:
VisADException- VisAD failure.
-
ConstantMapAdapter
Constructs.- Parameters:
value- The initial value for the DisplayRealType in units of the default unit of the DisplayRealType.drt- The DisplayRealType to be associated with this adapter.- Throws:
VisADException- VisAD failure.
-
-
Method Details
-
setValue
Set the constant value of the associated DisplayRealType. Fires aPropertyChangeEventforCONSTANT_MAPwith this instance as the source and with the both the old and new values appropriately set. The event is fired synchronously -- so watch out for deadlock.- Parameters:
value- The new value for the associated DisplayRealType.- Throws:
VisADException- VisAD failure.
-
setValue
Set the constant value of the associated DisplayRealType. Fires aPropertyChangeEventforCONSTANT_MAPwith this instance as the source and with the both the old and new values appropriately set. The event is fired synchronously -- so watch out for deadlock.- Parameters:
value- The new value for the associated DisplayRealType in units of the default unit of the DisplayRealType.- Throws:
VisADException- VisAD failure.
-
getConstantMap
Returns the constant-map property.- Returns:
- The constant-map property.
-
getConstantMaps
Returns the constant-map properties. This implementation returns this instances constant-map in a one-element array.- Specified by:
getConstantMapsin interfaceConstantMaps- Returns:
- The constant-map properties.
-
getConstantMaps
Returns theConstantMaps of this instance. It is guaranteed that the returned array contains no duplicates.- Parameters:
constantMapAdapters- An array of adapted ConstantMap-s. May benull.- Returns:
- The array of ConstantMap-s corresponding
to the input. May be
null.
-
setDisplay
This method should be package private because it is expected that only a DisplayAdapter will invoke this method.- Specified by:
setDisplayin interfaceConstantMaps- Parameters:
display- The VisAD display.- Throws:
VisADException- VisAD failure.RemoteException- Java RMI failure.
-
accept
Accepts a visitor for this instance.- Specified by:
acceptin interfaceConstantMaps- Parameters:
visitor- The visitor for this instance.- Throws:
VisADException- VisAD failure.RemoteException- Java RMI failure.
-
toString
Returns the string representation of this instance. -
compareTo
Compares this instance to another object.- Specified by:
compareToin interfaceComparable- Parameters:
obj- The other object. Must be an instance of this class.- Returns:
- A value less than, equal to, or greater than zero depending on whether this instance is considered less than, equal to, or greater than the other object, respectively.
-
equals
Indicates if this instance is semantically identical to another object. -
hashCode
public int hashCode()Returns the hash code of this instance.
-