pl.netanel.swt.matrix
Class Grouping.NodeVisitor

java.lang.Object
  extended by pl.netanel.swt.matrix.Grouping.NodeVisitor
Enclosing class:
Grouping

public abstract static class Grouping.NodeVisitor
extends java.lang.Object

Traverses the given node or array of nodes and all the related nodes at the lower levels. The order of visiting is parent first then children.

Implements the Visitor pattern.


Field Summary
protected  Grouping.Node node
          Node being visited
protected  boolean stop
          Stops the traversing if set to true
protected  boolean stopBranch
          Stops traversing deeper into the current branch if set to true
 
Constructor Summary
Grouping.NodeVisitor()
           
 
Method Summary
 Grouping.Node get()
          Returns the latest visited node.
 Grouping.NodeVisitor traverse()
          Can encapsulate the traversal starting node or nodes.
 Grouping.NodeVisitor traverse(Grouping.Node node)
          Traverses starting from the given node.
 Grouping.NodeVisitor traverse(java.util.List<Grouping.Node> nodes)
          Traverses starting from the given nodes.
protected  void visitAfter(Grouping.Node node)
          Method executed after traversing children
protected  void visitBefore(Grouping.Node node)
          Method executed before traversing children
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

node

protected Grouping.Node node
Node being visited


stop

protected boolean stop
Stops the traversing if set to true


stopBranch

protected boolean stopBranch
Stops traversing deeper into the current branch if set to true

Constructor Detail

Grouping.NodeVisitor

public Grouping.NodeVisitor()
Method Detail

visitBefore

protected void visitBefore(Grouping.Node node)
Method executed before traversing children

Parameters:
node - parent for the children to traverse

visitAfter

protected void visitAfter(Grouping.Node node)
Method executed after traversing children

Parameters:
node - parent for the children to traverse

get

public Grouping.Node get()
Returns the latest visited node.

Returns:
the latest visited node

traverse

public Grouping.NodeVisitor traverse(Grouping.Node node)
Traverses starting from the given node.

Parameters:
node - node to traverse
Returns:
this object

traverse

public Grouping.NodeVisitor traverse(java.util.List<Grouping.Node> nodes)
Traverses starting from the given nodes.

Parameters:
nodes - nodes to traverse
Returns:
this object

traverse

public Grouping.NodeVisitor traverse()
Can encapsulate the traversal starting node or nodes.

Returns:
this object


Copyright © 2011 netanel.pl. All Rights Reserved.