ca.quine.jcommons.freemind.maputil
Class FoldLargeNodes

java.lang.Object
  |
  +--ca.quine.jcommons.freemind.maputil.FoldLargeNodes
All Implemented Interfaces:
INodeApplicator

public class FoldLargeNodes
extends Object
implements INodeApplicator

Fold (close) nodes with more than the given number of child nodes. If a node is already folded, then we "trim" the tree (that is, we do not descend on the node's children). A parent node with (say) three children, where all of them are folded, has a count of three regardless of how many children the folded nodes have. This implementation is not used by MapUtils for MapUtils.closeLargeNodes(Map, int). It is provided as an example of how "trimming" a tree can be useful (that is, returning INodeApplicator.SEARCH_TRIM from the apply method).


Field Summary
 
Fields inherited from interface ca.quine.jcommons.freemind.maputil.INodeApplicator
SEARCH_CONTINUE, SEARCH_STOP, SEARCH_TRIM
 
Constructor Summary
FoldLargeNodes(int maxChildren)
           
 
Method Summary
 int apply(Node parentNode, Node node)
           
protected  int countChildren(Node node)
           
protected  boolean isFolded(Node node)
           
protected  boolean isLeaf(Node node)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FoldLargeNodes

public FoldLargeNodes(int maxChildren)
Method Detail

apply

public int apply(Node parentNode,
                 Node node)
Specified by:
apply in interface INodeApplicator

countChildren

protected int countChildren(Node node)

isLeaf

protected boolean isLeaf(Node node)

isFolded

protected boolean isFolded(Node node)