Package tweetoscope.tweetsFilter
Class LangTweetFilter
java.lang.Object
tweetoscope.tweetsFilter.TweetFilter
tweetoscope.tweetsFilter.LangTweetFilter
- All Implemented Interfaces:
Flow.Publisher<com.twitter.clientlib.model.Tweet>
,Flow.Subscriber<com.twitter.clientlib.model.Tweet>
Filters Tweets according to the detected language.
- Author:
- Virginie Galtier
-
Field Summary
Modifier and TypeFieldDescriptionprotected String
target language to match (examples: "fr", "en"...)Fields inherited from class tweetoscope.tweetsFilter.TweetFilter
subscribers
-
Constructor Summary
ConstructorDescriptionLangTweetFilter
(String language) Creates a filter that tests whether the "language" tag of a Tweet (if it is set) equals a given code. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
match
(com.twitter.clientlib.model.Tweet tweet) Tests the filter conditionsMethods inherited from class tweetoscope.tweetsFilter.TweetFilter
onComplete, onError, onNext, onSubscribe, subscribe
-
Field Details
-
language
target language to match (examples: "fr", "en"...)
-
-
Constructor Details
-
LangTweetFilter
Creates a filter that tests whether the "language" tag of a Tweet (if it is set) equals a given code.- Parameters:
language
- target language to match (example: "en")
-
-
Method Details
-
match
protected boolean match(com.twitter.clientlib.model.Tweet tweet) Description copied from class:TweetFilter
Tests the filter conditions- Specified by:
match
in classTweetFilter
- Parameters:
tweet
- Tweet to examine- Returns:
- true if the Tweet complies with the filter, false if it doesn't match the filter conditions
-