| Modifier and Type | Method and Description |
|---|---|
| public default boolean | |
| public MutableMultimap | Returns: a synchronized view of this multimap.Returns a synchronized wrapper backed by this multimap. |
| public void | |
| public <K2, V2> MutableMultimap | collectKeyMultiValues(Function<? super K, ? extends K2> keyFunction, Function<? super V, ? extends V2> valueFunction)
Redeclares org. Returns a new multimap with the results of applying the specified keyFunction and valueFunction on each key and corresponding values of the source multimap. |
| public <K2, V2> MutableMultimap | collectKeysValues(Function2<? super K, ? super V, Pair<K2, V2>> function)
Redeclares org. Returns a new multimap with the results of applying the specified function on each key and value of the source multimap. |
| public <V2> MutableMultimap | collectValues(Function<? super V, ? extends V2> function)
Redeclares org. Returns a new multimap with the results of applying the specified function on each value of the source multimap. |
| public MutableMultimap | flip()
Redeclares org. Given a Multimap from Domain |
| public MutableCollection | get(K key)
Redeclares org. Returns a view of all values associated with the given key. |
| public MutableCollection | getIfAbsentPutAll(K key, Iterable<? extends V> values)
Puts values into multimap if there are no values already associated with key. |
| public MutableMultimap | newEmpty()
Redeclares org. Creates a new instance of the same implementation type, using the default capacity and growth parameters. |
| public boolean | |
| public boolean | |
| public <KK extends K, VV extends V> boolean | |
| public default boolean | |
| public default boolean | |
| public MutableMultimap | rejectKeysMultiValues(Predicate2<? super K, ? super RichIterable<V>> predicate)
Redeclares org. Returns all elements of the source multimap that don't satisfy the predicate. |
| public MutableMultimap | rejectKeysValues(Predicate2<? super K, ? super V> predicate)
Redeclares org. Returns all elements of the source multimap that don't satisfy the predicate. |
| public boolean | |
| public RichIterable | |
| public RichIterable | |
| public MutableMultimap | selectKeysMultiValues(Predicate2<? super K, ? super RichIterable<V>> predicate)
Redeclares org. Returns all elements of the source multimap that satisfies the predicate. |
| public MutableMultimap | selectKeysValues(Predicate2<? super K, ? super V> predicate)
Redeclares org. Returns all elements of the source multimap that satisfies the predicate. |
| public default MutableMultimap | withKeyMultiValues(K key, V... values)
Puts the key / values combination into the MutableMultimap and returns the MutableMultimap (this). |
| public default MutableMultimap | withKeyValue(K key, V value)
Puts the key / value combination into the MutableMultimap and returns the MutableMultimap (this). |
| add | back to summary |
|---|---|
| public default boolean add(Pair<? extends K, ? extends V> keyValuePair) Modification operation similar to put, however, takes the key-value pair as the input.
| |
| asSynchronized | back to summary |
|---|---|
| public MutableMultimap Returns a synchronized wrapper backed by this multimap. The preferred way of iterating over a synchronized multimap is to use the forEachKey(), forEachValue(), forEachKeyValue() and forEachKeyMultiValues methods which are properly synchronized internally. MutableMultimap synchedMultimap = multimap.asSynchronized(); synchedMultimap.forEachKey(key -> ... ); synchedMultimap.forEachValue(value -> ... ); synchedMultimap.forEachKeyValue((key, value) -> ... ); synchedMultimap.forEachKeyMultiValues((key, values) -> ... ); If you want to iterate imperatively over the keySet(), keysView(), valuesView(), or other views, you will need to protect the iteration by wrapping the code in a synchronized block on the multimap.
| |
| clear | back to summary |
|---|---|
| public void clear() | |
| collectKeyMultiValues | back to summary |
|---|---|
| public <K2, V2> MutableMultimap Redeclares org. Doc from org. Returns a new multimap with the results of applying the specified keyFunction and valueFunction on each key and corresponding values of the source multimap. This method is also commonly called transform or map. e.g. return multimap.collectKeyMultiValues(each -> each + 1, Person::getLastName);
| |
| collectKeysValues | back to summary |
|---|---|
| public <K2, V2> MutableMultimap Redeclares org. Doc from org. Returns a new multimap with the results of applying the specified function on each key and value of the source multimap. This method is also commonly called transform or map. e.g.
return multimap.collectKeysValues(new Function2<Integer, Person, Pair<String, String>>()
{
public Pair<String, String> valueOf(Integer age, Person person)
{
return Tuples.pair(age.toString(), person.getLastName());
}
});
| |
| collectValues | back to summary |
|---|---|
| public <V2> MutableMultimap Redeclares org. Doc from org. Returns a new multimap with the results of applying the specified function on each value of the source multimap. This method is also commonly called transform or map. e.g.
return multimap.collectValues(new Function<Person, String>()
{
public String valueOf(Person person)
{
return person.getLastName();
}
});
| |
| flip | back to summary |
|---|---|
| public MutableMultimap Redeclares org. Doc from org. Given a Multimap from Domain
| |
| get | back to summary |
|---|---|
| public MutableCollection Redeclares org. Doc from org. Returns a view of all values associated with the given key. If the given key does not exist, an empty
| |
| getIfAbsentPutAll | back to summary |
|---|---|
| public MutableCollection Puts values into multimap if there are no values already associated with key.
Then returns a view of the values associated with key, like the result of
| |
| newEmpty | back to summary |
|---|---|
| public MutableMultimap Redeclares org. Doc from org. Creates a new instance of the same implementation type, using the default capacity and growth parameters.
| |
| put | back to summary |
|---|---|
| public boolean put(K key, V value) | |
| putAll | back to summary |
|---|---|
| public boolean putAll(K key, Iterable<? extends V> values) | |
| putAll | back to summary |
|---|---|
| public <KK extends K, VV extends V> boolean putAll(Multimap<KK, VV> multimap) | |
| putAllPairs | back to summary |
|---|---|
| public default boolean putAllPairs(Pair<? extends K, ? extends V>... pairs) | |
| putAllPairs | back to summary |
|---|---|
| public default boolean putAllPairs(Iterable<? extends Pair<? extends K, ? extends V>> pairs) | |
| rejectKeysMultiValues | back to summary |
|---|---|
| public MutableMultimap Redeclares org. Doc from org. Returns all elements of the source multimap that don't satisfy the predicate. e.g.
return multimap.rejectKeysMultiValues(new Predicate2<Integer, Iterable<Person>>()
{
public boolean accept(Integer age, Iterable<Person> values)
{
return (age >= 18)
&& ((RichIterable<Person>)values.size() >= 2);
}
});
| |
| rejectKeysValues | back to summary |
|---|---|
| public MutableMultimap Redeclares org. Doc from org. Returns all elements of the source multimap that don't satisfy the predicate. e.g.
return multimap.rejectKeysValues(new Predicate2<Integer, Person>()
{
public boolean accept(Integer age, Person person)
{
return (age >= 18)
&& (person.getAddress().getCity().equals("Metuchen"));
}
});
| |
| remove | back to summary |
|---|---|
| public boolean remove(Object key, Object value) | |
| removeAll | back to summary |
|---|---|
| public RichIterable | |
| replaceValues | back to summary |
|---|---|
| public RichIterable | |
| selectKeysMultiValues | back to summary |
|---|---|
| public MutableMultimap Redeclares org. Doc from org. Returns all elements of the source multimap that satisfies the predicate. This method is also commonly called filter. e.g.
return multimap.selectKeysMultiValues(new Predicate2<Integer, Iterable<Person>>()
{
public boolean accept(Integer age, Iterable<Person> values)
{
return (age >= 18)
&& ((RichIterable<Person>)values.size() >= 2);
}
});
| |
| selectKeysValues | back to summary |
|---|---|
| public MutableMultimap Redeclares org. Doc from org. Returns all elements of the source multimap that satisfies the predicate. This method is also commonly called filter. e.g.
return multimap.selectKeysValues(new Predicate2<Integer, Person>()
{
public boolean accept(Integer age, Person person)
{
return (age >= 18)
&& (person.getAddress().getCity().equals("Metuchen"));
}
});
| |
| withKeyMultiValues | back to summary |
|---|---|
| public default MutableMultimap Puts the key / values combination into the MutableMultimap and returns the MutableMultimap (this).
| |
| withKeyValue | back to summary |
|---|---|
| public default MutableMultimap Puts the key / value combination into the MutableMultimap and returns the MutableMultimap (this).
| |