Class ForwardMultimap<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>>
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionForwardMultimap
(Collection<? extends Map.Entry<A, B>> c) ForwardMultimap
(Map<A, B> forward) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Adds a pair to this multimap.boolean
void
clear()
boolean
Whether this multimap contains a pair with the given components.boolean
containsUnchecked
(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.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.iterator()
Returns the set of left components of pairs with a given right component in this multimap.preimageAll
(Collection<? extends B> c) Returns the set of left components of pairs in this multimap, which have a right component in the given set.Convenience method for untyped inquiry.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.boolean
removeAllDomain
(Collection<? extends A> c) Removes all pairs with a left component in the given collection from this multimap.boolean
Convenience method for untyped remove.boolean
removeAllRange
(Collection<? extends B> c) Removes all pairs with a right component in the given collection from this multimap.boolean
Convenience method for untyped remove.boolean
removeDomain
(A a) Removes all pairs with a given left component from this multimap.boolean
Convenience method for untyped remove.boolean
removeRange
(B b) Removes all pairs with a given right component from this multimap.boolean
Convenience method for untyped remove.boolean
removeUnchecked
(Object a, Object b) Convenience method for untyped remove.boolean
retainAllDomain
(Collection<? extends A> c) Removes all pairs with a left component which is not the given collection from this multimap.boolean
Convenience method for untyped remove.boolean
retainAllRange
(Collection<? extends B> c) Removes all pairs with a right component which is not the given collection from this multimap.boolean
Convenience method for untyped remove.int
size()
boolean
Methods inherited from class java.util.AbstractCollection
addAll, contains, 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
-
Field Details
-
forward
-
-
Constructor Details
-
ForwardMultimap
-
ForwardMultimap
public ForwardMultimap() -
ForwardMultimap
-
-
Method Details
-
test
Description copied from interface:Multimap
-
size
public int size() -
iterator
-
add
-
clear
public void clear() -
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. -
contains
Description copied from interface:Multimap
Whether this multimap contains a pair with the given components. -
containsUnchecked
Description copied from interface:Multimap
Convenience method for untyped inquiry.- Specified by:
containsUnchecked
in interfaceMultimap<A,
B> - See Also:
-
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. -
removeUnchecked
Description copied from interface:Multimap
Convenience method for untyped remove.- Specified by:
removeUnchecked
in interfaceMultimap<A,
B> - See Also:
-
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> - Parameters:
a
- the left component of all pairs to remove.- Returns:
true
if this multimap has been changed by this operation,false
otherwise.
-
removeDomainUnchecked
Description copied from interface:Multimap
Convenience method for untyped remove.- Specified by:
removeDomainUnchecked
in interfaceMultimap<A,
B> - See Also:
-
removeRange
Description copied from interface:Multimap
Removes all pairs with a given right component from this multimap. The effect of the implementation on this multimap must be equivalent to the following code:removeRange(final B b) { for (A a : new HashSet<A>(domain())) remove(a, b) ; }
- Specified by:
removeRange
in interfaceMultimap<A,
B> - Parameters:
b
- the right component of all pairs to remove.- Returns:
true
if this multimap has been changed by this operation,false
otherwise.
-
removeRangeUnchecked
Description copied from interface:Multimap
Convenience method for untyped remove.- Specified by:
removeRangeUnchecked
in interfaceMultimap<A,
B> - See Also:
-
removeAllDomain
Description copied from interface:Multimap
Removes all pairs with a left component in the given collection from this multimap.- Specified by:
removeAllDomain
in interfaceMultimap<A,
B>
-
removeAllDomainUnchecked
Description copied from interface:Multimap
Convenience method for untyped remove.- Specified by:
removeAllDomainUnchecked
in interfaceMultimap<A,
B> - See Also:
-
retainAllDomain
Description copied from interface:Multimap
Removes all pairs with a left component which is not the given collection from this multimap.- Specified by:
retainAllDomain
in interfaceMultimap<A,
B>
-
retainAllDomainUnchecked
Description copied from interface:Multimap
Convenience method for untyped remove.- Specified by:
retainAllDomainUnchecked
in interfaceMultimap<A,
B> - See Also:
-
removeAllRange
Description copied from interface:Multimap
Removes all pairs with a right component in the given collection from this multimap.- Specified by:
removeAllRange
in interfaceMultimap<A,
B>
-
removeAllRangeUnchecked
Description copied from interface:Multimap
Convenience method for untyped remove.- Specified by:
removeAllRangeUnchecked
in interfaceMultimap<A,
B> - See Also:
-
retainAllRange
Description copied from interface:Multimap
Removes all pairs with a right component which is not the given collection from this multimap.- Specified by:
retainAllRange
in interfaceMultimap<A,
B>
-
retainAllRangeUnchecked
Description copied from interface:Multimap
Convenience method for untyped remove.- Specified by:
retainAllRangeUnchecked
in interfaceMultimap<A,
B> - See Also:
-
domain
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.The set returned by this implementation and its iterator supports the
remove
method if theentrySet
of the underlying map does. -
range
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.The set returned by this implementation and its iterator supports the
remove
method if theentrySet
of the underlying map does. // ?!? FIXME map comes indeed von außen !?! -
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:
-
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
Description copied from interface:Multimap
Convenience method for untyped inquiry.- Specified by:
imageAllUnchecked
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:
-
preimageAll
Description copied from interface:Multimap
Returns the set of left components of pairs in this multimap, which have a right component in the given set.- Specified by:
preimageAll
in interfaceMultimap<A,
B>
-
preimageAllUnchecked
Description copied from interface:Multimap
Convenience method for untyped inquiry.- Specified by:
preimageAllUnchecked
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>
-