org.opengts.geocoder
Class GeocodeProviderAdapter

java.lang.Object
  extended by org.opengts.geocoder.GeocodeProviderAdapter
All Implemented Interfaces:
GeocodeProvider

public abstract class GeocodeProviderAdapter
extends java.lang.Object
implements GeocodeProvider


Field Summary
static java.lang.String _PROP_isEnabled
           
static java.lang.String PROP_GeocodeProvider_
           
 
Constructor Summary
GeocodeProviderAdapter(java.lang.String name, java.lang.String key, RTProperties rtProps)
          Constructor
 
Method Summary
protected  java.lang.String[] _getUserPass()
          Parse and return the user name and password
static void _main()
           
 java.lang.String getAuthorization()
          Gets the authorization key of this GeocodeProvider
abstract  GeoPoint getGeocode(java.lang.String address, java.lang.String country)
          Returns GeoPoint of specified address
 java.lang.String getName()
          Gets the name of this GeocodeProvider
protected  java.lang.String getPassword()
          Return authorization password.
 RTProperties getProperties()
          Gets the properties for this ReverseGeocodeProvider
protected  java.lang.String getUsername()
          Return authorization username.
 boolean isEnabled()
          Returns true if this ReverseGeocodeProvider is enabled
abstract  boolean isFastOperation()
          Return true if this operation will take less than 20ms to complete (The returned value is used to determine whether the 'getGeocode' operation should be performed immediately, or lazily.)
static void main(java.lang.String[] args)
           
 void setAuthorization(java.lang.String key)
          Sets the authorization key of this GeocodeProvider
 void setName(java.lang.String name)
          Sets the name of this GeocodeProvider
 void setProperties(RTProperties rtProps)
          Sets the properties for this ReverseGeocodeProvider
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_GeocodeProvider_

public static final java.lang.String PROP_GeocodeProvider_
See Also:
Constant Field Values

_PROP_isEnabled

public static final java.lang.String _PROP_isEnabled
See Also:
Constant Field Values
Constructor Detail

GeocodeProviderAdapter

public GeocodeProviderAdapter(java.lang.String name,
                              java.lang.String key,
                              RTProperties rtProps)
Constructor

Parameters:
name - The name of this GeocodeProvider
key - The access key (may be null)
rtProps - The properties (may be null)
Method Detail

setName

public void setName(java.lang.String name)
Sets the name of this GeocodeProvider

Parameters:
name - The name of this geocode provider

getName

public java.lang.String getName()
Gets the name of this GeocodeProvider

Specified by:
getName in interface GeocodeProvider
Returns:
The name of this geocode provider

setAuthorization

public void setAuthorization(java.lang.String key)
Sets the authorization key of this GeocodeProvider

Parameters:
key - The key of this geocode provider

getAuthorization

public java.lang.String getAuthorization()
Gets the authorization key of this GeocodeProvider

Returns:
The access key of this geocode provider

_getUserPass

protected java.lang.String[] _getUserPass()
Parse and return the user name and password

Returns:
The username and password (always a 2 element array)

getUsername

protected java.lang.String getUsername()
Return authorization username. This assumes that the username and password are separated by a ':' character

Returns:
The username

getPassword

protected java.lang.String getPassword()
Return authorization password. This assumes that the username and password are separated by a ':' character

Returns:
The password

setProperties

public void setProperties(RTProperties rtProps)
Sets the properties for this ReverseGeocodeProvider

Parameters:
rtProps - The properties for this reverse-geocode provider

getProperties

public RTProperties getProperties()
Gets the properties for this ReverseGeocodeProvider

Returns:
The properties for this reverse-geocode provider

isEnabled

public boolean isEnabled()
Returns true if this ReverseGeocodeProvider is enabled

Specified by:
isEnabled in interface GeocodeProvider
Returns:
True if enabled

isFastOperation

public abstract boolean isFastOperation()
Description copied from interface: GeocodeProvider
Return true if this operation will take less than 20ms to complete (The returned value is used to determine whether the 'getGeocode' operation should be performed immediately, or lazily.)

Specified by:
isFastOperation in interface GeocodeProvider

getGeocode

public abstract GeoPoint getGeocode(java.lang.String address,
                                    java.lang.String country)
Description copied from interface: GeocodeProvider
Returns GeoPoint of specified address

Specified by:
getGeocode in interface GeocodeProvider

_main

public static void _main()

main

public static void main(java.lang.String[] args)