org.eclipse.jpt.common.utility.model.event
Class CollectionChangeEvent

java.lang.Object
  extended by java.util.EventObject
      extended by org.eclipse.jpt.common.utility.model.event.ChangeEvent
          extended by org.eclipse.jpt.common.utility.model.event.CollectionEvent
              extended by org.eclipse.jpt.common.utility.model.event.CollectionChangeEvent
All Implemented Interfaces:
java.io.Serializable

public final class CollectionChangeEvent
extends CollectionEvent

A "collection change" event gets delivered whenever a model changes a "bound" or "constrained" collection in a manner that is not easily characterized by the other collection events. A CollectionChangeEvent is sent as an argument to the CollectionChangeListener. A CollectionChangeEvent is accompanied by the collection name and the current state of the collection.

Provisional API: This class is part of an interim API that is still under development and expected to change significantly before reaching stability. It is available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.

See Also:
Serialized Form

Constructor Summary
CollectionChangeEvent(Model source, java.lang.String collectionName, java.util.Collection<?> collection)
          Construct a new collection change event.
 
Method Summary
 CollectionChangeEvent clone(Model newSource)
          Return a copy of the event with the specified source replacing the current source.
 CollectionChangeEvent clone(Model newSource, java.lang.String newCollectionName)
          Return a copy of the event with the specified source and collection name replacing the current source and collection name.
 java.lang.Iterable<?> getCollection()
          Return the current state of the collection.
 int getCollectionSize()
          Return the number of items in the current state of the collection.
 
Methods inherited from class org.eclipse.jpt.common.utility.model.event.CollectionEvent
getCollectionName
 
Methods inherited from class org.eclipse.jpt.common.utility.model.event.ChangeEvent
getSource, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CollectionChangeEvent

public CollectionChangeEvent(Model source,
                             java.lang.String collectionName,
                             java.util.Collection<?> collection)
Construct a new collection change event.

Parameters:
source - The object on which the event initially occurred.
collectionName - The programmatic name of the collection that was changed.
Method Detail

getCollection

public java.lang.Iterable<?> getCollection()
Return the current state of the collection.


getCollectionSize

public int getCollectionSize()
Return the number of items in the current state of the collection.


clone

public CollectionChangeEvent clone(Model newSource)
Return a copy of the event with the specified source replacing the current source.


clone

public CollectionChangeEvent clone(Model newSource,
                                   java.lang.String newCollectionName)
Return a copy of the event with the specified source and collection name replacing the current source and collection name.