public interface CloseableIterator<T> extends Iterator<T>, Closeable
Iterator
that implements Closeable
which allows a Graph
implementation
that hold open resources to provide the user the option to release those resources.Modifier and Type | Method and Description |
---|---|
static <T> CloseableIterator<T> |
asCloseable(Iterator<T> iterator)
Wraps an existing
Iterator in a CloseableIterator . |
default void |
close() |
static <T> void |
closeIterator(Iterator<T> iterator) |
forEachRemaining, hasNext, next, remove
static <T> CloseableIterator<T> asCloseable(Iterator<T> iterator)
Iterator
in a CloseableIterator
. If the Iterator
is already of that
type then it will simply be returned as-is.default void close()
close
in interface AutoCloseable
close
in interface Closeable
static <T> void closeIterator(Iterator<T> iterator)
Copyright © 2013–2020 Apache Software Foundation. All rights reserved.