twitter4j

## Class GeoQuery

- java.lang.Object
- - twitter4j.GeoQuery

All Implemented Interfaces:
  Serializable

    public final class GeoQuery
    extends Object
    implements Serializable

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

### Constructor Summary

Constructors
Constructor and Description
`GeoQuery(GeoLocation location)` Creates a GeoQuery with the specified location
`GeoQuery(String ip)` Creates a GeoQuery with the specified IP address
`GeoQuery(String query, String ip, GeoLocation location)` Creates a GeoQuery with the specified query, ip and location

### Method Summary

All Methods Instance Methods Concrete Methods
`GeoQuery` `accuracy(String accuracy)`
`boolean` `equals(Object o)`
`String` `getAccuracy()`
`String` `getGranularity()`
`String` `getIp()`
`GeoLocation` `getLocation()`
`int` `getMaxResults()`
`String` `getQuery()` Gets the query to filter Place results from geo/search
`GeoQuery` `granularity(String granularity)`
`int` `hashCode()`
`GeoQuery` `maxResults(int maxResults)`
`void` `setAccuracy(String accuracy)` Sets a hint on the "region" in which to search.
`void` `setGranularity(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.
`void` `setQuery(String query)`
`String` `toString()`

### Methods inherited from class java.lang.Object

`getClass, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### GeoQuery

    public GeoQuery(GeoLocation location)

Creates a GeoQuery with the specified location

Parameters:
  `location` - geo location

#### GeoQuery

    public GeoQuery(String ip)

Creates a GeoQuery with the specified IP address

Parameters:
  `ip` - IP address

#### GeoQuery

    public GeoQuery(String query,
                    String ip,
                    GeoLocation location)

Creates a GeoQuery with the specified query, ip and location

Parameters:
  `query` - free-form text to match
  `ip` - IP address
  `location` - geo location

### Method Detail

#### getLocation

    public GeoLocation getLocation()

#### getQuery

    public String getQuery()

Gets the query to filter Place results from geo/search

Returns:
  the query

#### setQuery

    public void setQuery(String query)

#### getIp

    public String getIp()

#### getAccuracy

    public String getAccuracy()

#### setAccuracy

    public void setAccuracy(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(String accuracy)

#### getGranularity

    public String getGranularity()

#### setGranularity

    public void setGranularity(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(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)

#### equals

    public boolean equals(Object o)

Overrides:
  `equals` in class `Object`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`