| 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectinfo.bioinfweb.treegraph.document.NodeLadderizeComparable
public class NodeLadderizeComparable
This class is a wrapper class for Node-objects that allowws them to be
 compared by their number of terminal subnodes. It is used to ladderize a tree.
| Field Summary | |
|---|---|
static String | 
CHILD_COUNT_KEY
 | 
private  boolean | 
ladderizeDown
 | 
private  Node | 
node
 | 
| Constructor Summary | |
|---|---|
NodeLadderizeComparable(Node node,
                        boolean ladderizeDown)
 | 
|
| Method Summary | |
|---|---|
static void | 
addToNode(NodeLadderizeComparable[] elements,
          Node root)
This method is used to reinsert sorted elements in the a subtree.  | 
 int | 
compareTo(NodeLadderizeComparable other)
Compares which node has more (or less) nodes in its subtree.  | 
static int | 
countNodes(Node root)
Sets all the childCount values of the contained Node-objects. | 
static NodeLadderizeComparable[] | 
encloseSubnodes(Node root,
                boolean ladderizeDown)
Encloses all direct subelements of root with a NodeLadderizeComparable-
 object and adds this objects to an array that is returned. | 
 Node | 
getNode()
 | 
 boolean | 
isLadderizeDown()
 | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
public static final String CHILD_COUNT_KEY
private Node node
private boolean ladderizeDown
| Constructor Detail | 
|---|
public NodeLadderizeComparable(Node node, boolean ladderizeDown)
| Method Detail | 
|---|
public boolean isLadderizeDown()
public Node getNode()
public int compareTo(NodeLadderizeComparable other)
countNodes() has to be called first.
compareTo in interface Comparable<NodeLadderizeComparable>other - an other NodeLadderizeComparable that should be comparedinfo.bioinfweb.treegraph.document.Node#getChildCount(), 
info.bioinfweb.treegraph.document.NodeLadderizeComparable#countNodes()public static NodeLadderizeComparable[] encloseSubnodes(Node root, boolean ladderizeDown)
root with a NodeLadderizeComparable-
 object and adds this objects to an array that is returned.
root - the parent element of the subelements to encloseladderizeDown - whether the elements will be ladderized down
NodeLadderizeComparable-objectspublic static void addToNode(NodeLadderizeComparable[] elements, Node root)
elements - the elements to insertroot - the future parent element of the elements to insertpublic static int countNodes(Node root)
childCount values of the contained Node-objects.
 This methode is used to perform ladderization.
rootinfo.bioinfweb.treegraph.document.Node#getChildCount(), 
LadderizeEdit, 
LadderizeAction
  | 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||