Package it.unimi.dsi.law.warc.io
Class WarcFilteredIterator
java.lang.Object
it.unimi.dsi.law.warc.io.WarcFilteredIterator
- All Implemented Interfaces:
Iterator<WarcRecord>
public class WarcFilteredIterator extends Object implements Iterator<WarcRecord>
A class to iterate over WARC files getting only records that satisfy a given filter.
-
Constructor Summary
Constructors Constructor Description WarcFilteredIterator(FastBufferedInputStream in, WarcRecord record, Filter<WarcRecord> filter)Builds the filtered iterator.WarcFilteredIterator(FastBufferedInputStream in, WarcRecord record, Filter<WarcRecord> filter, ProgressLogger pl)Builds the filtered iterator. -
Method Summary
Modifier and Type Method Description booleanhasNext()WarcRecordnext()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
-
WarcFilteredIterator
public WarcFilteredIterator(FastBufferedInputStream in, WarcRecord record, Filter<WarcRecord> filter, ProgressLogger pl)Builds the filtered iterator.This constructor takes a
WarcRecord(or aGZWarcRecordif the stream contains compressed records) that will be reused (and thus modified) by calls tohasNext()andnext().- Parameters:
in- the input stream.record- the record used for reading.filter- the filter.pl- a (pre-initialized)ProgressLoggerthat will be updated during reads.
-
WarcFilteredIterator
public WarcFilteredIterator(FastBufferedInputStream in, WarcRecord record, Filter<WarcRecord> filter)Builds the filtered iterator.This constructor takes a
WarcRecord(or aGZWarcRecordif the stream contains compressed records) that will be reused (and thus modified) by calls tohasNext()andnext().- Parameters:
in- the input stream.record- the record used for reading.filter- the filter.
-
-
Method Details
-
hasNext
public boolean hasNext()- Specified by:
hasNextin interfaceIterator<WarcRecord>
-
next
- Specified by:
nextin interfaceIterator<WarcRecord>
-
remove
public void remove()- Specified by:
removein interfaceIterator<WarcRecord>
-