java.beans.beancontext
Class BeanContextMembershipEvent

java.lang.Object
  extended by java.util.EventObject
      extended by java.beans.beancontext.BeanContextEvent
          extended by java.beans.beancontext.BeanContextMembershipEvent
All Implemented Interfaces:
Serializable

public class BeanContextMembershipEvent
extends BeanContextEvent

Event fired when children are added to or removed from a BeanContext. Whether they were added or removed depends entirely on which method of the listener interface was called.

Since:
1.2
See Also:
BeanContextMembershipListener, Serialized Form

Field Summary
protected  Collection children
          The children that were added or removed.
 
Fields inherited from class java.beans.beancontext.BeanContextEvent
propagatedFrom
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
BeanContextMembershipEvent(BeanContext context, Collection children)
          Create a new membership event.
BeanContextMembershipEvent(BeanContext context, Object[] children)
          Create a new membership event.
 
Method Summary
 boolean contains(Object child)
          Tell whether the Object is one of the children added or removed.
 Iterator iterator()
          An iterator that will step through all the children.
 int size()
          The number of children removed or added.
 Object[] toArray()
          An array of the children.
 
Methods inherited from class java.beans.beancontext.BeanContextEvent
getBeanContext, getPropagatedFrom, isPropagated, setPropagatedFrom
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

children

protected Collection children
The children that were added or removed.

Constructor Detail

BeanContextMembershipEvent

public BeanContextMembershipEvent(BeanContext context,
                                  Collection children)
Create a new membership event.

Parameters:
context - the event source.
children - the children added to or removed from the source.

BeanContextMembershipEvent

public BeanContextMembershipEvent(BeanContext context,
                                  Object[] children)
Create a new membership event.

Parameters:
context - the event source.
children - the children added to or removed from the source.
Method Detail

size

public int size()
The number of children removed or added.

Returns:
the number of children removed or added.

iterator

public Iterator iterator()
An iterator that will step through all the children.

Returns:
an iterator over all the children.

toArray

public Object[] toArray()
An array of the children.

Returns:
an array of the children.

contains

public boolean contains(Object child)
Tell whether the Object is one of the children added or removed.

Parameters:
child - the child to check.
Returns:
whether the Object is added or removed.