public class ForwardMultimap<A,B> extends AbstractCollection<Map.Entry<A,B>> implements Multimap<A,B>
Constructor and Description |
---|
ForwardMultimap(Collection<? extends Map.Entry<A,B>> c) |
ForwardMultimap(Map<A,B> forward) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(A a,
B b)
Adds a pair to this this multimap.
|
boolean |
add(Map.Entry<A,B> e) |
void |
clear() |
boolean |
contains(A a,
B b) |
boolean |
containsUnchecked(Object a,
Object b) |
Set<A> |
domain()
Returns the set of left components of pairs in this multimap.
|
Set<B> |
image(A a)
Returns the set of right components of pairs with a given left
component in this multimap.
|
Set<B> |
imageAll(Collection<? extends A> c) |
Set<B> |
imageAllUnchecked(Collection<?> c) |
Map<A,Set<B>> |
imageMap() |
Set<B> |
imageUnchecked(Object a) |
Iterator<Map.Entry<A,B>> |
iterator() |
Set<A> |
preimage(B b)
Returns the set of left components of pairs with a given right
component in this multimap.
|
Set<A> |
preimageAll(Collection<? extends B> c) |
Set<A> |
preimageAllUnchecked(Collection<?> c) |
Map<B,Set<A>> |
preimageMap() |
Set<A> |
preimageUnchecked(Object b) |
Set<B> |
range()
Returns the set of right components of pairs in this multimap.
|
boolean |
relates(A a,
B b) |
boolean |
remove(A a,
B b)
Removes a pair from this this multimap.
|
boolean |
removeAllDomain(Collection<? extends A> c) |
boolean |
removeAllDomainUnchecked(Collection<?> c) |
boolean |
removeAllRange(Collection<? extends B> c) |
boolean |
removeAllRangeUnchecked(Collection<?> c) |
boolean |
removeDomain(A a)
Removes all pairs with a given left component from this
multimap.
|
boolean |
removeDomainUnchecked(Object a) |
boolean |
removeRange(B b)
Removes all pairs with a given right component from this
multimap.
|
boolean |
removeRangeUnchecked(Object b) |
boolean |
removeUnchecked(Object a,
Object b) |
boolean |
retainAllDomain(Collection<? extends A> c) |
boolean |
retainAllDomainUnchecked(Collection<?> c) |
boolean |
retainAllRange(Collection<? extends B> c) |
boolean |
retainAllRangeUnchecked(Collection<?> c) |
int |
size() |
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addAll, contains, containsAll, equals, hashCode, isEmpty, remove, removeAll, retainAll, spliterator, toArray, toArray
parallelStream, removeIf, stream
public ForwardMultimap(Collection<? extends Map.Entry<A,B>> c)
public int size()
public void clear()
public boolean add(A a, B b)
Multimap
equals
any pair contained in
this multimap componentwise must not change this multimap.public boolean containsUnchecked(Object a, Object b)
containsUnchecked
in interface Multimap<A,B>
public boolean remove(A a, B b)
Multimap
equals
no pair contained in this multimap componentwise
must not change this multimap.public boolean removeUnchecked(Object a, Object b)
removeUnchecked
in interface Multimap<A,B>
public boolean removeDomain(A a)
Multimap
removeDomain(final A a) { for (B b : new HashSet<B>(range())) remove(a, b) ; }
removeDomain
in interface Multimap<A,B>
a
- the left component of all pairs to remove.true
if this multimap has been changed by this
operation, false
otherwise.public boolean removeDomainUnchecked(Object a)
public boolean removeRange(B b)
Multimap
removeRange(final B b) { for (A a : new HashSet<A>(domain())) remove(a, b) ; }
removeRange
in interface Multimap<A,B>
b
- the right component of all pairs to remove.true
if this multimap has been changed by this
operation, false
otherwise.public boolean removeRangeUnchecked(Object b)
public boolean removeAllDomain(Collection<? extends A> c)
removeAllDomain
in interface Multimap<A,B>
public boolean removeAllDomainUnchecked(Collection<?> c)
removeAllDomainUnchecked
in interface Multimap<A,B>
public boolean retainAllDomain(Collection<? extends A> c)
retainAllDomain
in interface Multimap<A,B>
public boolean retainAllDomainUnchecked(Collection<?> c)
retainAllDomainUnchecked
in interface Multimap<A,B>
public boolean removeAllRange(Collection<? extends B> c)
removeAllRange
in interface Multimap<A,B>
public boolean removeAllRangeUnchecked(Collection<?> c)
removeAllRangeUnchecked
in interface Multimap<A,B>
public boolean retainAllRange(Collection<? extends B> c)
retainAllRange
in interface Multimap<A,B>
public boolean retainAllRangeUnchecked(Collection<?> c)
retainAllRangeUnchecked
in interface Multimap<A,B>
public Set<A> domain()
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 the remove
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 the entrySet
of the
underlying map does.
public Set<B> range()
If this multimap supports the removeRange
operation,
then the returned set and its iterators must support the remove
operation.
The set returned by this implementation and its iterator
supports the remove
method if the entrySet
of the
underlying map does.
public Set<B> image(A a)
Multimap
The returned set need not be modifiable. The behaviour of this multimap after successfully modifying the returned set is unspecified.
public Set<B> imageUnchecked(Object a)
imageUnchecked
in interface Multimap<A,B>
public Set<B> imageAll(Collection<? extends A> c)
public Set<B> imageAllUnchecked(Collection<?> c)
imageAllUnchecked
in interface Multimap<A,B>
public Set<A> preimage(B b)
Multimap
The returned set need not be modifiable. The behaviour of this multimap after successfully modifying the returned set is unspecified.
public Set<A> preimageUnchecked(Object b)
preimageUnchecked
in interface Multimap<A,B>
public Set<A> preimageAll(Collection<? extends B> c)
preimageAll
in interface Multimap<A,B>
public Set<A> preimageAllUnchecked(Collection<?> c)
preimageAllUnchecked
in interface Multimap<A,B>
see also the complete user documentation .