Top Description Fields Constructors Methods
org.eclipse.collections.impl.map.strategy.immutable

pack-priv final Class ImmutableEmptyMapWithHashingStrategy<K, V>

extends AbstractImmutableMap<K, V>
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
java.io.Serializable, java.util.Collection, .Map, .Set, org.eclipse.collections.api.RichIterable, org.eclipse.collections.api.block.HashingStrategy, org.eclipse.collections.api.block.function.Function, .Function0, .Function2, org.eclipse.collections.api.block.predicate.Predicate2, org.eclipse.collections.api.block.procedure.Procedure, .Procedure2, org.eclipse.collections.api.block.procedure.primitive.ObjectIntProcedure, org.eclipse.collections.api.factory.Lists, .Maps, .Sets, org.eclipse.collections.api.map.ImmutableMap, org.eclipse.collections.api.tuple.Pair, org.eclipse.collections.impl.map.immutable.AbstractImmutableMap, org.eclipse.collections.impl.utility.LazyIterate

This is a zero element ImmutableUnifiedMapWithHashingStrategy which is created by calling the HashingStrategyMaps.immutable.empty() method.

Field Summary

Modifier and TypeField and Description
private final HashingStrategy<? super K>
private static final long

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public <K2, V2> ImmutableMap<K2, V2>
collect(Function2<? super K, ? super V, Pair<K2, V2>> function)

Overrides org.eclipse.collections.impl.map.immutable.AbstractImmutableMap.collect.

Implements org.eclipse.collections.api.map.ImmutableMap.collect, org.eclipse.collections.api.map.MapIterable.collect.

For each key and value of the map the function is evaluated.

public <R> ImmutableMap<R, V>
public <R> ImmutableMap<K, R>
public boolean
containsKey(Object key)

Implements org.eclipse.collections.api.map.MapIterable.containsKey, java.util.Map.containsKey.

Returns true if this map contains a mapping for the specified key.

public boolean
containsValue(Object value)

Implements org.eclipse.collections.api.map.MapIterable.containsValue, java.util.Map.containsValue.

Returns true if this map maps one or more keys to the specified value.

public Pair<K, V>
detect(Predicate2<? super K, ? super V> predicate)

Overrides org.eclipse.collections.impl.map.immutable.AbstractImmutableMap.detect.

Implements org.eclipse.collections.api.map.MapIterable.detect.

Return the first key and value of the map for which the predicate evaluates to true when they are given as arguments.

public boolean
equals(Object other)

Overrides java.lang.Object.equals.

Implements org.eclipse.collections.api.map.MapIterable.equals, java.util.Map.equals.

Compares the specified object with this map for equality.

public ImmutableMap<V, K>
flipUniqueValues()

Overrides org.eclipse.collections.impl.map.immutable.AbstractImmutableMap.flipUniqueValues.

Implements org.eclipse.collections.api.map.ImmutableMap.flipUniqueValues, org.eclipse.collections.api.map.MapIterable.flipUniqueValues.

Return the MapIterable that is obtained by flipping the direction of this map and making the associations from value to key.

public void
forEachKey(Procedure<? super K> procedure)

Overrides org.eclipse.collections.impl.map.AbstractMapIterable.forEachKey.

Implements org.eclipse.collections.api.map.MapIterable.forEachKey.

Calls the procedure with each key of the map.

public void
forEachKeyValue(Procedure2<? super K, ? super V> procedure)

Implements org.eclipse.collections.api.map.MapIterable.forEachKeyValue.

Calls the procedure with each key-value pair of the map.

public void
forEachValue(Procedure<? super V> procedure)

Overrides org.eclipse.collections.impl.map.AbstractMapIterable.forEachValue.

Implements org.eclipse.collections.api.map.MapIterable.forEachValue.

Calls the procedure with each value of the map.

public <P> void
forEachWith(Procedure2<? super V, ? super P> procedure, P parameter)

