io.sarl.lang.core
Class Event
All Superinterfaces:
java.io.Serializable
All Known Subclasses:
AgentKilled, AgentSpawned, ContextJoined, ContextLeft, Destroy, Failure, Initialize, MemberExcluded, MemberJoined, MemberLeft, ParticipantJoined, ParticipantLeft, SpaceCreated, SpaceDestroyed, AppExit, DeadEvent
abstract event Event
extends java.lang.Object
implements java.io.Serializable
Elementary interaction unit inside an EventSpace An event is the specification of some occurrence in a Space that may potentially trigger effects by a listener. Within a Space, the notion of Scope enables to precisely control/filter the potential recipients of an event.
Maven Group Identifier:
io.sarl.lang
Maven Artifact Identifier:
core
Property Summary
Modifier and type Property and description
Address source
The source of the event.
Constructor Summary
Constructor and description
new
Constructs an Event without source.
new(Address)
Constructs an Event with a source.
Action Summary
Modifier and type Action and description
boolean equals(Object)
Address getSource
The source of the event.
int hashCode
boolean isFrom(Address)
Replies if the event was emitted by an entity with the given address.
boolean isFrom(UUID)
Replies if the event was emitted by an entity with the given identifier.
void setSource(Address)
The address of the source of this event.
final java.lang.String toString
protected void toString(ToStringBuilder)
fill the given builder with the string representation of this object.
Property Details
source
var source : Address
The source of the event.

This property is an alias for the action: getSource

Returns:
the source of the event.
Constructor Details
new
new
Constructs an Event without source. The source must be set with setSource(Address) by the creator of the event, or by the emitting mechanism, before sending the event on the event bus.
new(Address)
new(Address)
Constructs an Event with a source.
Parameters:
source - source of the event.
Action Details
equals(Object)
def equals(Object) : boolean
getSource
def getSource : Address
The source of the event.
Returns:
the source of the event.
hashCode
def hashCode : int
isFrom(Address)
def isFrom(Address) : boolean
Replies if the event was emitted by an entity with the given address.
Parameters:
address - the address of the emitter to test.
Returns:
true if the given event was emitted by an entity with the given address; otherwise false .
Since:
0.2
isFrom(UUID)
def isFrom(UUID) : boolean
Replies if the event was emitted by an entity with the given identifier.
Parameters:
entityId - the identifier of the emitter to test.
Returns:
true if the given event was emitted by an entity with the given identifier; otherwise false .
Since:
0.2
setSource(Address)
def setSource(Address)
The address of the source of this event.
Parameters:
source - the source of the event.
toString
def toString : java.lang.String
toString(ToStringBuilder)
protected def toString(ToStringBuilder)
fill the given builder with the string representation of this object.
Parameters:
builder - the string builder.
Since:
0.7