com.bbn.swede.core.dom
Class NodeDisplacementVisitor

java.lang.Object
  extended bycom.bbn.swede.core.dom.NodeDisplacementVisitor
All Implemented Interfaces:
IOASTNodeVisitor

public class NodeDisplacementVisitor
extends Object
implements IOASTNodeVisitor

A visitor to adjust the position of nodes in the OAST to reflect a character displacement.


Field Summary
protected  int _iOffsetLength
          The length of the displacement.
protected  int _iStartOffset
          The starting offset of the displacement.
 
Constructor Summary
NodeDisplacementVisitor(int iStartOffset, int iOffsetLength)
          Creates a NodeDisplacementVisitor.
 
Method Summary
 boolean visit(OASTNode node)
          Performs the recursion's action for a node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_iStartOffset

protected int _iStartOffset
The starting offset of the displacement.


_iOffsetLength

protected int _iOffsetLength
The length of the displacement.

Constructor Detail

NodeDisplacementVisitor

public NodeDisplacementVisitor(int iStartOffset,
                               int iOffsetLength)
Creates a NodeDisplacementVisitor.

Parameters:
iStartOffset - The location of the displacement.
iOffsetLength - The magnitude of the displacement. May be negative.
Method Detail

visit

public boolean visit(OASTNode node)
Description copied from interface: IOASTNodeVisitor
Performs the recursion's action for a node. The return value indicates whether to process the node's children.

Specified by:
visit in interface IOASTNodeVisitor
Parameters:
node - The node
Returns:
true to continue and visit node's children, false to prevent them from being processed.


Copyright © 2004-2005 BBN Technologies. All Rights Reserved.