Class Iterations
java.lang.Object
org.eclipse.rdf4j.common.iteration.Iterations
- Direct Known Subclasses:
QueryResults
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
-
Method Summary
Modifier and TypeMethodDescriptionstatic <E,
X extends Exception, C extends Collection<E>>
CaddAll
(CloseableIteration<? extends E, X> iter, C collection) Deprecated.Adds all elements from the suppliedCloseableIteration
to the specified collection then closes theCloseableIteration
.static <E,
X extends Exception, C extends Collection<E>>
CDeprecated, for removal: This API element is subject to removal in a future version.asList
(CloseableIteration<? extends E, X> iter) Deprecated.Get a List containing all elements obtained from the specified iteration.Deprecated, for removal: This API element is subject to removal in a future version.asSet
(CloseableIteration<? extends E, ? extends X> iteration, Supplier<Set<E>> setMaker) Deprecated.Get a Set containing all elements obtained from the specified iteration.asSet
(CloseableIteration<? extends E, X> iter) Deprecated.Get a Set containing all elements obtained from the specified iteration.Deprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.static <X extends Exception>
voidcloseCloseable
(Iteration<?, X> iteration) Deprecated, for removal: This API element is subject to removal in a future version.static <T> Stream<T>
stream
(CloseableIteration<T, ? extends Exception> iteration) Deprecated.Get a sequentialStream
with the suppliedCloseableIteration
as its source.static <T> Stream<T>
Deprecated, for removal: This API element is subject to removal in a future version.toString
(CloseableIteration<?, X> iteration, String separator) Deprecated.Converts aCloseableIteration
to a string by concatenating all the string representations of objects in the iteration, divided by a separator.static <X extends Exception>
voidtoString
(CloseableIteration<?, X> iteration, String separator, StringBuilder sb) Deprecated.Converts aCloseableIteration
to a string by concatenating all the string representations of objects in the iteration, divided by a separator.Deprecated, for removal: This API element is subject to removal in a future version.static <X extends Exception>
voidtoString
(Iteration<?, X> iteration, String separator, StringBuilder sb) Deprecated, for removal: This API element is subject to removal in a future version.
-
Constructor Details
-
Iterations
public Iterations()Deprecated.
-
-
Method Details
-
asList
@Deprecated(since="4.1.0", forRemoval=true) public static <E,X extends Exception> List<E> asList(Iteration<? extends E, X> iter) throws XDeprecated, 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 Exception
-
asList
public static <E,X extends Exception> List<E> asList(CloseableIteration<? extends E, X> iter) throws XDeprecated.Get a List containing all elements obtained from the specified iteration.- Parameters:
iter
- theCloseableIteration
to get the elements from- Returns:
- a List containing all elements obtained from the specified iteration.
- Throws:
X extends Exception
-
asSet
@Deprecated(since="4.1.0", forRemoval=true) public static <E,X extends Exception> Set<E> asSet(Iteration<? extends E, X> iter) throws XDeprecated, 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 Exception
-
asSet
public static <E,X extends Exception> Set<E> asSet(CloseableIteration<? extends E, X> iter) throws XDeprecated.Get a Set containing all elements obtained from the specified iteration.- Parameters:
iter
- theCloseableIteration
to get the elements from- Returns:
- a Set containing all elements obtained from the specified iteration.
- Throws:
X extends Exception
-
addAll
@Deprecated(since="4.1.0", forRemoval=true) public static <E,X extends Exception, C addAllC extends Collection<E>> (Iteration<? extends E, X> iter, C collection) throws XDeprecated, 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 ofCloseableIteration
it is automatically closed after consumption.- Parameters:
iter
- An iteration containing elements to add to the container. If the iteration is an instance ofCloseableIteration
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 Exception
-
addAll
public static <E,X extends Exception, C addAllC extends Collection<E>> (CloseableIteration<? extends E, X> iter, C collection) throws XDeprecated.Adds all elements from the suppliedCloseableIteration
to the specified collection then closes theCloseableIteration
.- Parameters:
iter
- ACloseableIteration
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 Exception
-
stream
@Deprecated(since="4.1.0", forRemoval=true) public static <T> Stream<T> stream(Iteration<T, ? extends Exception> iteration) Deprecated, for removal: This API element is subject to removal in a future version.Get a sequentialStream
with the suppliedIteration
as its source. If the source iteration is aCloseableIteration
, 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 aRuntimeException
. -
stream
Deprecated.Get a sequentialStream
with the suppliedCloseableIteration
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 aRuntimeException
.- Parameters:
iteration
- a sourceCloseableIteration
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 Exception> void closeCloseable(Iteration<?, X> iteration) throws XDeprecated, for removal: This API element is subject to removal in a future version.Closes the supplied iteration if it is an instance ofCloseableIteration
, otherwise the request is ignored.- Parameters:
iteration
- The iteration that should be closed.- Throws:
X extends Exception
-
toString
@Deprecated(since="4.1.0", forRemoval=true) public static <X extends Exception> String toString(Iteration<?, X> iteration, String separator) throws XDeprecated, 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 implementObject.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 Exception
-
toString
public static <X extends Exception> String toString(CloseableIteration<?, X> iteration, String separator) throws XDeprecated.Converts aCloseableIteration
to a string by concatenating all the string representations of objects in the iteration, divided by a separator.- Parameters:
iteration
- ACloseableIteration
over arbitrary objects that are expected to implementObject.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 Exception
-
toString
@Deprecated(since="4.1.0", forRemoval=true) public static <X extends Exception> void toString(Iteration<?, X> iteration, String separator, StringBuilder sb) throws XDeprecated, 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 implementObject.toString()
.separator
- The separator to insert between the object strings.sb
- A StringBuilder to append the iteration string to.- Throws:
X extends Exception
-
toString
public static <X extends Exception> void toString(CloseableIteration<?, X> iteration, String separator, StringBuilder sb) throws XDeprecated.Converts aCloseableIteration
to a string by concatenating all the string representations of objects in the iteration, divided by a separator.- Parameters:
iteration
- ACloseableIteration
over arbitrary objects that are expected to implementObject.toString()
.separator
- The separator to insert between the object strings.sb
- A StringBuilder to append the iteration string to.- Throws:
X extends Exception
-
asSet
@Deprecated(since="4.1.0", forRemoval=true) public static <E,X extends Exception> Set<E> asSet(Iteration<? extends E, ? extends X> iteration, Supplier<Set<E>> setMaker) throws XDeprecated, 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 fromsetMaker
- the Supplier that constructs a new set- Returns:
- a Set containing all elements obtained from the specified iteration.
- Throws:
X extends Exception
-
asSet
public static <E,X extends Exception> Set<E> asSet(CloseableIteration<? extends E, ? extends X> iteration, Supplier<Set<E>> setMaker) throws XDeprecated.Get a Set containing all elements obtained from the specified iteration.- Parameters:
iteration
- the iteration to get the elements fromsetMaker
- the Supplier that constructs a new set- Returns:
- a Set containing all elements obtained from the specified iteration.
- Throws:
X extends Exception
-