com.lamatek.tags.google.beans
Class Ip2GeoCoder

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

public class Ip2GeoCoder
extends java.lang.Object
implements IPCoder, java.io.Serializable

Ip2GeoCoder

Version:
0.40 This implementation of IPCoder attempts to geocode an IP address using the Ip2Geo web service. Developers should not override this method, but should rather create their own classes that implement IPCoder.
Author:
Tom Cole
See Also:
Serialized Form

Constructor Summary
Ip2GeoCoder()
           
 
Method Summary
 boolean geocode()
          Attempts to geocode the current IP address.
 double getLatitude()
          Returns the latitude (in decimal form) of the IP as a double.
 double getLongitude()
          Returns the longitude (in decimal form) of the IP as a double.
 void setIp(java.lang.String ip)
          Sets the ip address to geocode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Ip2GeoCoder

public Ip2GeoCoder()
Method Detail

setIp

public void setIp(java.lang.String ip)
Description copied from interface: IPCoder
Sets the ip address to geocode.

Specified by:
setIp in interface IPCoder
Parameters:
ip - The IPv4 or IPv6 address to geocode.

geocode

public boolean geocode()
Description copied from interface: IPCoder
Attempts to geocode the current IP address.

Specified by:
geocode in interface IPCoder
Returns:
True if the IP was geocoded or false if it was not.

getLongitude

public double getLongitude()
Description copied from interface: IPCoder
Returns the longitude (in decimal form) of the IP as a double.

Specified by:
getLongitude in interface IPCoder
Returns:
Longitude as a double.

getLatitude

public double getLatitude()
Description copied from interface: IPCoder
Returns the latitude (in decimal form) of the IP as a double.

Specified by:
getLatitude in interface IPCoder
Returns:
Latitude as a double.