## visad
Class ConstantMap

    java.lang.Object
      visad.ScalarMap
          visad.ConstantMap

All Implemented Interfaces:
  Cloneable, Comparable, Serializable

public class ConstantMap
extends ScalarMap

mapping from constant to DisplayRealType

See Also:
  Serialized Form

Field Summary

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()` Create and return a copy of this ScalarMap.
`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)` Returns a string representation of the ScalarMap with the specified prefix prepended.

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, inverseScaleValues, isAutoScale, makeScale, nullDisplay, peekTicks, removeScalarMapListener, resetAutoScale, resetTicks, scaleValues, scaleValues, 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`
  Throws:
    `VisADException` - VisAD failure
    `RemoteException` - Java RMI failure

### 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.

  Overrides:
    `equals` in class `ScalarMap`
  Parameters:
    `o` - - A object.
  Returns:
    `true` if and only if this instance is equal to o.

### compareTo

    public int compareTo(Object obj)

  Compares this instance to another object.

  Specified by:
    `compareTo` in interface `Comparable`
  Overrides:
    `compareTo` in class `ScalarMap`
  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.

### 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.

  Overrides:
    `compareTo` in class `ScalarMap`
  Parameters:
    `that` - The ScalarMap.
  Returns:
    -1 always. ConstantMap-s are considered less than true ScalarMap-s.

### clone

    public Object clone()

  Description copied from class: `ScalarMap`
  Create and return a copy of this ScalarMap.

  Overrides:
    `clone` in class `ScalarMap`
  Returns:
    copy of the ScalarMap or `null` if a copy couldn't be created.

### toString

    public String toString(String pre)

  Description copied from class: `ScalarMap`
  Returns a string representation of the ScalarMap with the specified prefix prepended.

  Overrides:
    `toString` in class `ScalarMap`
  Parameters:
    `pre` - prefix to prepend to the representation
  Returns:
    a string that "textually represents" this ScalarMap with `pre` prepended.

### setAspectCartesian

    void setAspectCartesian(double[] aspect)
                      throws VisADException,
                             RemoteException

  do nothing over-ride of ScalarMap method

  Overrides:
    `setAspectCartesian` in class `ScalarMap`
  Parameters:
    `aspect` - ratios; 3 elements for Java3D, 2 for Java2D
  Throws:
    `VisADException` - a VisAD error occurred
    `RemoteException` - an RMI error occurred