Class AbstractMultimap<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>>
Multimap
.
The next level will supply the particular storage room.
Only the methods AbstractCollection.size()
and AbstractCollection.iterator()
are not implemented here.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Adds a pair to this multimap if not already present.boolean
Whether this multimap contains a pair with the given components.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.imageMap()
Returns a map which maps each A which appears as a left component to a set of all B which appear as its right component.Convenience method for untyped inquiry.Returns the set of left components of pairs with a given right component in this multimap.Returns a map which maps each B which appears as a right component to a set of all A which appear as its left component.Convenience method for untyped inquiry.range()
Returns the set of right components of pairs in this multimap.boolean
Removes a pair from this multimap.Methods inherited from class java.util.AbstractCollection
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, 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
Methods inherited from interface eu.bandm.tools.util.multi.Multimap
addAll, containsAll, containsUnchecked, imageAll, imageAllUnchecked, preimageAll, preimageAllUnchecked, removeAll, removeAllDomain, removeAllDomainUnchecked, removeAllRange, removeAllRangeUnchecked, removeDomain, removeDomainUnchecked, removeRange, removeRangeUnchecked, removeUnchecked, retainAll, retainAllDomain, retainAllDomainUnchecked, retainAllRange, retainAllRangeUnchecked, test, toArray, toArray
-
Constructor Details
-
AbstractMultimap
protected AbstractMultimap()
-
-
Method Details
-
add
Adds a pair to this multimap if not already present.The default implementation calls
#add(Object)
with a newly created map entry to hold the pair. Subclasses may override this method for a more efficient implementation. -
remove
Description copied from interface:Multimap
Removes a pair from this multimap. Removing a pair thatequals
no pair contained in this multimap componentwise must not change this multimap. -
contains
Description copied from interface:Multimap
Whether this multimap contains a pair with the given components. -
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. -
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
Description copied from interface:Multimap
Convenience method for untyped inquiry.- Specified by:
imageUnchecked
in interfaceMultimap<A,
B> - See Also:
-
imageMap
Description copied from interface:Multimap
Returns a map which maps each A which appears as a left component to a set of all B which appear as its right component. -
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.
-
preimageUnchecked
Description copied from interface:Multimap
Convenience method for untyped inquiry.- Specified by:
preimageUnchecked
in interfaceMultimap<A,
B> - See Also:
-
preimageMap
Description copied from interface:Multimap
Returns a map which maps each B which appears as a right component to a set of all A which appear as its left component.- Specified by:
preimageMap
in interfaceMultimap<A,
B>
-