Overrides org.eclipse.collections.impl.map.AbstractMapIterable.forEachWith.

Implements org.eclipse.collections.api.InternalIterable.forEachWith.

The procedure2 is evaluated for each element in the iterable with the specified parameter provided as the second argument.

public void
forEachWithIndex(ObjectIntProcedure<? super V> objectIntProcedure)

Overrides org.eclipse.collections.impl.map.AbstractMapIterable.forEachWithIndex.

Implements org.eclipse.collections.api.InternalIterable.forEachWithIndex.

Iterates over the iterable passing each element and the current relative int index to the specified instance of ObjectIntProcedure.

public V
get(Object key)

Implements org.eclipse.collections.api.map.MapIterable.get, java.util.Map.get.

Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.

public V
getIfAbsent(K key, Function0<? extends V> function)

Overrides org.eclipse.collections.impl.map.AbstractMapIterable.getIfAbsent.

Implements org.eclipse.collections.api.map.MapIterable.getIfAbsent.

Return the value in the Map that corresponds to the specified key, or if there is no value at the key, return the result of evaluating the specified Function0.

public V
getIfAbsentValue(K key, V value)

Overrides org.eclipse.collections.impl.map.AbstractMapIterable.getIfAbsentValue.

Implements org.eclipse.collections.api.map.MapIterable.getIfAbsentValue.

Return the value in the Map that corresponds to the specified key, or if there is no value at the key, return value.

public <P> V
getIfAbsentWith(K key, Function<? super P, ? extends V> function, P parameter)

Overrides org.eclipse.collections.impl.map.AbstractMapIterable.getIfAbsentWith.

Implements org.eclipse.collections.api.map.MapIterable.getIfAbsentWith.

Return the value in the Map that corresponds to the specified key, or if there is no value at the key, return the result of evaluating the specified function and parameter.

public V
getOnly()

Overrides org.eclipse.collections.impl.map.AbstractMapIterable.getOnly.

Overrides default org.eclipse.collections.api.RichIterable.getOnly.

Returns the element if the iterable has exactly one element.

public int
public <A> A
ifPresentApply(K key, Function<? super V, ? extends A> function)

Overrides org.eclipse.collections.impl.map.AbstractMapIterable.ifPresentApply.

Implements org.eclipse.collections.api.map.MapIterable.ifPresentApply.

If there is a value in the Map that corresponds to the specified key return the result of applying the specified Function on the value, otherwise return null.

public boolean
public Set<K>
keySet()

Implements java.util.Map.keySet.

Returns a Set view of the keys contained in this map.

public RichIterable<K>
keysView()

Implements org.eclipse.collections.api.map.MapIterable.keysView.

Returns an unmodifiable lazy iterable wrapped around the keySet for the map.

public RichIterable<Pair<K, V>>
keyValuesView()

Implements org.eclipse.collections.api.map.MapIterable.keyValuesView.

Returns an unmodifiable lazy iterable of key/value pairs wrapped around the entrySet for the map.

public boolean
notEmpty()

Overrides default org.eclipse.collections.api.RichIterable.notEmpty.

The English equivalent of !this.isEmpty()

public ImmutableMap<K, V>
reject(Predicate2<? super K, ? super V> predicate)

Overrides org.eclipse.collections.impl.map.immutable.AbstractImmutableMap.reject.

Implements org.eclipse.collections.api.map.ImmutableMap.reject, org.eclipse.collections.api.map.MapIterable.reject.

For each key and value of the map the predicate is evaluated, if the result of the evaluation is false, that key and value are returned in a new map.

public ImmutableMap<K, V>
select(Predicate2<? super K, ? super V> predicate)

Overrides org.eclipse.collections.impl.map.immutable.AbstractImmutableMap.select.

Implements org.eclipse.collections.api.map.ImmutableMap.select, org.eclipse.collections.api.map.MapIterable.select.

