/[classpath]/classpath/java/util/EventObject.java
ViewVC logotype

Diff of /classpath/java/util/EventObject.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.7 by mark, Tue Jan 22 22:27:01 2002 UTC revision 1.8 by ericb, Fri Feb 22 02:09:40 2002 UTC
# Line 1  Line 1 
1  /* EventObject.java - Represent events fired by objects.  /* EventObject.java -- Represent events fired by objects
2     Copyright (C) 1999, 2000 Free Software Foundation, Inc.     Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc.
3    
4  This file is part of GNU Classpath.  This file is part of GNU Classpath.
5    
# Line 43  import java.io.Serializable; Line 43  import java.io.Serializable;
43  /**  /**
44   * Represents Events fired by Objects.   * Represents Events fired by Objects.
45   *   *
46     * @author Eric Blake <ebb9@email.byu.edu>
47   * @see EventListener   * @see EventListener
48     * @since 1.1
49     * @status updated to 1.4
50   */   */
51  public class EventObject implements Serializable  public class EventObject implements Serializable
52  {  {
53      /**
54       * Compatible with JDK 1.1+.
55       */
56    private static final long serialVersionUID = 5516075349620653480L;    private static final long serialVersionUID = 5516075349620653480L;
57    
58      /**
59       * The source object; in other words, the object which this event takes
60       * place on.
61       */
62    protected transient Object source;    protected transient Object source;
63    
64    /**    /**
65     * Constructs an EventObject with the specified source.     * Constructs an EventObject with the specified source.
66       *
67       * @param source the source of the event
68       * @throws IllegalArgumentException if source is null (This is not
69       *         specified, but matches the behavior of the JDK)
70     */     */
71    public EventObject(Object source)    public EventObject(Object source)
72    {    {
# Line 59  public class EventObject implements Seri Line 74  public class EventObject implements Seri
74    }    }
75    
76    /**    /**
77     * @return The source of the Event.     * Returns the source of the event.
78       *
79       * @return the event source
80     */     */
81    public Object getSource()    public Object getSource()
82    {    {
# Line 67  public class EventObject implements Seri Line 84  public class EventObject implements Seri
84    }    }
85    
86    /**    /**
87     * @return String representation of the Event.     * Converts the event to a String. The format is not specified, but by
88     * @override toString in class Object     * observation, the JDK uses:
89       * <code>getClass() + "[source=" + source + "]";</code>.
90       *
91       * @return String representation of the Event
92     */     */
93    public String toString()    public String toString()
94    {    {
95      return this.getClass() + "[source=" + source.toString() + "]";      return getClass() + "[source=" + source + "]";
96    }    }
97  }  }

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26