Modifier and Type | Class and Description |
---|---|
static class |
Geocode.GeocodingException
Thrown when a geocoding-specific IO exception occurs.
|
static class |
Geocode.Table
The geocode table of a vote-server, caching geocode data in relational form.
|
Constructor and Description |
---|
Geocode(String region,
String address,
Geocode.Table table)
Constructs a Geocode, reading its initial state from the geocode table, or leaving
it at default values if it does not exist in the table.
|
Modifier and Type | Method and Description |
---|---|
String |
address()
The street address that is geocoded.
|
boolean |
exists()
Returns true if this geocode has been stored in the table; false otherwise.
|
double |
latitude()
The latitude of the address in radians.
|
double |
longitude()
The longitude of the address in radians.
|
String |
region()
The country in which the address is specified.
|
void |
setCoordinates(double newLatitude,
double newLongitude)
Sets the latitude and longitude.
|
long |
timestamp()
The time at which this geocode was last stored to the table, in milliseconds since
the 'epoch'; or zero, if it was never stored.
|
String |
toString()
Returns a descripion of this geocode, including the address and its geographic
coordinates.
|
void |
write(Geocode.Table table)
Stores this geocode in the table.
|
public Geocode(String region, String address, Geocode.Table table) throws SQLException
table
- the vote-server's geocode table.SQLException
region()
,
address()
public String address()
public boolean exists()
public double latitude()
setCoordinates(double,double)
public double longitude()
setCoordinates(double,double)
public String region()
public void setCoordinates(double newLatitude, double newLongitude)
latitude()
,
longitude()
public final long timestamp()
System.currentTimeMillis()
public void write(Geocode.Table table) throws SQLException
table
- the vote-server's geocode table.SQLException