Dali Provisional API
Release 3.2

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

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.CollectionAddEvent
All Implemented Interfaces:
Serializable

public final class CollectionAddEvent
extends CollectionEvent

A "collection add" event gets delivered whenever a model adds items to a "bound" or "constrained" collection. A CollectionAddEvent is sent as an argument to the CollectionChangeListener.

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

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
CollectionAddEvent(Model source, String collectionName, Collection<?> items)
          Construct a new collection add event.
CollectionAddEvent(Model source, String collectionName, Object item)
          Construct a new collection add event.
 
Method Summary
 CollectionAddEvent clone(Model newSource)
          Return a copy of the event with the specified source replacing the current source.
 CollectionAddEvent clone(Model newSource, String newCollectionName)
          Return a copy of the event with the specified source and collection name replacing the current source and collection name.
 Iterable<?> getItems()
          Return the items added to the collection.
 int getItemsSize()
          Return the number of items added to the collection.
protected  void toString(StringBuilder sb)
           
 
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CollectionAddEvent

public CollectionAddEvent(Model source,
                          String collectionName,
                          Object item)
Construct a new collection add event.

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

CollectionAddEvent

public CollectionAddEvent(Model source,
                          String collectionName,
                          Collection<?> items)
Construct a new collection add event.

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

getItems

public Iterable<?> getItems()
Return the items added to the collection.


getItemsSize

public int getItemsSize()
Return the number of items added to the collection.


toString

protected void toString(StringBuilder sb)
Overrides:
toString in class CollectionEvent

clone

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


clone

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


Dali Provisional API
Release 3.2

Copyright (c) 2012 Oracle. All rights reserved.