|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttwitter4j.Query
public final class Query
A data class represents search query.
An instance of this class is NOT thread safe.
Instances can be shared across threads, but should not be mutated while a search is ongoing.
Field Summary | |
---|---|
static java.lang.String |
KILOMETERS
|
static java.lang.String |
MILES
|
static java.lang.String |
MIXED
mixed: Include both popular and real time results in the response. |
static java.lang.String |
POPULAR
|
static java.lang.String |
RECENT
|
Constructor Summary | |
---|---|
Query()
|
|
Query(java.lang.String query)
|
Method Summary | |
---|---|
boolean |
equals(java.lang.Object o)
|
Query |
geoCode(GeoLocation location,
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 |
java.lang.String |
getGeocode()
Returns the specified geocode |
java.lang.String |
getLang()
Returns the lang |
java.lang.String |
getLocale()
Returns the language of the query you are sending (only ja is currently effective). |
long |
getMaxId()
Returns tweets with status ids less than the given id. |
int |
getPage()
Returns the page number (starting at 1) to return, up to a max of roughly 1500 results |
java.lang.String |
getQuery()
Returns the specified query |
java.lang.String |
getResultType()
Returns resultType |
int |
getRpp()
Returns the number of tweets to return per page, up to a max of 100 |
java.lang.String |
getSince()
Returns tweets with since the given date. |
long |
getSinceId()
returns sinceId |
java.lang.String |
getUntil()
Returns until |
int |
hashCode()
|
Query |
lang(java.lang.String lang)
restricts tweets to the given language, given by an ISO 639-1 code |
Query |
locale(java.lang.String locale)
Specify the language of the query you are sending (only ja is currently effective). |
Query |
maxId(long maxId)
If specified, returns tweets with status ids less than the given id. |
Query |
page(int page)
sets the page number (starting at 1) to return, up to a max of roughly 1500 results |
Query |
query(java.lang.String query)
Sets the query string |
Query |
resultType(java.lang.String resultType)
If specified, returns tweets included popular or real time or both in the responce |
Query |
rpp(int rpp)
sets the number of tweets to return per page, up to a max of 100 |
void |
setGeoCode(GeoLocation location,
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 |
setLocale(java.lang.String locale)
Specify the language of the query you are sending (only ja is currently effective). |
void |
setMaxId(long maxId)
If specified, returns tweets with status ids less than the given id. |
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 |
setResultType(java.lang.String resultType)
Default value is Query.MIXED if parameter not specified |
void |
setRpp(int rpp)
sets the number of tweets to return per page, up to a max of 100 |
void |
setSince(java.lang.String since)
If specified, returns tweets with since the given date. |
void |
setSinceId(long sinceId)
returns tweets with status ids greater than the given id. |
void |
setUntil(java.lang.String until)
If specified, returns tweets with generated before the given date. |
Query |
since(java.lang.String since)
If specified, returns tweets with since the given date. |
Query |
sinceId(long sinceId)
returns tweets with status ids greater than the given id. |
java.lang.String |
toString()
|
Query |
until(java.lang.String until)
If specified, returns tweets with generated before the given date. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String MILES
public static final java.lang.String KILOMETERS
public static final java.lang.String MIXED
public static final java.lang.String POPULAR
public static final java.lang.String RECENT
Constructor Detail |
---|
public Query()
public Query(java.lang.String query)
Method Detail |
---|
public java.lang.String getQuery()
public void setQuery(java.lang.String query)
query
- the query stringpublic Query query(java.lang.String query)
query
- the query string
public java.lang.String getLang()
public void setLang(java.lang.String lang)
lang
- an ISO 639-1 codepublic Query lang(java.lang.String lang)
lang
- an ISO 639-1 code
public java.lang.String getLocale()
public void setLocale(java.lang.String locale)
locale
- the localepublic Query locale(java.lang.String locale)
locale
- the locale
public long getMaxId()
public void setMaxId(long maxId)
maxId
- maxIdpublic Query maxId(long maxId)
maxId
- maxId
public int getRpp()
public void setRpp(int rpp)
rpp
- the number of tweets to return per pagepublic Query rpp(int rpp)
rpp
- the number of tweets to return per page
public int getPage()
public void setPage(int page)
page
- the page number (starting at 1) to returnpublic Query page(int page)
page
- the page number (starting at 1) to return
public java.lang.String getSince()
public void setSince(java.lang.String since)
since
- sincepublic Query since(java.lang.String since)
since
- since
public long getSinceId()
public void setSinceId(long sinceId)
sinceId
- returns tweets with status ids greater than the given idpublic Query sinceId(long sinceId)
sinceId
- returns tweets with status ids greater than the given id
public java.lang.String getGeocode()
public void setGeoCode(GeoLocation location, double radius, java.lang.String unit)
location
- geo locationradius
- radiusunit
- Query.MILES or Query.KILOMETERSpublic Query geoCode(GeoLocation location, double radius, java.lang.String unit)
location
- geo locationradius
- radiusunit
- Query.MILES or Query.KILOMETERS
public java.lang.String getUntil()
public void setUntil(java.lang.String until)
until
- untilpublic Query until(java.lang.String until)
until
- until
public java.lang.String getResultType()
public void setResultType(java.lang.String resultType)
resultType
- Query.MIXED or Query.POPULAR or Query.RECENTpublic Query resultType(java.lang.String resultType)
resultType
- resultType
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |