Class Iterations

  • Direct Known Subclasses:
    QueryResults

    @Deprecated(since="4.1.0")
    public class Iterations
    extends java.lang.Object
    Deprecated.
    This class consists exclusively of static methods that operate on or return Iterations. It is the Iteration-equivalent of java.util.Collections.
    • Constructor Summary

      Constructors 
      Constructor Description
      Iterations()
      Deprecated.
       
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static <E,​X extends java.lang.Exception,​C extends java.util.Collection<E>>
      C
      addAll​(CloseableIteration<? extends E,​X> iter, C collection)
      Deprecated.
      Adds all elements from the supplied CloseableIteration to the specified collection then closes the CloseableIteration.
      static <E,​X extends java.lang.Exception,​C extends java.util.Collection<E>>
      C
      addAll​(Iteration<? extends E,​X> iter, C collection)
      Deprecated, for removal: This API element is subject to removal in a future version.
      static <E,​X extends java.lang.Exception>
      java.util.List<E>
      asList​(CloseableIteration<? extends E,​X> iter)
      Deprecated.
      Get a List containing all elements obtained from the specified iteration.
      static <E,​X extends java.lang.Exception>
      java.util.List<E>
      asList​(Iteration<? extends E,​X> iter)
      Deprecated, for removal: This API element is subject to removal in a future version.
      static <E,​X extends java.lang.Exception>
      java.util.Set<E>
      asSet​(CloseableIteration<? extends E,​? extends X> iteration, java.util.function.Supplier<java.util.Set<E>> setMaker)
      Deprecated.
      Get a Set containing all elements obtained from the specified iteration.
      static <E,​X extends java.lang.Exception>
      java.util.Set<E>
      asSet​(CloseableIteration<? extends E,​X> iter)
      Deprecated.
      Get a Set containing all elements obtained from the specified iteration.
      static <E,​X extends java.lang.Exception>
      java.util.Set<E>
      asSet​(Iteration<? extends E,​? extends X> iteration, java.util.function.Supplier<java.util.Set<E>> setMaker)
      Deprecated, for removal: This API element is subject to removal in a future version.
      static <E,​X extends java.lang.Exception>
      java.util.Set<E>
      asSet​(Iteration<? extends E,​X> iter)
      Deprecated, for removal: This API element is subject to removal in a future version.
      static <X extends java.lang.Exception>
      void
      closeCloseable​(Iteration<?,​X> iteration)
      Deprecated, for removal: This API element is subject to removal in a future version.
      static <T> java.util.stream.Stream<T> stream​(CloseableIteration<T,​? extends java.lang.Exception> iteration)
      Deprecated.
      Get a sequential Stream with the supplied CloseableIteration as its source.
      static <T> java.util.stream.Stream<T> stream​(Iteration<T,​? extends java.lang.Exception> iteration)
      Deprecated, for removal: This API element is subject to removal in a future version.
      static <X extends java.lang.Exception>
      java.lang.String
      toString​(CloseableIteration<?,​X> iteration, java.lang.String separator)
      Deprecated.
      Converts a CloseableIteration to a string by concatenating all the string representations of objects in the iteration, divided by a separator.
      static <X extends java.lang.Exception>
      void
      toString​(CloseableIteration<?,​X> iteration, java.lang.String separator, java.lang.StringBuilder sb)
      Deprecated.
      Converts a CloseableIteration to a string by concatenating all the string representations of objects in the iteration, divided by a separator.
      static <X extends java.lang.Exception>
      java.lang.String
      toString​(Iteration<?,​X> iteration, java.lang.String separator)
      Deprecated, for removal: This API element is subject to removal in a future version.
      static <X extends java.lang.Exception>
      void
      toString​(Iteration<?,​X> iteration, java.lang.String separator, java.lang.StringBuilder sb)
      Deprecated, for removal: This API element is subject to removal in a future version.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Iterations

        public Iterations()
        Deprecated.
    • Method Detail

      • asList

        @Deprecated(since="4.1.0",
                    forRemoval=true)
        public static <E,​X extends java.lang.Exception> java.util.List<E> asList​(Iteration<? extends E,​X> iter)
                                                                                throws X extends java.lang.Exception
        Deprecated, for removal: This API element is subject to removal in a future version.
        Get a List containing all elements obtained from the specified iteration.
        Parameters:
        iter - the iteration to get the elements from
        Returns:
        a List containing all elements obtained from the specified iteration.
        Throws:
        X extends java.lang.Exception
      • asList

        public static <E,​X extends java.lang.Exception> java.util.List<E> asList​(CloseableIteration<? extends E,​X> iter)
                                                                                throws X extends java.lang.Exception
        Deprecated.
        Get a List containing all elements obtained from the specified iteration.
        Parameters:
        iter - the CloseableIteration to get the elements from
        Returns:
        a List containing all elements obtained from the specified iteration.
        Throws:
        X extends java.lang.Exception
      • asSet

        @Deprecated(since="4.1.0",
                    forRemoval=true)
        public static <E,​X extends java.lang.Exception> java.util.Set<E> asSet​(Iteration<? extends E,​X> iter)
                                                                              throws X extends java.lang.Exception
        Deprecated, for removal: This API element is subject to removal in a future version.
        Get a Set containing all elements obtained from the specified iteration.
        Parameters:
        iter - the iteration to get the elements from
        Returns:
        a Set containing all elements obtained from the specified iteration.
        Throws:
        X extends java.lang.Exception
      • asSet

        public static <E,​X extends java.lang.Exception> java.util.Set<E> asSet​(CloseableIteration<? extends E,​X> iter)
                                                                              throws X extends java.lang.Exception
        Deprecated.
        Get a Set containing all elements obtained from the specified iteration.
        Parameters:
        iter - the CloseableIteration to get the elements from
        Returns:
        a Set containing all elements obtained from the specified iteration.
        Throws:
        X extends java.lang.Exception
      • addAll

        @Deprecated(since="4.1.0",
                    forRemoval=true)
        public static <E,​X extends java.lang.Exception,​C extends java.util.Collection<E>> C addAll​(Iteration<? extends E,​X> iter,
                                                                                                               C collection)
                                                                                                        throws X extends java.lang.Exception
        Deprecated, for removal: This API element is subject to removal in a future version.
        Adds all elements from the supplied iteration to the specified collection. If the supplied iteration is an instance of CloseableIteration it is automatically closed after consumption.
        Parameters:
        iter - An iteration containing elements to add to the container. If the iteration is an instance of CloseableIteration it is automatically closed after consumption.
        collection - The collection to add the elements to.
        Returns:
        The collection object that was supplied to this method.
        Throws:
        X extends java.lang.Exception
      • addAll

        public static <E,​X extends java.lang.Exception,​C extends java.util.Collection<E>> C addAll​(CloseableIteration<? extends E,​X> iter,
                                                                                                               C collection)
                                                                                                        throws X extends java.lang.Exception
        Deprecated.
        Adds all elements from the supplied CloseableIteration to the specified collection then closes the CloseableIteration.
        Parameters:
        iter - A CloseableIteration containing elements to add to the container.
        collection - The collection to add the elements to.
        Returns:
        The collection object that was supplied to this method.
        Throws:
        X extends java.lang.Exception
      • stream

        @Deprecated(since="4.1.0",
                    forRemoval=true)
        public static <T> java.util.stream.Stream<T> stream​(Iteration<T,​? extends java.lang.Exception> iteration)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Get a sequential Stream with the supplied Iteration as its source. If the source iteration is a CloseableIteration, it will be automatically closed by the stream when done. Any checked exceptions thrown at any point during stream processing will be propagated wrapped in a RuntimeException.
        Parameters:
        iteration - a source Iteration for the stream.
        Returns:
        a sequential Stream object which can be used to process the data from the source iteration.
      • stream

        public static <T> java.util.stream.Stream<T> stream​(CloseableIteration<T,​? extends java.lang.Exception> iteration)
        Deprecated.
        Get a sequential Stream with the supplied CloseableIteration as its source. The source iteration will be automatically closed by the stream when done. Any checked exceptions thrown at any point during stream processing will be propagated wrapped in a RuntimeException.
        Parameters:
        iteration - a source CloseableIteration for the stream.
        Returns:
        a sequential Stream object which can be used to process the data from the source iteration.
      • closeCloseable

        @Deprecated(since="4.1.0",
                    forRemoval=true)
        public static <X extends java.lang.Exception> void closeCloseable​(Iteration<?,​X> iteration)
                                                                   throws X extends java.lang.Exception
        Deprecated, for removal: This API element is subject to removal in a future version.
        Closes the supplied iteration if it is an instance of CloseableIteration, otherwise the request is ignored.
        Parameters:
        iteration - The iteration that should be closed.
        Throws:
        X extends java.lang.Exception
      • toString

        @Deprecated(since="4.1.0",
                    forRemoval=true)
        public static <X extends java.lang.Exception> java.lang.String toString​(Iteration<?,​X> iteration,
                                                                                java.lang.String separator)
                                                                         throws X extends java.lang.Exception
        Deprecated, for removal: This API element is subject to removal in a future version.
        Converts an iteration to a string by concatenating all of the string representations of objects in the Iteration, divided by a separator.
        Parameters:
        iteration - An iteration over arbitrary objects that are expected to implement Object.toString().
        separator - The separator to insert between the object strings.
        Returns:
        A String representation of the objects provided by the supplied iteration.
        Throws:
        X extends java.lang.Exception
      • toString

        public static <X extends java.lang.Exception> java.lang.String toString​(CloseableIteration<?,​X> iteration,
                                                                                java.lang.String separator)
                                                                         throws X extends java.lang.Exception
        Deprecated.
        Converts a CloseableIteration to a string by concatenating all the string representations of objects in the iteration, divided by a separator.
        Parameters:
        iteration - A CloseableIteration over arbitrary objects that are expected to implement Object.toString().
        separator - The separator to insert between the object strings.
        Returns:
        A String representation of the objects provided by the supplied iteration.
        Throws:
        X extends java.lang.Exception
      • toString

        @Deprecated(since="4.1.0",
                    forRemoval=true)
        public static <X extends java.lang.Exception> void toString​(Iteration<?,​X> iteration,
                                                                    java.lang.String separator,
                                                                    java.lang.StringBuilder sb)
                                                             throws X extends java.lang.Exception
        Deprecated, for removal: This API element is subject to removal in a future version.
        Converts an iteration to a string by concatenating all the string representations of objects in the Iteration, divided by a separator.
        Parameters:
        iteration - An iteration over arbitrary objects that are expected to implement Object.toString().
        separator - The separator to insert between the object strings.
        sb - A StringBuilder to append the iteration string to.
        Throws:
        X extends java.lang.Exception
      • toString

        public static <X extends java.lang.Exception> void toString​(CloseableIteration<?,​X> iteration,
                                                                    java.lang.String separator,
                                                                    java.lang.StringBuilder sb)
                                                             throws X extends java.lang.Exception
        Deprecated.
        Converts a CloseableIteration to a string by concatenating all the string representations of objects in the iteration, divided by a separator.
        Parameters:
        iteration - A CloseableIteration over arbitrary objects that are expected to implement Object.toString().
        separator - The separator to insert between the object strings.
        sb - A StringBuilder to append the iteration string to.
        Throws:
        X extends java.lang.Exception
      • asSet

        @Deprecated(since="4.1.0",
                    forRemoval=true)
        public static <E,​X extends java.lang.Exception> java.util.Set<E> asSet​(Iteration<? extends E,​? extends X> iteration,
                                                                                     java.util.function.Supplier<java.util.Set<E>> setMaker)
                                                                              throws X extends java.lang.Exception
        Deprecated, for removal: This API element is subject to removal in a future version.
        Get a Set containing all elements obtained from the specified iteration.
        Parameters:
        iteration - the iteration to get the elements from
        setMaker - the Supplier that constructs a new set
        Returns:
        a Set containing all elements obtained from the specified iteration.
        Throws:
        X extends java.lang.Exception
      • asSet

        public static <E,​X extends java.lang.Exception> java.util.Set<E> asSet​(CloseableIteration<? extends E,​? extends X> iteration,
                                                                                     java.util.function.Supplier<java.util.Set<E>> setMaker)
                                                                              throws X extends java.lang.Exception
        Deprecated.
        Get a Set containing all elements obtained from the specified iteration.
        Parameters:
        iteration - the iteration to get the elements from
        setMaker - the Supplier that constructs a new set
        Returns:
        a Set containing all elements obtained from the specified iteration.
        Throws:
        X extends java.lang.Exception