public class PointerTargetTreeNodeList extends java.util.LinkedList<PointerTargetTreeNode> implements DeepCloneable
PointerTargetTreeNode
s.Modifier and Type | Class and 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 specified
PointerTarget . |
static interface |
PointerTargetTreeNodeList.Operation
Operation that is performed on the nodes of a tree or list.
|
Constructor and Description |
---|
PointerTargetTreeNodeList() |
PointerTargetTreeNodeList(java.util.LinkedList<PointerTargetTreeNode> list) |
Modifier and Type | Method and 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) |
PointerTargetTreeNodeList |
clone()
Create a shallow clone of the object.
|
PointerTargetTreeNodeList |
deepClone()
Create a deep clone of the object.
|
java.util.List<PointerTargetTreeNode> |
findAll(PointerTargetTreeNode node)
Finds all occurrences of
node within the list. |
PointerTargetTreeNode |
findFirst(PointerTargetTreeNode node)
Finds the first node in the list that is equal to
node . |
java.util.List<PointerTargetTreeNode> |
getAllMatches(PointerTargetTreeNodeList.Operation opr)
Walks the list and performs the operation
opr on each node. |
void |
getAllMatches(PointerTargetTreeNodeList.Operation opr,
java.util.List<PointerTargetTreeNode> matches)
Returns all matches and adds them to matches
|
PointerTargetTreeNode |
getFirstMatch(PointerTargetTreeNodeList.Operation opr)
Walks the list and all the children of each node in the list and
performs the operation
opr on each node. |
protected NodePrinter<PointerTargetTreeNode> |
getNodePrinter() |
protected void |
print() |
protected void |
print(java.io.PrintStream stream,
int indent,
int indentIncrement) |
add, add, addAll, addAll, addFirst, addLast, clear, contains, descendingIterator, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, set, size, spliterator, toArray, toArray
equals, hashCode, listIterator, removeRange, subList
containsAll, isEmpty, removeAll, retainAll, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
public PointerTargetTreeNodeList()
public PointerTargetTreeNodeList(java.util.LinkedList<PointerTargetTreeNode> list)
public void add(PointerTarget target)
public void add(PointerTarget target, PointerType type)
public void add(PointerTarget target, PointerType type, PointerTargetTreeNode parent)
public void add(PointerTarget target, PointerTargetTreeNodeList childTreeList, PointerType type)
public void add(PointerTarget target, PointerTargetTreeNodeList childTreeList, PointerType type, PointerTargetTreeNode parent)
public void add(PointerTarget target, PointerTargetTreeNodeList childTreeList, PointerTargetTreeNodeList pointerTreeList, PointerType type)
public void add(PointerTarget target, PointerTargetTreeNodeList childTreeList, PointerTargetTreeNodeList pointerTreeList, PointerType type, PointerTargetTreeNode parent)
protected NodePrinter<PointerTargetTreeNode> getNodePrinter()
public PointerTargetTreeNode getFirstMatch(PointerTargetTreeNodeList.Operation opr)
opr
on each node. Continues until
either opr returns a non-null value, or it reaches the last node in the list.opr
- operation to executepublic java.util.List<PointerTargetTreeNode> getAllMatches(PointerTargetTreeNodeList.Operation opr)
opr
on each node.
Searches the list exhaustively and return a List containing all nodes
that are returned by opr
.opr
- operationpublic void getAllMatches(PointerTargetTreeNodeList.Operation opr, java.util.List<PointerTargetTreeNode> matches)
opr
- operationmatches
- list of matchespublic PointerTargetTreeNode findFirst(PointerTargetTreeNode node)
node
.
node
is considered to match a node in the list
if they contain equal pointer targets and are of the same type.node
- node to search fornode
public java.util.List<PointerTargetTreeNode> findAll(PointerTargetTreeNode node)
node
within the list.node
- node to search fornode
within the listpublic PointerTargetTreeNodeList clone()
DeepCloneable
clone
in interface DeepCloneable
clone
in class java.util.LinkedList<PointerTargetTreeNode>
public PointerTargetTreeNodeList deepClone()
DeepCloneable
deepClone
in interface DeepCloneable
protected void print()
protected void print(java.io.PrintStream stream, int indent, int indentIncrement)