visad
Class ConstantMap

java.lang.Object
  |
  +--visad.ScalarMap
        |
        +--visad.ConstantMap

public class ConstantMap
extends ScalarMap

mapping from constant to DisplayRealType

See Also:
Serialized Form

Fields inherited from class visad.ScalarMap
displayRange, isScaled, ValueIndex
 
Constructor Summary
ConstantMap(double constant, DisplayRealType display_scalar)
          construct a ConstantMap with a double constant
ConstantMap(Real constant, DisplayRealType display_scalar)
          construct a ConstantMap with a Real constant;
 
Method Summary
 Object clone()
           
protected  int compareTo(ConstantMap that)
          Compares this instance to another instance.
 int compareTo(Object obj)
          Compares this instance to another object.
protected  int compareTo(ScalarMap that)
          Compares this instance to a ScalarMap.
 boolean equals(Object o)
          Indicates whether or not this instance equals an Object.
static boolean getAllowMultipleUseKludge()
           
 double getConstant()
           
static void setAllowMultipleUseKludge(boolean k)
          allow ConstantMaps to be used in multiple calls to DisplayImpl.addReference() or addReferences() such multiple use was not checked in the early releases of VisAD, and this method allows applications to easily avoid more extensive changes
(package private)  void setAspectCartesian(double[] aspect)
          do nothing over-ride of ScalarMap method
(package private)  void setControl()
          do nothing over-ride of ScalarMap method
 String toString(String pre)
           
 
Methods inherited from class visad.ScalarMap
addScalarMapListener, badRange, checkTicks, copy, doInitialize, equalizeFlow, getAxisScale, getControl, getDisplay, getDisplayScalar, getDisplayScalarIndex, getOverrideUnit, getRange, getScalar, getScalarIndex, getScalarName, getScale, getScaleEnable, getValueIndex, hashCode, incTick, inverseScaleValues, isAutoScale, makeScale, nullDisplay, peekTicks, removeScalarMapListener, resetAutoScale, resetTicks, scaleValues, scaleValues, setDisplay, setDisplayScalarIndex, setOverrideUnit, setRange, setRange, setRange, setRangeByUnits, setScalarIndex, setScalarName, setScaleColor, setScaleEnable, setTicks, setUnderscoreToBlank, setValueIndex, toString
 
Methods inherited from class java.lang.Object
, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConstantMap

public ConstantMap(double constant,
                   DisplayRealType display_scalar)
            throws VisADException
construct a ConstantMap with a double constant
Parameters:
constant - - double equated to DisplayRealType
display_scalar - - DisplayRealType set to constant (may not be Animation, SelectValue, SelectRange or IsoContour)
Throws:
VisADException - - a VisAD error occurred

ConstantMap

public ConstantMap(Real constant,
                   DisplayRealType display_scalar)
            throws VisADException
construct a ConstantMap with a Real constant;
Parameters:
constant - - Real whose value is equated to DisplayRealType
display_scalar - - DisplayRealType set to constant (may not be Animation, SelectValue, SelectRange or IsoContour)
Throws:
VisADException - - a VisAD error occurred
Method Detail

setAllowMultipleUseKludge

public static void setAllowMultipleUseKludge(boolean k)
allow ConstantMaps to be used in multiple calls to DisplayImpl.addReference() or addReferences() such multiple use was not checked in the early releases of VisAD, and this method allows applications to easily avoid more extensive changes
Parameters:
k - - true to allow multiple use

getAllowMultipleUseKludge

public static boolean getAllowMultipleUseKludge()
Returns:
boolean indicating whether ConstantMaps may be used in multiple calls to DisplayImpl.addReference() or addReferences()

setControl

void setControl()
          throws VisADException,
                 RemoteException
do nothing over-ride of ScalarMap method
Overrides:
setControl in class ScalarMap

getConstant

public double getConstant()
Returns:
constant value mapped to DisplayRealType

equals

public boolean equals(Object o)
Indicates whether or not this instance equals an Object.
Parameters:
o - - A object.
Returns:
true if and only if this instance is equal to o.
Overrides:
equals in class ScalarMap

compareTo

public int compareTo(Object obj)
Compares this instance to another object.
Parameters:
obj - The other object.
Returns:
A value that is negative, zero, or positive depending on whether this instance is considered less than, equal to, or greater than the other object, respectively.
Overrides:
compareTo in class ScalarMap

compareTo

protected int compareTo(ConstantMap that)
Compares this instance to another instance.
Parameters:
that - The other instance.
Returns:
A value that is negative, zero, or positive depending on whether this instance is considered less than, equal to, or greater than the other instance, respectively.

compareTo

protected int compareTo(ScalarMap that)
Compares this instance to a ScalarMap.
Parameters:
that - The ScalarMap.
Returns:
-1 always. ConstantMap-s are considered less than true ScalarMap-s.
Overrides:
compareTo in class ScalarMap

clone

public Object clone()
Overrides:
clone in class ScalarMap

toString

public String toString(String pre)
Overrides:
toString in class ScalarMap

setAspectCartesian

void setAspectCartesian(double[] aspect)
                  throws VisADException,
                         RemoteException
do nothing over-ride of ScalarMap method
Parameters:
aspect - ratios; 3 elements for Java3D, 2 for Java2D
Throws:
VisADException - a VisAD error occurred
RemoteException - an RMI error occurred
Overrides:
setAspectCartesian in class ScalarMap