ca.quine.jcommons.transform.appl
Class LinearizeApplicator

java.lang.Object
  |
  +--ca.quine.jcommons.transform.appl.LinearizeApplicator
All Implemented Interfaces:
IDFSNodeApplicator
Direct Known Subclasses:
LinearizeAndPruneApplicator

public class LinearizeApplicator
extends Object
implements IDFSNodeApplicator

Used with a DFS to produce a List of nodes in DFS order.


Field Summary
 
Fields inherited from interface ca.quine.jcommons.transform.graph.IDFSNodeApplicator
SEARCH_CONTINUE, SEARCH_STOP, SEARCH_TRIM
 
Constructor Summary
LinearizeApplicator()
           
 
Method Summary
 int applyForwardEdge(TransformNode parentNode, TransformNode node)
          Apply the parent node and child node of every "forward edge" in DFS order; IDFSNodeApplicator.SEARCH_TRIM is not a valid return for this method.
 int applyPostOrder(TransformNode parentNode, TransformNode node)
          Apply the parent node and child node of every edge in post-order DFS order; IDFSNodeApplicator.SEARCH_TRIM is not a valid return for this method.
 int applyPreOrder(TransformNode parentNode, TransformNode node)
          Apply the parent node and child node of every edge in pre-order DFS order.
 List getNodeList()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinearizeApplicator

public LinearizeApplicator()
Method Detail

applyPreOrder

public int applyPreOrder(TransformNode parentNode,
                         TransformNode node)
Description copied from interface: IDFSNodeApplicator
Apply the parent node and child node of every edge in pre-order DFS order.

Specified by:
applyPreOrder in interface IDFSNodeApplicator
Parameters:
parentNode -
node -
Returns:
IDFSNodeApplicator.SEARCH_CONTINUE, IDFSNodeApplicator.SEARCH_STOP, or IDFSNodeApplicator.SEARCH_TRIM

applyPostOrder

public int applyPostOrder(TransformNode parentNode,
                          TransformNode node)
Description copied from interface: IDFSNodeApplicator
Apply the parent node and child node of every edge in post-order DFS order; IDFSNodeApplicator.SEARCH_TRIM is not a valid return for this method.

Specified by:
applyPostOrder in interface IDFSNodeApplicator
Parameters:
parentNode -
node -
Returns:
IDFSNodeApplicator.SEARCH_CONTINUE, IDFSNodeApplicator.SEARCH_STOP

applyForwardEdge

public int applyForwardEdge(TransformNode parentNode,
                            TransformNode node)
Description copied from interface: IDFSNodeApplicator
Apply the parent node and child node of every "forward edge" in DFS order; IDFSNodeApplicator.SEARCH_TRIM is not a valid return for this method. For more information on forward edges, please consult "Introduction to Algorithms", Cormen, Leiserson, and Rivest, 1990.

Specified by:
applyForwardEdge in interface IDFSNodeApplicator
Parameters:
parentNode -
node -
Returns:
IDFSNodeApplicator.SEARCH_CONTINUE, IDFSNodeApplicator.SEARCH_STOP

getNodeList

public List getNodeList()