| Modifier and Type | Field and Description |
|---|---|
| private static final long |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| SynchronizedSetMultimap | back to summary |
|---|---|
| public SynchronizedSetMultimap(MutableSetMultimap<K, V> multimap) | |
| SynchronizedSetMultimap | back to summary |
|---|---|
| public SynchronizedSetMultimap(MutableSetMultimap<K, V> multimap, Object newLock) | |
| asSynchronized | back to summary |
|---|---|
| public MutableSetMultimap Implements org. Doc from org. 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.
| |
| collectKeyMultiValues | back to summary |
|---|---|
| public <K2, V2> MutableBagMultimap Implements 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> MutableBagMultimap Implements 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> MutableBagMultimap Implements 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 MutableSetMultimap Implements org. Doc from org. Given a Multimap from Domain
| |
| forEachKeyMutableSet | back to summary |
|---|---|
| public void forEachKeyMutableSet(Procedure2<? super K, ? super MutableSet<V>> procedure) Implements org.
| |
| get | back to summary |
|---|---|
| public MutableSet Implements org. Doc from org. Returns a view of all values associated with the given key. If the given key does not exist, an empty
| |
| getDelegate | back to summary |
|---|---|
| protected MutableSetMultimap Overrides org.
| |
| getIfAbsentPutAll | back to summary |
|---|---|
| public MutableSet Implements org. Doc from org. 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 MutableSetMultimap Implements org. Doc from org. Creates a new instance of the same implementation type, using the default capacity and growth parameters.
| |
| of | back to summary |
|---|---|
| public static <K, V> SynchronizedSetMultimap This method will take a Multimap and wrap it directly in a SynchronizedSetMultimap. | |
| of | back to summary |
|---|---|
| public static <K, V> SynchronizedSetMultimap This method will take a Multimap and wrap it directly in a SynchronizedSetMultimap. Additionally, a developer specifies which lock to use with the collection. | |
| rejectKeysMultiValues | back to summary |
|---|---|
| public MutableSetMultimap Implements 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 MutableSetMultimap Implements 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"));
}
});
| |
| removeAll | back to summary |
|---|---|
| public MutableSet Implements org.
| |
| replaceValues | back to summary |
|---|---|
| public MutableSet Implements org.
| |
| selectKeysMultiValues | back to summary |
|---|---|
| public MutableSetMultimap Implements 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 MutableSetMultimap Implements 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"));
}
});
| |
| toImmutable | back to summary |
|---|---|
| public ImmutableSetMultimap Implements org. Doc from org. Returns an immutable copy of this Multimap if it is not already immutable. If the Multimap is immutable, it will return itself. The returned Multimap will be
| |
| toMutable | back to summary |
|---|---|
| public MutableSetMultimap Implements org. Doc from org. Returns a mutable copy of this Multimap.
| |
| withKeyMultiValues | back to summary |
|---|---|
| public MutableSetMultimap Overrides org. Overrides default org. Doc from org. Puts the key / values combination into the MutableMultimap and returns the MutableMultimap (this).
| |