Package org.openrefine.util
Interface CloseableIterable<T>
-
- All Known Subinterfaces:
ChangeData<T>
- All Known Implementing Classes:
CloseableIterable.Wrapper
,LocalChangeData
,LoggedChangeData
,TestingChangeData
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface CloseableIterable<T>
A collection which can be iterated on multiple times, using aCloseableIterator
. This interface does not extendIterable
because it would then make it possible to treat aCloseableIterable
as anIterable
, discarding the information that the derived iterators need closing. It is however possible to represent anyIterable
as aCloseableIterable
using theof(Iterable)
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
CloseableIterable.Wrapper<T>
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default CloseableIterable<T>
drop(int n)
static <T> CloseableIterable<T>
empty()
default CloseableIterable<T>
filter(Predicate<? super T> predicate)
CloseableIterator<T>
iterator()
default <U> CloseableIterable<U>
map(Function<? super T,? extends U> function)
static <T> CloseableIterable<T>
of(Iterable<T> iterable)
default CloseableIterable<T>
take(int n)
-
-
-
Method Detail
-
iterator
CloseableIterator<T> iterator()
-
of
static <T> CloseableIterable<T> of(Iterable<T> iterable)
-
empty
static <T> CloseableIterable<T> empty()
-
drop
default CloseableIterable<T> drop(int n)
-
take
default CloseableIterable<T> take(int n)
-
map
default <U> CloseableIterable<U> map(Function<? super T,? extends U> function)
-
filter
default CloseableIterable<T> filter(Predicate<? super T> predicate)
-
-