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

pack-priv final Class ImmutableEmptySortedMap<K, V>

extends AbstractImmutableSortedMap<K, V>
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
java.io.Serializable, java.util.Collection, .Comparator, .Map, .NoSuchElementException, .Optional, .Set, org.eclipse.collections.api.RichIterable, 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, .SortedMaps, org.eclipse.collections.api.map.ImmutableMap, org.eclipse.collections.api.map.sorted.ImmutableSortedMap, org.eclipse.collections.api.tuple.Pair, org.eclipse.collections.impl.utility.LazyIterate

This is a zero element ImmutableSortedMap which is created by calling SortedMaps.immutable.empty().

Field Summary

Modifier and TypeField and Description
private final Comparator<? super K>
pack-priv static final ImmutableSortedMap<?, ?>
private static final long

Constructor Summary

AccessConstructor and Description
pack-priv
pack-priv
ImmutableEmptySortedMap(Comparator<? super K> comparator)

Method Summary

Modifier and TypeMethod and Description
public <K2, V2> ImmutableMap<K2, V2>
public <R> ImmutableSortedMap<K, R>
public Comparator<? super K>
comparator()

Implements org.eclipse.collections.api.map.sorted.SortedMapIterable.comparator, java.util.SortedMap.comparator.

Returns the comparator used to order the keys in this map, or null if this map uses the natural ordering of its keys.

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.sorted.immutable.AbstractImmutableSortedMap.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 Optional<Pair<K, V>>
detectOptional(Predicate2<? super K, ? super V> predicate)

Overrides org.eclipse.collections.impl.map.sorted.immutable.AbstractImmutableSortedMap.detectOptional.

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

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

public ImmutableSortedMap<K, V>
drop(int count)

Implements org.eclipse.collections.api.map.sorted.SortedMapIterable.drop.

Returns an iterable after skipping the first count elements or an empty iterable if the count is greater than the length of the iterable.

public Set<Map.Entry<K, V>>
entrySet()

Implements java.util.SortedMap.entrySet.

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

public boolean
public K
firstKey()

Implements java.util.SortedMap.firstKey.

Returns the first (lowest) key currently in this map.

public ImmutableMap<V, K>
flipUniqueValues()

Implements org.eclipse.collections.api.map.MapIterable.flipUniqueValues, org.eclipse.collections.api.map.ImmutableMapIterable.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, org.eclipse.collections.api.ordered.OrderedIterable.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.SortedMap.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 K
lastKey()

Implements java.util.SortedMap.lastKey.

Returns the last (highest) key currently in this map.

public boolean
notEmpty()

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

The English equivalent of !this.isEmpty()

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

Overrides org.eclipse.collections.impl.map.sorted.immutable.AbstractImmutableSortedMap.reject.

Implements org.eclipse.collections.api.map.sorted.ImmutableSortedMap.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 ImmutableSortedMap<K, V>
select(Predicate2<? super K, ? super V> predicate)

Overrides org.eclipse.collections.impl.map.sorted.immutable.AbstractImmutableSortedMap.select.

Implements org.eclipse.collections.api.map.sorted.ImmutableSortedMap.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 items in this iterable.

public ImmutableSortedMap<K, V>
take(int count)

Implements org.eclipse.collections.api.map.sorted.SortedMapIterable.take.

Returns the first count elements of the iterable or all the elements in the iterable if count is greater than the length of the iterable.

public ImmutableSortedMap<K, V>
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.SortedMap.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.sorted.immutable.AbstractImmutableSortedMap:
aggregateBycastToMapcastToSortedMapclearcollectcollectBooleancollectBytecollectCharcollectDoublecollectFloatcollectIfcollectIntcollectKeysUniquecollectLongcollectShortcollectWithcorrespondscountBycountByEachcountByWithdetectIndexdetectLastIndexdistinctdropWhileflatCollectflipforEachforEachforEachWithIndexgroupBygroupByEachgroupByUniqueKeyheadMapiteratornewWithAllKeyValueArgumentsnewWithAllKeyValuesnewWithKeyValuenewWithMapnewWithMapIterablenewWithoutAllKeysnewWithoutKeypartitionpartitionWhilepartitionWithputputAllrejectrejectWithremoveselectselectInstancesOfselectWithsubMapsumByDoublesumByFloatsumByIntsumByLongtailMaptakeWhiletoImmutabletoReversedtoSortedMaptoStackzipzipWithIndex

Field Detail

comparatorback to summary
private final Comparator<? super K> comparator
INSTANCEback to summary
pack-priv static final ImmutableSortedMap<?, ?> INSTANCE
serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

ImmutableEmptySortedMapback to summary
pack-priv ImmutableEmptySortedMap()
ImmutableEmptySortedMapback to summary
pack-priv ImmutableEmptySortedMap(Comparator<? super K> comparator)

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.sorted.immutable.AbstractImmutableSortedMap.collect.

