Package net.didion.jwnl.data.list
Class PointerTargetTreeNodeList
- java.lang.Object
-
- net.didion.jwnl.util.TypeCheckingList
-
- net.didion.jwnl.data.list.PointerTargetNodeList
-
- net.didion.jwnl.data.list.PointerTargetTreeNodeList
-
- All Implemented Interfaces:
java.lang.Cloneable,java.lang.Iterable,java.util.Collection,java.util.List,DeepCloneable
public class PointerTargetTreeNodeList extends PointerTargetNodeList
A list ofPointerTargetTreeNodes.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPointerTargetTreeNodeList.FindNodeOperationOperation that is used for finding the specified node in a tree.static classPointerTargetTreeNodeList.FindTargetOperationOperation that is used for finding the node(s) in a tree that have the specifiedPointerTarget.static interfacePointerTargetTreeNodeList.OperationOperation that is performed on the nodes of a tree or list.-
Nested classes/interfaces inherited from class net.didion.jwnl.util.TypeCheckingList
TypeCheckingList.TypeCheckingListIterator
-
-
Field Summary
Fields Modifier and Type Field Description private static NodePrinterPRINTER
-
Constructor Summary
Constructors Constructor Description PointerTargetTreeNodeList()PointerTargetTreeNodeList(java.util.LinkedList list)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(PointerTarget target)voidadd(PointerTarget target, PointerTargetTreeNodeList childTreeList, PointerTargetTreeNodeList pointerTreeList, PointerType type)voidadd(PointerTarget target, PointerTargetTreeNodeList childTreeList, PointerTargetTreeNodeList pointerTreeList, PointerType type, PointerTargetTreeNode parent)voidadd(PointerTarget target, PointerTargetTreeNodeList childTreeList, PointerType type)voidadd(PointerTarget target, PointerTargetTreeNodeList childTreeList, PointerType type, PointerTargetTreeNode parent)voidadd(PointerTarget target, PointerType type)voidadd(PointerTarget target, PointerType type, PointerTargetTreeNode parent)java.lang.Objectclone()Create a shallow clone of the objectjava.lang.ObjectdeepClone()Create a deep clone of the objectPointerTargetTreeNode[]findAll(PointerTargetTreeNode node)Find all occurances ofnodewithin the list.PointerTargetTreeNodefindFirst(PointerTargetTreeNode node)Find the first node in the list that is equal tonode.java.util.ListgetAllMatches(PointerTargetTreeNodeList.Operation opr)Walk the list and perform the operationopron each node.voidgetAllMatches(PointerTargetTreeNodeList.Operation opr, java.util.List matches)Get all matches and add them to matchesjava.lang.ObjectgetFirstMatch(PointerTargetTreeNodeList.Operation opr)Walk the list and all the children of each node in the list and perform the operationopron each node.protected NodePrintergetNodePrinter()-
Methods inherited from class net.didion.jwnl.data.list.PointerTargetNodeList
print, print, print, print, print, reverse, toTreeList
-
Methods inherited from class net.didion.jwnl.util.TypeCheckingList
add, add, addAll, addAll, clear, contains, containsAll, copyBackingList, equals, get, getType, getTypeCheckingListIterator, getTypeCheckingListIterator, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray
-
-
-
-
Field Detail
-
PRINTER
private static final NodePrinter PRINTER
-
-
Method Detail
-
add
public void add(PointerTarget target)
- Overrides:
addin classPointerTargetNodeList
-
add
public void add(PointerTarget target, PointerType type)
- Overrides:
addin classPointerTargetNodeList
-
add
public void add(PointerTarget target, PointerType type, PointerTargetTreeNode parent)
-
add
public void add(PointerTarget target, PointerTargetTreeNodeList childTreeList, PointerType type)
-
add
public void add(PointerTarget target, PointerTargetTreeNodeList childTreeList, PointerType type, PointerTargetTreeNode parent)
-
add
public void add(PointerTarget target, PointerTargetTreeNodeList childTreeList, PointerTargetTreeNodeList pointerTreeList, PointerType type)
-
add
public void add(PointerTarget target, PointerTargetTreeNodeList childTreeList, PointerTargetTreeNodeList pointerTreeList, PointerType type, PointerTargetTreeNode parent)
-
getNodePrinter
protected NodePrinter getNodePrinter()
- Overrides:
getNodePrinterin classPointerTargetNodeList
-
getFirstMatch
public java.lang.Object getFirstMatch(PointerTargetTreeNodeList.Operation opr)
Walk the list and all the children of each node in the list and perform the operationopron each node. Continues until either opr returns a non-null value, or it reaches the last node in the list.
-
getAllMatches
public java.util.List getAllMatches(PointerTargetTreeNodeList.Operation opr)
Walk the list and perform the operationopron each node. Searches the list exhaustively and return a List containing all nodes that are returned byopr.
-
getAllMatches
public void getAllMatches(PointerTargetTreeNodeList.Operation opr, java.util.List matches)
Get all matches and add them to matches
-
findFirst
public PointerTargetTreeNode findFirst(PointerTargetTreeNode node)
Find the first node in the list that is equal tonode.nodeis considered to match a node in the list if they contain equal pointer targets and are of the same type.
-
findAll
public PointerTargetTreeNode[] findAll(PointerTargetTreeNode node)
Find all occurances ofnodewithin the list.
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedExceptionDescription copied from interface:DeepCloneableCreate a shallow clone of the object- Specified by:
clonein interfaceDeepCloneable- Overrides:
clonein classPointerTargetNodeList- Throws:
java.lang.CloneNotSupportedException
-
deepClone
public java.lang.Object deepClone() throws java.lang.UnsupportedOperationExceptionDescription copied from interface:DeepCloneableCreate a deep clone of the object- Specified by:
deepClonein interfaceDeepCloneable- Overrides:
deepClonein classPointerTargetNodeList- Throws:
java.lang.UnsupportedOperationException
-
-