LimeWire Consolidated API

org.limewire.geocode
Class AbstractGeocoder

java.lang.Object
  extended by org.limewire.geocode.AbstractGeocoder
All Implemented Interfaces:
Geocoder

public abstract class AbstractGeocoder
extends Object
implements Geocoder


Constructor Summary
AbstractGeocoder()
           
 
Method Summary
 void clear()
          Clears the saved information, including that in the client.
 GeocodeInformation getGeocodeInformation()
          Returns the GeocodeInformationImpl obtained from Geocoder.initialize().
 boolean hasFailed()
          Returns true if we've called Geocoder.initialize() and something happened.
 boolean isReady()
          Returns true if Geocoder.getGeocodeInformation() will return a non-null value or Geocoder.hasFailed() is true.
protected  void setGeocodeInformation(InputStream is)
          Read the lines and set the fields appropriately.
protected  void setInvalid(Throwable reasonForFailure)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.limewire.geocode.Geocoder
initialize
 

Constructor Detail

AbstractGeocoder

public AbstractGeocoder()
Method Detail

getGeocodeInformation

public GeocodeInformation getGeocodeInformation()
Description copied from interface: Geocoder
Returns the GeocodeInformationImpl obtained from Geocoder.initialize().

Specified by:
getGeocodeInformation in interface Geocoder
Returns:
the GeocodeInformationImpl obtained from Geocoder.initialize()

isReady

public boolean isReady()
Description copied from interface: Geocoder
Returns true if Geocoder.getGeocodeInformation() will return a non-null value or Geocoder.hasFailed() is true.

Specified by:
isReady in interface Geocoder
Returns:
true if Geocoder.getGeocodeInformation() will return a non-null value or Geocoder.hasFailed() is true

hasFailed

public boolean hasFailed()
Description copied from interface: Geocoder
Returns true if we've called Geocoder.initialize() and something happened.

Specified by:
hasFailed in interface Geocoder
Returns:
true if we've called Geocoder.initialize() and something happened

clear

public void clear()
Description copied from interface: Geocoder
Clears the saved information, including that in the client. This is mainly used for testing.

Specified by:
clear in interface Geocoder

setInvalid

protected void setInvalid(Throwable reasonForFailure)

setGeocodeInformation

protected void setGeocodeInformation(InputStream is)
                              throws IOException
Read the lines and set the fields appropriately. The fields will be name/value pairs separated by tabs (i.e. \t). The name correspond to the set method on GeocodeInformationImpl.

For example: countryName United States would cause a call to g.setCountryName("United States").

Parameters:
is - input lines of the form
<first line ignored>
( String[Name] <tab> String[Value] <newline> )
[ repeat name/value pairs ]
Throws:
IOException

LimeWire Consolidated API

Copyright © 2009. All Rights Reserved.