public class GraphDB
extends Object
Constructor | Description |
---|---|
GraphDB(String dbPath) |
Example constructor shows how to create and start an XML parser.
|
Modifier and Type | Method | Description |
---|---|---|
(package private) Iterable<Long> |
adjacent(long v) |
Returns ids of all vertices adjacent to v.
|
(package private) double |
bearing(long v,
long w) |
Returns the initial bearing (angle) between vertices v and w in degrees.
|
(package private) static String |
cleanString(String s) |
Helper to process strings into their "cleaned" form, ignoring punctuation and capitalization.
|
(package private) long |
closest(double lon,
double lat) |
Returns the vertex closest to the given longitude and latitude.
|
(package private) double |
distance(long v,
long w) |
Returns the great-circle distance between vertices v and w in miles.
|
(package private) double |
lat(long v) |
Gets the latitude of a vertex.
|
(package private) double |
lon(long v) |
Gets the longitude of a vertex.
|
(package private) Iterable<Long> |
vertices() |
Returns an iterable of all vertex IDs in the graph.
|
public GraphDB(String dbPath)
dbPath
- Path to the XML file to be parsed.static String cleanString(String s)
s
- Input string.Iterable<Long> vertices()
Iterable<Long> adjacent(long v)
v
- The id of the vertex we are looking adjacent to.double distance(long v, long w)
v
- The id of the first vertex.w
- The id of the second vertex.double bearing(long v, long w)
v
- The id of the first vertex.w
- The id of the second vertex.long closest(double lon, double lat)
lon
- The target longitude.lat
- The target latitude.double lon(long v)
v
- The id of the vertex.double lat(long v)
v
- The id of the vertex.