org.oddjob.structural
Interface ChildList<E>

Type Parameters:
E - The type of the child.
All Known Implementing Classes:
ChildHelper

public interface ChildList<E>

A modifiable list of children.

Author:
rob

Method Summary
 int addChild(E child)
          Add a child to the end of the list.
 void insertChild(int index, E child)
          Insert a child.
 int removeChild(Object child)
          Remove a child.
 E removeChildAt(int index)
          Remove a child by index.
 

Method Detail

insertChild

void insertChild(int index,
                 E child)
Insert a child.

Parameters:
index - The 0 based index of the insert.
child - The child. Must not be null.

addChild

int addChild(E child)
Add a child to the end of the list.

Parameters:
child - The child. Must not be null.
Returns:
The index the child was added at.

removeChildAt

E removeChildAt(int index)
                throws IndexOutOfBoundsException
Remove a child by index.

Parameters:
index - The index of the child to remove.
Returns:
The child removed.
Throws:
IndexOutOfBoundsException - If there is no child at the index.

removeChild

int removeChild(Object child)
                throws IllegalStateException
Remove a child.

Parameters:
child - The child to be removed.
Returns:
The index the child was removed from.
Throws:
IllegalStateException - If the child is not a child of this list.