Package opennlp.tools.util
Class ObjectStreamUtils
- java.lang.Object
-
- opennlp.tools.util.ObjectStreamUtils
-
public class ObjectStreamUtils extends Object
-
-
Constructor Summary
Constructors Constructor Description ObjectStreamUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> ObjectStream<T>
concatenateObjectStream(Collection<ObjectStream<T>> streams)
Creates a single concatenatedObjectStream
from multiple individualstreams
with the same typeObjectStreamUtils
.static <T> ObjectStream<T>
concatenateObjectStream(ObjectStream<T>... streams)
Creates a single concatenatedObjectStream
from multiple individualstreams
with the same type.static <T> ObjectStream<T>
createObjectStream(Collection<T> collection)
Creates anObjectStream
form aCollection
.static <T> ObjectStream<T>
createObjectStream(T... array)
Creates anObjectStream
form an array ofObjectStreamUtils
.
-
-
-
Method Detail
-
createObjectStream
@SafeVarargs public static <T> ObjectStream<T> createObjectStream(T... array)
Creates anObjectStream
form an array ofObjectStreamUtils
.- Type Parameters:
T
- The generic type of the elements in thearray
.- Parameters:
array
- The elements to feed into the newObjectStream
.- Returns:
- The
ObjectStream
over the array elements.
-
createObjectStream
public static <T> ObjectStream<T> createObjectStream(Collection<T> collection)
Creates anObjectStream
form aCollection
.- Type Parameters:
T
- The generic type of the elements in thecollection
.- Parameters:
collection
- The elements to feed into the newObjectStream
.- Returns:
- The
ObjectStream
over the collection elements
-
concatenateObjectStream
public static <T> ObjectStream<T> concatenateObjectStream(Collection<ObjectStream<T>> streams)
Creates a single concatenatedObjectStream
from multiple individualstreams
with the same typeObjectStreamUtils
.- Type Parameters:
T
- The generic type of the elements in thecollection
.- Parameters:
streams
- The collection of streams to feed into the concatenatedObjectStream
. Every element of the collection must not benull
.- Returns:
- The concatenated
ObjectStream
aggregating all elements instreams
.
-
concatenateObjectStream
@SafeVarargs public static <T> ObjectStream<T> concatenateObjectStream(ObjectStream<T>... streams)
Creates a single concatenatedObjectStream
from multiple individualstreams
with the same type.- Type Parameters:
T
- The generic type of the elements in thestreams
.- Parameters:
streams
- One or more stream to feed into the concatenatedObjectStream
. Every element of the collection must not benull
.- Returns:
- The concatenated
ObjectStream
aggregating all elements instreams
.
-
-