org.placelab.mapper
Class MapLoader

java.lang.Object
  extended byorg.placelab.mapper.MapLoader
Direct Known Subclasses:
JDBMQuickMapLoader, MapSourceLoader

public class MapLoader
extends java.lang.Object

This utility class reloads the persistent Beacon cache from a file or URL. This will completely erase the existing AP cache and then load the new access points.


Field Summary
protected  Mapper mapper
           
 
Constructor Summary
MapLoader()
          Creates a new map loader that will use the default database name
MapLoader(Mapper m)
          Creates a new map loader that will name its database dbName.
 
Method Summary
 void createNewMap()
          Deletes all the known Beacons and returns how many elements were in the map.
 Mapper getMapper()
           
 int loadMap(java.io.InputStream is)
          Load up a new map from the given inputstream.
static void main(java.lang.String[] args)
          Pass in either a URL or a file with a set of known APs as an argument to this program.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mapper

protected Mapper mapper
Constructor Detail

MapLoader

public MapLoader(Mapper m)
Creates a new map loader that will name its database dbName. There can be multiple simultaneous AP cache's provided they have differnt names.


MapLoader

public MapLoader()
          throws java.io.IOException
Creates a new map loader that will use the default database name

Method Detail

getMapper

public Mapper getMapper()

main

public static void main(java.lang.String[] args)
Pass in either a URL or a file with a set of known APs as an argument to this program. The current public map should always be available at http://data.placelab.org/do-retrieve.php


createNewMap

public void createNewMap()
Deletes all the known Beacons and returns how many elements were in the map.


loadMap

public int loadMap(java.io.InputStream is)
            throws java.io.IOException
Load up a new map from the given inputstream. Returns the number of new Beacons loaded

Throws:
java.io.IOException