For each key and value of the map the predicate is evaluated, if the result of the evaluation is true, that key and value are returned in a new map.

public int
size()

Implements org.eclipse.collections.api.RichIterable.size, java.util.Map.size.

Returns the number of key-value mappings in this map.

public String
toString()

Overrides org.eclipse.collections.impl.AbstractRichIterable.toString.

Implements org.eclipse.collections.api.map.MapIterable.toString, org.eclipse.collections.api.RichIterable.toString.

Returns a string with the keys and values of this map separated by commas with spaces and enclosed in curly braces.

public Collection<V>
values()

Implements java.util.Map.values.

Returns a Collection view of the values contained in this map.

public RichIterable<V>
valuesView()

Implements org.eclipse.collections.api.map.MapIterable.valuesView.

Returns an unmodifiable lazy iterable wrapped around the values for the map.

private Object
Inherited from org.eclipse.collections.impl.map.immutable.AbstractImmutableMap:
aggregateBycastToMapclearcollectcollectBooleancollectBytecollectCharcollectDoublecollectFloatcollectIfcollectIntcollectLongcollectShortcollectWithcountBycountByEachcountByWithdetectOptionalentrySetflatCollectflipforEachgroupBygroupByEachgroupByUniqueKeyiteratornewWithAllKeyValueArgumentsnewWithAllKeyValuesnewWithKeyValuenewWithMapnewWithMapIterablenewWithoutAllKeysnewWithoutKeypartitionpartitionWithputputAllrejectrejectWithremoveselectselectInstancesOfselectWithsumByDoublesumByFloatsumByIntsumByLongtaptoImmutabletoMapzipzipWithIndex

Field Detail

hashingStrategyback to summary
private final HashingStrategy<? super K> hashingStrategy
serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

ImmutableEmptyMapWithHashingStrategyback to summary
pack-priv ImmutableEmptyMapWithHashingStrategy(HashingStrategy<? super K> hashingStrategy)

Method Detail

collectback to summary
public <K2, V2> ImmutableMap<K2, V2> collect(Function2<? super K, ? super V, Pair<K2, V2>> function)

Overrides org.eclipse.collections.impl.map.immutable.AbstractImmutableMap.collect.

Implements org.eclipse.collections.api.map.ImmutableMap.collect, org.eclipse.collections.api.map.MapIterable.collect.

Doc from org.eclipse.collections.api.map.MapIterable.collect.

For each key and value of the map the function is evaluated. The results of these evaluations are returned in a new map. The map returned will use the values projected from the function rather than the original values.

MapIterable<String, String> collected =
    peopleByCity.collect((City city, Person person) -> Pair.of(city.getCountry(), person.getAddress().getCity()));
Annotations
@Override
collectKeysUniqueback to summary
public <R> ImmutableMap<R, V> collectKeysUnique(Function2<? super K, ? super V, ? extends R> function)

Overrides org.eclipse.collections.impl.map.immutable.AbstractImmutableMap.collectKeysUnique.

Implements org.eclipse.collections.api.map.ImmutableMap.collectKeysUnique, org.eclipse.collections.api.map.MapIterable.collectKeysUnique.

Doc from org.eclipse.collections.api.map.MapIterable.collectKeysUnique.

For each key and value of the map the function is evaluated. The results of these evaluations are returned in a new map. The map returned will use the keys projected from the function rather than the original keys.

Annotations
@Override
collectValuesback to summary
public <R> ImmutableMap<K, R> collectValues(Function2<? super K, ? super V, ? extends R> function)

Overrides org.eclipse.collections.impl.map.immutable.AbstractImmutableMap.collectValues.

Implements org.eclipse.collections.api.map.ImmutableMap.collectValues, org.eclipse.collections.api.map.MapIterable.collectValues.

Doc from org.eclipse.collections.api.map.MapIterable.collectValues.

For each key and value of the map the function is evaluated. The results of these evaluations are returned in a new map. The map returned will use the values projected from the function rather than the original values.

MapIterable<City, String> collected =
    peopleByCity.collectValues((City city, Person person) -> person.getFirstName() + " " + person.getLastName());
Annotations
@Override
containsKeyback to summary
public boolean containsKey(Object key)

Implements org.eclipse.collections.api.map.MapIterable.containsKey, java.util.Map.containsKey.

Doc from java.util.Map.containsKey.

Returns true if this map contains a mapping for the specified key. More formally, returns true if and only if this map contains a mapping for a key k such that Objects.equals(key, k). (There can be at most one such mapping.)

Annotations
@Override
containsValueback to summary
public boolean containsValue(Object value)

Implements org.eclipse.collections.api.map.MapIterable.containsValue, java.util.Map.containsValue.

Doc from java.util.Map.containsValue.

Returns true if this map maps one or more keys to the specified value. More formally, returns true if and only if this map contains at least one mapping to a value v such that Objects.equals(value, v). This operation will probably require time linear in the map size for most implementations of the Map interface.

Annotations
@Override
detectback to summary
public Pair<K, V> detect(Predicate2<? super K, ? super V> predicate)

Overrides org.eclipse.collections.impl.map.immutable.AbstractImmutableMap.detect.

Implements org.eclipse.collections.api.map.MapIterable.detect.

Doc from org.eclipse.collections.api.map.MapIterable.detect.

Return the first key and value of the map for which the predicate evaluates to true when they are given as arguments. The predicate will only be evaluated until such pair is found or until all the keys and values of the map have been used as arguments. That is, there may be keys and values of the map that are never used as arguments to the predicate. The result is null if predicate does not evaluate to true for any key/value combination.

Pair<City, Person> detected =
    peopleByCity.detect((City city, Person person) -> city.getName().equals("Anytown") && person.getLastName().equals("Smith"));
Annotations
@Override
equalsback to summary
public boolean equals(Object other)

Overrides java.lang.Object.equals.

Implements org.eclipse.collections.api.map.MapIterable.equals, java.util.Map.equals.

Doc from java.util.Map.equals.

Compares the specified object with this map for equality. Returns true if the given object is also a map and the two maps represent the same mappings. More formally, two maps m1 and m2 represent the same mappings if m1.entrySet().equals(m2.entrySet()). This ensures that the equals method works properly across different implementations of the Map interface.

Annotations
@Override
flipUniqueValuesback to summary
public ImmutableMap<V, K> flipUniqueValues()

Overrides org.eclipse.collections.impl.map.immutable.AbstractImmutableMap.flipUniqueValues.

Implements org.eclipse.collections.api.map.ImmutableMap.flipUniqueValues, org.eclipse.collections.api.map.MapIterable.flipUniqueValues.

Doc from org.eclipse.collections.api.map.MapIterable.flipUniqueValues.

Return the MapIterable that is obtained by flipping the direction of this map and making the associations from value to key.

    MapIterable<Integer, String> map = this.newMapWithKeysValues(1, "1", 2, "2", 3, "3");
    MapIterable<String, Integer> result = map.flipUniqueValues();
    Assert.assertTrue(result.equals(UnifiedMap.newWithKeysValues("1", 1, "2", 2, "3", 3)));
Annotations
@Override
forEachKeyback to summary
public void forEachKey(Procedure<? super K> procedure)

Overrides org.eclipse.collections.impl.map.AbstractMapIterable.forEachKey.

Implements org.eclipse.collections.api.map.MapIterable.forEachKey.

Doc from org.eclipse.collections.api.map.MapIterable.forEachKey.

Calls the procedure with each key of the map.

    final Collection<Integer> result = new ArrayList<Integer>();
    MutableMap<Integer, String> map = this.newMapWithKeysValues(1, "1", 2, "2", 3, "3");
    map.forEachKey(new CollectionAddProcedure<Integer>(result));
    Verify.assertContainsAll(result, 1, 2, 3);
