Package it.unimi.dsi.law.warc.io
Class HttpResponseFilteredIterator
java.lang.Object
it.unimi.dsi.law.warc.io.HttpResponseFilteredIterator
- All Implemented Interfaces:
Iterator<WarcHttpResponse>
public class HttpResponseFilteredIterator extends Object implements Iterator<WarcHttpResponse>
A class to iterate over WARC files getting only records corresponding to
HttpResponse
that satisfy a given filter.-
Constructor Summary
Constructors Constructor Description HttpResponseFilteredIterator(FastBufferedInputStream in, WarcRecord record, WarcHttpResponse response, Filter<HttpResponse> filter2)
Builds the filtered iterator.HttpResponseFilteredIterator(FastBufferedInputStream in, WarcRecord record, WarcHttpResponse response, Filter<HttpResponse> filter, ProgressLogger pl)
Builds the filtered iterator. -
Method Summary
Modifier and Type Method Description boolean
hasNext()
WarcHttpResponse
next()
void
remove()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
HttpResponseFilteredIterator
public HttpResponseFilteredIterator(FastBufferedInputStream in, WarcRecord record, WarcHttpResponse response, Filter<HttpResponse> filter, ProgressLogger pl)Builds the filtered iterator.This constructor takes a
WarcRecord
(or aGZWarcRecord
if the stream contains compressed records) and aWarcHttpResponse
that will be reused (and thus modified) by calls tohasNext()
andnext()
.- Parameters:
in
- the input stream.record
- the record used for reading.response
- the repsonse used for reading.filter
- the filter.pl
- the progress logger.
-
HttpResponseFilteredIterator
public HttpResponseFilteredIterator(FastBufferedInputStream in, WarcRecord record, WarcHttpResponse response, Filter<HttpResponse> filter2)Builds the filtered iterator.This constructor takes a
WarcRecord
(or aGZWarcRecord
if the stream contains compressed records) and aWarcHttpResponse
that will be reused (and thus modified) by calls tohasNext()
andnext()
.- Parameters:
in
- the input stream.record
- the record used for reading.response
- the repsonse used for reading.filter2
- the filter.
-
-
Method Details
-
hasNext
public boolean hasNext()- Specified by:
hasNext
in interfaceIterator<WarcHttpResponse>
-
next
- Specified by:
next
in interfaceIterator<WarcHttpResponse>
-
remove
public void remove()- Specified by:
remove
in interfaceIterator<WarcHttpResponse>
-