Package eu.bandm.tools.ops
Class Multimaps
java.lang.Object
eu.bandm.tools.ops.Multimaps
Library of constants and combinators for classes implementing
Multimap
.-
Method Summary
Modifier and TypeMethodDescriptionstatic <A,
B> Multimap <A, B> Return a multimap that contains all combinations.static <A,
B> Multimap <A, B> Return a multimap that contains all combinations.static <A,
B> Multimap <A, B> Return a multimap that contains all combinations.static <A,
B> Multimap <A, B> asMultimap
(Set<Map.Entry<A, B>> things) static <A> Comparator
<A> cache
(Comparator<? super A> c) Cache comparator resultsstatic <A,
B> Map <A, B> static <A> Multimap
<A, A> static <A,
B, C> Multimap <A, C> static <A,
B, C, D>
Multimap<A, D> static <A,
B, C, D, E>
Multimap<A, E> static <A,
B, C, D, E, F>
Multimap<A, F> static <A,
B, C> Multimap <A, C> static <A,
B> Multimap <A, B> empty()
static <A,
B> Multimap <A, B> static <A> Multimap
<A, A> static <A,
B> Map <A, B> Adds the pairs from a Multimap into a Map, if possible.static <A,
B> Multimap <B, A> static void
static <A,
B> Multimap <A, B> maxMatching
(Multimap<A, B> rel) static <A> boolean
reflexiveClosure
(Multimap<A, A> r) static <A> boolean
reflexiveClosure
(Multimap<A, A> r, Set<? extends A> s) static <A> boolean
reflexiveReduction
(Multimap<A, A> r) static <A> boolean
reflexiveReduction
(Multimap<A, A> r, Set<? extends A> s) static <A,
B> Multimap <A, B> singleton
(A a, B b) static <A,
B> Multimap <A, B> slice
(BiPredicate<? super A, ? super B> r, Set<? extends A> dom, Set<? extends B> ran) static <A,
B, C, D>
Multimap<C, D> span
(Multimap<A, B> gen, Function<? super A, ? extends C> left, Function<? super B, ? extends D> right) static <A> Set
<A> static <A> boolean
symmetricClosure
(Multimap<A, A> r) static <A,
B, C> Multimap <A, C> static <A,
B, C, D>
Multimap<A, D> static <A,
B, C> Multimap <B, C> toSpan
(Function<? super A, ? extends B> left, Function<? super A, ? extends C> right, Collection<? extends A> gen) static <A,
B, C, D>
Multimap<C, D> toSpan
(Function<? super A, ? extends C> left, Function<? super B, ? extends D> right, Multimap<? extends A, ? extends B> gen) static <A,
B> Multimap <A, B> toSum
(Collection<? extends A> dom, Function<? super A, ? extends Collection<? extends B>> fun) static <A> Multimap
<A, A> toSymmetricClosure
(Multimap<A, A> r) static <A> Multimap
<A, A> toTransitiveClosure
(Multimap<A, A> r) static <A> boolean
transitiveClosure
(Multimap<A, A> r) static <A> boolean
transitiveClosureSparse
(Multimap<A, A> r) static <A,
B> Multimap <A, B> unmodifiableMultimap
(Multimap<? extends A, ? extends B> m)
-
Method Details
-
cache
Cache comparator results -
intoMap
Adds the pairs from a Multimap into a Map, if possible.- Parameters:
in
- MultiMap to copy to the mapout
- Map which is updated. Needs not be empty.- Throws:
RuntimeException
- iff the contents of in plus out do not represent a map in the mathematical sense.
-
empty
-
singleton
-
id
-
all
Return a multimap that contains all combinations. -
all
Return a multimap that contains all combinations. -
all
Return a multimap that contains all combinations. -
inverse
-
toCompose
-
toCompose
-
composeAs
-
compose
-
compose
-
compose
-
compose
-
compose
-
forward
-
support
-
reflexiveClosure
-
reflexiveClosure
-
reflexiveReduction
-
reflexiveReduction
-
symmetricClosure
-
toSymmetricClosure
-
transitiveClosure
-
transitiveClosureSparse
-
toTransitiveClosure
-
slice
public static <A,B> Multimap<A,B> slice(BiPredicate<? super A, ? super B> r, Set<? extends A> dom, Set<? extends B> ran) -
toSum
public static <A,B> Multimap<A,B> toSum(Collection<? extends A> dom, Function<? super A, ? extends Collection<? extends B>> fun) -
unmodifiableMultimap
-
span
-
toSpan
public static <A,B, Multimap<B,C> C> toSpan(Function<? super A, ? extends B> left, Function<? super A, ? extends C> right, Collection<? extends A> gen) -
toSpan
-
maxMatching
-
asMultimap
-
choose
-
main
-