Annotations
@Override
forEachKeyValueback to summary
public void forEachKeyValue(Procedure2<? super K, ? super V> procedure)

Implements org.eclipse.collections.api.map.MapIterable.forEachKeyValue.

Doc from org.eclipse.collections.api.map.MapIterable.forEachKeyValue.

Calls the procedure with each key-value pair of the map.

    final Collection<String> collection = new ArrayList<String>();
    MutableMap<Integer, String> map = this.newMapWithKeysValues(1, "One", 2, "Two", 3, "Three");
    map.forEachKeyValue((Integer key, String value) -> collection.add(String.valueOf(key) + value));
    Verify.assertContainsAll(collection, "1One", "2Two", "3Three");
Annotations
@Override
forEachValueback to summary
public void forEachValue(Procedure<? super V> procedure)

Overrides org.eclipse.collections.impl.map.AbstractMapIterable.forEachValue.

Implements org.eclipse.collections.api.map.MapIterable.forEachValue.

Doc from org.eclipse.collections.api.map.MapIterable.forEachValue.

Calls the procedure with each value of the map.

    Set<String> result = UnifiedSet.newSet();
    MutableMap<Integer, String> map = this.newMapWithKeysValues(1, "One", 2, "Two", 3, "Three", 4, "Four");
    map.forEachValue(new CollectionAddProcedure<String>(result));
    Verify.assertSetsEqual(UnifiedSet.newSetWith("One", "Two", "Three", "Four"), result);
Annotations
@Override
forEachWithback to summary
public <P> void forEachWith(Procedure2<? super V, ? super P> procedure, P parameter)

Overrides org.eclipse.collections.impl.map.AbstractMapIterable.forEachWith.

Implements org.eclipse.collections.api.InternalIterable.forEachWith.

Doc from org.eclipse.collections.api.InternalIterable.forEachWith.

The procedure2 is evaluated for each element in the iterable with the specified parameter provided as the second argument.

Example using a Java 8 lambda:

people.forEachWith((Person person, Person other) ->
    {
        if (person.isRelatedTo(other))
        {
             LOGGER.info(person.getName());
        }
    }, fred);

Example using an anonymous inner class:

people.forEachWith(new Procedure2<Person, Person>()
{
    public void value(Person person, Person other)
    {
        if (person.isRelatedTo(other))
        {
             LOGGER.info(person.getName());
        }
    }
}, fred);
Annotations
@Override
forEachWithIndexback to summary
public void forEachWithIndex(ObjectIntProcedure<? super V> objectIntProcedure)

Overrides org.eclipse.collections.impl.map.AbstractMapIterable.forEachWithIndex.

Implements org.eclipse.collections.api.InternalIterable.forEachWithIndex.

Doc from org.eclipse.collections.api.InternalIterable.forEachWithIndex.

Iterates over the iterable passing each element and the current relative int index to the specified instance of ObjectIntProcedure.

Example using a Java 8 lambda:

people.forEachWithIndex((Person person, int index) -> LOGGER.info("Index: " + index + " person: " + person.getName()));

Example using an anonymous inner class:

people.forEachWithIndex(new ObjectIntProcedure<Person>()
{
    public void value(Person person, int index)
    {
        LOGGER.info("Index: " + index + " person: " + person.getName());
    }
});
Annotations
@Override
getback to summary
public V get(Object key)

Implements org.eclipse.collections.api.map.MapIterable.get, java.util.Map.get.

Doc from java.util.Map.get.

Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.

More formally, if this map contains a mapping from a key k to a value v such that Objects.equals(key, k), then this method returns v; otherwise it returns null. (There can be at most one such mapping.)

If this map permits null values, then a return value of null does not necessarily indicate that the map contains no mapping for the key; it's also possible that the map explicitly maps the key to null. The containsKey operation may be used to distinguish these two cases.

