T
- Type of items in the streampublic abstract class AbstractTwitterStatusesFilterDataset<T> extends BlockingDroppingBufferedStream<T> implements StreamingDataset<T>
This class is abstract in terms of the object the stream consumes. Instances of this class can construct the specific object they require for each twitter status using:
Constructor and Description |
---|
AbstractTwitterStatusesFilterDataset(twitter4j.FilterQuery query,
TwitterAPIToken token,
BlockingDroppingQueue<T> buffer)
Construct with the given Twitter API credentials and buffer
|
Modifier and Type | Method and Description |
---|---|
T |
getRandomInstance() |
int |
numInstances()
Returns the number of instances in this dataset.
|
protected abstract void |
registerStatus(twitter4j.Status status,
String json)
Handle the given incoming status and optionally
BlockingDroppingBufferedStream.register(Object)
it with the stream. |
close, getBuffer, hasNext, next, register
filter, forEach, forEach, forEach, iterator, map, map, parallelForEach, parallelForEach, remove, transform
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
filter, forEach, forEach, forEach, map, map, parallelForEach, parallelForEach, transform
forEachRemaining, hasNext, next, remove
forEach, iterator, spliterator
public AbstractTwitterStatusesFilterDataset(twitter4j.FilterQuery query, TwitterAPIToken token, BlockingDroppingQueue<T> buffer)
query
- the querytoken
- the Twitter api authentication credentialsbuffer
- the backing buffer for storing data before consumption from
the streamprotected abstract void registerStatus(twitter4j.Status status, String json) throws InterruptedException
BlockingDroppingBufferedStream.register(Object)
it with the stream.status
- the parsed Status
json
- the json stringInterruptedException
public T getRandomInstance()
getRandomInstance
in interface Dataset<T>
public int numInstances()
Dataset
numInstances
in interface Dataset<T>