com.guiseframework.event
Class ListEvent<E>

java.lang.Object
  extended by java.util.EventObject
      extended by com.globalmentor.event.AbstractEvent
          extended by com.guiseframework.event.AbstractGuiseEvent
              extended by com.guiseframework.event.CollectionEvent<E>
                  extended by com.guiseframework.event.ListEvent<E>
Type Parameters:
E - The type of elements contained in the list.
All Implemented Interfaces:
com.globalmentor.event.Event, GuiseEvent, java.io.Serializable

public class ListEvent<E>
extends CollectionEvent<E>

An event indicating a list 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 list modification.

Author:
Garret Wilson
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
ListEvent(java.lang.Object source)
          Source constructor for general list modification.
ListEvent(java.lang.Object source, int index, E addedElement, E removedElement)
          Source constructor for an added and/or removed element.
 
Method Summary
 int getIndex()
           
 
Methods inherited from class com.guiseframework.event.CollectionEvent
getAddedElement, getRemovedElement
 
Methods inherited from class com.guiseframework.event.AbstractGuiseEvent
getSession
 
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
 
Methods inherited from interface com.globalmentor.event.Event
getSource
 

Constructor Detail

ListEvent

public ListEvent(java.lang.Object source)
Source constructor for general list modification.

Parameters:
source - The object on which the event initially occurred.
Throws:
java.lang.NullPointerException - if the given source is null.

ListEvent

public ListEvent(java.lang.Object source,
                 int index,
                 E addedElement,
                 E removedElement)
Source constructor for an added and/or removed element.

Parameters:
source - The object on which the event initially occurred.
index - The index at which an element was added and/or removed, or -1 if the index is unknown.
addedElement - The element that was added to the list, or null if no element was added or it is unknown whether or which elements were added.
removedElement - The element that was removed from the list, or null if no element was removed or it is unknown whether or which elements were removed.
Throws:
java.lang.NullPointerException - if the given source is null.
Method Detail

getIndex

public int getIndex()
Returns:
The index at which an element was added and/or removed, or -1 if the index is unknown.


Copyright © 2005-2010 GlobalMentor, Inc. All Rights Reserved.