net.sf.extjwnl.data.list
Class PointerTargetTreeNodeList
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.AbstractSequentialList<E>
java.util.LinkedList<PointerTargetTreeNode>
net.sf.extjwnl.data.list.PointerTargetTreeNodeList
- All Implemented Interfaces:
- Serializable, Cloneable, Iterable<PointerTargetTreeNode>, Collection<PointerTargetTreeNode>, Deque<PointerTargetTreeNode>, List<PointerTargetTreeNode>, Queue<PointerTargetTreeNode>, DeepCloneable
public class PointerTargetTreeNodeList
- extends LinkedList<PointerTargetTreeNode>
- implements DeepCloneable
A list of PointerTargetTreeNode
s.
- Author:
- John Didion
- See Also:
- Serialized Form
Method Summary |
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. |
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 . |
List<PointerTargetTreeNode> |
getAllMatches(PointerTargetTreeNodeList.Operation opr)
Walks the list and performs the operation opr on each node. |
void |
getAllMatches(PointerTargetTreeNodeList.Operation opr,
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(PrintStream stream,
int indent,
int indentIncrement)
|
Methods inherited from class java.util.LinkedList |
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, toArray, toArray |
PointerTargetTreeNodeList
public PointerTargetTreeNodeList()
PointerTargetTreeNodeList
public PointerTargetTreeNodeList(LinkedList<PointerTargetTreeNode> list)
add
public void add(PointerTarget target)
add
public void add(PointerTarget target,
PointerType type)
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<PointerTargetTreeNode> getNodePrinter()
getFirstMatch
public 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. Continues until
either opr returns a non-null value, or it reaches the last node in the list.
- Parameters:
opr
- operation to execute
- Returns:
- operation result
getAllMatches
public List<PointerTargetTreeNode> getAllMatches(PointerTargetTreeNodeList.Operation opr)
- Walks the list and performs the operation
opr
on each node.
Searches the list exhaustively and return a List containing all nodes
that are returned by opr
.
- Parameters:
opr
- operation
- Returns:
- list of operation results
getAllMatches
public void getAllMatches(PointerTargetTreeNodeList.Operation opr,
List<PointerTargetTreeNode> matches)
- Returns all matches and adds them to matches
- Parameters:
opr
- operationmatches
- list of matches
findFirst
public PointerTargetTreeNode findFirst(PointerTargetTreeNode node)
- Finds the first node in the list that is equal to
node
.
node
is considered to match a node in the list
if they contain equal pointer targets and are of the same type.
- Parameters:
node
- node to search for
- Returns:
- the first node in the list that is equal to
node
findAll
public List<PointerTargetTreeNode> findAll(PointerTargetTreeNode node)
- Finds all occurrences of
node
within the list.
- Parameters:
node
- node to search for
- Returns:
- all occurrences of
node
within the list
clone
public PointerTargetTreeNodeList clone()
- Description copied from interface:
DeepCloneable
- Create a shallow clone of the object.
- Specified by:
clone
in interface DeepCloneable
- Overrides:
clone
in class LinkedList<PointerTargetTreeNode>
deepClone
public PointerTargetTreeNodeList deepClone()
- Description copied from interface:
DeepCloneable
- Create a deep clone of the object.
- Specified by:
deepClone
in interface DeepCloneable
- Returns:
- a deep clone of the object
print
protected void print()
print
protected void print(PrintStream stream,
int indent,
int indentIncrement)
Copyright © 2011. All Rights Reserved.