Package com.chemaxon.calculations.io
Class CloseableIterators
java.lang.Object
com.chemaxon.calculations.io.CloseableIterators
@Beta
@PublicAPI
@Deprecated(forRemoval=true)
@SubjectToRemoval(date=JAN_01_2025)
public final class CloseableIterators
extends Object
Deprecated, for removal: This API element is subject to removal in a future version.
Will be removed without replacement.
Utility class.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T,
U> CloseableIterator<U> transform
(CloseableIterator<T> i, Function<T, U> transformation) Deprecated.CloseableIterator.transform(java.util.function.Function)
provides default method making this utility not necessarystatic <T> CloseableIterator<T>
Deprecated, for removal: This API element is subject to removal in a future version.Wrap anIterator
into aCloseableIterator
.static <T> CloseableIterator<T>
Deprecated, for removal: This API element is subject to removal in a future version.static <S extends Closeable,
T>
CloseableIterator<T>wrapTransformed
(S source, Function<? super S, Iterator<T>> transformation) Deprecated, for removal: This API element is subject to removal in a future version.Make a CloseableIterator from an Iterator resulting from the transformation of a Closeable.
-
Method Details
-
wrapTransformed
public static <S extends Closeable,T> CloseableIterator<T> wrapTransformed(S source, Function<? super S, Iterator<T>> transformation) Deprecated, for removal: This API element is subject to removal in a future version.Make a CloseableIterator from an Iterator resulting from the transformation of a Closeable.- Type Parameters:
S
- Type of source which is Closeable and will be transformed into an IteratorT
- Type of iterated item created by the transformed Iterator- Parameters:
source
- Source to transform and to closetransformation
- Transformation- Returns:
- Result
-
transform
@Deprecated public static <T,U> CloseableIterator<U> transform(CloseableIterator<T> i, Function<T, U> transformation) Deprecated.CloseableIterator.transform(java.util.function.Function)
provides default method making this utility not necessaryCreate a transformed view of a CloseableIterator.The returned instances enforce
CloseableIterator.close()
related API contracts.- Type Parameters:
T
- Iterated typeU
- Transformed type- Parameters:
i
- Iterator to wraptransformation
- Transformation to apply- Returns:
- Transformed view
-
wrap
Deprecated, for removal: This API element is subject to removal in a future version.Wrap anIterator
into aCloseableIterator
.The returned instances enforce
CloseableIterator.close()
related API contracts.- Type Parameters:
T
- Iterated type- Parameters:
i
- Iterator to wrap- Returns:
- Wrapped instance
-
wrap
Deprecated, for removal: This API element is subject to removal in a future version.- Type Parameters:
T
- Iterated type- Parameters:
i
- Iterator to wrapc
- Closeable to delegate- Returns:
- Composite
-