org.apache.asn1.ber
Interface TupleNodeVisitor

All Known Implementing Classes:
DeterminateLengthVisitor, TupleEncodingVisitor

public interface TupleNodeVisitor

Tuple tree node visitor interface. Note that this is a more specific variant of the extrinsic visitor pattern. It has the following advantages over the standard visitor pattern:

Version:
$Rev: 157644 $
Author:
Apache Directory Project
See Also:
TupleNode.accept(TupleNodeVisitor)

Method Summary
 boolean canVisit(TupleNode node)
          Checks to see if a node can be visited.
 java.util.ArrayList getOrder(TupleNode node, java.util.ArrayList children)
          Get the array of children to visit sequentially to determine the order of child visitations.
 boolean isPrefix()
          Determines whether the visitation order is prefix or postfix.
 void setMonitor(VisitorMonitor monitor)
          Sets the monitoring which recieves callbacks of notable events from this visitor.
 void visit(TupleNode node)
          Visits a tree of tuple nodes using a specific visitation order.
 

Method Detail

visit

void visit(TupleNode node)
Visits a tree of tuple nodes using a specific visitation order.

Parameters:
node - the node to visit

canVisit

boolean canVisit(TupleNode node)
Checks to see if a node can be visited.

Parameters:
node - the node to be visited
Returns:
whether or node the node should be visited

isPrefix

boolean isPrefix()
Determines whether the visitation order is prefix or postfix.

Returns:
true if the visitation is in prefix order, false otherwise.

getOrder

java.util.ArrayList getOrder(TupleNode node,
                             java.util.ArrayList children)
Get the array of children to visit sequentially to determine the order of child visitations. Some children may not be returned at all if canVisit() returns false on them.

Parameters:
node - the parent branch node
children - the child node array
Returns:
the new reordered array of children

setMonitor

void setMonitor(VisitorMonitor monitor)
Sets the monitoring which recieves callbacks of notable events from this visitor.

Parameters:
monitor - the monitor instance for the visitor


Copyright © 2004-2009 . All Rights Reserved.