Class IndexMultimap<A,B>
- All Implemented Interfaces:
Nullfree,Multimap<A,,B> Iterable<Map.Entry<A,,B>> Collection<Map.Entry<A,,B>> BiPredicate<A,,B> Set<Map.Entry<A,B>>
-
Field Summary
Fields inherited from interface eu.bandm.tools.util.multi.Multimap
DEFAULT_PAIR_FORMAT_STRING -
Constructor Summary
ConstructorsConstructorDescriptionIndexMultimap(Index<A> domIndex, Index<B> ranIndex) IndexMultimap(IndexMultimap<A, B> m) -
Method Summary
Modifier and TypeMethodDescriptionbooleanadd(int i, int j) Special for indexed bases multimaps, is NOT an override.booleanAdds a pair to this multimap if not already present.booleanbooleancontains(int i, int j) Special for indexed bases multimaps, is NOT an override.booleanWhether this multimap contains a pair with the given components.booleanbooleancontainsUnchecked(Object a, Object b) Convenience method for untyped inquiry.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) Convenience method for untyped inquiry.Convenience method for untyped inquiry.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.booleanremove(int i, int j) Special for indexed bases multimaps, is NOT an override.booleanRemoves a pair from this multimap.booleanremoveDomain(A a) Removes all pairs with a given left component from this multimap.booleanremoveUnchecked(Object a, Object b) Convenience method for untyped remove.intsize()Methods inherited from class eu.bandm.tools.util.multi.AbstractMultimap
addAll, imageMap, preimageMap, preimageUnchecked, toStringMethods inherited from class java.util.AbstractCollection
clear, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArrayMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.function.BiPredicate
and, negate, orMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface eu.bandm.tools.util.multi.Multimap
containsAll, preimageAll, preimageAllUnchecked, removeAll, removeAllDomain, removeAllDomainUnchecked, removeAllRange, removeAllRangeUnchecked, removeDomainUnchecked, removeRange, removeRangeUnchecked, retainAll, retainAllDomain, retainAllDomainUnchecked, retainAllRange, retainAllRangeUnchecked, test, toArray, toArray, toString, toString
-
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:MultimapWhether this multimap contains a pair with the given components. -
containsUnchecked
Description copied from interface:MultimapConvenience method for untyped inquiry.- Parameters:
a- the left component of the pair to testb- the right component of the pair to test- Returns:
- whether this multimap contains a pair with the given components.
- See Also:
-
contains
-
add
Description copied from class:AbstractMultimapAdds a pair to this multimap if not already present.The default implementation calls
AbstractCollection.add(E)with a newly created map entry to hold the pair. Subclasses may override this method for a more efficient implementation. -
add
-
remove
Description copied from interface:MultimapRemoves a pair from this multimap. Removing a pair thatequalsno pair contained in this multimap componentwise must not change this multimap. -
removeUnchecked
Description copied from interface:MultimapConvenience method for untyped remove.- Parameters:
a- the left component of the pair to remove.b- the right component of the pair to remove.- Returns:
- whether this multimap has been changed by this operation
- See Also:
-
domain
Description copied from interface:MultimapReturns 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
removeDomainoperation, then the returned set and its iterators must support theremoveoperation, and changes by these operations must be reflected by this multimap. -
range
Description copied from interface:MultimapReturns the set of right 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
removeRangeoperation, then the returned set and its iterators must support theremoveoperation, and changes by these operations must be reflected by this multimap. -
removeDomain
Description copied from interface:MultimapRemoves 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) ; }- Parameters:
a- the left component of all pairs to remove.- Returns:
- whether this multimap has been changed by this operation
-
image
Description copied from interface:MultimapReturns 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
Description copied from interface:MultimapConvenience method for untyped inquiry.- Specified by:
imageUncheckedin interfaceMultimap<A,B> - Overrides:
imageUncheckedin classAbstractMultimap<A,B> - Parameters:
a- a left component.- Returns:
- the set of right components of pairs with a left
component that
equals(a)in this multimap. - See Also:
-
imageAll
Description copied from interface:MultimapReturns the set of right components of pairs in this multimap which have a left component in the given set.- Parameters:
c- a set of left components.- Returns:
- the set of right components of pairs with a left component in the given set.
-
imageAllUnchecked
Description copied from interface:MultimapConvenience method for untyped inquiry.- Parameters:
c- a set of left components.- Returns:
- the set of right components of pairs with a left component in the given set.
- See Also:
-
preimage
Description copied from interface:MultimapReturns 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.
-