Class ImmutableEmptySortedMap<K,V>
- java.lang.Object
-
- org.eclipse.collections.impl.AbstractRichIterable<V>
-
- org.eclipse.collections.impl.map.AbstractMapIterable<K,V>
-
- org.eclipse.collections.impl.map.sorted.immutable.AbstractImmutableSortedMap<K,V>
-
- org.eclipse.collections.impl.map.sorted.immutable.ImmutableEmptySortedMap<K,V>
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Iterable<V>,java.util.Map<K,V>,java.util.SortedMap<K,V>,InternalIterable<V>,ImmutableMapIterable<K,V>,MapIterable<K,V>,ImmutableSortedMap<K,V>,SortedMapIterable<K,V>,OrderedIterable<V>,ReversibleIterable<V>,RichIterable<V>
final class ImmutableEmptySortedMap<K,V> extends AbstractImmutableSortedMap<K,V> implements java.io.Serializable
This is a zero elementImmutableSortedMapwhich is created by calling SortedMaps.immutable.empty().
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Comparator<? super K>comparator(package private) static ImmutableSortedMap<?,?>INSTANCEprivate static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description ImmutableEmptySortedMap()ImmutableEmptySortedMap(java.util.Comparator<? super K> comparator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <K2,V2>
ImmutableMap<K2,V2>collect(Function2<? super K,? super V,Pair<K2,V2>> function)For each key and value of the map the function is evaluated.<R> ImmutableSortedMap<K,R>collectValues(Function2<? super K,? super V,? extends R> function)For each key and value of the map the function is evaluated.java.util.Comparator<? super K>comparator()booleancontainsKey(java.lang.Object key)booleancontainsValue(java.lang.Object value)Pair<K,V>detect(Predicate2<? super K,? super V> predicate)Return the first key and value of the map for which the predicate evaluates to true when they are given as arguments.java.util.Optional<Pair<K,V>>detectOptional(Predicate2<? super K,? super V> predicate)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.ImmutableSortedMap<K,V>drop(int count)Returns an iterable after skipping the firstcountelements or an empty iterable if thecountis greater than the length of the iterable.java.util.Set<java.util.Map.Entry<K,V>>entrySet()booleanequals(java.lang.Object other)Follows the same general contract asMap.equals(Object).KfirstKey()ImmutableMap<V,K>flipUniqueValues()Return the MapIterable that is obtained by flipping the direction of this map and making the associations from value to key.voidforEachKey(Procedure<? super K> procedure)Calls theprocedurewith each key of the map.voidforEachKeyValue(Procedure2<? super K,? super V> procedure)Calls theprocedurewith each key-value pair of the map.voidforEachValue(Procedure<? super V> procedure)Calls the procedure with each value of the map.<P> voidforEachWith(Procedure2<? super V,? super P> procedure, P parameter)The procedure2 is evaluated for each element in the iterable with the specified parameter provided as the second argument.voidforEachWithIndex(ObjectIntProcedure<? super V> objectIntProcedure)Iterates over the iterable passing each element and the current relative int index to the specified instance of ObjectIntProcedure.Vget(java.lang.Object key)VgetIfAbsent(K key, Function0<? extends V> function)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.VgetIfAbsentValue(K key, V value)Return the value in the Map that corresponds to the specified key, or if there is no value at the key, returnvalue.<P> VgetIfAbsentWith(K key, Function<? super P,? extends V> function, P parameter)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.VgetOnly()Returns the element if the iterable has exactly one element.inthashCode()Follows the same general contract asMap.hashCode().<A> AifPresentApply(K key, Function<? super V,? extends A> function)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.booleanisEmpty()Returns true if this iterable has zero items.java.util.Set<K>keySet()RichIterable<K>keysView()Returns an unmodifiable lazy iterable wrapped around the keySet for the map.RichIterable<Pair<K,V>>keyValuesView()Returns an unmodifiable lazy iterable of key/value pairs wrapped around the entrySet for the map.KlastKey()booleannotEmpty()The English equivalent of !this.isEmpty()ImmutableSortedMap<K,V>reject(Predicate2<? super K,? super V> predicate)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.ImmutableSortedMap<K,V>select(Predicate2<? super K,? super V> predicate)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.intsize()Returns the number of items in this iterable.ImmutableSortedMap<K,V>take(int count)Returns the firstcountelements of the iterable or all the elements in the iterable ifcountis greater than the length of the iterable.ImmutableSortedMap<K,V>tap(Procedure<? super V> procedure)Executes the Procedure for each value of the map and returnsthis.java.lang.StringtoString()Returns a string with the elements of the iterable separated by commas with spaces and enclosed in square brackets.java.util.Collection<V>values()RichIterable<V>valuesView()Returns an unmodifiable lazy iterable wrapped around the values for the map.private java.lang.ObjectwriteReplace()-
Methods inherited from class org.eclipse.collections.impl.map.sorted.immutable.AbstractImmutableSortedMap
aggregateBy, castToMap, castToSortedMap, clear, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectKeysUnique, collectLong, collectShort, collectWith, corresponds, countBy, countByEach, countByWith, detectIndex, detectLastIndex, distinct, dropWhile, flatCollect, flip, forEach, forEach, forEachWithIndex, groupBy, groupByEach, groupByUniqueKey, headMap, iterator, newWithAllKeyValueArguments, newWithAllKeyValues, newWithKeyValue, newWithMap, newWithMapIterable, newWithoutAllKeys, newWithoutKey, partition, partitionWhile, partitionWith, put, putAll, reject, rejectWith, remove, select, selectInstancesOf, selectWith, subMap, sumByDouble, sumByFloat, sumByInt, sumByLong, tailMap, takeWhile, toImmutable, toReversed, toSortedMap, toStack, zip, zipWithIndex
-
Methods inherited from class org.eclipse.collections.impl.map.AbstractMapIterable
allSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, asLazy, chunk, contains, detect, detectIfNone, detectOptional, detectWith, detectWithIfNone, detectWithOptional, each, getFirst, getLast, getOrDefault, isAbsent, keyAndValueEquals, keyAndValueHashCode, noneSatisfy, noneSatisfyWith, toArray, toArray
-
Methods inherited from class org.eclipse.collections.impl.AbstractRichIterable
appendString, appendString, collect, collectIf, collectWith, containsAll, containsAllArguments, containsAllIterable, count, countWith, flatCollect, forEach, groupBy, groupByEach, groupByUniqueKey, injectInto, injectInto, injectInto, injectInto, injectInto, into, max, max, maxBy, min, min, minBy, reject, rejectWith, select, selectWith, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, toBag, toBiMap, toList, toMap, toSet, toSortedBag, toSortedBag, toSortedBagBy, toSortedListBy, toSortedMap, toSortedMap, toSortedMapBy, toSortedSet, toSortedSet, toSortedSetBy, zip, zipWithIndex
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.collections.api.map.sorted.ImmutableSortedMap
aggregateBy, aggregateInPlaceBy, collectWithIndex, flatCollectWith, reduceBy
-
Methods inherited from interface org.eclipse.collections.api.InternalIterable
forEach
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Methods inherited from interface org.eclipse.collections.api.map.MapIterable
getOrDefault, injectIntoKeyValue, parallelStream, spliterator, stream
-
Methods inherited from interface org.eclipse.collections.api.ordered.OrderedIterable
collectWithIndex, getFirst, getFirstOptional, getLast, getLastOptional, indexOf, max, min, rejectWithIndex, selectWithIndex, zip, zipWithIndex
-
Methods inherited from interface org.eclipse.collections.api.ordered.ReversibleIterable
asReversed, reverseForEach, reverseForEachWithIndex
-
Methods inherited from interface org.eclipse.collections.api.RichIterable
aggregateBy, allSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, appendString, appendString, appendString, asLazy, chunk, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, contains, containsAll, containsAllArguments, containsAllIterable, containsAny, containsAnyIterable, containsBy, containsNone, containsNoneIterable, count, countBy, countByEach, countByWith, countWith, detect, detectIfNone, detectOptional, detectWith, detectWithIfNone, detectWithOptional, each, flatCollect, flatCollectBoolean, flatCollectByte, flatCollectChar, flatCollectDouble, flatCollectFloat, flatCollectInt, flatCollectLong, flatCollectShort, flatCollectWith, forEach, getAny, groupBy, groupByAndCollect, groupByEach, groupByUniqueKey, injectInto, injectInto, injectInto, injectInto, injectInto, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, into, makeString, makeString, makeString, makeString, max, maxBy, maxByOptional, maxOptional, maxOptional, min, minBy, minByOptional, minOptional, minOptional, noneSatisfy, noneSatisfyWith, reduce, reduceBy, reduceInPlace, reduceInPlace, reject, rejectWith, select, selectWith, summarizeDouble, summarizeFloat, summarizeInt, summarizeLong, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, toArray, toArray, toBag, toBiMap, toImmutableBag, toImmutableBiMap, toImmutableList, toImmutableMap, toImmutableSet, toImmutableSortedBag, toImmutableSortedBag, toImmutableSortedBagBy, toImmutableSortedList, toImmutableSortedList, toImmutableSortedListBy, toImmutableSortedSet, toImmutableSortedSet, toImmutableSortedSetBy, toList, toMap, toMap, toSet, toSortedBag, toSortedBag, toSortedBagBy, toSortedList, toSortedList, toSortedListBy, toSortedMap, toSortedMap, toSortedMapBy, toSortedSet, toSortedSet, toSortedSetBy
-
-
-
-
Field Detail
-
INSTANCE
static final ImmutableSortedMap<?,?> INSTANCE
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
comparator
private final java.util.Comparator<? super K> comparator
-
-
Constructor Detail
-
ImmutableEmptySortedMap
ImmutableEmptySortedMap()
-
ImmutableEmptySortedMap
ImmutableEmptySortedMap(java.util.Comparator<? super K> comparator)
-
-
Method Detail
-
size
public int size()
Description copied from interface:RichIterableReturns the number of items in this iterable.- Specified by:
sizein interfacejava.util.Map<K,V>- Specified by:
sizein interfaceRichIterable<K>
-
keysView
public RichIterable<K> keysView()
Description copied from interface:MapIterableReturns an unmodifiable lazy iterable wrapped around the keySet for the map.- Specified by:
keysViewin interfaceMapIterable<K,V>
-
valuesView
public RichIterable<V> valuesView()
Description copied from interface:MapIterableReturns an unmodifiable lazy iterable wrapped around the values for the map.- Specified by:
valuesViewin interfaceMapIterable<K,V>
-
keyValuesView
public RichIterable<Pair<K,V>> keyValuesView()
Description copied from interface:MapIterableReturns an unmodifiable lazy iterable of key/value pairs wrapped around the entrySet for the map.- Specified by:
keyValuesViewin interfaceMapIterable<K,V>
-
containsKey
public boolean containsKey(java.lang.Object key)
- Specified by:
containsKeyin interfacejava.util.Map<K,V>- Specified by:
containsKeyin interfaceMapIterable<K,V>- See Also:
Map.containsKey(Object)
-
containsValue
public boolean containsValue(java.lang.Object value)
- Specified by:
containsValuein interfacejava.util.Map<K,V>- Specified by:
containsValuein interfaceMapIterable<K,V>- See Also:
Map.containsValue(Object)
-
get
public V get(java.lang.Object key)
-
toString
public java.lang.String toString()
Description copied from class:AbstractRichIterableReturns a string with the elements of the iterable separated by commas with spaces and enclosed in square brackets.Assert.assertEquals("[]", Lists.mutable.empty().toString()); Assert.assertEquals("[1]", Lists.mutable.with(1).toString()); Assert.assertEquals("[1, 2, 3]", Lists.mutable.with(1, 2, 3).toString());- Specified by:
toStringin interfaceMapIterable<K,V>- Specified by:
toStringin interfaceRichIterable<K>- Overrides:
toStringin classAbstractRichIterable<V>- Returns:
- a string representation of this collection.
- See Also:
AbstractCollection.toString()
-
equals
public boolean equals(java.lang.Object other)
Description copied from interface:MapIterableFollows the same general contract asMap.equals(Object).
-
hashCode
public int hashCode()
Description copied from interface:MapIterableFollows the same general contract asMap.hashCode().
-
tap
public ImmutableSortedMap<K,V> tap(Procedure<? super V> procedure)
Description copied from interface:MapIterableExecutes the Procedure for each value of the map and returnsthis.return peopleByCity.tap(person -> LOGGER.info(person.getName()));
- Specified by:
tapin interfaceImmutableMapIterable<K,V>- Specified by:
tapin interfaceImmutableSortedMap<K,V>- Specified by:
tapin interfaceMapIterable<K,V>- Specified by:
tapin interfaceOrderedIterable<K>- Specified by:
tapin interfaceReversibleIterable<K>- Specified by:
tapin interfaceRichIterable<K>- Specified by:
tapin interfaceSortedMapIterable<K,V>- Overrides:
tapin classAbstractImmutableSortedMap<K,V>- See Also:
RichIterable.forEach(Procedure)
-
forEachKeyValue
public void forEachKeyValue(Procedure2<? super K,? super V> procedure)
Description copied from interface:MapIterableCalls theprocedurewith 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");- Specified by:
forEachKeyValuein interfaceMapIterable<K,V>
-
flipUniqueValues
public ImmutableMap<V,K> flipUniqueValues()
Description copied from interface:MapIterableReturn 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)));- Specified by:
flipUniqueValuesin interfaceImmutableMapIterable<K,V>- Specified by:
flipUniqueValuesin interfaceMapIterable<K,V>
-
forEachKey
public void forEachKey(Procedure<? super K> procedure)
Description copied from interface:MapIterableCalls theprocedurewith 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);- Specified by:
forEachKeyin interfaceMapIterable<K,V>- Overrides:
forEachKeyin classAbstractMapIterable<K,V>
-
forEachValue
public void forEachValue(Procedure<? super V> procedure)
Description copied from interface:MapIterableCalls 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);- Specified by:
forEachValuein interfaceMapIterable<K,V>- Overrides:
forEachValuein classAbstractMapIterable<K,V>
-
forEachWithIndex
public void forEachWithIndex(ObjectIntProcedure<? super V> objectIntProcedure)
Description copied from interface:InternalIterableIterates 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()); } });- Specified by:
forEachWithIndexin interfaceInternalIterable<K>- Specified by:
forEachWithIndexin interfaceOrderedIterable<K>- Overrides:
forEachWithIndexin classAbstractMapIterable<K,V>
-
forEachWith
public <P> void forEachWith(Procedure2<? super V,? super P> procedure, P parameter)
Description copied from interface:InternalIterableThe 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);- Specified by:
forEachWithin interfaceInternalIterable<K>- Overrides:
forEachWithin classAbstractMapIterable<K,V>
-
isEmpty
public boolean isEmpty()
Description copied from interface:RichIterableReturns true if this iterable has zero items.- Specified by:
isEmptyin interfacejava.util.Map<K,V>- Specified by:
isEmptyin interfaceRichIterable<K>- Overrides:
isEmptyin classAbstractRichIterable<V>
-
notEmpty
public boolean notEmpty()
Description copied from interface:RichIterableThe English equivalent of !this.isEmpty()- Specified by:
notEmptyin interfaceRichIterable<K>
-
ifPresentApply
public <A> A ifPresentApply(K key, Function<? super V,? extends A> function)
Description copied from interface:MapIterableIf 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.- Specified by:
ifPresentApplyin interfaceMapIterable<K,V>- Overrides:
ifPresentApplyin classAbstractMapIterable<K,V>
-
getIfAbsent
public V getIfAbsent(K key, Function0<? extends V> function)
Description copied from interface:MapIterableReturn 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.- Specified by:
getIfAbsentin interfaceMapIterable<K,V>- Overrides:
getIfAbsentin classAbstractMapIterable<K,V>
-
getIfAbsentValue
public V getIfAbsentValue(K key, V value)
Description copied from interface:MapIterableReturn the value in the Map that corresponds to the specified key, or if there is no value at the key, returnvalue.- Specified by:
getIfAbsentValuein interfaceMapIterable<K,V>- Overrides:
getIfAbsentValuein classAbstractMapIterable<K,V>
-
getIfAbsentWith
public <P> V getIfAbsentWith(K key, Function<? super P,? extends V> function, P parameter)
Description copied from interface:MapIterableReturn 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.- Specified by:
getIfAbsentWithin interfaceMapIterable<K,V>- Overrides:
getIfAbsentWithin classAbstractMapIterable<K,V>
-
collect
public <K2,V2> ImmutableMap<K2,V2> collect(Function2<? super K,? super V,Pair<K2,V2>> function)
Description copied from interface:MapIterableFor 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()));- Specified by:
collectin interfaceImmutableMapIterable<K,V>- Specified by:
collectin interfaceImmutableSortedMap<K,V>- Specified by:
collectin interfaceMapIterable<K,V>- Specified by:
collectin interfaceSortedMapIterable<K,V>- Overrides:
collectin classAbstractImmutableSortedMap<K,V>
-
collectValues
public <R> ImmutableSortedMap<K,R> collectValues(Function2<? super K,? super V,? extends R> function)
Description copied from interface:MapIterableFor 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());- Specified by:
collectValuesin interfaceImmutableMapIterable<K,V>- Specified by:
collectValuesin interfaceImmutableSortedMap<K,V>- Specified by:
collectValuesin interfaceMapIterable<K,V>- Specified by:
collectValuesin interfaceSortedMapIterable<K,V>- Overrides:
collectValuesin classAbstractImmutableSortedMap<K,V>
-
detect
public Pair<K,V> detect(Predicate2<? super K,? super V> predicate)
Description copied from interface:MapIterableReturn 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"));- Specified by:
detectin interfaceMapIterable<K,V>- Overrides:
detectin classAbstractImmutableSortedMap<K,V>
-
detectOptional
public java.util.Optional<Pair<K,V>> detectOptional(Predicate2<? super K,? super V> predicate)
Description copied from interface:MapIterableReturn 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"));- Specified by:
detectOptionalin interfaceMapIterable<K,V>- Overrides:
detectOptionalin classAbstractImmutableSortedMap<K,V>
-
reject
public ImmutableSortedMap<K,V> reject(Predicate2<? super K,? super V> predicate)
Description copied from interface:MapIterableFor 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"));- Specified by:
rejectin interfaceImmutableMapIterable<K,V>- Specified by:
rejectin interfaceImmutableSortedMap<K,V>- Specified by:
rejectin interfaceMapIterable<K,V>- Specified by:
rejectin interfaceSortedMapIterable<K,V>- Overrides:
rejectin classAbstractImmutableSortedMap<K,V>
-
select
public ImmutableSortedMap<K,V> select(Predicate2<? super K,? super V> predicate)
Description copied from interface:MapIterableFor 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"));- Specified by:
selectin interfaceImmutableMapIterable<K,V>- Specified by:
selectin interfaceImmutableSortedMap<K,V>- Specified by:
selectin interfaceMapIterable<K,V>- Specified by:
selectin interfaceSortedMapIterable<K,V>- Overrides:
selectin classAbstractImmutableSortedMap<K,V>
-
comparator
public java.util.Comparator<? super K> comparator()
- Specified by:
comparatorin interfacejava.util.SortedMap<K,V>- Specified by:
comparatorin interfaceSortedMapIterable<K,V>
-
keySet
public java.util.Set<K> keySet()
-
values
public java.util.Collection<V> values()
-
writeReplace
private java.lang.Object writeReplace()
-
take
public ImmutableSortedMap<K,V> take(int count)
Description copied from interface:ReversibleIterableReturns the firstcountelements of the iterable or all the elements in the iterable ifcountis greater than the length of the iterable.- Specified by:
takein interfaceReversibleIterable<K>- Specified by:
takein interfaceSortedMapIterable<K,V>- Parameters:
count- the number of items to take.
-
drop
public ImmutableSortedMap<K,V> drop(int count)
Description copied from interface:ReversibleIterableReturns an iterable after skipping the firstcountelements or an empty iterable if thecountis greater than the length of the iterable.- Specified by:
dropin interfaceReversibleIterable<K>- Specified by:
dropin interfaceSortedMapIterable<K,V>- Parameters:
count- the number of items to drop.
-
getOnly
public V getOnly()
Description copied from interface:RichIterableReturns the element if the iterable has exactly one element. Otherwise, throwIllegalStateException.- Specified by:
getOnlyin interfaceRichIterable<K>- Overrides:
getOnlyin classAbstractMapIterable<K,V>- Returns:
- an element of an iterable.
-
-