net.sf.extjwnl.data.list
Class PointerTargetTreeNodeList

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.AbstractSequentialList<E>
              extended by java.util.LinkedList<PointerTargetTreeNode>
                  extended by 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 PointerTargetTreeNodes.

Author:
John Didion
See Also:
Serialized Form

Nested Class Summary
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.
 
Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
PointerTargetTreeNodeList()
           
PointerTargetTreeNodeList(LinkedList<PointerTargetTreeNode> list)
           
 
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
 
Methods inherited from class java.util.AbstractSequentialList
iterator
 
Methods inherited from class java.util.AbstractList
equals, hashCode, listIterator, removeRange, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, isEmpty, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, isEmpty, iterator, listIterator, removeAll, retainAll, subList
 
Methods inherited from interface java.util.Deque
iterator
 

Constructor Detail

PointerTargetTreeNodeList

public PointerTargetTreeNodeList()

PointerTargetTreeNodeList

public PointerTargetTreeNodeList(LinkedList<PointerTargetTreeNode> list)
Method Detail

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 - operation
matches - 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.