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
public class PointerTargetTreeNodeList extends PointerTargetNodeList
A list ofPointerTargetTreeNode
s.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PointerTargetTreeNodeList.FindNodeOperation
Operation that is used for finding the specified node in a tree.static class
PointerTargetTreeNodeList.FindTargetOperation
Operation that is used for finding the node(s) in a tree that have the specifiedPointerTarget
.static interface
PointerTargetTreeNodeList.Operation
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
-
-
Constructor Summary
Constructors Constructor Description PointerTargetTreeNodeList()
PointerTargetTreeNodeList(LinkedList list)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
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)
Object
clone()
Create a shallow clone of the objectObject
deepClone()
Create a deep clone of the objectPointerTargetTreeNode[]
findAll(PointerTargetTreeNode node)
Find all occurances ofnode
within the list.PointerTargetTreeNode
findFirst(PointerTargetTreeNode node)
Find the first node in the list that is equal tonode
.List
getAllMatches(PointerTargetTreeNodeList.Operation opr)
Walk the list and perform the operationopr
on each node.void
getAllMatches(PointerTargetTreeNodeList.Operation opr, List matches)
Get all matches and add them to matchesObject
getFirstMatch(PointerTargetTreeNodeList.Operation opr)
Walk the list and all the children of each node in the list and perform the operationopr
on each node.protected NodePrinter
getNodePrinter()
-
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
-
-
-
-
Constructor Detail
-
PointerTargetTreeNodeList
public PointerTargetTreeNodeList()
-
PointerTargetTreeNodeList
public PointerTargetTreeNodeList(LinkedList list)
-
-
Method Detail
-
add
public void add(PointerTarget target)
- Overrides:
add
in classPointerTargetNodeList
-
add
public void add(PointerTarget target, PointerType type)
- Overrides:
add
in 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:
getNodePrinter
in classPointerTargetNodeList
-
getFirstMatch
public Object getFirstMatch(PointerTargetTreeNodeList.Operation opr)
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
public List getAllMatches(PointerTargetTreeNodeList.Operation opr)
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
public void getAllMatches(PointerTargetTreeNodeList.Operation opr, 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
.node
is 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 ofnode
within the list.
-
clone
public Object clone() throws CloneNotSupportedException
Description copied from interface:DeepCloneable
Create a shallow clone of the object- Specified by:
clone
in interfaceDeepCloneable
- Overrides:
clone
in classPointerTargetNodeList
- Throws:
CloneNotSupportedException
-
deepClone
public Object deepClone() throws UnsupportedOperationException
Description copied from interface:DeepCloneable
Create a deep clone of the object- Specified by:
deepClone
in interfaceDeepCloneable
- Overrides:
deepClone
in classPointerTargetNodeList
- Throws:
UnsupportedOperationException
-
-