Package io.guise.framework.event
Class CollectionEvent<E>
- java.lang.Object
-
- java.util.EventObject
-
- com.globalmentor.event.AbstractEvent
-
- io.guise.framework.event.AbstractGuiseEvent
-
- io.guise.framework.event.CollectionEvent<E>
-
- Type Parameters:
E
- The type of elements contained in the collection.
- All Implemented Interfaces:
com.globalmentor.event.Event
,GuiseEvent
,java.io.Serializable
public class CollectionEvent<E> extends AbstractGuiseEvent
An event indicating a collection has been modified. If a single element was replaced both an added and removed element will be provided. If neither an added nor a removed element are provided, the event represents a general collection modification.- Author:
- Garret Wilson
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CollectionEvent(java.lang.Object source)
Source constructor for general collection modification.CollectionEvent(java.lang.Object source, E addedElement, E removedElement)
Source constructor for an added and/or removed element.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description E
getAddedElement()
E
getRemovedElement()
-
Methods inherited from class io.guise.framework.event.AbstractGuiseEvent
getSession
-
-
-
-
Constructor Detail
-
CollectionEvent
public CollectionEvent(java.lang.Object source)
Source constructor for general collection modification.- Parameters:
source
- The object on which the event initially occurred.- Throws:
java.lang.NullPointerException
- if the given source isnull
.
-
CollectionEvent
public CollectionEvent(java.lang.Object source, E addedElement, E removedElement)
Source constructor for an added and/or removed element.- Parameters:
source
- The object on which the event initially occurred.addedElement
- The element that was added to the collection, ornull
if no element was added or it is unknown whether or which elements were added.removedElement
- The element that was removed from the collection, ornull
if no element was removed or it is unknown whether or which elements were removed.- Throws:
java.lang.NullPointerException
- if the given source isnull
.
-
-
Method Detail
-
getAddedElement
public E getAddedElement()
- Returns:
- The element that was added to the collection, or
null
if no element was added or it is unknown whether or which elements were added.
-
getRemovedElement
public E getRemovedElement()
- Returns:
- The element that was removed from the collection, or
null
if no element was added or it is unknown whether or which elements were removed.
-
-