diff options
author | Tom Tromey <tromey@redhat.com> | 2002-06-17 21:32:01 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2002-06-17 21:32:01 +0000 |
commit | 8217640552c471fe1e10c1fb8203770f31f031a8 (patch) | |
tree | 3dbac456e9c6f8922043007964a911fa1318f858 /libjava/java/util/EventObject.java | |
parent | 390de76932ff3924137305697272777d104eec13 (diff) | |
download | gcc-8217640552c471fe1e10c1fb8203770f31f031a8.zip gcc-8217640552c471fe1e10c1fb8203770f31f031a8.tar.gz gcc-8217640552c471fe1e10c1fb8203770f31f031a8.tar.bz2 |
javaprims.h: Updated class declaration list.
* 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.
From-SVN: r54720
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 0c3af2b..3ccb6ec 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 |