diff options
author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-06-17 21:32:01 +0000 |
---|---|---|
committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-06-17 21:32:01 +0000 |
commit | 551e0cf9e7404a1f53a80675f32ed4dc866eccb6 (patch) | |
tree | 3dbac456e9c6f8922043007964a911fa1318f858 /libjava/java/util/EventObject.java | |
parent | 05888bbf0f6155506443f21d3e64f78af19bbc53 (diff) | |
download | ppe42-gcc-551e0cf9e7404a1f53a80675f32ed4dc866eccb6.tar.gz ppe42-gcc-551e0cf9e7404a1f53a80675f32ed4dc866eccb6.zip |
* gcj/javaprims.h: Updated class declaration list.
* Makefile.in: Rebuilt.
* Makefile.am (core_java_source_files): Added new file.
* java/util/EventListenerProxy.java: New file.
* java/util/EventListener.java: Re-merge with Classpath.
* java/util/EventObject.java: Re-merge with Classpath.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@54720 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java/util/EventObject.java')
-rw-r--r-- | libjava/java/util/EventObject.java | 38 |
1 files changed, 31 insertions, 7 deletions
diff --git a/libjava/java/util/EventObject.java b/libjava/java/util/EventObject.java index 0c3af2b0d95..3ccb6ecd29a 100644 --- a/libjava/java/util/EventObject.java +++ b/libjava/java/util/EventObject.java @@ -1,5 +1,5 @@ -/* EventObject.java - Represent events fired by objects. - Copyright (C) 1999, 2000 Free Software Foundation, Inc. +/* EventObject.java -- represents an event on an object + Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -43,23 +43,44 @@ import java.io.Serializable; /** * Represents Events fired by Objects. * + * @author Eric Blake <ebb9@email.byu.edu> * @see EventListener + * @since 1.1 + * @status updated to 1.4 */ public class EventObject implements Serializable { + /** + * Compatible with JDK 1.1+. + */ private static final long serialVersionUID = 5516075349620653480L; + + /** + * The source object; in other words, the object which this event takes + * place on. + */ protected transient Object source; /** * Constructs an EventObject with the specified source. + * + * @param source the source of the event + * @throws IllegalArgumentException if source is null (This is not + * specified, but matches the behavior of the JDK) */ public EventObject(Object source) { + // This check for null is stupid, if you ask me, since source is + // protected and non-final, so a subclass can set it to null later on. + if (source == null) + throw new IllegalArgumentException(); this.source = source; } /** - * @return The source of the Event. + * Returns the source of the event. + * + * @return the event source */ public Object getSource() { @@ -67,11 +88,14 @@ public class EventObject implements Serializable } /** - * @return String representation of the Event. - * @override toString in class Object + * Converts the event to a String. The format is not specified, but by + * observation, the JDK uses: + * <code>getClass().getName() + "[source=" + source + "]";</code>. + * + * @return String representation of the Event */ public String toString() { - return this.getClass() + "[source=" + source.toString() + "]"; + return getClass().getName() + "[source=" + source + "]"; } -} +} // class EventObject |