com.gargoylesoftware.base.collections

Class NotificationListEvent

public class NotificationListEvent extends EventObject

An event that is fired when a NotificationList changes.

Version: $Revision: 1.4 $

Author: Mike Bowler

Field Summary
intaction_
static intCHANGE
Action indicating that an item in the list was change.
intendIndex_
static intINSERT
Action indicating that an item was inserted into the list.
ListnewValues_
ListoldValues_
static intREMOVE
Action indicating that an item was removed from the list.
static longserialVersionUID
intstartIndex_
Constructor Summary
NotificationListEvent(NotificationList source, int action, int startIndex, int endIndex, List oldValues, List newValues)
Create a new event.
Method Summary
protected voidassertNotNull(String fieldName, Object object)
Throw an exception if the specified object is null
intgetAction()
Return the action which will be one of INSERT, REMOVE, CHANGE.
intgetEndIndex()
Return the end index.
ListgetNewValues()
Return the new values
ListgetOldValues()
Return the old values.
intgetStartIndex()
Return the start index.

Field Detail

action_

private final int action_

CHANGE

public static final int CHANGE
Action indicating that an item in the list was change.

endIndex_

private final int endIndex_

INSERT

public static final int INSERT
Action indicating that an item was inserted into the list.

newValues_

private final List newValues_

oldValues_

private final List oldValues_

REMOVE

public static final int REMOVE
Action indicating that an item was removed from the list.

serialVersionUID

private static final long serialVersionUID

startIndex_

private final int startIndex_

Constructor Detail

NotificationListEvent

public NotificationListEvent(NotificationList source, int action, int startIndex, int endIndex, List oldValues, List newValues)
Create a new event.

Parameters: source The NotificationList action The action that occured. This will be one of INSERT, REMOVE or CHANGE. startIndex The index of the first item that is affected. endIndex The index of the last item that is affected. oldValues The original values. newValues The new values.

Method Detail

assertNotNull

protected final void assertNotNull(String fieldName, Object object)
Throw an exception if the specified object is null

Parameters: fieldName The name of the paremeter we are checking object The value of the parameter we are checking

getAction

public int getAction()
Return the action which will be one of INSERT, REMOVE, CHANGE.

Returns: The action.

getEndIndex

public int getEndIndex()
Return the end index.

Returns: The end index.

getNewValues

public List getNewValues()
Return the new values

Returns: The new values.

getOldValues

public List getOldValues()
Return the old values.

Returns: The old values.

getStartIndex

public int getStartIndex()
Return the start index.

Returns: The start index.