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 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 Iterator
      T - Type of iterated item created by the transformed Iterator
      Parameters:
      source - Source to transform and to close
      transformation - 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 necessary
      Create a transformed view of a CloseableIterator.

      The returned instances enforce CloseableIterator.close() related API contracts.

      Type Parameters:
      T - Iterated type
      U - Transformed type
      Parameters:
      i - Iterator to wrap
      transformation - Transformation to apply
      Returns:
      Transformed view
    • wrap

      public static <T> CloseableIterator<T> wrap(Iterator<T> i)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Wrap an Iterator into a CloseableIterator.

      The returned instances enforce CloseableIterator.close() related API contracts.

      Type Parameters:
      T - Iterated type
      Parameters:
      i - Iterator to wrap
      Returns:
      Wrapped instance
    • wrap

      public static <T> CloseableIterator<T> wrap(Iterator<T> i, Closeable c)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Compose an Iterator and a Closeable into a CloseableIterator.
      Type Parameters:
      T - Iterated type
      Parameters:
      i - Iterator to wrap
      c - Closeable to delegate
      Returns:
      Composite