org.apache.asn1.ber
Class DeterminateLengthVisitor

java.lang.Object
  extended byorg.apache.asn1.ber.DeterminateLengthVisitor
All Implemented Interfaces:
TupleNodeVisitor

public class DeterminateLengthVisitor
extends java.lang.Object
implements TupleNodeVisitor

A visitor used to transform a TLV tuple tree by altering tuples to use determinate length encodings rather than the indeterminate form.

Author:
Apache Directory Project $Rev: 157644 $

Field Summary
private  VisitorMonitor monitor
          the visitor monitor called when notible events occur
 
Constructor Summary
DeterminateLengthVisitor()
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

monitor

private VisitorMonitor monitor
the visitor monitor called when notible events occur

Constructor Detail

DeterminateLengthVisitor

public DeterminateLengthVisitor()
Method Detail

visit

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

Specified by:
visit in interface TupleNodeVisitor
Parameters:
node - the node to visit

canVisit

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

Specified by:
canVisit in interface TupleNodeVisitor
Parameters:
node - the node to be visited
Returns:
whether or node the node should be visited

isPrefix

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

Specified by:
isPrefix in interface TupleNodeVisitor
Returns:
true if the visitation is in prefix order, false otherwise.

getOrder

public 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.

Specified by:
getOrder in interface TupleNodeVisitor
Parameters:
node - the parent branch node
children - the child node array
Returns:
the new reordered array of children

setMonitor

public void setMonitor(VisitorMonitor monitor)
Description copied from interface: TupleNodeVisitor
Sets the monitoring which recieves callbacks of notable events from this visitor.

Specified by:
setMonitor in interface TupleNodeVisitor
Parameters:
monitor - the monitor instance for the visitor


Copyright © 2004-2006 . All Rights Reserved.