Annotations
@Override
getIfAbsentback to summary
public V getIfAbsent(K key, Function0<? extends V> function)

Overrides org.eclipse.collections.impl.map.AbstractMapIterable.getIfAbsent.

Implements org.eclipse.collections.api.map.MapIterable.getIfAbsent.

Doc from org.eclipse.collections.api.map.MapIterable.getIfAbsent.

Return the value in the Map that corresponds to the specified key, or if there is no value at the key, return the result of evaluating the specified Function0.

Annotations
@Override
getIfAbsentValueback to summary
public V getIfAbsentValue(K key, V value)

Overrides org.eclipse.collections.impl.map.AbstractMapIterable.getIfAbsentValue.

Implements org.eclipse.collections.api.map.MapIterable.getIfAbsentValue.

Doc from org.eclipse.collections.api.map.MapIterable.getIfAbsentValue.

Return the value in the Map that corresponds to the specified key, or if there is no value at the key, return value.

Annotations
@Override
getIfAbsentWithback to summary
public <P> V getIfAbsentWith(K key, Function<? super P, ? extends V> function, P parameter)

Overrides org.eclipse.collections.impl.map.AbstractMapIterable.getIfAbsentWith.

Implements org.eclipse.collections.api.map.MapIterable.getIfAbsentWith.

Doc from org.eclipse.collections.api.map.MapIterable.getIfAbsentWith.

Return the value in the Map that corresponds to the specified key, or if there is no value at the key, return the result of evaluating the specified function and parameter.

Annotations
@Override
getOnlyback to summary
public V getOnly()

Overrides org.eclipse.collections.impl.map.AbstractMapIterable.getOnly.

Overrides default org.eclipse.collections.api.RichIterable.getOnly.

Doc from org.eclipse.collections.api.RichIterable.getOnly.

Returns the element if the iterable has exactly one element. Otherwise, throw IllegalStateException.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Implements org.eclipse.collections.api.map.MapIterable.hashCode, java.util.Map.hashCode.

Doc from java.util.Map.hashCode.

Returns the hash code value for this map. The hash code of a map is defined to be the sum of the hash codes of each entry in the map's entrySet() view. This ensures that m1.equals(m2) implies that m1.hashCode()==m2.hashCode() for any two maps m1 and m2, as required by the general contract of Object#hashCode.

Annotations
@Override
ifPresentApplyback to summary
public <A> A ifPresentApply(K key, Function<? super V, ? extends A> function)

Overrides org.eclipse.collections.impl.map.AbstractMapIterable.ifPresentApply.

Implements org.eclipse.collections.api.map.MapIterable.ifPresentApply.

Doc from org.eclipse.collections.api.map.MapIterable.ifPresentApply.

If there is a value in the Map that corresponds to the specified key return the result of applying the specified Function on the value, otherwise return null.

Annotations
@Override
isEmptyback to summary
public boolean isEmpty()

Overrides org.eclipse.collections.impl.AbstractRichIterable.isEmpty.

Implements org.eclipse.collections.api.RichIterable.isEmpty, java.util.Map.isEmpty.

Doc from java.util.Map.isEmpty.

Returns true if this map contains no key-value mappings.

Annotations
@Override
keySetback to summary
public Set<K> keySet()

Implements java.util.Map.keySet.

Doc from java.util.Map.keySet.

