/** * @param l * list to walk * @param f * consumer * @param <T> * type * @return true if any match */ public static <T> boolean anyMatchOnAllPairs(List<T> l, Predicate<org.semanticweb.owlapi.util.OWLAPIStreamUtils.Pair<T>> f) { return OWLAPIStreamUtils.allPairs(l).anyMatch(f); }
/** * @param l * list to walk * @param f * consumer * @param <T> * type * @return true if all match */ public static <T> boolean allMatchOnAllPairs(List<T> l, Predicate<org.semanticweb.owlapi.util.OWLAPIStreamUtils.Pair<T>> f) { return OWLAPIStreamUtils.allPairs(l).allMatch(f); }
/** * @param input collection to partition * @return a stream of coordinates for a symmetric matrix of size {@code l.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> Stream<Pair<T>> allPairs(Stream<T> input) { return allPairs(asList(input)); }
/** * @param input collection to partition * @return a stream of coordinates for a symmetric matrix of size {@code l.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> Stream<Pair<T>> allPairs(Stream<T> input) { return allPairs(asList(input)); }
/** * @param input collection to partition * @return a stream of coordinates for a symmetric matrix of size {@code l.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> Stream<Pair<T>> allPairs(Stream<T> input) { return allPairs(asList(input)); }
/** * @param visitor visitor to apply to all pairwise elements in this axiom; pairs are ordered, * i.e., (i, j) and (j, i) will be considered. (i,i) is skipped. * @return true if all pairs evaluation is true */ default boolean allMatchAllPairs(OWLPairwiseBooleanVisitor<C> visitor) { return allPairs(operands()).allMatch(v -> visitor.visit(v.i, v.j)); }
/** * @param visitor visitor to apply to all pairwise elements in this axiom; pairs are ordered, * i.e., (i, j) and (j, i) will be considered. (i,i) is skipped. */ default void forEachAllPairs(OWLPairwiseVoidVisitor<C> visitor) { allPairs(operands()).forEach(v -> visitor.visit(v.i, v.j)); }
/** * @param visitor visitor to apply to all pairwise elements in this axiom; pairs are ordered, * i.e., (i, j) and (j, i) will be considered. (i,i) is skipped. * @return true if at least one pair evaluation is true */ default boolean anyMatchAllPairs(OWLPairwiseBooleanVisitor<C> visitor) { return allPairs(operands()).anyMatch(v -> visitor.visit(v.i, v.j)); }
/** * @param visitor visitor to apply to all pairwise elements in this axiom; pairs are ordered, * i.e., (i, j) and (j, i) will be considered. (i,i) is skipped. * @return true if at least one pair evaluation is true */ default boolean anyMatchAllPairs(OWLPairwiseBooleanVisitor<C> visitor) { return allPairs(operands()).anyMatch(v -> visitor.visit(v.i, v.j)); }
/** * @param visitor visitor to apply to all pairwise elements in this axiom; pairs are ordered, * i.e., (i, j) and (j, i) will be considered. (i,i) is skipped. */ default void forEachAllPairs(OWLPairwiseVoidVisitor<C> visitor) { allPairs(operands()).forEach(v -> visitor.visit(v.i, v.j)); }
/** * @param visitor visitor to apply to all pairwise elements in this axiom; pairs are ordered, * i.e., (i, j) and (j, i) will be considered. (i,i) is skipped. * @return true if at least one pair evaluation is true */ default boolean anyMatchAllPairs(OWLPairwiseBooleanVisitor<C> visitor) { return allPairs(operands()).anyMatch(v -> visitor.visit(v.i, v.j)); }
/** * @param visitor visitor to apply to all pairwise elements in this axiom; pairs are ordered, * i.e., (i, j) and (j, i) will be considered. (i,i) is skipped. */ default void forEachAllPairs(OWLPairwiseVoidVisitor<C> visitor) { allPairs(operands()).forEach(v -> visitor.visit(v.i, v.j)); }
/** * @param visitor visitor to apply to all pairwise elements in this axiom; pairs are ordered, * i.e., (i, j) and (j, i) will be considered. (i,i) is skipped. * @return true if all pairs evaluation is true */ default boolean allMatchAllPairs(OWLPairwiseBooleanVisitor<C> visitor) { return allPairs(operands()).allMatch(v -> visitor.visit(v.i, v.j)); }
/** * @param visitor visitor to apply to all pairwise elements in this axiom; pairs are ordered, * i.e., (i, j) and (j, i) will be considered. (i,i) is skipped. * @return true if all pairs evaluation is true */ default boolean allMatchAllPairs(OWLPairwiseBooleanVisitor<C> visitor) { return allPairs(operands()).allMatch(v -> visitor.visit(v.i, v.j)); }
/** * @param <T> type returned by visitor * @param visitor visitor to apply to all pairwise elements in this axiom; pairs are ordered, * i.e., (i, j) and (j, i) will be considered. (i,i) is skipped. * @return collection of all visitor return values that are not null */ default <T> Collection<T> walkAllPairwise(OWLPairwiseVisitor<T, C> visitor) { return asList( allPairs(operands()).map(v -> visitor.visit(v.i, v.j)).filter(Objects::nonNull)); }
/** * @param <T> type returned by visitor * @param visitor visitor to apply to all pairwise elements in this axiom; pairs are ordered, * i.e., (i, j) and (j, i) will be considered. (i,i) is skipped. * @return collection of all visitor return values that are not null */ default <T> Collection<T> walkAllPairwise(OWLPairwiseVisitor<T, C> visitor) { return asList( allPairs(operands()).map(v -> visitor.visit(v.i, v.j)).filter(Objects::nonNull)); }
/** * @param <T> type returned by visitor * @param visitor visitor to apply to all pairwise elements in this axiom; pairs are ordered, * i.e., (i, j) and (j, i) will be considered. (i,i) is skipped. * @return collection of all visitor return values that are not null */ default <T> Collection<T> walkAllPairwise(OWLPairwiseVisitor<T, C> visitor) { return asList( allPairs(operands()).map(v -> visitor.visit(v.i, v.j)).filter(Objects::nonNull)); }