twitter4j
Class Query

java.lang.Object
  extended by twitter4j.Query

public class Query
extends java.lang.Object

A data class represents search query.

Author:
Yusuke Yamamoto - yusuke at mac.com
See Also:
Twitter API / Search API Documentation, Twitter API / Search Operators

Field Summary
private  java.lang.String geocode
           
static java.lang.String KILOMETERS
           
private  java.lang.String lang
           
static java.lang.String MILES
           
private  int page
           
private  java.lang.String query
           
private  int rpp
           
private  long sinceId
           
 
Constructor Summary
Query()
           
Query(java.lang.String query)
           
 
Method Summary
private  void appendParameter(java.lang.String name, long value, java.util.List<twitter4j.http.PostParameter> params)
           
private  void appendParameter(java.lang.String name, java.lang.String value, java.util.List<twitter4j.http.PostParameter> params)
           
 twitter4j.http.PostParameter[] asPostParameters()
           
 boolean equals(java.lang.Object o)
           
 java.lang.String getGeocode()
           
 java.lang.String getLang()
           
 int getPage()
           
 java.lang.String getQuery()
           
 int getRpp()
           
 long getSinceId()
           
 int hashCode()
           
 void setGeoCode(double latitude, double longtitude, double radius, java.lang.String unit)
          returns tweets by users located within a given radius of the given latitude/longitude, where the user's location is taken from their Twitter profile
 void setLang(java.lang.String lang)
          restricts tweets to the given language, given by an ISO 639-1 code
 void setPage(int page)
          sets the page number (starting at 1) to return, up to a max of roughly 1500 results
 void setQuery(java.lang.String query)
          Sets the query string
 void setRpp(int rpp)
          sets the number of tweets to return per page, up to a max of 100
 void setSinceId(long sinceId)
          returns tweets with status ids greater than the given id.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

query

private java.lang.String query

lang

private java.lang.String lang

rpp

private int rpp

page

private int page

sinceId

private long sinceId

geocode

private java.lang.String geocode

MILES

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

KILOMETERS

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

Query

public Query()

Query

public Query(java.lang.String query)
Method Detail

getQuery

public java.lang.String getQuery()

setQuery

public void setQuery(java.lang.String query)
Sets the query string

Parameters:
query - - the query string
See Also:
Twitter API / Search API Documentation, Twitter API / Search Operators

getLang

public java.lang.String getLang()

setLang

public void setLang(java.lang.String lang)
restricts tweets to the given language, given by an ISO 639-1 code

Parameters:
lang - an ISO 639-1 code

getRpp

public int getRpp()

setRpp

public void setRpp(int rpp)
sets the number of tweets to return per page, up to a max of 100

Parameters:
rpp - the number of tweets to return per page

getPage

public int getPage()

setPage

public void setPage(int page)
sets the page number (starting at 1) to return, up to a max of roughly 1500 results

Parameters:
page - - the page number (starting at 1) to return

getSinceId

public long getSinceId()

setSinceId

public void setSinceId(long sinceId)
returns tweets with status ids greater than the given id.

Parameters:
sinceId - - returns tweets with status ids greater than the given id

getGeocode

public java.lang.String getGeocode()

setGeoCode

public void setGeoCode(double latitude,
                       double longtitude,
                       double radius,
                       java.lang.String unit)
returns tweets by users located within a given radius of the given latitude/longitude, where the user's location is taken from their Twitter profile

Parameters:
latitude - latitude
longtitude - longtitude
radius - radius
unit - Query.MILES or Query.KILOMETERS

asPostParameters

public twitter4j.http.PostParameter[] asPostParameters()

appendParameter

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

appendParameter

private void appendParameter(java.lang.String name,
                             long value,
                             java.util.List<twitter4j.http.PostParameter> 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