net.didion.jwnl.data.list
Class PointerTargetTreeNodeList

java.lang.Object
  extended by net.didion.jwnl.util.TypeCheckingList
      extended by net.didion.jwnl.data.list.PointerTargetNodeList
          extended by net.didion.jwnl.data.list.PointerTargetTreeNodeList
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.List, DeepCloneable

public class PointerTargetTreeNodeList
extends PointerTargetNodeList

A list of PointerTargetTreeNodes.


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.
 
Nested classes/interfaces inherited from class net.didion.jwnl.util.TypeCheckingList
TypeCheckingList.TypeCheckingListIterator
 
Constructor Summary
PointerTargetTreeNodeList()
           
PointerTargetTreeNodeList(java.util.LinkedList 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)
           
 java.lang.Object clone()
          Create a shallow clone of the object
 java.lang.Object deepClone()
          Create a deep clone of the object
 PointerTargetTreeNode[] findAll(PointerTargetTreeNode node)
          Find all occurances of node within the list.
 PointerTargetTreeNode findFirst(PointerTargetTreeNode node)
          Find the first node in the list that is equal to node.
 java.util.List getAllMatches(PointerTargetTreeNodeList.Operation opr)
          Walk the list and perform the operation opr on each node.
 void getAllMatches(PointerTargetTreeNodeList.Operation opr, java.util.List matches)
          Get all matches and add them to matches
 java.lang.Object getFirstMatch(PointerTargetTreeNodeList.Operation opr)
          Walk the list and all the children of each node in the list and perform the operation opr on each node.
 
Methods inherited from class net.didion.jwnl.data.list.PointerTargetNodeList
print, print, print, print, reverse, toTreeList
 
Methods inherited from class net.didion.jwnl.util.TypeCheckingList
add, add, addAll, addAll, clear, contains, containsAll, equals, get, getType, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.List
hashCode
 

Constructor Detail

PointerTargetTreeNodeList

public PointerTargetTreeNodeList()

PointerTargetTreeNodeList

public PointerTargetTreeNodeList(java.util.LinkedList list)
Method Detail

add

public void add(PointerTarget target)
Overrides:
add in class PointerTargetNodeList

add

public void add(PointerTarget target,
                PointerType type)
Overrides:
add in class PointerTargetNodeList

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)

getFirstMatch

public java.lang.Object getFirstMatch(PointerTargetTreeNodeList.Operation opr)
Walk the list and all the children of each node in the list and perform the operation opr on each node. Continues until either opr returns a non-null value, or it reaches the last node in the list.


getAllMatches

public java.util.List getAllMatches(PointerTargetTreeNodeList.Operation opr)
Walk the list and perform the operation opr on each node. Searches the list exhaustively and return a List containing all nodes that are returned by opr.


getAllMatches

public void getAllMatches(PointerTargetTreeNodeList.Operation opr,
                          java.util.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 to node. 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 of node within the list.


clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Description copied from interface: DeepCloneable
Create a shallow clone of the object

Specified by:
clone in interface DeepCloneable
Overrides:
clone in class PointerTargetNodeList
Throws:
java.lang.CloneNotSupportedException

deepClone

public java.lang.Object deepClone()
                           throws java.lang.UnsupportedOperationException
Description copied from interface: DeepCloneable
Create a deep clone of the object

Specified by:
deepClone in interface DeepCloneable
Overrides:
deepClone in class PointerTargetNodeList
Throws:
java.lang.UnsupportedOperationException