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

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.ListChangeEvent
All Implemented Interfaces:
java.io.Serializable

public final class ListChangeEvent
extends ListEvent

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

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
ListChangeEvent(Model source, java.lang.String listName, java.util.List<?> list)
          Construct a new list change event.
 
Method Summary
 ListChangeEvent clone(Model newSource)
          Return a copy of the event with the specified source replacing the current source.
 ListChangeEvent 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.
 java.lang.Iterable<?> getList()
          Return the current state of the list.
 int getListSize()
          Return the number of items in the current state of 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

ListChangeEvent

public ListChangeEvent(Model source,
                       java.lang.String listName,
                       java.util.List<?> list)
Construct a new list change event.

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

getList

public java.lang.Iterable<?> getList()
Return the current state of the list.


getListSize

public int getListSize()
Return the number of items in the current state of the list.


clone

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


clone

public ListChangeEvent 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.