java.util
Class EventObject

java.lang.Object
  extended by java.util.EventObject
All Implemented Interfaces:
Serializable

public class EventObject
extends Object
implements Serializable

Represents Events fired by Objects.

Since:
1.1
See Also:
EventListener, Serialized Form

Field Summary
protected  Object source
          The source object; in other words, the object which this event takes place on.
 
Constructor Summary
EventObject(Object source)
          Constructs an EventObject with the specified source.
 
Method Summary
 Object getSource()
          Returns the source of the event.
 String toString()
          Converts the event to a String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

source

protected transient Object source
The source object; in other words, the object which this event takes place on.

Constructor Detail

EventObject

public EventObject(Object source)
Constructs an EventObject with the specified source.

Parameters:
source - the source of the event
Throws:
IllegalArgumentException - if source is null (This is not specified, but matches the behavior of the JDK)
Method Detail

getSource

public Object getSource()
Returns the source of the event.

Returns:
the event source

toString

public String toString()
Converts the event to a String. The format is not specified, but by observation, the JDK uses: getClass().getName() + "[source=" + source + "]";.

Overrides:
toString in class Object
Returns:
String representation of the Event
See Also:
Object.getClass(), Object.hashCode(), Class.getName(), Integer.toHexString(int)