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:
Cloneable
,Iterable
,Collection
,List
,DeepCloneable
A list of
PointerTargetTreeNode
s.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Operation that is used for finding the specified node in a tree.static class
Operation that is used for finding the node(s) in a tree that have the specifiedPointerTarget
.static interface
Operation 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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(PointerTarget target) void
add
(PointerTarget target, PointerTargetTreeNodeList childTreeList, PointerTargetTreeNodeList pointerTreeList, PointerType type) void
add
(PointerTarget target, PointerTargetTreeNodeList childTreeList, PointerTargetTreeNodeList pointerTreeList, PointerType type, PointerTargetTreeNode parent) void
add
(PointerTarget target, PointerTargetTreeNodeList childTreeList, PointerType type) void
add
(PointerTarget target, PointerTargetTreeNodeList childTreeList, PointerType type, PointerTargetTreeNode parent) void
add
(PointerTarget target, PointerType type) void
add
(PointerTarget target, PointerType type, PointerTargetTreeNode parent) clone()
Create a shallow clone of the objectCreate a deep clone of the objectfindAll
(PointerTargetTreeNode node) Find all occurances ofnode
within the list.Find the first node in the list that is equal tonode
.Walk the list and perform the operationopr
on each node.void
getAllMatches
(PointerTargetTreeNodeList.Operation opr, List matches) Get all matches and add them to matchesWalk the list and all the children of each node in the list and perform the operationopr
on each node.protected NodePrinter
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
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream
Methods inherited from interface java.util.List
hashCode, replaceAll, sort, spliterator
-
Field Details
-
PRINTER
-
-
Constructor Details
-
PointerTargetTreeNodeList
public PointerTargetTreeNodeList() -
PointerTargetTreeNodeList
-
-
Method Details
-
add
- Overrides:
add
in classPointerTargetNodeList
-
add
- Overrides:
add
in classPointerTargetNodeList
-
add
-
add
-
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
- Overrides:
getNodePrinter
in classPointerTargetNodeList
-
getFirstMatch
Walk the list and all the children of each node in the list and perform the operationopr
on each node. Continues until either opr returns a non-null value, or it reaches the last node in the list. -
getAllMatches
Walk the list and perform the operationopr
on each node. Searches the list exhaustively and return a List containing all nodes that are returned byopr
. -
getAllMatches
Get all matches and add them to matches -
findFirst
Find the first node in the list that is equal tonode
.node
is considered to match a node in the list if they contain equal pointer targets and are of the same type. -
findAll
Find all occurances ofnode
within the list. -
clone
Description copied from interface:DeepCloneable
Create a shallow clone of the object- Specified by:
clone
in interfaceDeepCloneable
- Overrides:
clone
in classPointerTargetNodeList
- Throws:
CloneNotSupportedException
-
deepClone
Description copied from interface:DeepCloneable
Create a deep clone of the object- Specified by:
deepClone
in interfaceDeepCloneable
- Overrides:
deepClone
in classPointerTargetNodeList
- Throws:
UnsupportedOperationException
-