visad
Class DataReferenceImpl

java.lang.Object
  extended byvisad.ThingReferenceImpl
      extended byvisad.DataReferenceImpl
All Implemented Interfaces:
DataReference, ThingReference

public class DataReferenceImpl
extends ThingReferenceImpl
implements DataReference

DataReferenceImpl is a local implementation of DataReference.

DataReferenceImpl is not Serializable and should not be copied between JVMs.


Field Summary
 
Fields inherited from class visad.ThingReferenceImpl
ListenerVector, Name
 
Constructor Summary
DataReferenceImpl(String name)
          Constructs from a name for the instance.
 
Method Summary
(package private)  void adaptedSetData(RemoteData d, RemoteDataReference r)
          method for use by setData() method of the RemoteDataReferenceImpl that adapts this DataReferenceImpl
 boolean equals(Object obj)
          Indicates whether or not this instance is equal to an object
 Data getData()
           
 MathType getType()
          this is more efficient than getData().getType() for RemoteDataReferences
 void setData(Data d)
          Sets the Data object to which this instance refers.
 String toString()
           
 
Methods inherited from class visad.ThingReferenceImpl
acknowledgeThingChanged, adaptedAcknowledgeThingChanged, adaptedAddThingChangedListener, adaptedPeekThingChanged, adaptedRemoveThingChangedListener, adaptedSetThing, addThingChangedListener, findThingChangedLink, getName, getThing, getTick, incTick, peekThingChanged, removeThingChangedListener, setThing
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface visad.ThingReference
acknowledgeThingChanged, addThingChangedListener, getName, getThing, getTick, incTick, peekThingChanged, removeThingChangedListener, setThing
 

Constructor Detail

DataReferenceImpl

public DataReferenceImpl(String name)
                  throws VisADException
Constructs from a name for the instance.

Parameters:
name - The name for this instance.
Throws:
VisADException - if the name is null.
Method Detail

getData

public Data getData()
Specified by:
getData in interface DataReference
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

Specified by:
getType in interface DataReference
Returns:
the MathType of referenced Data object, or null if none;
Throws:
VisADException - a VisAD error occurred
RemoteException - an RMI error occurred

setData

public void setData(Data d)
             throws VisADException,
                    RemoteException
Sets the Data object to which this instance refers.

Specified by:
setData in interface DataReference
Parameters:
d - The data object.
Throws:
ReferenceException - if the data object is null.
RemoteVisADException - if the data object is a RemoteData.
RemoteException - an RMI error occurred
VisADException - a VisAD error occurred

adaptedSetData

void adaptedSetData(RemoteData d,
                    RemoteDataReference r)
              throws VisADException,
                     RemoteException
method for use by setData() method of the RemoteDataReferenceImpl that adapts this DataReferenceImpl

Parameters:
d - RemoteData being set
r - RemoteDataReference adapting this DataReferenceImpl
Throws:
VisADException - a VisAD error occurred
RemoteException - an RMI error occurred

equals

public boolean equals(Object obj)
Indicates whether or not this instance is equal to an object

Overrides:
equals in class ThingReferenceImpl
Returns:
true if and only if this instance equals o.

toString

public String toString()
Overrides:
toString in class ThingReferenceImpl
Returns:
String representation of this