org.planx.msd.graph
Class TemplateNode.TemplateNavigator

java.lang.Object
  extended by org.planx.msd.graph.TemplateNode.TemplateNavigator
All Implemented Interfaces:
Navigator<TemplateNode<N,L>>
Enclosing class:
TemplateNode<N,L>

protected class TemplateNode.TemplateNavigator
extends Object
implements Navigator<TemplateNode<N,L>>


Constructor Summary
protected TemplateNode.TemplateNavigator()
           
 
Method Summary
 int childCount(TemplateNode<N,L> node)
          Returns the number of children of the specified node.
 TemplateNode<N,L> chooseCanonical(List<Compactor.Edge> eqCls)
          Choose the canonical node from among equivalent nodes.
 TemplateNode<N,L> getChild(TemplateNode<N,L> node, int index)
          Returns the child of the specified node with the specified child index.
 int getHeight(TemplateNode<N,L> node)
          Returns the height of the specified node.
 Object getVisitToken(TemplateNode<N,L> node)
          Returns the visit token of the specified node.
 boolean isOutside(TemplateNode<N,L> node)
          Returns true if the specified node is outside the bounds for the discrimination.
 void setChild(TemplateNode<N,L> node, int index, TemplateNode<N,L> child)
          Replaces an existing reference to a child node.
 void setHeight(TemplateNode<N,L> node, int height)
          Sets the height of the specified node.
 void setVisitToken(TemplateNode<N,L> node, Object token)
          Sets the visit token of the specified node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TemplateNode.TemplateNavigator

protected TemplateNode.TemplateNavigator()
Method Detail

getChild

public TemplateNode<N,L> getChild(TemplateNode<N,L> node,
                                  int index)
Description copied from interface: Navigator
Returns the child of the specified node with the specified child index.

Specified by:
getChild in interface Navigator<TemplateNode<N,L>>

setChild

public void setChild(TemplateNode<N,L> node,
                     int index,
                     TemplateNode<N,L> child)
Description copied from interface: Navigator
Replaces an existing reference to a child node.

Specified by:
setChild in interface Navigator<TemplateNode<N,L>>

childCount

public int childCount(TemplateNode<N,L> node)
Description copied from interface: Navigator
Returns the number of children of the specified node.

Specified by:
childCount in interface Navigator<TemplateNode<N,L>>

getVisitToken

public Object getVisitToken(TemplateNode<N,L> node)
Description copied from interface: Navigator
Returns the visit token of the specified node. This is used to ensure that subtrees are not visited multiple times during dagification.

Specified by:
getVisitToken in interface Navigator<TemplateNode<N,L>>

setVisitToken

public void setVisitToken(TemplateNode<N,L> node,
                          Object token)
Description copied from interface: Navigator
Sets the visit token of the specified node.

Specified by:
setVisitToken in interface Navigator<TemplateNode<N,L>>

getHeight

public int getHeight(TemplateNode<N,L> node)
Description copied from interface: Navigator
Returns the height of the specified node.

Specified by:
getHeight in interface Navigator<TemplateNode<N,L>>

setHeight

public void setHeight(TemplateNode<N,L> node,
                      int height)
Description copied from interface: Navigator
Sets the height of the specified node.

Specified by:
setHeight in interface Navigator<TemplateNode<N,L>>

isOutside

public boolean isOutside(TemplateNode<N,L> node)
Description copied from interface: Navigator
Returns true if the specified node is outside the bounds for the discrimination. The node will not be visited.

Specified by:
isOutside in interface Navigator<TemplateNode<N,L>>

chooseCanonical

public TemplateNode<N,L> chooseCanonical(List<Compactor.Edge> eqCls)
Description copied from interface: Navigator
Choose the canonical node from among equivalent nodes. This method will only be called for equivalence classes containing more than one element.

Specified by:
chooseCanonical in interface Navigator<TemplateNode<N,L>>


Copyright © 2010. All Rights Reserved.