agent.example
Class ExampleEvent

java.lang.Object
  extended byjava.util.EventObject
      extended byagent.base.AgentEvent
          extended byagent.example.ExampleEvent
All Implemented Interfaces:
java.io.Serializable

public class ExampleEvent
extends AgentEvent

Example event structure. The constants at the top specify the various states the event can be in - this is a sort of sub-category which indicates to the event receiver what kind of "ExampleEvent" the event it receives actually is.

Aside from the event's id, an event will usually contain some sort of data in it. In this ExampleEvent it just stores an arbitrary Object, but in a real event it would likely contain something more specific (e.g. MessageEvents contain references to their respective Message objects).

See Also:
Serialized Form

Field Summary
static int STATE1
           
static int STATE2
           
 
Fields inherited from class agent.base.AgentEvent
ACTIVE, HALTED
 
Constructor Summary
ExampleEvent(java.lang.Object source, java.lang.Object d, int id)
          Constructor
 
Method Summary
 java.lang.Object getData()
          Get/set accessors.
 void setData(java.lang.Object d)
           
 java.lang.String toString()
          Stringifys the event
 
Methods inherited from class agent.base.AgentEvent
getID, getStatus, getTime, halt, isActive, setID, setStatus, setTime
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

STATE1

public static final int STATE1
See Also:
Constant Field Values

STATE2

public static final int STATE2
See Also:
Constant Field Values
Constructor Detail

ExampleEvent

public ExampleEvent(java.lang.Object source,
                    java.lang.Object d,
                    int id)
Constructor

Parameters:
source - The source of the event
d - The data in question
id - The id of the event
Method Detail

getData

public java.lang.Object getData()
Get/set accessors.


setData

public void setData(java.lang.Object d)

toString

public java.lang.String toString()
Stringifys the event