|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ISharedWorldView
Interface for WorldViews for multi-agent systems
Method Summary | |
---|---|
void |
addEventListener(Class<?> eventClass,
IWorldEventListener<?> listener)
Adds listener to a specific event (Level A listeners). |
void |
addObjectListener(Class<?> objectClass,
Class<?> eventClass,
IWorldObjectEventListener<?,?> listener)
Adds listener to a specified 'event' that occurs on the specific 'objectClass' (Level C listeners). |
void |
addObjectListener(Class<?> objectClass,
IWorldObjectEventListener<?,?> listener)
Adds listener to all events that happens on any object of the 'objectClass' (Level B listeners). |
void |
addObjectListener(WorldObjectId objectId,
Class<?> eventClass,
IWorldObjectEventListener<?,?> listener)
Adds listener to a specified 'event' that occurs on the specific object with 'objectId' (Level E listeners). |
void |
addObjectListener(WorldObjectId objectId,
IWorldObjectEventListener<?,?> listener)
Adds listener to all events that happens on object with specific 'objectId' (Level D listeners). |
ISharedWorldObject |
getShared(ITeamId teamId,
WorldObjectId objectId,
TimeKey time)
Returns the shared part of a requested object. |
IStaticWorldObject |
getStatic(WorldObjectId id)
Returns only the static part of a requested object, static part of each objects only contains properties, that will NOT be changed over time. |
boolean |
isListening(Class<?> objectClass,
Class<?> eventClass,
IWorldObjectEventListener<?,?> listener)
Tests whether the 'listener' is listening at specified 'objectClass' for specified 'event' (Level C listeners). |
boolean |
isListening(Class<?> eventClass,
IWorldEventListener<?> listener)
Tests whether the 'listener' is listening to a specific event (Level A listeners). |
boolean |
isListening(Class<?> objectClass,
IWorldObjectEventListener<?,?> listener)
Tests whether the 'listener' is listening at specified 'objectClass' (Level B listeners). |
boolean |
isListening(IWorldEventListener<?> listener)
Checks whether this listener is hooked to the world view (at any listener level). |
boolean |
isListening(WorldObjectId objectId,
Class<?> eventClass,
IWorldObjectEventListener<?,?> listener)
Tests whether the 'listener' is listening to a specified 'event' that occurs on the specific object with 'objectId' (Level E listeners). |
boolean |
isListening(WorldObjectId objectId,
IWorldObjectEventListener<?,?> listener)
Tests whether the 'listener' is listening at specified 'objectId' (Level D Listeners). |
void |
registerLocalWorldView(ILocalWorldView localWV,
ILifecycleBus bus)
This method is called when a new localWorldView is created and wants to use this sharedWorldView, the method registers the LocalWorldView with the sharedWorldView's sharedComponentBus and also internally stores the information about which WorldViews are registered to it. |
void |
removeEventListener(Class<?> eventClass,
IWorldEventListener<?> listener)
Removes listener from a specific event (Level A listeners). |
void |
removeListener(IWorldEventListener<?> listener)
Removes listener from every listeners category (from every listener level). |
void |
removeObjectListener(Class<?> objectClass,
Class<?> eventClass,
IWorldObjectEventListener<?,?> listener)
Removes listener from specific 'objectClass' listening for specified 'event' (Level C listeners). |
void |
removeObjectListener(Class<?> objectClass,
IWorldObjectEventListener<?,?> listener)
Removes listener from specific 'objectClass' listening for specified 'event' (Level B listeners). |
void |
removeObjectListener(WorldObjectId objectId,
Class<?> eventClass,
IWorldObjectEventListener<?,?> listener)
Removes listener to a specified 'event' that occurs on the specific object with 'objectId' (Level E listeners). |
void |
removeObjectListener(WorldObjectId objectId,
IWorldObjectEventListener<?,?> listener)
Removes listener from objects with specified 'objectId' (Level D Listeners). |
Methods inherited from interface cz.cuni.amis.pogamut.multi.communication.worldview.ISharedWorldChangeEventInput |
---|
notify |
Methods inherited from interface cz.cuni.amis.pogamut.base.component.ISharedComponent |
---|
addComponentBus, removeComponentBus |
Methods inherited from interface cz.cuni.amis.pogamut.base.component.IComponent |
---|
getComponentId |
Method Detail |
---|
void registerLocalWorldView(ILocalWorldView localWV, ILifecycleBus bus)
localWV
- The local WorldView to to register.bus
- ILifecycleBus of the corresponding LocalWorldViewvoid addEventListener(Class<?> eventClass, IWorldEventListener<?> listener)
It is the most general type of listener-registration allowing you to sniff any type of events.
Events passed to the listener are filtered only according to the 'event' class.
WARNING: even though the method does not require templated class and listener, you must be sure that 'listener' can accept 'eventClass'.
eventClass
- which event types you want to receivelistener
- where you want to handle these eventsvoid addObjectListener(Class<?> objectClass, IWorldObjectEventListener<?,?> listener)
Events passed to the listener are filtered according to the 'objectClass'.
WARNING: even though the method does not require templated classes and listener, you must be sure that 'listener' accepts all events (IWorldObjectEvent) for objects of 'objectClass'.
objectClass
- which object class you want to listen ateventClass
- which event class you want to receivelistener
- where you want to handle these eventsvoid addObjectListener(Class<?> objectClass, Class<?> eventClass, IWorldObjectEventListener<?,?> listener)
Events passed to the listener are filtered according to the 'event' and 'objectClass' of the object the event happened upon.
WARNING: even though the method does not require templated classes and listener, you must be sure that 'listener' accepts 'eventClass' for objects of 'objectClass'.
eventClass can be any implementor of IWorldObjectEvent
. E.g.
WorldObjectAppearedEvent
, WorldObjectDestroyedEvent
, WorldObjectDisappearedEvent
,
WorldObjectFirstEncounteredEvent
or WorldObjectUpdatedEvent
.
objectClass
- which object class you want to listen ateventClass
- which event class you want to receivelistener
- where you want to handle these eventsvoid addObjectListener(WorldObjectId objectId, IWorldObjectEventListener<?,?> listener)
Events passed to the listener are filtered according to the 'objectId' of the object.
WARNING: you must ensure that 'listener' can accept the event raised on object of specified 'objectId'.
objectId
- which object you want to listen atlistener
- where you want to handle eventsvoid addObjectListener(WorldObjectId objectId, Class<?> eventClass, IWorldObjectEventListener<?,?> listener)
Events passed to the listener are filtered according to the 'event' and 'objectId' of the object.
WARNING: even though the method does not require templated classes and listener, you must be sure that 'listener' accepts 'eventClass' for objects of specified 'objectId'.
objectId
- which object you want to listen ateventClass
- which event classes you want to receivelistener
- where you want to handle these eventsvoid removeEventListener(Class<?> eventClass, IWorldEventListener<?> listener)
eventClass
- which events class you want to remove the listener fromlistener
- you want to removevoid removeObjectListener(Class<?> objectClass, IWorldObjectEventListener<?,?> listener)
objectClass
- class of objects you want the listener to remove fromeventClass
- which events class you want to remove the listener fromlistener
- you want to removevoid removeObjectListener(Class<?> objectClass, Class<?> eventClass, IWorldObjectEventListener<?,?> listener)
objectClass
- class of objects you want the listener to remove fromeventClass
- which events class you want to remove the listener fromlistener
- you want to removevoid removeObjectListener(WorldObjectId objectId, IWorldObjectEventListener<?,?> listener)
objectId
- id of object you want the listener to remove fromlistener
- you want to removevoid removeObjectListener(WorldObjectId objectId, Class<?> eventClass, IWorldObjectEventListener<?,?> listener)
objectId
- id of object you want the listener to remove fromeventClass
- event class you want to stop receiving in the listenerlistener
- you want to removevoid removeListener(IWorldEventListener<?> listener)
WARNING: Can be time consuming! (Iterating through all levels of listeners.)
listener
- you want to remove from all listener levelsboolean isListening(Class<?> eventClass, IWorldEventListener<?> listener)
eventClass
- which events you want to receivelistener
- that is tested
boolean isListening(Class<?> objectClass, IWorldObjectEventListener<?,?> listener)
objectClass
- where the listener is testedlistener
- that is tested
boolean isListening(Class<?> objectClass, Class<?> eventClass, IWorldObjectEventListener<?,?> listener)
objectClass
- where the listener is testedeventClass
- where the listener is testedlistener
- that is tested
boolean isListening(WorldObjectId objectId, IWorldObjectEventListener<?,?> listener)
objectId
- where the listener is testedlistener
- that is tested
boolean isListening(WorldObjectId objectId, Class<?> eventClass, IWorldObjectEventListener<?,?> listener)
objectId
- where the listener is testedeventClass
- what class is testedlistener
- that is tested
boolean isListening(IWorldEventListener<?> listener)
WARNING: Can be time consuming! (Iterating through all levels of listeners.)
listener
-
IStaticWorldObject getStatic(WorldObjectId id)
id
- - WorldObjectId of the entire WorldObjectISharedWorldObject getShared(ITeamId teamId, WorldObjectId objectId, TimeKey time)
teamId
- objectId
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |