Top Description Fields Constructors Methods
org.eclipse.collections.impl.multimap.set.sorted

public final Class SynchronizedPutTreeSortedSetMultimap<K, V>

extends AbstractSynchronizedPutMultimap<K, V, MutableSortedSet<V>>
implements MutableSortedSetMultimap<K, V>, Externalizable
Class Inheritance
All Implemented Interfaces
java.io.Externalizable, java.io.Serializable, org.eclipse.collections.api.multimap.sortedset.MutableSortedSetMultimap, org.eclipse.collections.api.multimap.sortedset.SortedSetMultimap, org.eclipse.collections.api.multimap.ordered.ReversibleIterableMultimap, org.eclipse.collections.api.multimap.ordered.OrderedIterableMultimap, org.eclipse.collections.api.multimap.Multimap, org.eclipse.collections.api.multimap.ordered.SortedIterableMultimap, org.eclipse.collections.api.multimap.set.SetMultimap, org.eclipse.collections.api.multimap.set.MutableSetIterableMultimap, org.eclipse.collections.api.multimap.MutableMultimap
Imports
java.io.Externalizable, .IOException, .ObjectInput, .ObjectOutput, java.util.Comparator, org.eclipse.collections.api.RichIterable, org.eclipse.collections.api.block.function.Function, .Function2, org.eclipse.collections.api.block.predicate.Predicate2, org.eclipse.collections.api.factory.Maps, org.eclipse.collections.api.map.MutableMap, org.eclipse.collections.api.multimap.Multimap, org.eclipse.collections.api.multimap.set.MutableSetMultimap, org.eclipse.collections.api.multimap.sortedset.ImmutableSortedSetMultimap, .MutableSortedSetMultimap, .SortedSetMultimap, org.eclipse.collections.api.set.sorted.ImmutableSortedSet, .MutableSortedSet, org.eclipse.collections.api.tuple.Pair, org.eclipse.collections.impl.multimap.AbstractSynchronizedPutMultimap, org.eclipse.collections.impl.multimap.bag.HashBagMultimap, org.eclipse.collections.impl.multimap.list.FastListMultimap, org.eclipse.collections.impl.set.sorted.mutable.TreeSortedSet, org.eclipse.collections.impl.utility.ArrayIterate, .Iterate

A Multimap that is optimized for parallel writes, but is not protected for concurrent reads.

Field Summary

Modifier and TypeField and Description
private Comparator<? super V>
private static final long

Constructor Summary

AccessConstructor and Description
public
public
public
SynchronizedPutTreeSortedSetMultimap(Multimap<? extends K, ? extends V> multimap)

public
public

Method Summary

Modifier and TypeMethod and Description
public MutableSortedSetMultimap<K, V>
public <K2, V2> HashBagMultimap<K2, V2>
collectKeyMultiValues(Function<? super K, ? extends K2> keyFunction, Function<? super V, ? extends V2> valueFunction)

Implements org.eclipse.collections.api.multimap.sortedset.MutableSortedSetMultimap.collectKeyMultiValues, org.eclipse.collections.api.multimap.MutableMultimap.collectKeyMultiValues, org.eclipse.collections.api.multimap.Multimap.collectKeyMultiValues.

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> HashBagMultimap<K2, V2>
collectKeysValues(Function2<? super K, ? super V, Pair<K2, V2>> function)

Implements org.eclipse.collections.api.multimap.sortedset.MutableSortedSetMultimap.collectKeysValues, org.eclipse.collections.api.multimap.MutableMultimap.collectKeysValues, org.eclipse.collections.api.multimap.Multimap.collectKeysValues.

Returns a new multimap with the results of applying the specified function on each key and value of the source multimap.

public <V2> FastListMultimap<K, V2>
collectValues(Function<? super V, ? extends V2> function)

Implements org.eclipse.collections.api.multimap.sortedset.MutableSortedSetMultimap.collectValues, org.eclipse.collections.api.multimap.MutableMultimap.collectValues, org.eclipse.collections.api.multimap.Multimap.collectValues.

Returns a new multimap with the results of applying the specified function on each value of the source multimap.

public Comparator<? super V>
protected MutableSortedSet<V>
createCollection()

Implements abstract org.eclipse.collections.impl.multimap.AbstractMultimap.createCollection.

Creates the collection of values for a single key.

public MutableSetMultimap<V, K>
public SynchronizedPutTreeSortedSetMultimap<K, V>
public static <K, V> SynchronizedPutTreeSortedSetMultimap<K, V>
newMultimap(Comparator<? super V> comparator)

public static <K, V> SynchronizedPutTreeSortedSetMultimap<K, V>
public static <K, V> SynchronizedPutTreeSortedSetMultimap<K, V>
newMultimap(Multimap<? extends K, ? extends V> multimap)

public static <K, V> SynchronizedPutTreeSortedSetMultimap<K, V>
newMultimap(Pair<K, V>... pairs)

public static <K, V> SynchronizedPutTreeSortedSetMultimap<K, V>
newMultimap(Iterable<Pair<K, V>> inputIterable)

public void
readExternal(ObjectInput in)

Overrides org.eclipse.collections.impl.multimap.AbstractMutableMultimap.readExternal.

Implements java.io.Externalizable.readExternal.

The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays.

public TreeSortedSetMultimap<K, V>
public TreeSortedSetMultimap<K, V>
public TreeSortedSetMultimap<K, V>
public TreeSortedSetMultimap<K, V>
public ImmutableSortedSetMultimap<K, V>
public MutableSortedSetMultimap<K, V>
public SynchronizedPutTreeSortedSetMultimap<K, V>
public void
writeExternal(ObjectOutput out)

Overrides org.eclipse.collections.impl.multimap.AbstractMutableMultimap.writeExternal.

Implements java.io.Externalizable.writeExternal.

The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays.

Inherited from org.eclipse.collections.impl.multimap.AbstractSynchronizedPutMultimap:
addToTotalSizeclearTotalSizecreateMapcreateMapWithKeyCountdecrementTotalSizegetIfAbsentPutAllincrementTotalSizeputsizesubtractFromTotalSize

Field Detail

comparatorback to summary
private Comparator<? super V> comparator
serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

SynchronizedPutTreeSortedSetMultimapback to summary
public SynchronizedPutTreeSortedSetMultimap()
SynchronizedPutTreeSortedSetMultimapback to summary
public SynchronizedPutTreeSortedSetMultimap(Comparator<? super V> comparator)
SynchronizedPutTreeSortedSetMultimapback to summary
public SynchronizedPutTreeSortedSetMultimap(Multimap<? extends K, ? extends V> multimap)
SynchronizedPutTreeSortedSetMultimapback to summary
public SynchronizedPutTreeSortedSetMultimap(Pair<K, V>... pairs)
SynchronizedPutTreeSortedSetMultimapback to summary
public SynchronizedPutTreeSortedSetMultimap(Iterable<Pair<K, V>> inputIterable)

Method Detail

asSynchronizedback to summary
public MutableSortedSetMultimap<K, V> asSynchronized()

Implements org.eclipse.collections.api.multimap.sortedset.MutableSortedSetMultimap.asSynchronized, org.eclipse.collections.api.multimap.MutableMultimap.asSynchronized.

Doc from org.eclipse.collections.api.multimap.MutableMultimap.asSynchronized.

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.

Annotations
@Override
collectKeyMultiValuesback to summary
public <K2, V2> HashBagMultimap<K2, V2> collectKeyMultiValues(Function<? super K, ? extends K2> keyFunction, Function<? super V, ? extends V2> valueFunction)

Implements org.eclipse.collections.api.multimap.sortedset.MutableSortedSetMultimap.collectKeyMultiValues, org.eclipse.collections.api.multimap.MutableMultimap.collectKeyMultiValues, org.eclipse.collections.api.multimap.Multimap.collectKeyMultiValues.

Doc from org.eclipse.collections.api.multimap.Multimap.collectKeyMultiValues.

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);
Annotations
@Override
collectKeysValuesback to summary
public <K2, V2> HashBagMultimap<K2, V2> collectKeysValues(Function2<? super K, ? super V, Pair<K2, V2>> function)

Implements org.eclipse.collections.api.multimap.sortedset.MutableSortedSetMultimap.collectKeysValues, org.eclipse.collections.api.multimap.MutableMultimap.collectKeysValues, org.eclipse.collections.api.multimap.Multimap.collectKeysValues.

Doc from org.eclipse.collections.api.multimap.Multimap.collectKeysValues.

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());
    }
});
Annotations
@Override
collectValuesback to summary
public <V2> FastListMultimap<K, V2> collectValues(Function<? super V, ? extends V2> function)

Implements org.eclipse.collections.api.multimap.sortedset.MutableSortedSetMultimap.collectValues, org.eclipse.collections.api.multimap.MutableMultimap.collectValues, org.eclipse.collections.api.multimap.Multimap.collectValues.

Doc from org.eclipse.collections.api.multimap.Multimap.collectValues.

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();
    }
});
Annotations
@Override
comparatorback to summary
public Comparator<? super V> comparator()

Implements org.eclipse.collections.api.multimap.ordered.SortedIterableMultimap.comparator.

Annotations
@Override
createCollectionback to summary
protected MutableSortedSet<V> createCollection()

Implements abstract org.eclipse.collections.impl.multimap.AbstractMultimap.createCollection.

Doc from org.eclipse.collections.impl.multimap.AbstractMultimap.createCollection.

Creates the collection of values for a single key.

Collections with weak, soft, or phantom references are not supported. Each call to createCollection should create a new instance.

The returned collection class determines whether duplicate key-value pairs are allowed.

Annotations
@Override
flipback to summary
public MutableSetMultimap<V, K> flip()

Implements org.eclipse.collections.api.multimap.sortedset.MutableSortedSetMultimap.flip, org.eclipse.collections.api.multimap.MutableMultimap.flip, org.eclipse.collections.api.multimap.Multimap.flip.

Doc from org.eclipse.collections.api.multimap.Multimap.flip.

Given a Multimap from Domain -> Range return a multimap from Range -> Domain.

Annotations
@Override
newEmptyback to summary
public SynchronizedPutTreeSortedSetMultimap<K, V> newEmpty()

Implements org.eclipse.collections.api.multimap.sortedset.MutableSortedSetMultimap.newEmpty, org.eclipse.collections.api.multimap.MutableMultimap.newEmpty, org.eclipse.collections.api.multimap.Multimap.newEmpty.

Doc from org.eclipse.collections.api.multimap.Multimap.newEmpty.

Creates a new instance of the same implementation type, using the default capacity and growth parameters.

Annotations
@Override
newMultimapback to summary
public static <K, V> SynchronizedPutTreeSortedSetMultimap<K, V> newMultimap(Comparator<? super V> comparator)
newMultimapback to summary
public static <K, V> SynchronizedPutTreeSortedSetMultimap<K, V> newMultimap()
newMultimapback to summary
public static <K, V> SynchronizedPutTreeSortedSetMultimap<K, V> newMultimap(Multimap<? extends K, ? extends V> multimap)
newMultimapback to summary
public static <K, V> SynchronizedPutTreeSortedSetMultimap<K, V> newMultimap(Pair<K, V>... pairs)
newMultimapback to summary
public static <K, V> SynchronizedPutTreeSortedSetMultimap<K, V> newMultimap(Iterable<Pair<K, V>> inputIterable)
readExternalback to summary
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException

Overrides org.eclipse.collections.impl.multimap.AbstractMutableMultimap.readExternal.

Implements java.io.Externalizable.readExternal.

Doc from java.io.Externalizable.readExternal.

The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays. The readExternal method must read the values in the same sequence and with the same types as were written by writeExternal.

Annotations
@Override
Exceptions
IOException:
if I/O errors occur
ClassNotFoundException:
If the class for an object being restored cannot be found.
rejectKeysMultiValuesback to summary
public TreeSortedSetMultimap<K, V> rejectKeysMultiValues(Predicate2<? super K, ? super RichIterable<V>> predicate)

Implements org.eclipse.collections.api.multimap.sortedset.MutableSortedSetMultimap.rejectKeysMultiValues, org.eclipse.collections.api.multimap.MutableMultimap.rejectKeysMultiValues, org.eclipse.collections.api.multimap.Multimap.rejectKeysMultiValues.

Doc from org.eclipse.collections.api.multimap.Multimap.rejectKeysMultiValues.

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);
    }
});
Annotations
@Override
rejectKeysValuesback to summary
public TreeSortedSetMultimap<K, V> rejectKeysValues(Predicate2<? super K, ? super V> predicate)

Implements org.eclipse.collections.api.multimap.sortedset.MutableSortedSetMultimap.rejectKeysValues, org.eclipse.collections.api.multimap.MutableMultimap.rejectKeysValues, org.eclipse.collections.api.multimap.Multimap.rejectKeysValues.

Doc from org.eclipse.collections.api.multimap.Multimap.rejectKeysValues.

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"));
    }
});
Annotations
@Override
selectKeysMultiValuesback to summary
public TreeSortedSetMultimap<K, V> selectKeysMultiValues(Predicate2<? super K, ? super RichIterable<V>> predicate)

Implements org.eclipse.collections.api.multimap.sortedset.MutableSortedSetMultimap.selectKeysMultiValues, org.eclipse.collections.api.multimap.MutableMultimap.selectKeysMultiValues, org.eclipse.collections.api.multimap.Multimap.selectKeysMultiValues.

Doc from org.eclipse.collections.api.multimap.Multimap.selectKeysMultiValues.

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);
    }
});
Annotations
@Override
selectKeysValuesback to summary
public TreeSortedSetMultimap<K, V> selectKeysValues(Predicate2<? super K, ? super V> predicate)

Implements org.eclipse.collections.api.multimap.sortedset.MutableSortedSetMultimap.selectKeysValues, org.eclipse.collections.api.multimap.MutableMultimap.selectKeysValues, org.eclipse.collections.api.multimap.Multimap.selectKeysValues.

Doc from org.eclipse.collections.api.multimap.Multimap.selectKeysValues.

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"));
    }
});
Annotations
@Override
toImmutableback to summary
public ImmutableSortedSetMultimap<K, V> toImmutable()

Implements org.eclipse.collections.api.multimap.Multimap.toImmutable, org.eclipse.collections.api.multimap.sortedset.SortedSetMultimap.toImmutable.

Doc from org.eclipse.collections.api.multimap.Multimap.toImmutable.

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 Serializable if this Multimap is Serializable.

Annotations
@Override
toMutableback to summary
public MutableSortedSetMultimap<K, V> toMutable()

Implements org.eclipse.collections.api.multimap.Multimap.toMutable, org.eclipse.collections.api.multimap.sortedset.SortedSetMultimap.toMutable.

Doc from org.eclipse.collections.api.multimap.Multimap.toMutable.

Returns a mutable copy of this Multimap.

Annotations
@Override
withKeyMultiValuesback to summary
public SynchronizedPutTreeSortedSetMultimap<K, V> withKeyMultiValues(K key, V... values)

Overrides org.eclipse.collections.impl.multimap.AbstractSynchronizedPutMultimap.withKeyMultiValues.

Overrides default org.eclipse.collections.api.multimap.sortedset.MutableSortedSetMultimap.withKeyMultiValues, org.eclipse.collections.api.multimap.MutableMultimap.withKeyMultiValues.

Doc from org.eclipse.collections.api.multimap.MutableMultimap.withKeyMultiValues.

Puts the key / values combination into the MutableMultimap and returns the MutableMultimap (this).

Annotations
@Override
writeExternalback to summary
public void writeExternal(ObjectOutput out) throws IOException

Overrides org.eclipse.collections.impl.multimap.AbstractMutableMultimap.writeExternal.

Implements java.io.Externalizable.writeExternal.

Doc from java.io.Externalizable.writeExternal.

The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays.

Annotations
@Override
Exceptions
IOException:
Includes any I/O exceptions that may occur