org.planx.msd.graph
Interface Navigator<N>

All Known Implementing Classes:
CanonicPolicy, FirstPolicy, LeastInterRegionPolicy, NodeNavigator, TemplateNode.TemplateNavigator

public interface Navigator<N>

A Navigator is a bridge between MSD and a document model.


Method Summary
 int childCount(N node)
          Returns the number of children of the specified node.
 N chooseCanonical(List<Compactor.Edge> eqCls)
          Choose the canonical node from among equivalent nodes.
 N getChild(N node, int index)
          Returns the child of the specified node with the specified child index.
 int getHeight(N node)
          Returns the height of the specified node.
 Object getVisitToken(N node)
          Returns the visit token of the specified node.
 boolean isOutside(N node)
          Returns true if the specified node is outside the bounds for the discrimination.
 void setChild(N node, int index, N child)
          Replaces an existing reference to a child node.
 void setHeight(N node, int height)
          Sets the height of the specified node.
 void setVisitToken(N node, Object token)
          Sets the visit token of the specified node.
 

Method Detail

getChild

N getChild(N node,
           int index)
Returns the child of the specified node with the specified child index.


setChild

void setChild(N node,
              int index,
              N child)
Replaces an existing reference to a child node.


childCount

int childCount(N node)
Returns the number of children of the specified node.


getVisitToken

Object getVisitToken(N node)
Returns the visit token of the specified node. This is used to ensure that subtrees are not visited multiple times during dagification.


setVisitToken

void setVisitToken(N node,
                   Object token)
Sets the visit token of the specified node.


getHeight

int getHeight(N node)
Returns the height of the specified node.


setHeight

void setHeight(N node,
               int height)
Sets the height of the specified node.


isOutside

boolean isOutside(N node)
Returns true if the specified node is outside the bounds for the discrimination. The node will not be visited.


chooseCanonical

N chooseCanonical(List<Compactor.Edge> eqCls)
Choose the canonical node from among equivalent nodes. This method will only be called for equivalence classes containing more than one element.



Copyright © 2010. All Rights Reserved.