wt.visitor
Class BasicWalker

java.lang.Object
  extended bywt.visitor.BasicWalker
All Implemented Interfaces:
Walker
Direct Known Subclasses:
Navigator

public abstract class BasicWalker
extends Object
implements Walker

This abstract class is an implementation which provides some basic functionality for sub-class use.

Descendant classes are responsible for maintaining a list of nodes that have been visited. This is used to pass a flag to the Visitor's visit operation. As a convenience, registerVisitedNode() and clearVisitedNodes() methods are implemented in this base class.

Supported API: false

Extendable: false


Field Summary
private static String CLASSNAME
           
private  NodeExpander nodeExpander
           
private  Hashtable nodes
           
private  boolean recursionDetectionEnabled
          The notion of recursion detection is established here.
private static String RESOURCE
           
private  Visitor visitor
           
 
Fields inherited from interface wt.visitor.Walker
NODE_EXPANDER, VISITOR
 
Constructor Summary
BasicWalker()
           
 
Method Summary
protected  void clearVisitedNodes()
          This method clears the internal registration of nodes that were visited.
 NodeExpander getNodeExpander()
          Gets the object for the association that plays role: nodeExpander.
 Visitor getVisitor()
          Gets the object for the association that plays role: visitor.
 boolean isRecursionDetectionEnabled()
           
private  void nodeExpanderValidate(NodeExpander a_NodeExpander)
           
protected  boolean registerVisitedNode(ObjectIdentifier a_object)
          This method registers the node as visited.
 void setNodeExpander(NodeExpander a_NodeExpander)
          Sets the object for the association that plays role: nodeExpander.
 void setRecursionDetectionEnabled(boolean enable)
           
 void setVisitor(Visitor a_Visitor)
          Sets the object for the association that plays role: visitor.
private  void visitorValidate(Visitor a_Visitor)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface wt.visitor.Walker
traverse
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

visitor

private Visitor visitor

nodeExpander

private NodeExpander nodeExpander

recursionDetectionEnabled

private boolean recursionDetectionEnabled
The notion of recursion detection is established here. This class defines the object necessary (PathNode) to validate, but requires the extenders (DFSWalker and BFSWalker) to use it correctly. Note that these classes must also implement appropriate behavior when recursion is disabled. The reason for not doing it here is that there's no need to even create the PathNodes if we're not doing detection; if we were to disable validatePath in the PathNode, we'd ultimately be creating a lot of objects that won't do anything.


nodes

private Hashtable nodes
Constructor Detail

BasicWalker

public BasicWalker()
Method Detail

registerVisitedNode

protected boolean registerVisitedNode(ObjectIdentifier a_object)
This method registers the node as visited. It returns true, if the node was previously registered.

Supported API: false

Parameters:
a_object -
Returns:
boolean

clearVisitedNodes

protected void clearVisitedNodes()
This method clears the internal registration of nodes that were visited.

Supported API: false


getVisitor

public Visitor getVisitor()
Gets the object for the association that plays role: visitor.

Supported API: false

Specified by:
getVisitor in interface Walker
Returns:
Visitor

setVisitor

public void setVisitor(Visitor a_Visitor)
                throws WTPropertyVetoException
Sets the object for the association that plays role: visitor.

Supported API: false

Specified by:
setVisitor in interface Walker
Parameters:
a_Visitor -
Throws:
WTPropertyVetoException

visitorValidate

private void visitorValidate(Visitor a_Visitor)
                      throws WTPropertyVetoException
Parameters:
a_Visitor -
Throws:
WTPropertyVetoException

getNodeExpander

public NodeExpander getNodeExpander()
Gets the object for the association that plays role: nodeExpander.

Supported API: false

Specified by:
getNodeExpander in interface Walker
Returns:
NodeExpander

setNodeExpander

public void setNodeExpander(NodeExpander a_NodeExpander)
                     throws WTPropertyVetoException
Sets the object for the association that plays role: nodeExpander.

Supported API: false

Specified by:
setNodeExpander in interface Walker
Parameters:
a_NodeExpander -
Throws:
WTPropertyVetoException

nodeExpanderValidate

private void nodeExpanderValidate(NodeExpander a_NodeExpander)
                           throws WTPropertyVetoException
Parameters:
a_NodeExpander -
Throws:
WTPropertyVetoException

isRecursionDetectionEnabled

public boolean isRecursionDetectionEnabled()

setRecursionDetectionEnabled

public void setRecursionDetectionEnabled(boolean enable)