T - The type of the iterated elements.public final class CachingIterable<T>
extends java.lang.Object
implements java.lang.Iterable<T>
Iterable that stores the result of a given Iterator and allows to re-iterate the values. This is meant to speed up repeated access to slow
iterators.
Note that CachingIterable needs to synchronize access to the original iterator (and an internal list), which causes some overhead. So only use this
if reiterating the original source is impossible or expensive (compared to the number of times you need to reiterate).| Constructor and Description |
|---|
CachingIterable(java.util.Iterator<T> iterator) |