|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.twitterapime.search.QueryComposer
public final class QueryComposer
This class is responsible for composing queries that are used to be sent to Twitter Search API. This class provides methods for most parameters/operators that are supported by Twitter Search API.
Query
,
SearchDevice
,
Timeline
Method Summary | |
---|---|
static Query |
append(Query q1,
Query q2)
Append a query to another one. |
static Query |
containAll(java.lang.String words)
Create a query to search for tweets that contain all the given words. |
static Query |
containAny(java.lang.String words)
Create a query to search for tweets that contain at least one of the given words. |
static Query |
containExact(java.lang.String phrase)
Create a query to search for tweets that exactly match the given phrase, e.g., "The sky is blue.". |
static Query |
containHashtag(java.lang.String tag)
Create a query to search for tweets that contain the given hashtag, e.g., "twitter". |
static Query |
containLink()
Create a query to search for tweets that contain link(s). |
static Query |
containNone(java.lang.String words)
Create a query to search for tweets that do not contain none of the given words. |
static Query |
containQuestion()
Create a query to search for tweets that contain a question "?". |
static Query |
count(int count)
Create a query to define the tweet count to be returned. |
static Query |
from(java.lang.String person)
Create a query to search for tweets that were sent by a given person, e.g., "twitteruser". |
static Query |
geocode(java.lang.String lat,
java.lang.String lon,
int rad,
java.lang.String unit)
Create a query to search for tweets that were sent from a user that was located within a given radius of the given latitude/longitude. |
static Query |
lang(java.lang.String lang)
Create a query to search for tweets that are from given language, e.g., "en". |
static Query |
maxID(java.lang.String id)
Create a query to search for tweets that are lesser than or equal to a given ID, e.g., "123549789". |
static Query |
negativeAttitude()
Create a query to search for tweets that contain a negative attitude ":(". |
static Query |
page(int number)
Create a query to define the number of tweets page to be returned. |
static Query |
paginate(int resultCount,
int pageNumber)
Create a query to paginate the results to be returned. |
static Query |
positiveAttitude()
Create a query to search for tweets that contain a positive attitude ":)". |
static Query |
reference(java.lang.String person)
Create a query to search for tweets that reference a given person, e.g., "twitteruser". |
static Query |
resultCount(int count)
Create a query to define the tweet count to be returned. |
static Query |
since(java.util.Date date)
Create a query to search for tweets that were sent since a given date, e.g., "01/01/2009". |
static Query |
sinceID(java.lang.String id)
Create a query to search for tweets that are greater than a given ID, e.g., "123549789". |
static Query |
source(java.lang.String appName)
Create a query to search for tweets that were sent from a given source application, e.g., "web". |
static Query |
to(java.lang.String person)
Create a query to search for tweets that were sent to a given person, e.g., "twitteruser". |
static Query |
until(java.util.Date date)
Create a query to search for tweets that were sent until a given date, e.g., "01/10/2009". |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Query append(Query q1, Query q2)
Append a query to another one.
q1
- Query 1.q2
- Query 2.
java.lang.IllegalArgumentException
- If q1/q2 is null.public static Query containAll(java.lang.String words)
Create a query to search for tweets that contain all the given words. To specify more than one word, the words must be separated by a white space, e.g., "java sun microsystems".
words
- The words.
public static Query containExact(java.lang.String phrase)
Create a query to search for tweets that exactly match the given phrase, e.g., "The sky is blue.".
phrase
- The phrase.
public static Query containAny(java.lang.String words)
Create a query to search for tweets that contain at least one of the given words. To specify more than one word, the words must be separated by a white space, e.g., "java .net linux".
words
- The words.
public static Query containNone(java.lang.String words)
Create a query to search for tweets that do not contain none of the given words. To specify more than one word, the words must be separated by a white space, e.g., ".net microsoft".
words
- The words.
public static Query containHashtag(java.lang.String tag)
Create a query to search for tweets that contain the given hashtag, e.g., "twitter".
tag
- The tag.
public static Query from(java.lang.String person)
Create a query to search for tweets that were sent by a given person, e.g., "twitteruser".
person
- The person.
public static Query reference(java.lang.String person)
Create a query to search for tweets that reference a given person, e.g., "twitteruser".
person
- The person.
public static Query to(java.lang.String person)
Create a query to search for tweets that were sent to a given person, e.g., "twitteruser".
person
- The person.
public static Query since(java.util.Date date)
Create a query to search for tweets that were sent since a given date, e.g., "01/01/2009".
This query must be appended to another one, otherwise Twitter Search API may return an error.
date
- The date.
java.lang.IllegalArgumentException
- If date is null.public static Query until(java.util.Date date)
Create a query to search for tweets that were sent until a given date, e.g., "01/10/2009".
This query must be appended to another one, otherwise Twitter Search API may return an error.
date
- The date.
java.lang.IllegalArgumentException
- If date is null.public static Query sinceID(java.lang.String id)
Create a query to search for tweets that are greater than a given ID, e.g., "123549789".
This query must be appended to another one, otherwise Twitter Search API may return an error.
id
- The ID.
public static Query maxID(java.lang.String id)
Create a query to search for tweets that are lesser than or equal to a given ID, e.g., "123549789".
id
- The ID.
public static Query lang(java.lang.String lang)
Create a query to search for tweets that are from given language, e.g., "en".
This query must be appended to another one, otherwise Twitter Search API may return an error.
lang
- The language code.
public static Query source(java.lang.String appName)
Create a query to search for tweets that were sent from a given source application, e.g., "web".
This query must be appended to another one, otherwise Twitter Search API may return an error.
appName
- The application name.
public static Query resultCount(int count)
Create a query to define the tweet count to be returned.
This query must be appended to another one, otherwise Twitter Search API may return an error.
count
- The count.
public static Query count(int count)
Create a query to define the tweet count to be returned.
This query must be used only with REST API search methods. For Search API
search methods, use resultCount(int)
instead.
count
- The count.
public static Query page(int number)
Create a query to define the number of tweets page to be returned.
This query must be appended to another one, otherwise Twitter Search API may return an error.
number
- The page number.
public static Query paginate(int resultCount, int pageNumber)
Create a query to paginate the results to be returned.
This query must be appended to another one, otherwise Twitter Search API may return an error.
resultCount
- The result count.pageNumber
- The page number.
public static Query geocode(java.lang.String lat, java.lang.String lon, int rad, java.lang.String unit)
Create a query to search for tweets that were sent from a user that was located within a given radius of the given latitude/longitude. e.g., "40.757929,-73.985506,25km".
lat
- The latitude.lon
- The longitude.rad
- The radius.unit
- The radius unit ("mi" or "km").
public static Query positiveAttitude()
Create a query to search for tweets that contain a positive attitude ":)".
public static Query negativeAttitude()
Create a query to search for tweets that contain a negative attitude ":(".
public static Query containLink()
Create a query to search for tweets that contain link(s).
This query must be appended to another one, otherwise Twitter Search API may return an error.
public static Query containQuestion()
Create a query to search for tweets that contain a question "?".
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |