|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.oddjob.structural.ChildHelper<E>
public class ChildHelper<E>
Helper for managing child Objects. This class will track structural changes and notify listeners.
Constructor Summary | |
---|---|
ChildHelper(Structural source)
Constructor. |
Method Summary | |
---|---|
int |
addChild(E child)
Add a child to the end of the list. |
void |
addStructuralListener(StructuralListener listener)
Add a listener. |
boolean |
contains(E child)
Is this child ours? |
E |
getChild()
Return an only child. |
E |
getChildAt(int index)
Return a child. |
Object[] |
getChildren()
Return an array of children. |
E[] |
getChildren(E[] array)
Return an array of children. |
static Object[] |
getChildren(Structural structural)
|
void |
hardResetChildren()
Perform a hard reset. |
void |
insertChild(int index,
E child)
Insert a child. |
boolean |
isNoListeners()
Returns true if there are no listeners listening for StructuralEvent s. |
Iterator<E> |
iterator()
|
void |
removeAllChildren()
Allows a sub class to remove all children from itself. |
int |
removeChild(Object child)
Remove a child. |
E |
removeChildAt(int index)
Remove a child by index. |
void |
removeStructuralListener(StructuralListener listener)
Remove a listener. |
int |
size()
The number of children. |
void |
softResetChildren()
Perform a soft reset. |
void |
stopChildren()
Stops all the child jobs. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ChildHelper(Structural source)
source
- The source used as the source of the event.Method Detail |
---|
public void insertChild(int index, E child)
insertChild
in interface ChildList<E>
index
- The index.child
- The child.public int addChild(E child)
addChild
in interface ChildList<E>
child
- The child. Must not be null.
public E removeChildAt(int index) throws IndexOutOfBoundsException
removeChildAt
in interface ChildList<E>
index
- The index of the child to remove.
IndexOutOfBoundsException
- If there is no child at the index.public int removeChild(Object child) throws IllegalStateException
removeChild
in interface ChildList<E>
child
- The child to be removed.
IllegalStateException
- If the child is not our child.public void removeAllChildren()
This method isn't synchronized. Simultaneous removal of children by a different thread could result in an IndexOutOfBoundsException.
public void stopChildren() throws FailedToStopException
FailedToStopException
public void softResetChildren()
public void hardResetChildren()
public Object[] getChildren()
public E[] getChildren(E[] array)
public E getChildAt(int index)
public E getChild()
public boolean contains(E child)
child
-
public Iterator<E> iterator()
iterator
in interface Iterable<E>
public void addStructuralListener(StructuralListener listener)
Structural
addStructuralListener
in interface Structural
listener
- The listener.public void removeStructuralListener(StructuralListener listener)
Structural
removeStructuralListener
in interface Structural
listener
- The listener.public boolean isNoListeners()
StructuralEvent
s.
public int size()
public static Object[] getChildren(Structural structural)
public String toString()
toString
in class Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |