Package net.didion.jwnl.data.list
Class PointerTargetTree
- java.lang.Object
-
- net.didion.jwnl.data.list.PointerTargetTree
-
public class PointerTargetTree extends java.lang.ObjectA container for the root node of a pointer target tree.
-
-
Field Summary
Fields Modifier and Type Field Description private PointerTargetTreeNode_rootNode
-
Constructor Summary
Constructors Constructor Description PointerTargetTree(PointerTargetTreeNode rootNode)PointerTargetTree(Synset synset, PointerTargetTreeNodeList list)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)Two PointerTargetTree's are equal if their root nodes are equal.PointerTargetTreeNode[]findAll(PointerTargetTreeNode node)Find all occurances ofnodein the tree.PointerTargetTreeNode[]findAll(PointerTarget target)Find all nodes in the tree whose target is targetPointerTargetTreeNodefindFirst(PointerTargetTreeNode node)Find the first occurance ofnodein the tree.PointerTargetTreeNodefindFirst(PointerTarget target)Find the first node in the tree whose target is targetjava.util.ListgetAllMatches(PointerTargetTreeNodeList.Operation opr)Walk the tree and perform the operationopron each node.java.lang.ObjectgetFirstMatch(PointerTargetTreeNodeList.Operation opr)Walk the tree and perform the operationopron each node.PointerTargetTreeNodegetRootNode()voidprint()PointerTargetNodeList[]reverse()Reverse this tree.java.util.ListtoList()Convert this tree to an List of PointerTargetNodeLists.
-
-
-
Field Detail
-
_rootNode
private PointerTargetTreeNode _rootNode
-
-
Constructor Detail
-
PointerTargetTree
public PointerTargetTree(PointerTargetTreeNode rootNode)
-
PointerTargetTree
public PointerTargetTree(Synset synset, PointerTargetTreeNodeList list)
-
-
Method Detail
-
getRootNode
public PointerTargetTreeNode getRootNode()
-
equals
public boolean equals(java.lang.Object obj)
Two PointerTargetTree's are equal if their root nodes are equal.- Overrides:
equalsin classjava.lang.Object
-
getFirstMatch
public java.lang.Object getFirstMatch(PointerTargetTreeNodeList.Operation opr)
Walk the tree and perform the operationopron each node. Continues until either opr returns a non-null value, or it reaches the last node in the tree.
-
getAllMatches
public java.util.List getAllMatches(PointerTargetTreeNodeList.Operation opr)
Walk the tree and perform the operationopron each node. Searchs the tree exhaustively and returns a List containing all nodes that are returned byopr.
-
findFirst
public PointerTargetTreeNode findFirst(PointerTargetTreeNode node)
Find the first occurance ofnodein the tree.
-
findFirst
public PointerTargetTreeNode findFirst(PointerTarget target)
Find the first node in the tree whose target is target
-
findAll
public PointerTargetTreeNode[] findAll(PointerTargetTreeNode node)
Find all occurances ofnodein the tree.
-
findAll
public PointerTargetTreeNode[] findAll(PointerTarget target)
Find all nodes in the tree whose target is target
-
print
public void print()
-
reverse
public PointerTargetNodeList[] reverse()
Reverse this tree. A reversal is done by converting this tree to lists and then reversing each of the lists. The structure of the tree is unaffected by this operation.
-
toList
public java.util.List toList()
Convert this tree to an List of PointerTargetNodeLists. This creates one list for each unique path through the tree.
-
-