Returns a Set view of the keys contained in this map. The set is backed by the map, so changes to the map are reflected in the set, and vice-versa. If the map is modified while an iteration over the set is in progress (except through the iterator's own remove operation), the results of the iteration are undefined. The set supports element removal, which removes the corresponding mapping from the map, via the Iterator.remove, Set.remove, removeAll, retainAll, and clear operations. It does not support the add or addAll operations.

Annotations
@Override
keysViewback to summary
public RichIterable<K> keysView()

Implements org.eclipse.collections.api.map.MapIterable.keysView.

Doc from org.eclipse.collections.api.map.MapIterable.keysView.

Returns an unmodifiable lazy iterable wrapped around the keySet for the map.

Annotations
@Override
keyValuesViewback to summary
public RichIterable<Pair<K, V>> keyValuesView()

Implements org.eclipse.collections.api.map.MapIterable.keyValuesView.

Doc from org.eclipse.collections.api.map.MapIterable.keyValuesView.

Returns an unmodifiable lazy iterable of key/value pairs wrapped around the entrySet for the map.

Annotations
@Override
notEmptyback to summary
public boolean notEmpty()

Overrides default org.eclipse.collections.api.RichIterable.notEmpty.

Doc from org.eclipse.collections.api.RichIterable.notEmpty.

The English equivalent of !this.isEmpty()

Annotations
@Override
rejectback to summary
public ImmutableMap<K, V> reject(Predicate2<? super K, ? super V> predicate)

Overrides org.eclipse.collections.impl.map.immutable.AbstractImmutableMap.reject.

Implements org.eclipse.collections.api.map.ImmutableMap.reject, org.eclipse.collections.api.map.MapIterable.reject.

Doc from org.eclipse.collections.api.map.MapIterable.reject.

For each key and value of the map the predicate is evaluated, if the result of the evaluation is false, that key and value are returned in a new map.

MapIterable<City, Person> rejected =
    peopleByCity.reject((city, person) -> city.getName().equals("Anytown") && person.getLastName().equals("Smith"));
Annotations
@Override
selectback to summary
public ImmutableMap<K, V> select(Predicate2<? super K, ? super V> predicate)

Overrides org.eclipse.collections.impl.map.immutable.AbstractImmutableMap.select.

Implements org.eclipse.collections.api.map.ImmutableMap.select, org.eclipse.collections.api.map.MapIterable.select.

Doc from org.eclipse.collections.api.map.MapIterable.select.

For each key and value of the map the predicate is evaluated, if the result of the evaluation is true, that key and value are returned in a new map.

MapIterable<City, Person> selected =
    peopleByCity.select((city, person) -> city.getName().equals("Anytown") && person.getLastName().equals("Smith"));
Annotations
@Override
sizeback to summary
public int size()

Implements org.eclipse.collections.api.RichIterable.size, java.util.Map.size.

Doc from java.util.Map.size.

Returns the number of key-value mappings in this map. If the map contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.

Annotations
@Override
toStringback to summary
public String toString()

Overrides org.eclipse.collections.impl.AbstractRichIterable.toString.

Implements org.eclipse.collections.api.map.MapIterable.toString, org.eclipse.collections.api.RichIterable.toString.

Doc from org.eclipse.collections.api.map.MapIterable.toString.

Returns a string with the keys and values of this map separated by commas with spaces and enclosed in curly braces. Each key and value is separated by an equals sign.

Assert.assertEquals("{1=1, 2=2, 3=3}", Maps.mutable.with(1, 1, 2, 2, 3, 3).toString());
Annotations
@Override
valuesback to summary
public Collection<V> values()

Implements java.util.Map.values.

Doc from java.util.Map.values.

Returns a Collection view of the values contained in this map. The collection is backed by the map, so changes to the map are reflected in the collection, and vice-versa. If the map is modified while an iteration over the collection is in progress (except through the iterator's own remove operation), the results of the iteration are undefined. The collection supports element removal, which removes the corresponding mapping from the map, via the Iterator.remove, Collection.remove, removeAll, retainAll and clear operations. It does not support the add or addAll operations.

Annotations
@Override
valuesViewback to summary
public RichIterable<V> valuesView()

Implements org.eclipse.collections.api.map.MapIterable.valuesView.

Doc from org.eclipse.collections.api.map.MapIterable.valuesView.

Returns an unmodifiable lazy iterable wrapped around the values for the map.

Annotations
@Override
writeReplaceback to summary
private Object writeReplace()