com.lamatek.tags.google.beans
Class GeocoderBean

java.lang.Object
  extended by com.lamatek.tags.google.beans.GeocoderBean
All Implemented Interfaces:
Geocoder, java.io.Serializable

public class GeocoderBean
extends java.lang.Object
implements Geocoder, java.io.Serializable

GeocoderBean

Version:
0.40 Default address to lon/lat geocoder. It parses the current information and passes responsibility to either USAddressGeocoder or IntlAddressGeocoder. This class does not perform any actual geocoding itself, rather it passes to the appropriate geocoder based on country.
Author:
Tom Cole
See Also:
Serialized Form

Constructor Summary
GeocoderBean()
           
 
Method Summary
 boolean geocode()
          If developers wish to use other geocoders other than the USAddressGeocoder and IntlAddressGeocoder, they should override this method to call the geocoder of their choice.
 java.lang.String getAddress()
           
 java.lang.String getCity()
           
 java.lang.String getCountry()
           
 double getLatitude()
          Returns the latitude (in decimal form) of the location geocoded.
 double getLongitude()
          Returns the longitude (in decimal form) of the location geocoded.
 java.lang.String getPrecision()
          Returns any precision information provided by the underlying geocoder.
 java.lang.String getState()
           
 java.lang.String getWarning()
          Returns any warnings given by the underlying geocoder.
 java.lang.String getZip()
           
 void setAddress(java.lang.String address)
          Sets the street address of the location to geocode.
 void setCity(java.lang.String city)
          Sets the city name of the location to geocode.
 void setCountry(java.lang.String country)
          Sets the country code for the location to geocode.
 void setState(java.lang.String state)
          Sets the state/province of the location to geocode.
 void setZip(java.lang.String zip)
          Sets the ZIP or Postal code of the location to geocode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeocoderBean

public GeocoderBean()
Method Detail

geocode

public boolean geocode()
If developers wish to use other geocoders other than the USAddressGeocoder and IntlAddressGeocoder, they should override this method to call the geocoder of their choice.

Specified by:
geocode in interface Geocoder
Returns:
True if the geocoding was successful or false if it was not.

getAddress

public java.lang.String getAddress()

setAddress

public void setAddress(java.lang.String address)
Description copied from interface: Geocoder
Sets the street address of the location to geocode.

Specified by:
setAddress in interface Geocoder
Parameters:
address - A valid street address (i.e. 74 Connor Lane)

getCity

public java.lang.String getCity()

setCity

public void setCity(java.lang.String city)
Description copied from interface: Geocoder
Sets the city name of the location to geocode.

Specified by:
setCity in interface Geocoder
Parameters:
city - The US or Internation city name.

getCountry

public java.lang.String getCountry()

setCountry

public void setCountry(java.lang.String country)
Description copied from interface: Geocoder
Sets the country code for the location to geocode.

Specified by:
setCountry in interface Geocoder
Parameters:
country - The ISO compliant 2-character country code.

getState

public java.lang.String getState()

setState

public void setState(java.lang.String state)
Description copied from interface: Geocoder
Sets the state/province of the location to geocode.

Specified by:
setState in interface Geocoder
Parameters:
state - The US state or International province name.

getZip

public java.lang.String getZip()

setZip

public void setZip(java.lang.String zip)
Description copied from interface: Geocoder
Sets the ZIP or Postal code of the location to geocode.

Specified by:
setZip in interface Geocoder
Parameters:
zip - The US ZIP or International postal code.

getLatitude

public double getLatitude()
Description copied from interface: Geocoder
Returns the latitude (in decimal form) of the location geocoded.

Specified by:
getLatitude in interface Geocoder
Returns:
The latitude (in decimal form) of the location as a double.

getLongitude

public double getLongitude()
Description copied from interface: Geocoder
Returns the longitude (in decimal form) of the location geocoded.

Specified by:
getLongitude in interface Geocoder
Returns:
The longitude (in decimal form) of the location as a double.

getPrecision

public java.lang.String getPrecision()
Description copied from interface: Geocoder
Returns any precision information provided by the underlying geocoder. If none is present, or the coder does not support this feature, then this method will return null.

Specified by:
getPrecision in interface Geocoder
Returns:
Any precision information or null if none is available.

getWarning

public java.lang.String getWarning()
Description copied from interface: Geocoder
Returns any warnings given by the underlying geocoder.

Specified by:
getWarning in interface Geocoder
Returns:
Any warning information or null if none is available.