## visad.data.netcdf.in
Class VirtualTuple

    java.lang.Object
      visad.data.netcdf.in.VirtualData
          visad.data.netcdf.in.VirtualTuple

public class VirtualTuple
extends VirtualData

Provides support for a virtual VisAD Tuple. Instances are mutable.

Constructor Summary
`VirtualTuple()` Constructs from nothing.
`VirtualTuple(VirtualData data)` Constructs from a virtual data object.
`VirtualTuple(VirtualData[] datas)` Constructs from a 1-D array of virtual data objects.

Method Summary
`void` `add(VirtualData data)` Adds a component to this tuple.
`void` `clear()` Clears this instance.
`Object` `clone()` Clones this instance.
`VirtualData` `get(int index)` Gets a component of this tuple.
`DataImpl` `getData(Context context)` Gets the VisAD data object of this tuple, in context.
`DataFactory` `getDataFactory()` Returns the factory used to create VisAD data objects.
`MathType` `getType()` Gets the VisAD MathType of this virtual tuple.
`void` `replace(int index, VirtualData data)` Replaces a component of this tuple.
`void` `setDataFactory(DataFactory factory)` Sets the factory used to create the VisAD data object corresponding to this tuple and contained elements.
`int` `size()` Returns the number of components in this tuple.

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

### VirtualTuple

    public VirtualTuple()

  Constructs from nothing.

### VirtualTuple

    public VirtualTuple(VirtualData data)

  Constructs from a virtual data object.

Parameters:
  `data` - A virtual data object.

### VirtualTuple

    public VirtualTuple(VirtualData[] datas)

  Constructs from a 1-D array of virtual data objects. Order is preserved.

Parameters:
  `datas` - A 1-D array of virtual data objects.

Method Detail

### size

    public int size()

  Returns the number of components in this tuple.

  Returns:
    The number of components in this tuple.

### add

    public void add(VirtualData data)

  Adds a component to this tuple.

  Parameters:
    `data` - The component to be added.

### getType

    public MathType getType()
                     throws VisADException

  Gets the VisAD MathType of this virtual tuple.

  Specified by:
    `getType` in class `VirtualData`
  Returns:
    The VisAD MathType of the merged data items or `null` if no data items.
  Throws:
    `VisADException` - VisAD failure.

### get

    public VirtualData get(int index)
                    throws ArrayIndexOutOfBoundsException

  Gets a component of this tuple.

  Parameters:
    `index` - The index of the component to get.
  Returns:
    The `index`-th component.
  Throws:
    `ArrayIndexOutOfBoundsException`

### replace

    public void replace(int index,
                        VirtualData data)
                 throws ArrayIndexOutOfBoundsException

  Replaces a component of this tuple.

  Parameters:
    `index` - The index of the component to replace.
    `data` - The new component.
  Throws:
    `ArrayIndexOutOfBoundsException`

### getData

    public DataImpl getData(Context context)
                     throws VisADException,
                            RemoteException,
                            IOException

  Gets the VisAD data object of this tuple, in context.

  Specified by:
    `getData` in class `VirtualData`
  Parameters:
    `context` - The context for retrieving the data object.
  Returns:
    The VisAD data object or `null` if there is no data.
  Throws:
    `VisADException` - Couldn't create necessary VisAD object.
    `RemoteException` - Remote access failure.
    `IOException` - I/0 failure.

### clear

    public void clear()

  Clears this instance.

### clone

    public 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 the VisAD data object corresponding to this tuple and contained elements.

  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`
  Returns:
    The factory for creating VisAD data objects.