public class OWLAPIStreamUtils extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
OWLAPIStreamUtils.Pair<T>
Class for pairwise partition
|
public static <T> Set<T> asSet(java.util.stream.Stream<T> s)
s - stream to turn to set. The stream is consumed by this operation.public static <T> Set<T> asSet(java.util.stream.Stream<?> s, Class<T> type)
T - type of return collections - stream to turn to set. The stream is consumed by this operation.type - force return type to be exactly Tpublic static <T> Set<T> asUnorderedSet(java.util.stream.Stream<T> s)
s - stream to turn to set. The stream is consumed by this operation.public static <T> Set<T> asUnorderedSet(java.util.stream.Stream<?> s, Class<T> type)
T - type of return collections - stream to turn to set. The stream is consumed by this operation.type - force return type to be exactly Tpublic static <T> List<T> asList(java.util.stream.Stream<T> s)
s - stream to turn to list. The stream is consumed by this operation.public static <T> List<T> asListNullsForbidden(java.util.stream.Stream<T> s)
s - stream to turn to list. The stream is consumed by this operation.public static <T> List<T> asList(java.util.stream.Stream<?> s, Class<T> type)
T - type of return collections - stream to turn to list. The stream is consumed by this operation.type - force return type to be exactly Tpublic static <T,Q> Map<T,Q> asMap(java.util.stream.Stream<Q> s, java.util.function.Function<Q,T> f)
T - type of keyQ - type of input and values - stream to turn to map. The stream is consumed by this operation.f - function to create the keypublic static <K,V,Q> Map<K,V> asMap(java.util.stream.Stream<Q> s, java.util.function.Function<Q,K> key, java.util.function.Function<Q,V> val)
K - type of keyV - type of valueQ - type of inputs - stream to turn to map. The stream is consumed by this operation.key - function to create the keyval - function to create the valuepublic static boolean contains(java.util.stream.Stream<?> s, Object o)
s - stream to check for containment. The stream is consumed at least
partially by this operationo - object to searchpublic static <T> boolean add(Collection<? super T> c, java.util.stream.Stream<T> s)
s - stream of elements to addc - collection to add topublic static int compareCollections(Collection<? extends OWLObject> set1, Collection<? extends OWLObject> set2)
set1 - collection to compareset2 - collection to comparepublic static int compareStreams(java.util.stream.Stream<?> set1, java.util.stream.Stream<?> set2)
set1 - stream to compareset2 - stream to comparepublic static int compareIterators(Iterator<?> set1, Iterator<?> set2)
set1 - iterator to compareset2 - iterator to comparepublic static boolean equalIterators(Iterator<?> set1, Iterator<?> set2)
set1 - iterator to compareset2 - iterator to comparepublic static boolean equalStreams(java.util.stream.Stream<?> set1, java.util.stream.Stream<?> set2)
set1 - stream to compareset2 - stream to comparepublic static int compareLists(List<? extends OWLObject> set1, List<? extends OWLObject> set2)
set1 - list to compareset2 - list to comparepublic static <T> java.util.stream.Stream<T> empty()
public static java.util.stream.Stream<?> allComponents(HasComponents root)
root - the root for the invisitpublic static java.util.stream.Stream<?> flatComponents(HasComponents root)
root - the root for the invisitpublic static java.util.stream.Stream<int[]> pairs(int size)
size - size of matrixsize. For input 3, the values are (1,2), (1,3), (2,3)public static java.util.stream.Stream<int[]> allPairs(int size)
size - size of matrixsize, excluding main diagonal. For input 3, the values
are (1,2), (1,3), (2,3), (2,1),(3,1), (3,2)public static <T> java.util.stream.Stream<OWLAPIStreamUtils.Pair<T>> pairs(Collection<T> input)
input - collection to partitionl.size(), where l is the list corresponding to the input
collection. For input of length 3, the values are
(l.get(1),l.get(2)), (l.get(1),l.get(3)), (l.get(2),l.get(3))public static <T> java.util.stream.Stream<OWLAPIStreamUtils.Pair<T>> allPairs(Collection<T> input)
input - collection to partitionl.size(), where l is the list corresponding to the input
collection, excluding main diagonal. For input 3, the values are
(l.get(1),l.get(2)), (l.get(1),l.get(3)), (l.get(2),l.get(3)),
(l.get(2),l.get(1)),(l.get(3),l.get(1)), (l.get(3),l.get(2))public static <T> java.util.stream.Stream<OWLAPIStreamUtils.Pair<T>> pairs(java.util.stream.Stream<T> input)
input - collection to partitionl.size(), where l is the list corresponding to the input
collection. For input of length 3, the values are
(l.get(1),l.get(2)), (l.get(1),l.get(3)), (l.get(2),l.get(3))public static <T> java.util.stream.Stream<OWLAPIStreamUtils.Pair<T>> allPairs(java.util.stream.Stream<T> input)
input - collection to partitionl.size(), where l is the list corresponding to the input
collection, excluding main diagonal. For input 3, the values are
(l.get(1),l.get(2)), (l.get(1),l.get(3)), (l.get(2),l.get(3)),
(l.get(2),l.get(1)),(l.get(3),l.get(1)), (l.get(3),l.get(2))public static <T> OWLAPIStreamUtils.Pair<T> pair(T i, T j)
i - firstj - secondCopyright © 2017 The University of Manchester. All Rights Reserved.