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

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.ListEvent
              extended by org.eclipse.jpt.common.utility.model.event.ListAddEvent
All Implemented Interfaces:
java.io.Serializable

public final class ListAddEvent
extends ListEvent

A "list add" event gets delivered whenever a model adds items to a "bound" or "constrained" list. A ListAddEvent is sent as an argument to the ListChangeListener.

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
ListAddEvent(Model source, java.lang.String listName, int index, java.util.List<?> items)
          Construct a new list add event.
ListAddEvent(Model source, java.lang.String listName, int index, java.lang.Object item)
          Construct a new list add event.
 
Method Summary
 ListAddEvent clone(Model newSource)
          Return a copy of the event with the specified source replacing the current source.
 ListAddEvent clone(Model newSource, java.lang.String newListName)
          Return a copy of the event with the specified source and list name replacing the current source and list name.
 ListAddEvent clone(Model newSource, java.lang.String newListName, int offset)
          Return a copy of the event with the specified source and list name replacing the current source and list name and displacing the index by the specified amount.
 int getIndex()
          Return the index at which the items were added to the list.
 java.lang.Iterable<?> getItems()
          Return the items added to the list.
 int getItemsSize()
          Return the number of items added to the list.
 
Methods inherited from class org.eclipse.jpt.common.utility.model.event.ListEvent
getListName
 
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

ListAddEvent

public ListAddEvent(Model source,
                    java.lang.String listName,
                    int index,
                    java.lang.Object item)
Construct a new list add event.

Parameters:
source - The object on which the event initially occurred.
listName - The programmatic name of the list that was changed.
index - The index at which the items were added.
item - The item added to the list.

ListAddEvent

public ListAddEvent(Model source,
                    java.lang.String listName,
                    int index,
                    java.util.List<?> items)
Construct a new list add event.

Parameters:
source - The object on which the event initially occurred.
listName - The programmatic name of the list that was changed.
index - The index at which the items were added.
items - The items added to the list.
Method Detail

getIndex

public int getIndex()
Return the index at which the items were added to the list.


getItems

public java.lang.Iterable<?> getItems()
Return the items added to the list.


getItemsSize

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


clone

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


clone

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


clone

public ListAddEvent clone(Model newSource,
                          java.lang.String newListName,
                          int offset)
Return a copy of the event with the specified source and list name replacing the current source and list name and displacing the index by the specified amount.