## visad
Class SingletonSet

    java.lang.Object
      visad.ThingImpl
          visad.DataImpl
              visad.Set
                  visad.SimpleSet
                      visad.SampledSet
                          visad.SingletonSet

All Implemented Interfaces:
  Cloneable, Data, SampledSetIface, Serializable, SetIface, SimpleSetIface, Thing

public class SingletonSet
extends SampledSet

SingletonSet is the class for Set-s containing one member.

See Also:
  Serialized Form

Nested Class Summary

Nested classes inherited from class visad.DataImpl
`DataImpl.Syncher`

Nested classes inherited from class visad.ThingImpl
`ThingImpl.RemotePair`

Field Summary

Fields inherited from class visad.SampledSet
`Hi, Low, Samples`

Fields inherited from class visad.SimpleSet
`ManifoldDimension`

Fields inherited from class visad.Set
`DomainCoordinateSystem, DomainDimension, hashCode, hashCodeSet, Length, SetErrors, SetUnits`

Fields inherited from class visad.DataImpl
`Type`

Fields inherited from interface visad.Data

`ABS, ACOS, ACOS_DEGREES, ADD, ASIN, ASIN_DEGREES, ATAN, ATAN_DEGREES, ATAN2, ATAN2_DEGREES, CEIL, COS, COS_DEGREES, DEGREES_TO_RADIANS, DEPENDENT, DIVIDE, EXP, FLOOR, INDEPENDENT, INV_ATAN2, INV_ATAN2_DEGREES, INV_DIVIDE, INV_POW, INV_REMAINDER, INV_SUBTRACT, LOG, MAX, MIN, MULTIPLY, NEAREST_NEIGHBOR, NEGATE, NO_ERRORS, NOP, POW, RADIANS_TO_DEGREES, REMAINDER, RINT, ROUND, SIN, SIN_DEGREES, SQRT, SUBTRACT, TAN, TAN_DEGREES, WEIGHTED_AVERAGE`

Constructor Summary
`SingletonSet(RealTuple d)` Construct a SingletonSet with the single sample given by a RealTuple
`SingletonSet(RealTuple d, CoordinateSystem coord_sys, Unit[] units, ErrorEstimate[] errors)` Construct a SingletonSet with the single sample given by a RealTuple, and a non-default CoordinateSystem, Units and ErrorEstimates.
`SingletonSet(RealTupleType type, double[] values, CoordinateSystem coordSys, Unit[] units, ErrorEstimate[] errors)` Constructs from a type, numeric values, units, coordinate system, and error estimates.

Method Summary
`Object` `cloneButType(MathType type)` Clone this SingletonSet, but change the MathType
`int[]` `doubleToIndex(double[][] value)` convert an array of doubles in R^DomainDimension to an array of 1-D indices
`void` `doubleToInterp(double[][] value, int[][] indices, double[][] weights)` for each of an array of values in R^DomainDimension, compute an array of 1-D indices and an array of weights, to be used for interpolation; indices[i] and weights[i] are null if i-th value is outside grid (i.e., if no interpolation is possible)
`boolean` `equals(Object set)` See if this SingletonSet is equal to the Object in question.
`RealTuple` `getData()` Get the RealTuple that this SingletonSet was initialized with.
`double[][]` `getDoubles(boolean copy)` Get the values from the RealTuple as an array of doubles
`void` `getNeighbors(int[][] neighbors)` Returns an array of indexes for neighboring points for each point in the set.
`int` `hashCode()` Returns the hash code of this instance.
`double[][]` `indexToDouble(int[] index)` convert an array of 1-D indices to an array of doubles in R^DomainDimension
`float[][]` `indexToValue(int[] index)` convert an array of 1-D indices to an array of values in R^DomainDimension
`boolean` `isMissing()` Check if the samples are missing.
`String` `longString(String pre)` Create string representation of this Set with a given prefix
`int[]` `valueToIndex(float[][] value)` convert an array of values in R^DomainDimension to an array of 1-D indices
`void` `valueToInterp(float[][] value, int[][] indices, float[][] weights)` for each of an array of values in R^DomainDimension, compute an array of 1-D indices and an array of weights, to be used for interpolation; indices[i] and weights[i] are null if i-th value is outside grid (i.e., if no interpolation is possible)

Methods inherited from class visad.SampledSet
`clone, computeRanges, computeRanges, cram_missing, cram_samples, getHi, getLow, getNeighbors, getSamples, getSamples, init_samples, init_samples, make1DGeometry, make3DGeometry, makePointGeometry, setGeometryArray, setGeometryArray`

Methods inherited from class visad.SimpleSet
`getManifoldDimension, setAnimationSampling`

Methods inherited from class visad.Set

`__getitem__, __len__, addEqualsCache, addNotEqualsCache, adjustType, copyDoubles, copyFloats, doubleToFloat, equalUnitAndCS, floatToDouble, getCoordinateSystem, getDimension, getDimension, getDoubles, getLength, getNeighbors, getSetErrors, getSetUnits, getWedge, longString, main, make2DGeometry, makeIsoLines, makeIsoSurface, makeSpatial, merge1DSets, testEqualsCache, testNotEqualsCache, unary, unitAndCSHashCode`

Methods inherited from class visad.DataImpl

`__add__, __add__, __div__, __div__, __mod__, __mod__, __mul__, __mul__, __neg__, __pow__, __pow__, __radd__, __rdiv__, __rmod__, __rmul__, __rpow__, __rsub__, __sub__, __sub__, abs, abs, acos, acos, acosDegrees, acosDegrees, add, add, adjustSamplingError, asin, asin, asinDegrees, asinDegrees, atan, atan, atan2, atan2, atan2Degrees, atan2Degrees, atanDegrees, atanDegrees, binary, binary, ceil, ceil, changeMathType, computeRanges, computeRanges, computeReferenceRanges, cos, cos, cosDegrees, cosDegrees, dataClone, divide, divide, exp, exp, floor, floor, getType, invertOp, local, log, log, max, max, min, min, multiply, multiply, negate, negate, notifyReferences, pow, pow, remainder, remainder, rint, rint, round, round, setParent, sin, sin, sinDegrees, sinDegrees, sqrt, sqrt, subtract, subtract, tan, tan, tanDegrees, tanDegrees, toString, unary`

Methods inherited from class visad.ThingImpl
`adaptedAddReference, adaptedRemoveReference, addReference, removeReference`

Methods inherited from class java.lang.Object
`finalize, getClass, notify, notifyAll, wait, wait, wait`

Methods inherited from interface visad.SetIface
`equalUnitAndCS, getCoordinateSystem, getDimension, getDoubles, getLength, getManifoldDimension, getNeighbors, getSetErrors, getSetUnits, getWedge, make2DGeometry, makeIsoLines, makeIsoSurface, makeSpatial, merge1DSets`

Methods inherited from interface visad.Data

`abs, abs, acos, acos, acosDegrees, acosDegrees, add, add, adjustSamplingError, asin, asin, asinDegrees, asinDegrees, atan, atan, atan2, atan2, atan2Degrees, atan2Degrees, atanDegrees, atanDegrees, binary, binary, ceil, ceil, changeMathType, computeRanges, computeRanges, cos, cos, cosDegrees, cosDegrees, dataClone, divide, divide, exp, exp, floor, floor, getType, local, log, log, longString, max, max, min, min, multiply, multiply, negate, negate, pow, pow, remainder, remainder, rint, rint, round, round, sin, sin, sinDegrees, sinDegrees, sqrt, sqrt, subtract, subtract, tan, tan, tanDegrees, tanDegrees, unary, unary`

Methods inherited from interface visad.Thing
`addReference, removeReference`

Constructor Detail

### SingletonSet

    public SingletonSet(RealTuple d)
                 throws VisADException,
                        RemoteException

  Construct a SingletonSet with the single sample given by a RealTuple

Parameters:
  `d` - sample as a RealTuple
Throws:
  `VisADException` - Couldn't create the necessary VisAD object
  `RemoteException` - Couldn't create the necessary remote object

### SingletonSet

    public SingletonSet(RealTuple d,
                        CoordinateSystem coord_sys,
                        Unit[] units,
                        ErrorEstimate[] errors)
                 throws VisADException,
                        RemoteException

  Construct a SingletonSet with the single sample given by a RealTuple, and a non-default CoordinateSystem, Units and ErrorEstimates.

Parameters:
  `d` - sample as a RealTuple
  `coord_sys` - CoordinateSystem
  `units` - Units
  `errors` - ErrorEstimate
Throws:
  `VisADException` - Couldn't create the necessary VisAD object
  `RemoteException` - Couldn't create the necessary remote object

### SingletonSet

    public SingletonSet(RealTupleType type,
                        double[] values,
                        CoordinateSystem coordSys,
                        Unit[] units,
                        ErrorEstimate[] errors)
                 throws VisADException,
                        RemoteException

  Constructs from a type, numeric values, units, coordinate system, and error estimates.

Parameters:
  `type` - The type for this instance.
  `values` - The numeric values in units of the `units` argument (if non-`null`); otherwise, in units of the coordinate system argument (if non- `null`); otherwise, in the default units of the type argument.
  `coordSys` - The coordinate system transformation for this instance or `null`.
  `units` - The units of the numeric values or `null`.
  `errors` - Error estimates for the values or `null`.
Throws:
  `VisADException` - if a VisAD failure occurs.
  `RemoteException` - if a Java RMI failure occurs.
  `NullPointerException` - if the type or values argument is `null`.
See Also:
  `CoordinateSystem.getCoordinateSystemUnits()`

Method Detail

### isMissing

    public boolean isMissing()

  Check if the samples are missing.

  Specified by:
    `isMissing` in interface `Data`
  Overrides:
    `isMissing` in class `SampledSet`
  Returns:
    false by definition, a SingletonSet never has missing samples since it is initialized with a RealTuple..

