cz.cuni.amis.pogamut.defcon.communication.messages.infos
Class DefConObjectUpdate

Package class diagram package DefConObjectUpdate
java.lang.Object
  extended by cz.cuni.amis.pogamut.defcon.communication.messages.infos.DefConObjectUpdate
All Implemented Interfaces:
IWorldChangeEvent, IWorldObjectUpdatedEvent, cz.cuni.amis.utils.listener.Event

public class DefConObjectUpdate
extends Object
implements IWorldObjectUpdatedEvent

Generic updater for arbitrary objects. All that you need is to annotate some fields with Updatable annotation.

Follows the philosophy of IWorldObjectUpdateEvent.

Author:
Jimmy

Nested Class Summary
 
Nested classes/interfaces inherited from interface cz.cuni.amis.pogamut.base.communication.translator.event.IWorldObjectUpdatedEvent
IWorldObjectUpdatedEvent.DestroyWorldObject
 
Constructor Summary
DefConObjectUpdate(DefConObject source)
          Creates new object update with 'source' as object that contains updates.
 
Method Summary
 WorldObjectId getId()
          Returns ID of the object that should be updated.
 double getLastSeenTime()
          Returns the time of the last update of the object.
 long getSimTime()
          DOCUMENT ME!
 DefConObject getSource()
          Returns source of the updates.
static cz.cuni.amis.pogamut.defcon.communication.messages.infos.DefConObjectUpdate.Updater getUpdater(Class<?> cls)
          Returns updater for class 'cls' from cache or creates new one.
protected  void setLastSeenTime(double time)
          Sets the last-seen-time of the object.
 IWorldObjectUpdateResult update(IWorldObject obj)
          Updates object 'obj' with the source event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefConObjectUpdate

public DefConObjectUpdate(DefConObject source)
Creates new object update with 'source' as object that contains updates.

Parameters:
source -
Method Detail

getUpdater

public static cz.cuni.amis.pogamut.defcon.communication.messages.infos.DefConObjectUpdate.Updater getUpdater(Class<?> cls)
Returns updater for class 'cls' from cache or creates new one.

Parameters:
cls -
Returns:

getSource

public DefConObject getSource()
Returns source of the updates.

Returns:

getId

public WorldObjectId getId()
Returns ID of the object that should be updated.

Specified by:
getId in interface IWorldObjectUpdatedEvent
Returns:
ID

update

public IWorldObjectUpdateResult update(IWorldObject obj)
Updates object 'obj' with the source event.

Specified by:
update in interface IWorldObjectUpdatedEvent
Parameters:
obj - object that should be updated
Returns:
result of the object update

getLastSeenTime

public double getLastSeenTime()
Returns the time of the last update of the object.

Returns:
time

setLastSeenTime

protected void setLastSeenTime(double time)
Sets the last-seen-time of the object.

Parameters:
time -

getSimTime

public long getSimTime()
DOCUMENT ME!

Specified by:
getSimTime in interface IWorldChangeEvent
Returns:
DOCUMENT ME!


Copyright © 2013 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.