com.ltu.smd116.dbp
Class DBHotSpot


public class DBHotSpot

This is the database provider for hotspots.

Author:
Daniel Nilsson

Constructor Summary
DBHotSpot()
          Create a new database provider for hotspots.

Method Summary
 voidaddHotSpot(HotSpotContainer hs)
          Add a new hotspot.
 HotSpotContainergetHotSpot(int id)
          Get a hotspot given the id.
 HotSpotContainergetHotSpot(int x, int y, int floor)
          Get a hotspot given the position.
 voidremoveHotSpot(HotSpotContainer hs)
          Remove a HotSpot.
 voidupdateHotSpot(HotSpotContainer hs)
          Updates the the hotspot in the db when you moved it.

Constructor Detail

DBHotSpot

public DBHotSpot()
Create a new database provider for hotspots.
Method Detail

addHotSpot

public void addHotSpot(HotSpotContainer hs)
Add a new hotspot.
Parameters:
hs - The hotspot to add.

getHotSpot

public HotSpotContainer getHotSpot(int id)
Get a hotspot given the id.
Parameters:
id - The id of the hotspot you want.
Returns: A HotSpotContainer containing the requested hotspot.

getHotSpot

public HotSpotContainer getHotSpot(int x, int y, int floor)
Get a hotspot given the position.
Parameters:
x - The x-coordinate.
y - The y-coordinate.
floor - The floor.
Returns: A HotSpotContainer containing the requested hotspot.

removeHotSpot

public void removeHotSpot(HotSpotContainer hs)
Remove a HotSpot.
Parameters:
hs - The HotSpot to remove.

updateHotSpot

public void updateHotSpot(HotSpotContainer hs)
Updates the the hotspot in the db when you moved it.
The id must not be changed.
Parameters:
hs - The HotSpotContainer to update.