### getNeighbors

    public void getNeighbors(int[][] neighbors)

  Returns an array of indexes for neighboring points for each point in the set. If `neighbors` is the return value, then `neighbors[i][j]` is the index of the `j`th neighbor of sample `i`.

  This implementation places an array of length zero into the single element of the input array. The length is zero because instances of this class have no neighboring sample points.

  Specified by:
    `getNeighbors` in interface `SetIface`
  Overrides:
    `getNeighbors` in class `Set`
  Parameters:
    `neighbors` - The array to hold the indicial arrays for each sample point.
  Throws:
    `ArrayIndexOutOfBoundsException` - if the length of the argument array is zero.

### indexToValue

    public float[][] indexToValue(int[] index)
                           throws VisADException

  convert an array of 1-D indices to an array of values in R^DomainDimension

  Specified by:
    `indexToValue` in interface `SetIface`
  Specified by:
    `indexToValue` in class `Set`
  Parameters:
    `index` - array of integer indices
  Returns:
    float array of values
  Throws:
    `VisADException` - couldn't create the necessary VisAD object

### indexToDouble

    public double[][] indexToDouble(int[] index)
                             throws VisADException

  convert an array of 1-D indices to an array of doubles in R^DomainDimension

  Specified by:
    `indexToDouble` in interface `SetIface`
  Overrides:
    `indexToDouble` in class `Set`
  Parameters:
    `index` - The indicies of the sample points.
  Returns:
    double array of values
  Throws:
    `VisADException` - couldn't create the necessary VisAD object

### valueToIndex

    public int[] valueToIndex(float[][] value)
                       throws VisADException

  convert an array of values in R^DomainDimension to an array of 1-D indices

  Specified by:
    `valueToIndex` in interface `SetIface`
  Specified by:
    `valueToIndex` in class `Set`
  Parameters:
    `value` - float[domain_dimension][number_of_values] array of Set values
  Returns:
    indices
  Throws:
    `VisADException` - couldn't create the necessary VisAD object

### doubleToIndex

    public int[] doubleToIndex(double[][] value)
                        throws VisADException

  convert an array of doubles in R^DomainDimension to an array of 1-D indices

  Specified by:
    `doubleToIndex` in interface `SetIface`
  Overrides:
    `doubleToIndex` in class `Set`
  Returns:
    indices
  Throws:
    `VisADException` - couldn't create the necessary VisAD object

### valueToInterp

    public void valueToInterp(float[][] value,
                              int[][] indices,
                              float[][] weights)
                       throws VisADException

  for each of an array of values in R^DomainDimension, compute an array of 1-D indices and an array of weights, to be used for interpolation; indices[i] and weights[i] are null if i-th value is outside grid (i.e., if no interpolation is possible)

  Specified by:
    `valueToInterp` in interface `SimpleSetIface`
  Specified by:
    `valueToInterp` in class `SimpleSet`
  Throws:
    `VisADException`

### doubleToInterp

    public void doubleToInterp(double[][] value,
                               int[][] indices,
                               double[][] weights)
                        throws VisADException

  for each of an array of values in R^DomainDimension, compute an array of 1-D indices and an array of weights, to be used for interpolation; indices[i] and weights[i] are null if i-th value is outside grid (i.e., if no interpolation is possible)

  Throws:
    `VisADException`

### getDoubles

    public double[][] getDoubles(boolean copy)
                          throws VisADException

  Get the values from the RealTuple as an array of doubles

  Specified by:
    `getDoubles` in interface `SetIface`
  Overrides:
    `getDoubles` in class `Set`
  Returns:
    samples as doubles.
  Throws:
    `VisADException` - couldn't create the necessary VisAD object

### getData

    public RealTuple getData()

  Get the RealTuple that this SingletonSet was initialized with.

  Returns:
    RealTuple

### equals

    public boolean equals(Object set)

  See if this SingletonSet is equal to the Object in question. They are equal if they are the same object and have the same Units, CoordinateSystem, dimension and their getData() returns are the equal.

  Specified by:
    `equals` in interface `SetIface`
  Specified by:
    `equals` in class `Set`
  Returns:
    true if equal, otherwise false

### hashCode

    public int hashCode()

  Returns the hash code of this instance.

### cloneButType

    public Object cloneButType(MathType type)
                        throws VisADException

  Clone this SingletonSet, but change the MathType

  Specified by:
    `cloneButType` in interface `SetIface`
  Specified by:
    `cloneButType` in class `Set`
  Parameters:
    `type` - new MathType
  Returns:
    clone of this set with new MathType
  Throws:
    `VisADException` - couldn't create the new SingletonSet

### longString

    public String longString(String pre)
                      throws VisADException

  Create string representation of this Set with a given prefix

  Specified by:
    `longString` in interface `Data`
  Overrides:
    `longString` in class `Set`
  Parameters:
    `pre` - Prefix for the string.
  Returns:
    String of the form pre + "SingletonSet: " + getData().toString()
  Throws:
    `VisADException` - couldn't create the longString