agent.example
Class ExampleEvent
java.lang.Object
java.util.EventObject
agent.base.AgentEvent
agent.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
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 java.util.EventObject |
getSource |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
STATE1
public static final int STATE1
- See Also:
- Constant Field Values
STATE2
public static final int STATE2
- See Also:
- Constant Field Values
ExampleEvent
public ExampleEvent(java.lang.Object source,
java.lang.Object d,
int id)
- Constructor
- Parameters:
source
- The source of the eventd
- The data in questionid
- The id of the event
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