Class OfflineIterable<T,​U extends T>

java.lang.Object
it.unimi.dsi.io.OfflineIterable<T,​U>
All Implemented Interfaces:
Size64, SafelyCloseable, Closeable, AutoCloseable, Iterable<U>

public class OfflineIterable<T,​U extends T>
extends Object
implements Iterable<U>, SafelyCloseable, Size64
An iterable that offers elements that were previously stored offline using specialized serialization methods. At construction, you provide a serializer that establishes how elements are written offline; after that, you can add elements one at a time or in a bulk way. At any moment, you can get an OfflineIterator on this object that returns all the elements added so far. Note that the returned iterator caches the current number of elements, so each iterator will return just the elements added at the time of its creation.

Warning: The store object provided at construction time is shared by all iterators.

Closing

Both OfflineIterable and OfflineIterator are SafelyCloseable (the latter will close its input stream when hasNext() returns false), but for better resource management you should close them after usage.

Since:
0.9.2
Author:
Sebastiano Vigna