org.placelab.mapper
Class TempMapper

java.lang.Object
  extended byorg.placelab.mapper.AbstractMapper
      extended byorg.placelab.mapper.TempMapper
All Implemented Interfaces:
Mapper

public class TempMapper
extends AbstractMapper

This mapper resides purely in memory, so it is NOT persistent. Use this for debugging.


Field Summary
 
Fields inherited from class org.placelab.mapper.AbstractMapper
UNKNOWN_BEACON_CLASS
 
Constructor Summary
TempMapper()
           
 
Method Summary
 boolean close()
          Closes the Mapper.
 boolean deleteAll()
          Deletes all Beacon records in the Mapper.
 void endBulkPuts()
           
protected  java.util.Vector findBeaconsImpl(java.lang.String id)
           
 boolean isOpened()
           
 boolean open()
          Opens the Mapper.
protected  boolean putBeaconsImpl(java.lang.String id, java.util.Vector beacons)
           
 java.util.Enumeration query(Coordinate c1, Coordinate c2)
          c1 and c2 define opposing corners of a rectangular area in which you wish to get an Iterator over all Beacons in that area.
 void startBulkPuts()
          Signals to the Mapper that it is about to be loaded in bulk.
 
Methods inherited from class org.placelab.mapper.AbstractMapper
addBeaconClass, addBeaconClass, createBeacon, findBeacon, findBeacons, getBeaconsFromStorageString, overrideOnPut, putBeacon, putBeacons
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TempMapper

public TempMapper()
Method Detail

query

public java.util.Enumeration query(Coordinate c1,
                                   Coordinate c2)
Description copied from interface: Mapper
c1 and c2 define opposing corners of a rectangular area in which you wish to get an Iterator over all Beacons in that area.

Specified by:
query in interface Mapper
Specified by:
query in class AbstractMapper

findBeaconsImpl

protected java.util.Vector findBeaconsImpl(java.lang.String id)
Specified by:
findBeaconsImpl in class AbstractMapper

putBeaconsImpl

protected boolean putBeaconsImpl(java.lang.String id,
                                 java.util.Vector beacons)
Specified by:
putBeaconsImpl in class AbstractMapper

open

public boolean open()
Description copied from interface: Mapper
Opens the Mapper. You must call this method before querying the mapper.

Returns:
whether or not the Mapper was successfully opened.

close

public boolean close()
Description copied from interface: Mapper
Closes the Mapper. Closed Mappers can no longer be queried.

Returns:
whether or not the Mapper was successfully closed.

deleteAll

public boolean deleteAll()
Description copied from interface: Mapper
Deletes all Beacon records in the Mapper. This is typically used by MapLoaders prior to reloading the Mapper with data.

Returns:
whether or not the Mapper was successfully emptied.

isOpened

public boolean isOpened()

startBulkPuts

public void startBulkPuts()
Description copied from interface: Mapper
Signals to the Mapper that it is about to be loaded in bulk. Some implementations can use this to lock their underlying database and speed up loading. You should not query the Mapper while using bulk loading.

See Also:
Mapper.endBulkPuts()

endBulkPuts

public void endBulkPuts()