visad.data
Class DataNode

java.lang.Object
  extended by visad.data.DataNode

public abstract class DataNode
extends Object

Abstract class for adapting a VisAD data object to the "Visitor" design pattern. This class knows how to traverse an arbitrary VisAD data object.


Constructor Summary
protected DataNode()
          Construct.
 
Method Summary
abstract  DataVisitor accept(DataVisitor visitor)
          Accept a visitor and traverse the data object.
static DataNode create(Data data)
          Factory method for creating an instance of the appropriate type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataNode

protected DataNode()
Construct. Protected to ensure use of the create() factory method.

Method Detail

create

public static DataNode create(Data data)
                       throws UnimplementedException
Factory method for creating an instance of the appropriate type.

Parameters:
data - The VisAD data object to be traversed.
Returns:
A DataNode that knows how to traverse the VisAD data object.
Throws:
UnimplementedException - A (soon to be implemented) method isn't implemented yet.
Precondition:
data is non-null.

accept

public abstract DataVisitor accept(DataVisitor visitor)
                            throws UnimplementedException,
                                   BadFormException,
                                   VisADException,
                                   RemoteException
Accept a visitor and traverse the data object.

Parameters:
visitor - The object that will have it's visit() method called for each subcomponent of the VisAD data object.
Returns:
visitor for convenience.
Throws:
UnimplementedException - A (soon to be implemented) method isn't implemented yet.
BadFormException - The VisAD data object doesn't "fit" the data model used by visitor.
VisADException - Problem in core VisAD (probably couldn't create some VisAD object).
RemoteException - Problem accessing the VisAD data object.
See Also:
DataVisitor
Precondition:
visitor is non-null.
Postcondition:
visitor has visited the VisAD data object data.