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 booleanhasNext()WarcHttpResponsenext()voidremove()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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 aGZWarcRecordif the stream contains compressed records) and aWarcHttpResponsethat 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 aGZWarcRecordif the stream contains compressed records) and aWarcHttpResponsethat 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:
hasNextin interfaceIterator<WarcHttpResponse>
-
next
- Specified by:
nextin interfaceIterator<WarcHttpResponse>
-
remove
public void remove()- Specified by:
removein interfaceIterator<WarcHttpResponse>
-