openlr.map.sqlite.impl
Class MapDatabaseImpl

java.lang.Object
  extended by openlr.map.sqlite.impl.MapDatabaseImpl
All Implemented Interfaces:
openlr.map.MapDatabase

public final class MapDatabaseImpl
extends Object
implements openlr.map.MapDatabase

Thread safe implementation of the OpenLR MapDatabase interface for use with a TomTom digital map in SQLite format.

OpenLR is a trade mark of TomTom International B.V.

email: software@openlr.org

Author:
TomTom International B.V.

Constructor Summary
MapDatabaseImpl(String db)
          Creates an instance of this MapDatabase implementation which uses the given SQLite database.
 
Method Summary
 Iterator<? extends openlr.map.Line> findLinesCloseByCoordinate(double longitude, double latitude, int distance)
          
 Iterator<? extends openlr.map.Node> findNodesCloseByCoordinate(double longitude, double latitude, int distance)
          
 Iterator<? extends openlr.map.Line> getAllLines()
          
 Iterator<? extends openlr.map.Node> getAllNodes()
          
 openlr.map.Line getLine(long id)
          
 Rectangle2D.Double getMapBoundingBox()
          
 openlr.map.Node getNode(long id)
          
 int getNumberOfLines()
          
 int getNumberOfNodes()
          
 boolean hasTurnRestrictionOnPath(List<? extends openlr.map.Line> path)
          
 boolean hasTurnRestrictions()
          
 void printCacheStats()
          Outputs statistics on the caches to the log.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MapDatabaseImpl

public MapDatabaseImpl(String db)
Creates an instance of this MapDatabase implementation which uses the given SQLite database.

Parameters:
db - a SQLite database which holds the network.
Method Detail

findLinesCloseByCoordinate

public Iterator<? extends openlr.map.Line> findLinesCloseByCoordinate(double longitude,
                                                                      double latitude,
                                                                      int distance)

Specified by:
findLinesCloseByCoordinate in interface openlr.map.MapDatabase

findNodesCloseByCoordinate

public Iterator<? extends openlr.map.Node> findNodesCloseByCoordinate(double longitude,
                                                                      double latitude,
                                                                      int distance)

Specified by:
findNodesCloseByCoordinate in interface openlr.map.MapDatabase

getLine

public openlr.map.Line getLine(long id)

Specified by:
getLine in interface openlr.map.MapDatabase

getNode

public openlr.map.Node getNode(long id)

Specified by:
getNode in interface openlr.map.MapDatabase

hasTurnRestrictionOnPath

public boolean hasTurnRestrictionOnPath(List<? extends openlr.map.Line> path)

Specified by:
hasTurnRestrictionOnPath in interface openlr.map.MapDatabase

hasTurnRestrictions

public boolean hasTurnRestrictions()

Specified by:
hasTurnRestrictions in interface openlr.map.MapDatabase

printCacheStats

public void printCacheStats()
Outputs statistics on the caches to the log.


toString

public String toString()

Overrides:
toString in class Object

getAllLines

public Iterator<? extends openlr.map.Line> getAllLines()

Specified by:
getAllLines in interface openlr.map.MapDatabase

getAllNodes

public Iterator<? extends openlr.map.Node> getAllNodes()

Specified by:
getAllNodes in interface openlr.map.MapDatabase

getMapBoundingBox

public Rectangle2D.Double getMapBoundingBox()

Specified by:
getMapBoundingBox in interface openlr.map.MapDatabase

getNumberOfLines

public int getNumberOfLines()

Specified by:
getNumberOfLines in interface openlr.map.MapDatabase

getNumberOfNodes

public int getNumberOfNodes()

Specified by:
getNumberOfNodes in interface openlr.map.MapDatabase


Copyright © 2012 TomTom International B.V.. All Rights Reserved.