com.sas.collection
Class CollectionChangedInfo

com.sas.collection.CollectionChangedInfo
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
OrderedListChangedInfo

public class CollectionChangedInfo

CollectionChangedInfo is a ContentsChangedEvent event object that is created and sent when a Collection has changed. This class provides additional details about how the collection has changed that cannot be conveyed with the default ContentsChangedEvent. The Collection, OrderedCollection, and StringCollection classes may fire CollectionChangedEvents. There are no specific listeners for this event; use the add/removeContentsChangedListener on collection objects to listen for ContentsChangedEvents and if the event is an instance of CollectionChangedInfo, you can optimize the handler for specific types of changes.

See Also:
ContentsChangedEvent, DictionaryChangedInfo, Collection, OrderedCollection, StringCollection, HowChanged, DictionaryChangedInfo, Serialized Form

Field Summary
 int end
          The index of the item after the last added/removed/reordered item.
 HowChanged howChanged
          How the or items items have changed.
 int start
          The index of the first added/removed/reordered item.
 java.lang.Object whatChanged
          What item changed.
 
Constructor Summary
CollectionChangedInfo(java.lang.Object source)
          Construct a ContentsChangedInfo object which conveys that a single item at an indeterminate index has changed
CollectionChangedInfo(java.lang.Object source, HowChanged howChanged)
          Construct a CollectionChangedInfo object which conveys that a one or more items at indeterminate indices have changed
CollectionChangedInfo(java.lang.Object source, HowChanged howChanged, int index)
          Construct a CollectionChangedInfo object which conveys that a single item at the specified index has changed (either added or removed or replaced)
CollectionChangedInfo(java.lang.Object source, HowChanged howChanged, int start, int end)
          Construct a CollectionChangedInfo object which conveys that a range of items has changed (either added, or removed or replaced)
CollectionChangedInfo(java.lang.Object source, java.lang.Object whatChanged, HowChanged howChanged)
          Construct a CollectionChangedInfo object which conveys that a one or more items at indeterminate indices have changed
CollectionChangedInfo(java.lang.Object source, java.lang.Object whatChanged, HowChanged howChanged, int index)
          Construct a CollectionChangedInfo object which conveys that a single item at an indeterminate index has changed (either added or removed or replaced)
CollectionChangedInfo(java.lang.Object source, java.lang.Object whatChanged, HowChanged howChanged, int start, int end)
          Construct a CollectionChangedInfo object which conveys that a range of items has changed (either added, or removed or replaced)
CollectionChangedInfo(java.lang.Object source, java.lang.String propertyName, java.lang.Object whatChanged, HowChanged howChanged, int start, int end)
          Construct a CollectionChangedInfo object which conveys that a range of items has changed (either added, or removed or replaced)
 
Method Summary
 java.lang.Object clone(com.sas.collection.ContentsChangedSource newSource)
          Clone the CollectionChangedInfo and sets the source to be the newSource
 
Methods inherited from class com.sas.collection.ContentsChangedEvent
clone
 

Field Detail

howChanged

public HowChanged howChanged
How the or items items have changed. One of HowChanged.REMOVED, HowChanged.ADDED, HowChanged.REPLACED, HowChanged.REORDERED or HowChanged.OTHER


whatChanged

public java.lang.Object whatChanged
What item changed. If this is null, then a range of more than one item changed.


start

public int start
The index of the first added/removed/reordered item. This will be -1 if the index is indeterminate, such as removing items from a Collection or Set.


end

public int end
The index of the item after the last added/removed/reordered item. This will be -1 if the index is indeterminate.

Constructor Detail

CollectionChangedInfo

public CollectionChangedInfo(java.lang.Object source)
Construct a ContentsChangedInfo object which conveys that a single item at an indeterminate index has changed

Parameters:
source - the object whose contents have changed.

CollectionChangedInfo

public CollectionChangedInfo(java.lang.Object source,
                             HowChanged howChanged)
Construct a CollectionChangedInfo object which conveys that a one or more items at indeterminate indices have changed

Parameters:
source - the collection whose contents have changed.
howChanged - indicates the type of change

CollectionChangedInfo

public CollectionChangedInfo(java.lang.Object source,
                             java.lang.Object whatChanged,
                             HowChanged howChanged)
Construct a CollectionChangedInfo object which conveys that a one or more items at indeterminate indices have changed

Parameters:
source - the collection whose contents have changed.
whatChanged - The item that changed (added, removed, replaced)
howChanged - indicates the type of change

CollectionChangedInfo

public CollectionChangedInfo(java.lang.Object source,
                             HowChanged howChanged,
                             int index)
Construct a CollectionChangedInfo object which conveys that a single item at the specified index has changed (either added or removed or replaced)

Parameters:
source - the collection whose contents have changed.
howChanged - indicates if the item was added or removed
index - the index of item that was added/removed from this collection

CollectionChangedInfo

public CollectionChangedInfo(java.lang.Object source,
                             java.lang.Object whatChanged,
                             HowChanged howChanged,
                             int index)
Construct a CollectionChangedInfo object which conveys that a single item at an indeterminate index has changed (either added or removed or replaced)

Parameters:
source - the collection whose contents have changed.
whatChanged - The item that changed (added, removed, replaced)
howChanged - indicates if the item was added or removed
index - the index of item that was added/removed from this collection

CollectionChangedInfo

public CollectionChangedInfo(java.lang.Object source,
                             HowChanged howChanged,
                             int start,
                             int end)
Construct a CollectionChangedInfo object which conveys that a range of items has changed (either added, or removed or replaced)

Parameters:
source - the collection whose contents have changed.
howChanged - indicates if the item was added or removed
start - the index of the first item added/removed from this collection
end - the last item added/removed from this collection is at index (end - 1)

CollectionChangedInfo

public CollectionChangedInfo(java.lang.Object source,
                             java.lang.Object whatChanged,
                             HowChanged howChanged,
                             int start,
                             int end)
Construct a CollectionChangedInfo object which conveys that a range of items has changed (either added, or removed or replaced)

Parameters:
source - the collection whose contents have changed.
whatChanged - The item that changed (added, removed, replaced)
howChanged - indicates if the item was added or removed
start - the index of the first item added/removed from this collection
end - the last item added/removed from this collection is at index (end - 1)

CollectionChangedInfo

public CollectionChangedInfo(java.lang.Object source,
                             java.lang.String propertyName,
                             java.lang.Object whatChanged,
                             HowChanged howChanged,
                             int start,
                             int end)
Construct a CollectionChangedInfo object which conveys that a range of items has changed (either added, or removed or replaced)

Parameters:
source - the collection whose contents have changed.
propertyName - The programmatic name of the property that was changed.
whatChanged - The item that changed (added, removed, replaced)
howChanged - indicates if the item was added or removed
start - the index of the first item added/removed from this collection
end - the last item added/removed from this collection is at index (end - 1)
Method Detail

clone

public java.lang.Object clone(com.sas.collection.ContentsChangedSource newSource)
                       throws java.lang.CloneNotSupportedException
Clone the CollectionChangedInfo and sets the source to be the newSource

Returns:
a clone of the CollectionChangedInfo, with the source changed to the newSource.
Throws:
java.lang.CloneNotSupportedException - if the CollectionChangedInfo cannot be cloned.



Copyright © 2009 SAS Institute Inc. All Rights Reserved.