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> FIXME DOCstatic <A,
B> Multimap<A, B> FIXME DOCstatic <A,
B> Multimap<A, B> FIXME DOCstatic <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) returns span(R, f, g) = { (x,y) ∊ R ⚫ (f(x),f(y) }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) return span(f, g, a) = { x ∊ A ⚫ (f(x),g(x))}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:
out
- Map which is updated. Needs not be empty.in
- MultiMap to copy to the map- Throws:
RuntimeException
- iff the contents of in plus out do not represent a map in the mathematical sense.
-
empty
-
singleton
-
id
-
all
FIXME DOC -
all
FIXME DOC -
all
FIXME DOC -
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
public static <A,B, Multimap<C,C, D> D> span(Multimap<A, B> gen, Function<? super A, ? extends C> left, Function<? super B, ? extends D> right) returns span(R, f, g) = { (x,y) ∊ R ⚫ (f(x),f(y) } -
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) return span(f, g, a) = { x ∊ A ⚫ (f(x),g(x))} -
toSpan
-
maxMatching
-
asMultimap
-
choose
-
main
-