fcmodeler.util
Class SetChangeEvent

java.lang.Object
  |
  +--java.util.EventObject
        |
        +--fcmodeler.util.SetChangeEvent
All Implemented Interfaces:
java.io.Serializable

public final class SetChangeEvent
extends java.util.EventObject

An event representing a change in a set. Instances of this class represent either an element being added to a set or an element being removed from a set. The exact type can be accessed through the getChangeType method. The set that was modified can be accessed through the getSource method, and the element that was added to or removed from the set can be accessed through the getElement method.

Since:
JDK1.3
Version:
$Revision: 1.1 $
Author:
Julie Dickerson , Zach Cox
See Also:
Serialized Form

Field Summary
static int ELEMENT_ADDED
          The constant for an element addition event.
static int ELEMENT_REMOVED
          The constant for an element removal event.
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
SetChangeEvent(java.util.Set source, java.lang.Object element, int type)
          Creates a new SetChangeEvent.
 
Method Summary
 int getChangeType()
          Returns the type of change.
 java.lang.Object getElement()
          Returns the element that was either added to or removed from the set.
 java.lang.String toString()
          Returns the string representation of this set change event.
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ELEMENT_ADDED

public static final int ELEMENT_ADDED
The constant for an element addition event.

ELEMENT_REMOVED

public static final int ELEMENT_REMOVED
The constant for an element removal event.
Constructor Detail

SetChangeEvent

public SetChangeEvent(java.util.Set source,
                      java.lang.Object element,
                      int type)
Creates a new SetChangeEvent. The specified element was either added to or removed from the source set, as idicated by the specified type.
Parameters:
source - the set that was modified.
element - the element that was added to or removed from the source set.
type - either ELEMENT_ADDED or ELEMENT_REMOVED.
Method Detail

getElement

public java.lang.Object getElement()
Returns the element that was either added to or removed from the set.
Returns:
the element that was either added to or removed from the set.

getChangeType

public int getChangeType()
Returns the type of change. The returned int is equal to either ELEMENT_ADDED or ELEMENT_REMOVED.
Returns:
the type of change.

toString

public java.lang.String toString()
Returns the string representation of this set change event.
Overrides:
toString in class java.util.EventObject
Returns:
the string representation of this set change event.