Package org.dmfs.jems2.iterable
Class Frozen<T>
- java.lang.Object
-
- org.dmfs.jems2.iterable.Frozen<T>
-
- All Implemented Interfaces:
java.lang.Iterable<T>
public final class Frozen<T> extends java.lang.Object implements java.lang.Iterable<T>AnIterablestores the elements of the givenIteratororIterablein order to allow re-iterating them.This is meant to speed up repeated access to slow iterators.
Note that
Frozenneeds 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).
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Iterator<T>iterator()
-