visad.data.netcdf.in
Class VirtualScalar

java.lang.Object
  extended by visad.data.netcdf.in.VirtualData
      extended by visad.data.netcdf.in.VirtualScalar

public class VirtualScalar
extends VirtualData

Provides support for a virtual VisAD Scalar.


Constructor Summary
VirtualScalar(ScalarType type, Variable var, SimpleSet rangeSet, Unit unit, visad.data.netcdf.in.Vetter vetter)
          Constructs from a scalar type, a 1-D netCDF variable, a range set, a unit, and a value vetter.
 
Method Summary
 java.lang.Object clone()
          Clones this instance.
 DataImpl getData(Context context)
          Gets the VisAD data object corresponding to this virtual, data object.
 DataFactory getDataFactory()
          Returns the factory used to create VisAD data objects.
 double[] getDoubles(Context context)
          Gets the double values corresponding to this virtual, data object at a given context.
 SimpleSet getRangeSet()
          Gets the range set of this scalar.
 ScalarType getScalarType()
          Gets the ScalarType of this scalar.
 MathType getType()
          Gets the MathType of this scalar.
 Unit getUnit()
          Gets the unit of the value.
 Variable getVariable()
          Gets the netCDF variable.
 visad.data.netcdf.in.Vetter getVetter()
          Gets the value vetter.
 void setDataFactory(DataFactory factory)
          Sets the factory used to create VisAD data objects.
 
Methods inherited from class visad.data.netcdf.in.VirtualData
getData, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VirtualScalar

public VirtualScalar(ScalarType type,
                     Variable var,
                     SimpleSet rangeSet,
                     Unit unit,
                     visad.data.netcdf.in.Vetter vetter)
Constructs from a scalar type, a 1-D netCDF variable, a range set, a unit, and a value vetter.

Parameters:
type - The type of the nested scalar.
var - The 1-D netCDF variable.
rangeSet - The range set of the values.
unit - The unit of the values.
vetter - The value vetter.
Method Detail

getScalarType

public ScalarType getScalarType()
Gets the ScalarType of this scalar.

Returns:
The ScalarType of this scalar.

getType

public MathType getType()
Gets the MathType of this scalar.

Specified by:
getType in class VirtualData
Returns:
The ScalarType of this scalar.

getRangeSet

public SimpleSet getRangeSet()
Gets the range set of this scalar.

Returns:
The range set of this scalar.

getUnit

public Unit getUnit()
Gets the unit of the value.

Returns:
The unit of the value.

getVariable

public Variable getVariable()
Gets the netCDF variable.

Returns:
The netCDF variable.

getVetter

public visad.data.netcdf.in.Vetter getVetter()
Gets the value vetter.

Returns:
The value vetter.

getData

public DataImpl getData(Context context)
                 throws InvalidContextException,
                        VisADException,
                        java.rmi.RemoteException,
                        java.io.IOException
Gets the VisAD data object corresponding to this virtual, data object.

Specified by:
getData in class VirtualData
Parameters:
context - The context in which the data is to be gotten.
Returns:
The VisAD Scalar corresponding to this virtual, data object. throws InvalidContextException Invalid context.
Throws:
InvalidContextException - if the indicial context is invalid.
VisADException - Couldn't create necessary VisAD object.
java.rmi.RemoteException - if a Java RMI failure occurs.
java.io.IOException - I/O failure.

getDoubles

public double[] getDoubles(Context context)
                    throws java.io.IOException,
                           VisADException
Gets the double values corresponding to this virtual, data object at a given context.

Returns:
The double values of this virtual, data object. throws VisADException Couldn't create necessary VisAD object. throws IOException I/O failure.
Throws:
java.io.IOException
VisADException

clone

public java.lang.Object clone()
Clones this instance.

Specified by:
clone in class VirtualData
Returns:
A (deep) clone of this instance.

setDataFactory

public void setDataFactory(DataFactory factory)
Sets the factory used to create VisAD data objects.

Specified by:
setDataFactory in class VirtualData
Parameters:
factory - The factory for creating VisAD data objects.

getDataFactory

public DataFactory getDataFactory()
Returns the factory used to create VisAD data objects.

Specified by:
getDataFactory in class VirtualData
Parameters:
factory - The factory for creating VisAD data objects.
Returns:
The factory for creating VisAD data objects.