facets.util.datatree
Class NodeList

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList<TypedNode>
              extended by facets.util.datatree.NodeList
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<TypedNode>, java.util.Collection<TypedNode>, java.util.List<TypedNode>, java.util.RandomAccess

public final class NodeList
extends java.util.ArrayList<TypedNode>

List wrapping a DataNode and its TypedNode.children().

See Also:
Serialized Form

Field Summary
 DataNode parent
          The node whose children the NodeList is manipulating.
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
NodeList(TypedNode parent, boolean autoUpdate)
          Unique constructor.
 
Method Summary
 void add(int at, TypedNode n)
           
 boolean add(TypedNode n)
           
 boolean addAll(java.util.Collection<? extends TypedNode> c)
           
 void addAll(int at, TypedNode... nodes)
           
 void addAll(TypedNode... nodes)
           
 void clear()
           
 TypedNode[] copyChildren()
           
 TypedNode remove(int at)
           
 boolean remove(java.lang.Object o)
           
 boolean removeAll(java.util.Collection<?> c)
           
 void removeAll(TypedNode[] nodes)
           
 TypedNode set(int at, TypedNode n)
           
 void updateMixedParent(java.lang.Object insertMark)
           
 void updateParent()
          Update parent with the contents of the NodeList.
 
Methods inherited from class java.util.ArrayList
addAll, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, removeRange, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, 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, iterator, listIterator, listIterator, retainAll, subList
 

Field Detail

parent

public final DataNode parent
The node whose children the NodeList is manipulating.

Constructor Detail

NodeList

public NodeList(TypedNode parent,
                boolean autoUpdate)
Unique constructor.

Parameters:
parent - must be a DataNode whose children the NodeList will manipulate
autoUpdate - should each operation of the NodeList be reflected immediately in parent?
Method Detail

updateParent

public void updateParent()
Update parent with the contents of the NodeList.

Called internally on each operation unless false was passed to NodeList(TypedNode, boolean), in which case client code must call as appropriate.


add

public boolean add(TypedNode n)
Specified by:
add in interface java.util.Collection<TypedNode>
Specified by:
add in interface java.util.List<TypedNode>
Overrides:
add in class java.util.ArrayList<TypedNode>

set

public TypedNode set(int at,
                     TypedNode n)
Specified by:
set in interface java.util.List<TypedNode>
Overrides:
set in class java.util.ArrayList<TypedNode>

add

public void add(int at,
                TypedNode n)
Specified by:
add in interface java.util.List<TypedNode>
Overrides:
add in class java.util.ArrayList<TypedNode>

addAll

public boolean addAll(java.util.Collection<? extends TypedNode> c)
Specified by:
addAll in interface java.util.Collection<TypedNode>
Specified by:
addAll in interface java.util.List<TypedNode>
Overrides:
addAll in class java.util.ArrayList<TypedNode>

remove

public boolean remove(java.lang.Object o)
Specified by:
remove in interface java.util.Collection<TypedNode>
Specified by:
remove in interface java.util.List<TypedNode>
Overrides:
remove in class java.util.ArrayList<TypedNode>

remove

public TypedNode remove(int at)
Specified by:
remove in interface java.util.List<TypedNode>
Overrides:
remove in class java.util.ArrayList<TypedNode>

removeAll

public boolean removeAll(java.util.Collection<?> c)
Specified by:
removeAll in interface java.util.Collection<TypedNode>
Specified by:
removeAll in interface java.util.List<TypedNode>
Overrides:
removeAll in class java.util.AbstractCollection<TypedNode>

clear

public void clear()
Specified by:
clear in interface java.util.Collection<TypedNode>
Specified by:
clear in interface java.util.List<TypedNode>
Overrides:
clear in class java.util.ArrayList<TypedNode>

addAll

public void addAll(TypedNode... nodes)

addAll

public void addAll(int at,
                   TypedNode... nodes)

removeAll

public void removeAll(TypedNode[] nodes)

copyChildren

public TypedNode[] copyChildren()

updateMixedParent

public void updateMixedParent(java.lang.Object insertMark)