es.ucm.look.data.local
Class DBDataHandler

java.lang.Object
  extended by es.ucm.look.data.local.DBDataHandler
All Implemented Interfaces:
DataGetter, DataHandler, DataSetter
Direct Known Subclasses:
RemoteDBHandler

public class DBDataHandler
extends java.lang.Object
implements DataHandler

To have the persistence to a database, implements DataHandler


Constructor Summary
DBDataHandler()
           
DBDataHandler(Context c)
           
 
Method Summary
 void addEntity(EntityData data)
          Adds an entity to the world
 java.util.List<EntityData> getElementsUpdated(float x, float y, float z, float radius, java.util.Date date)
          Returns all elements near the given point with the given radius that changed since last update
 void updatePosition(EntityData data, float x, float y, float z)
          Modifies the position for an entity
 void updateProperty(EntityData data, java.lang.String property, java.lang.String newValue)
          Updates the value from a entity data property
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBDataHandler

public DBDataHandler()

DBDataHandler

public DBDataHandler(Context c)
Method Detail

addEntity

public void addEntity(EntityData data)
Description copied from interface: DataSetter
Adds an entity to the world

Specified by:
addEntity in interface DataSetter

getElementsUpdated

public java.util.List<EntityData> getElementsUpdated(float x,
                                                     float y,
                                                     float z,
                                                     float radius,
                                                     java.util.Date date)
Description copied from interface: DataGetter
Returns all elements near the given point with the given radius that changed since last update

Specified by:
getElementsUpdated in interface DataGetter
Parameters:
x - x coordinate
y - y coordinate
z - z coordinate
radius - radius to be checked. If radius is -1, is considered as infinitum
date - time of the last update. If date is null, all elements will be returned
Returns:
the list with the ids

updatePosition

public void updatePosition(EntityData data,
                           float x,
                           float y,
                           float z)
Description copied from interface: DataSetter
Modifies the position for an entity

Specified by:
updatePosition in interface DataSetter
Parameters:
data - data representing the entity
x - x coordinate
y - y coordinate
z - z coordinate

updateProperty

public void updateProperty(EntityData data,
                           java.lang.String property,
                           java.lang.String newValue)
Description copied from interface: DataSetter
Updates the value from a entity data property

Specified by:
updateProperty in interface DataSetter
Parameters:
data - entity data
property - the property name
newValue - the nuew value for the property