public class CollectionEvent<T>
extends java.util.EventObject
T
is the type of item stored in the collection.Modifier and Type | Class and Description |
---|---|
static class |
CollectionEvent.Type
The type of change in the collection.
|
Constructor and Description |
---|
CollectionEvent(java.lang.Object source,
T item,
CollectionEvent.Type type)
Creates an event for an item that has no index.
|
CollectionEvent(java.lang.Object source,
T item,
int index,
CollectionEvent.Type type)
Creates an event for an item with its index.
|
Modifier and Type | Method and Description |
---|---|
int |
getIndex()
Returns the index of the item in collection or -1 if this index is unknown.
|
T |
getItem()
Returns the added or deleted item.
|
CollectionEvent.Type |
getType()
Returns the type of event.
|
public CollectionEvent(java.lang.Object source, T item, CollectionEvent.Type type)
source
- the object to which an item was added or deleteditem
- the added or deleted itemtype
- CollectionEvent.Type.ADD
or CollectionEvent.Type.DELETE
public CollectionEvent(java.lang.Object source, T item, int index, CollectionEvent.Type type)
source
- the object to which an item was added or deleteditem
- the added or deleted itemindex
- the index at which the item was added or deleted, or -1 if unknowntype
- CollectionEvent.Type.ADD
or CollectionEvent.Type.DELETE
public T getItem()
public int getIndex()
public CollectionEvent.Type getType()
© Copyrights 2006-2023 Emmanuel PUYBARET / eTeks
Distributed under GNU General Public License