public abstract class AbstractMultimap<A,B> extends AbstractCollection<Map.Entry<A,B>> implements Multimap<A,B>
| Constructor and Description |
|---|
AbstractMultimap() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(A a,
B b)
Adds a pair to this this multimap.
|
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) |
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) |
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitadd, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, spliterator, toArray, toArrayparallelStream, removeIf, streampublic boolean add(A a, B b)
Multimapequals any pair contained in
this multimap componentwise must not change this multimap.public boolean remove(A a, B b)
Multimapequals 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 containsUnchecked(Object a, Object b)
containsUnchecked in interface Multimap<A,B>public Set<A> domain()
MultimapThe 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.
public Set<B> range()
MultimapIf this multimap supports the removeRange operation,
then the returned set and its iterators must support the remove operation.
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<B> image(A a)
MultimapThe 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)
MultimapThe 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 .