|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectGeocode
public final class Geocode
The cached geocoding of a residential address, backed by a row of the subserver's * geocode table. Caching is employed to lighten the load on the geocoding service.
| Nested Class Summary | |
|---|---|
static class |
Geocode.GeocodingException
Thrown when a geocoding-specific IO exception occurs. |
static class |
Geocode.GoogleGeocoding
An account with the geocoding service of the Google Maps API. |
static class |
Geocode.Table
The geocode table of an electoral subserver, caching geocode data in relational form. |
| Constructor Summary | |
|---|---|
Geocode(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. |
|
| Method Summary | |
|---|---|
String |
address()
The residential address that is geocoded. |
void |
commit(Geocode.Table table)
Stores this geocode in the table. |
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. |
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Geocode(String address,
Geocode.Table table)
throws SQLException
address - per address()table - the subserver's geocode table
SQLExceptionexists()| Method Detail |
|---|
public String address()
public void commit(Geocode.Table table)
throws SQLException
table - the subserver's geocode table
SQLExceptionpublic boolean exists()
public double latitude()
setCoordinates(Double,Double)public double longitude()
setCoordinates(Double,Double)
public void setCoordinates(Double newLatitude,
Double newLongitude)
latitude(),
longitude()public final long timestamp()
System.currentTimeMillis()public String toString()
toString in class Object
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||