twitter4j
Class GeoQuery

java.lang.Object
  extended by twitter4j.GeoQuery
All Implemented Interfaces:
java.io.Serializable

public final class GeoQuery
extends java.lang.Object
implements java.io.Serializable

Since:
Twitter4J 2.1.1
Author:
Yusuke Yamamoto - yusuke at mac.com
See Also:
Serialized Form

Field Summary
private  java.lang.String accuracy
           
static java.lang.String CITY
           
private  java.lang.String granularity
           
private  java.lang.String ip
           
private  GeoLocation location
           
private  int maxResults
           
static java.lang.String NEIGHBORHOOD
           
private static long serialVersionUID
           
 
Constructor Summary
GeoQuery(GeoLocation location)
          Creates a GeoQuery with the specified location
GeoQuery(java.lang.String ip)
          Creates a GeoQuery with the specified IP address
 
Method Summary
 GeoQuery accuracy(java.lang.String accuracy)
           
private  void appendParameter(java.lang.String name, double value, java.util.List<twitter4j.internal.http.HttpParameter> params)
           
private  void appendParameter(java.lang.String name, int value, java.util.List<twitter4j.internal.http.HttpParameter> params)
           
private  void appendParameter(java.lang.String name, java.lang.String value, java.util.List<twitter4j.internal.http.HttpParameter> params)
           
(package private)  twitter4j.internal.http.HttpParameter[] asHttpParameterArray()
           
 boolean equals(java.lang.Object o)
           
 java.lang.String getAccuracy()
           
 java.lang.String getGranularity()
           
 java.lang.String getIp()
           
 GeoLocation getLocation()
           
 int getMaxResults()
           
 GeoQuery granularity(java.lang.String granularity)
           
 int hashCode()
           
 GeoQuery maxResults(int maxResults)
           
 void setAccuracy(java.lang.String accuracy)
          Sets a hint on the "region" in which to search.
 void setGranularity(java.lang.String granularity)
          Sets the minimal granularity of data to return.
 void setMaxResults(int maxResults)
          Sets a hint as to the number of results to return.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

location

private GeoLocation location

ip

private java.lang.String ip

accuracy

private java.lang.String accuracy

granularity

private java.lang.String granularity

maxResults

private int maxResults

NEIGHBORHOOD

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

CITY

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

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

GeoQuery

public GeoQuery(GeoLocation location)
Creates a GeoQuery with the specified location

Parameters:
location -

GeoQuery

public GeoQuery(java.lang.String ip)
Creates a GeoQuery with the specified IP address

Parameters:
ip - IP address
Method Detail

getLocation

public GeoLocation getLocation()

getIp

public java.lang.String getIp()

getAccuracy

public java.lang.String getAccuracy()

setAccuracy

public void setAccuracy(java.lang.String accuracy)
Sets a hint on the "region" in which to search. If a number, then this is a radius in meters, but it can also take a string that is suffixed with ft to specify feet. If this is not passed in, then it is assumed to be 0m. If coming from a device, in practice, this value is whatever accuracy the device has measuring its location (whether it be coming from a GPS, WiFi triangulation, etc.).

Parameters:
accuracy - a hint on the "region" in which to search.

accuracy

public GeoQuery accuracy(java.lang.String accuracy)

getGranularity

public java.lang.String getGranularity()

setGranularity

public void setGranularity(java.lang.String granularity)
Sets the minimal granularity of data to return. If this is not passed in, then neighborhood is assumed. city can also be passed.

Parameters:
granularity - the minimal granularity of data to return

granularity

public GeoQuery granularity(java.lang.String granularity)

getMaxResults

public int getMaxResults()

setMaxResults

public void setMaxResults(int maxResults)
Sets a hint as to the number of results to return. This does not guarantee that the number of results returned will equal max_results, but instead informs how many "nearby" results to return. Ideally, only pass in the number of places you intend to display to the user here.

Parameters:
maxResults - A hint as to the number of results to return.

maxResults

public GeoQuery maxResults(int maxResults)

asHttpParameterArray

twitter4j.internal.http.HttpParameter[] asHttpParameterArray()

appendParameter

private void appendParameter(java.lang.String name,
                             java.lang.String value,
                             java.util.List<twitter4j.internal.http.HttpParameter> params)

appendParameter

private void appendParameter(java.lang.String name,
                             int value,
                             java.util.List<twitter4j.internal.http.HttpParameter> params)

appendParameter

private void appendParameter(java.lang.String name,
                             double value,
                             java.util.List<twitter4j.internal.http.HttpParameter> params)

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object