Class IndexMultimap<A,B>
- All Implemented Interfaces:
Multimap<A,
,B> Iterable<Map.Entry<A,
,B>> Collection<Map.Entry<A,
,B>> BiPredicate<A,
,B> Set<Map.Entry<A,
B>>
-
Constructor Summary
ConstructorDescriptionIndexMultimap
(Index<A> domIndex, Index<B> ranIndex) IndexMultimap
(IndexMultimap<A, B> m) -
Method Summary
Modifier and TypeMethodDescriptionboolean
add
(int i, int j) Special for indexed bases multimaps, is NOT an override.boolean
Adds a pair to this multimap.boolean
boolean
contains
(int i, int j) Special for indexed bases multimaps, is NOT an override.boolean
Whether this multimap contains a pair with the given components.boolean
boolean
containsUnchecked
(Object a, Object b) domain()
Returns the set of left components of pairs in this multimap.Returns the set of right components of pairs with a given left component in this multimap.imageAll
(Collection<? extends A> c) Returns the set of right components of pairs in this multimap, which have a left component in the given set.imageAllUnchecked
(Collection<?> c) iterator()
Returns the set of left components of pairs with a given right component in this multimap.range()
Returns the set of right components of pairs in this multimap.boolean
remove
(int i, int j) Special for indexed bases multimaps, is NOT an override.boolean
Removes a pair from this this multimap.boolean
removeDomain
(A a) Removes all pairs with a given left component from this multimap.boolean
removeUnchecked
(Object a, Object b) int
size()
Methods inherited from class eu.bandm.tools.ops.AbstractMultimap
imageMap, preimageAll, preimageAllUnchecked, preimageMap, preimageUnchecked, removeAllDomain, removeAllDomainUnchecked, removeAllRange, removeAllRangeUnchecked, removeDomainUnchecked, removeRange, removeRangeUnchecked, retainAllDomain, retainAllDomainUnchecked, retainAllRange, retainAllRangeUnchecked, test
Methods inherited from class java.util.AbstractCollection
addAll, clear, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.function.BiPredicate
and, negate, or
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Constructor Details
-
IndexMultimap
-
IndexMultimap
-
-
Method Details
-
getDomainIndex
-
getRangeIndex
-
add
public boolean add(int i, int j) Special for indexed bases multimaps, is NOT an override. -
remove
public boolean remove(int i, int j) Special for indexed bases multimaps, is NOT an override. -
contains
public boolean contains(int i, int j) Special for indexed bases multimaps, is NOT an override. -
size
public int size() -
iterator
-
contains
Description copied from interface:Multimap
Whether this multimap contains a pair with the given components. -
containsUnchecked
- Specified by:
containsUnchecked
in interfaceMultimap<A,
B> - Overrides:
containsUnchecked
in classAbstractMultimap<A,
B>
-
contains
-
add
Description copied from interface:Multimap
Adds a pair to this multimap. This operation must be stable: adding a pair thatequals
any pair contained in this multimap componentwise must not change this multimap. -
add
-
remove
Description copied from interface:Multimap
Removes a pair from this this multimap. Removing a pair thatequals
no pair contained in this multimap componentwise must not change this multimap. -
removeUnchecked
- Specified by:
removeUnchecked
in interfaceMultimap<A,
B> - Overrides:
removeUnchecked
in classAbstractMultimap<A,
B>
-
domain
Description copied from interface:Multimap
Returns the set of left components of pairs in this multimap.The returned set is backed by this multimap, such that changes to this multimap are reflected by the set. The behavior of modifications of this multimap concurrent to iteration of the set is unspecified.
If this multimap supports the
removeDomain
operation, then the returned set and its iterators must support theremove
operation, and changes by these operations must be reflected by this multimap. -
range
Description copied from interface:Multimap
Returns the set of right components of pairs in this multimap.If this multimap supports the
removeRange
operation, then the returned set and its iterators must support theremove
operation. -
removeDomain
Description copied from interface:Multimap
Removes all pairs with a given left component from this multimap. The effect of the implementation on this multimap must be equivalent to the following code:removeDomain(final A a) { for (B b : new HashSet<B>(range())) remove(a, b) ; }
- Specified by:
removeDomain
in interfaceMultimap<A,
B> - Overrides:
removeDomain
in classAbstractMultimap<A,
B> - Parameters:
a
- the left component of all pairs to remove.- Returns:
true
if this multimap has been changed by this operation,false
otherwise.
-
image
Description copied from interface:Multimap
Returns the set of right components of pairs with a given left component in this multimap.The returned set need not be modifiable. The behaviour of this multimap after successfully modifying the returned set is unspecified.
-
imageUnchecked
- Specified by:
imageUnchecked
in interfaceMultimap<A,
B> - Overrides:
imageUnchecked
in classAbstractMultimap<A,
B> - See Also:
-
imageAll
Description copied from interface:Multimap
Returns the set of right components of pairs in this multimap, which have a left component in the given set. -
imageAllUnchecked
- Specified by:
imageAllUnchecked
in interfaceMultimap<A,
B> - Overrides:
imageAllUnchecked
in classAbstractMultimap<A,
B> - See Also:
-
preimage
Description copied from interface:Multimap
Returns the set of left components of pairs with a given right component in this multimap.The returned set need not be modifiable. The behaviour of this multimap after successfully modifying the returned set is unspecified.
-