## visad
Interface DataReference

All Superinterfaces:
  ThingReference

All Known Subinterfaces:
  RemoteDataReference

All Known Implementing Classes:
  DataReferenceImpl, RemoteDataReferenceImpl

public interface DataReference
extends ThingReference

DataReference is the VisAD interface for named holders for data objects. It can provide a symbol table binding between a name and a variable for a user interface that includes a formula interpreter, or a full language interpreter (e.g., a Java interpreter).

During computations the Data object referenced by a DataReference may change. DataReference objects are passed to Display objects, so that a display may depict the changing values of named variables.

DataReference is a source of ThingChangedEvent-s, and thus defines addThingChangedListener and removeThingChangedListener.

DataReference objects may be local (DataReferenceImpl) or remote (RemoteDataReferenceImpl).

Method Summary
`Data` `getData()`
`MathType` `getType()` this is more efficient than getData().getType() for RemoteDataReferences

`void`

`setData(Data d)`
set reference to data, replacing any currently referenced Data object; if this is local (i.e., an instance of DataReferenceImpl) then the Data argument must also be local (i.e., an instance of DataImpl); if this is Remote (i.e., an instance of RemoteDataReference) then a local Data argument (i.e., an instance of DataImpl) will be passed by copy and a remote Data argument (i.e., an instance of RemoteData) will be passed by remote reference; invokes d.addReference(DataReference r)

Methods inherited from interface visad.ThingReference
`acknowledgeThingChanged, addThingChangedListener, getName, getThing, getTick, incTick, peekThingChanged, removeThingChangedListener, setThing`

Method Detail

### setData

    public void setData(Data d)
                 throws VisADException,
                        RemoteException

  set reference to data, replacing any currently referenced Data object; if this is local (i.e., an instance of DataReferenceImpl) then the Data argument must also be local (i.e., an instance of DataImpl); if this is Remote (i.e., an instance of RemoteDataReference) then a local Data argument (i.e., an instance of DataImpl) will be passed by copy and a remote Data argument (i.e., an instance of RemoteData) will be passed by remote reference; invokes d.addReference(DataReference r)

  Parameters:
    `d` - Data object to be set
  Throws:
    `VisADException` - a VisAD error occurred
    `RemoteException` - an RMI error occurred

### getData

    public Data getData()
                 throws VisADException,
                        RemoteException

  Returns:
    referenced Data object, or null if none
  Throws:
    `VisADException` - a VisAD error occurred
    `RemoteException` - an RMI error occurred

### getType

    public MathType getType()
                     throws VisADException,
                            RemoteException

  this is more efficient than getData().getType() for RemoteDataReferences

  Returns:
    the MathType of referenced Data object, or null if none;
  Throws:
    `VisADException` - a VisAD error occurred
    `RemoteException` - an RMI error occurred