dsto.dfc.collections
Class CollectionEvent

java.lang.Object
  extended by java.util.EventObject
      extended by dsto.dfc.collections.CollectionEvent
All Implemented Interfaces:
Serializable

public class CollectionEvent
extends EventObject

Version:
$Revision$
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
CollectionEvent(Object source, Collection elements)
           
CollectionEvent(Object source, CollectionEvent srcEvent)
          Copy constructor useful for re-firing an event from a wrapped collection.
CollectionEvent(Object source, Collection elements, int startIndex, int endIndex)
          Create an event where a number of indexed elements have changed.
CollectionEvent(Object source, Object element)
          Create an event when only one element has been added/removed.
CollectionEvent(Object source, Object element, int index)
          Create an event where an indexed element has changed.
CollectionEvent(Object source, Object element, int startIndex, int endIndex)
          Create an event where an indexed element has moved (eg see DfcMonitoredList).
 
Method Summary
 int getElementCount()
           
 Collection getElements()
           
 int getEndIndex()
          The end index of the changed elements (if not coming from an indexed collection, this will be -1).
 Collection getSourceAsCollection()
          Shortcut to get source as a Collection.
 int getStartIndex()
          The start index of the changed elements (if not coming from an indexed collection, this will be -1).
 Iterator iterator()
           
 
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
 

Constructor Detail

CollectionEvent

public CollectionEvent(Object source,
                       CollectionEvent srcEvent)
Copy constructor useful for re-firing an event from a wrapped collection.

Parameters:
source - The source for this event.
srcEvent - The wrapped event: all fields except source will beb copied.

CollectionEvent

public CollectionEvent(Object source,
                       Collection elements)

CollectionEvent

public CollectionEvent(Object source,
                       Object element)
Create an event when only one element has been added/removed.


CollectionEvent

public CollectionEvent(Object source,
                       Object element,
                       int index)
Create an event where an indexed element has changed.


CollectionEvent

public CollectionEvent(Object source,
                       Collection elements,
                       int startIndex,
                       int endIndex)
Create an event where a number of indexed elements have changed.

Parameters:
source - The source of the event.
elements - A collection of contiguous elements that changed.
startIndex - The start index of the changed elements.
endIndex - The end index of the changed elements (inclusive).

CollectionEvent

public CollectionEvent(Object source,
                       Object element,
                       int startIndex,
                       int endIndex)
Create an event where an indexed element has moved (eg see DfcMonitoredList).

Method Detail

getSourceAsCollection

public Collection getSourceAsCollection()
Shortcut to get source as a Collection.


getElementCount

public int getElementCount()

getElements

public Collection getElements()

iterator

public Iterator iterator()

getStartIndex

public int getStartIndex()
The start index of the changed elements (if not coming from an indexed collection, this will be -1).


getEndIndex

public int getEndIndex()
The end index of the changed elements (if not coming from an indexed collection, this will be -1).



Copyright © 2008 Commonwealth of Australia