com.gargoylesoftware.base.collections
Class NotificationListEvent

java.lang.Object
  extended byjava.util.EventObject
      extended bycom.gargoylesoftware.base.collections.NotificationListEvent
All Implemented Interfaces:
Serializable

public class NotificationListEvent
extends EventObject

An event that is fired when a NotificationList changes.

Version:
$Revision: 1.5 $
Author:
Mike Bowler
See Also:
Serialized Form

Field Summary
static int CHANGE
          Action indicating that an item in the list was change.
static int INSERT
          Action indicating that an item was inserted into the list.
static int REMOVE
          Action indicating that an item was removed from the list.
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
NotificationListEvent(NotificationList source, int action, int startIndex, int endIndex, List oldValues, List newValues)
          Create a new event.
 
Method Summary
protected  void assertNotNull(String fieldName, Object object)
          Throw an exception if the specified object is null
 int getAction()
          Return the action which will be one of INSERT, REMOVE, CHANGE.
 int getEndIndex()
          Return the end index.
 List getNewValues()
          Return the new values
 List getOldValues()
          Return the old values.
 int getStartIndex()
          Return the start index.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

INSERT

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

See Also:
Constant Field Values

REMOVE

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

See Also:
Constant Field Values

CHANGE

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

See Also:
Constant Field Values
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

getStartIndex

public int getStartIndex()
Return the start index.

Returns:
The start index.

getEndIndex

public int getEndIndex()
Return the end index.

Returns:
The end index.

getAction

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

Returns:
The action.

getNewValues

public List getNewValues()
Return the new values

Returns:
The new values.

getOldValues

public List getOldValues()
Return the old values.

Returns:
The old values.

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


Copyright © 1998-2005 Gargoyle Software Inc.. All Rights Reserved.