Implements org.eclipse.collections.api.map.sorted.ImmutableSortedMap.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
collectValuesback to summary
public <R> ImmutableSortedMap<K, R> collectValues(Function2<? super K, ? super V, ? extends R> function)

Overrides org.eclipse.collections.impl.map.sorted.immutable.AbstractImmutableSortedMap.collectValues.

Implements org.eclipse.collections.api.map.sorted.ImmutableSortedMap.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
comparatorback to summary
public Comparator<? super K> comparator()

Implements org.eclipse.collections.api.map.sorted.SortedMapIterable.comparator, java.util.SortedMap.comparator.

Doc from java.util.SortedMap.comparator.

Returns the comparator used to order the keys in this map, or null if this map uses the natural ordering of its keys.

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.sorted.immutable.AbstractImmutableSortedMap.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
detectOptionalback to summary
public Optional<Pair<K, V>> detectOptional(Predicate2<? super K, ? super V> predicate)

Overrides org.eclipse.collections.impl.map.sorted.immutable.AbstractImmutableSortedMap.detectOptional.

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

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

Return the first key and value of the map as an Optional 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.

Optional<Pair<City, Person>> detected =
    peopleByCity.detectOptional((city, person)
         -> city.getName().equals("Anytown") && person.getLastName().equals("Smith"));
Annotations
@Override
dropback to summary
public ImmutableSortedMap<K, V> drop(int count)

Implements org.eclipse.collections.api.map.sorted.SortedMapIterable.drop.

Doc from org.eclipse.collections.api.ordered.ReversibleIterable.drop.

Returns an iterable after skipping the first count elements or an empty iterable if the count is greater than the length of the iterable.

Annotations
@Override
entrySetback to summary
public Set<Map.Entry<K, V>> entrySet()

Implements java.util.SortedMap.entrySet.

Doc from java.util.SortedMap.entrySet.

Returns a Set view of the mappings contained in this map. The set's iterator returns the entries in ascending key order. 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, or through the setValue operation on a map entry returned by the iterator) 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
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 org.eclipse.collections.api.map.MapIterable.equals.

Follows the same general contract as Map#equals(Object).

Annotations
@Override
firstKeyback to summary
public K firstKey()

Implements java.util.SortedMap.firstKey.

Doc from java.util.SortedMap.firstKey.

Returns the first (lowest) key currently in this map.

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

Implements org.eclipse.collections.api.map.MapIterable.flipUniqueValues, org.eclipse.collections.api.map.ImmutableMapIterable.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, org.eclipse.collections.api.ordered.OrderedIterable.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 org.eclipse.collections.api.map.MapIterable.hashCode.

Follows the same general contract as Map#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 org.eclipse.collections.api.RichIterable.isEmpty.

Returns true if this iterable has zero items.

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

Implements java.util.SortedMap.keySet.

Doc from java.util.SortedMap.keySet.

Returns a Set view of the keys contained in this map. The set's iterator returns the keys in ascending order. 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
lastKeyback to summary
public K lastKey()

Implements java.util.SortedMap.lastKey.

Doc from java.util.SortedMap.lastKey.

Returns the last (highest) key currently in this 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 ImmutableSortedMap<K, V> reject(Predicate2<? super K, ? super V> predicate)

Overrides org.eclipse.collections.impl.map.sorted.immutable.AbstractImmutableSortedMap.reject.

Implements org.eclipse.collections.api.map.sorted.ImmutableSortedMap.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 ImmutableSortedMap<K, V> select(Predicate2<? super K, ? super V> predicate)

Overrides org.eclipse.collections.impl.map.sorted.immutable.AbstractImmutableSortedMap.select.

Implements org.eclipse.collections.api.map.sorted.ImmutableSortedMap.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 org.eclipse.collections.api.RichIterable.size.

Returns the number of items in this iterable.

Annotations
@Override
takeback to summary
public ImmutableSortedMap<K, V> take(int count)

Implements org.eclipse.collections.api.map.sorted.SortedMapIterable.take.

Doc from org.eclipse.collections.api.ordered.ReversibleIterable.take.

Returns the first count elements of the iterable or all the elements in the iterable if count is greater than the length of the iterable.

Annotations
@Override
tapback to summary
public ImmutableSortedMap<K, V> tap(Procedure<? super V> procedure)

Overrides org.eclipse.collections.impl.map.sorted.immutable.AbstractImmutableSortedMap.tap.

Implements org.eclipse.collections.api.map.sorted.ImmutableSortedMap.tap, org.eclipse.collections.api.map.MapIterable.tap, org.eclipse.collections.api.RichIterable.tap.

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

Executes the Procedure for each value of the map and returns this.

return peopleByCity.tap(person -> LOGGER.info(person.getName()));
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.SortedMap.values.

Doc from java.util.SortedMap.values.

Returns a Collection view of the values contained in this map. The collection's iterator returns the values in ascending order of the corresponding keys. 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()