Interface DoubleObjectMap<V>
- All Superinterfaces:
InternalIterable<V>
,Iterable<V>
,PrimitiveObjectMap<V>
,RichIterable<V>
- All Known Subinterfaces:
ImmutableDoubleObjectMap<V>
,MutableDoubleObjectMap<V>
- All Known Implementing Classes:
AbstractImmutableDoubleObjectMap
,DoubleObjectHashMap
,SynchronizedDoubleObjectMap
,UnmodifiableDoubleObjectMap
public interface DoubleObjectMap<V> extends PrimitiveObjectMap<V>
This file was automatically generated from template file primitiveObjectMap.stg.
- Since:
- 3.0.
-
Method Summary
Modifier and Type Method Description boolean
containsKey(double key)
Returns whether or not the key is present in the map.ObjectDoubleMap<V>
flipUniqueValues()
Return the ObjectDoubleMap that is obtained by flipping the direction of this map and making the associations from value to key.void
forEachKey(DoubleProcedure procedure)
Iterates through each key in the map, invoking the procedure for each.void
forEachKeyValue(DoubleObjectProcedure<? super V> procedure)
Iterates through each key/value pair in the map, invoking the procedure for each.V
get(double key)
Retrieves the value associated with the key.V
getIfAbsent(double key, Function0<? extends V> ifAbsent)
Retrieves the value associated with the key if one exists; if it does not, returns the result of invoking the value supplier.MutableDoubleSet
keySet()
Returns a set containing all the keys in this map.LazyDoubleIterable
keysView()
Returns a view of the keys in this map.RichIterable<DoubleObjectPair<V>>
keyValuesView()
Returns a view of the key/value pairs in this map.DoubleObjectMap<V>
reject(DoubleObjectPredicate<? super V> predicate)
Return a copy of this map containing only the key/value pairs that do not match the predicate.DoubleObjectMap<V>
select(DoubleObjectPredicate<? super V> predicate)
Return a copy of this map containing only the key/value pairs that match the predicate.DoubleObjectMap<V>
tap(Procedure<? super V> procedure)
Executes the Procedure for each element in the iterable and returnsthis
.ImmutableDoubleObjectMap<V>
toImmutable()
Returns a copy of this map that is immutable (if this map is mutable) or itself if it is already immutable.Methods inherited from interface org.eclipse.collections.api.InternalIterable
forEach, forEachWith, forEachWithIndex
Methods inherited from interface org.eclipse.collections.api.map.primitive.PrimitiveObjectMap
collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, containsValue, equals, flatCollect, flatCollectWith, forEachValue, groupBy, groupByEach, groupByUniqueKey, hashCode, parallelStream, partition, partitionWith, reject, rejectWith, select, selectInstancesOf, selectWith, spliterator, stream, toString, values, zip, zipWithIndex
Methods inherited from interface org.eclipse.collections.api.RichIterable
aggregateBy, aggregateBy, aggregateInPlaceBy, allSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, appendString, appendString, appendString, asLazy, chunk, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, contains, containsAll, containsAllArguments, containsAllIterable, containsBy, count, countBy, countBy, countByEach, countByEach, countByWith, countByWith, countWith, detect, detectIfNone, detectOptional, detectWith, detectWithIfNone, detectWithOptional, each, flatCollect, flatCollectBoolean, flatCollectByte, flatCollectChar, flatCollectDouble, flatCollectFloat, flatCollectInt, flatCollectLong, flatCollectShort, flatCollectWith, forEach, getAny, getFirst, getLast, getOnly, groupBy, groupByAndCollect, groupByEach, groupByUniqueKey, injectInto, injectInto, injectInto, injectInto, injectInto, into, isEmpty, makeString, makeString, makeString, max, max, maxBy, maxByOptional, maxOptional, maxOptional, min, min, minBy, minByOptional, minOptional, minOptional, noneSatisfy, noneSatisfyWith, notEmpty, reduce, reduceInPlace, reduceInPlace, reject, rejectWith, select, selectWith, size, sumByDouble, sumByFloat, sumByInt, sumByLong, summarizeDouble, summarizeFloat, summarizeInt, summarizeLong, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, toArray, toArray, toBag, toBiMap, toList, toMap, toMap, toSet, toSortedBag, toSortedBag, toSortedBagBy, toSortedList, toSortedList, toSortedListBy, toSortedMap, toSortedMap, toSortedMapBy, toSortedSet, toSortedSet, toSortedSetBy, zip, zipWithIndex
-
Method Details
-
get
Retrieves the value associated with the key. If no mapping exists for the key,null
is returned.- Parameters:
key
- the key- Returns:
- the value associated with the key, or the default value if no such mapping exists
-
getIfAbsent
Retrieves the value associated with the key if one exists; if it does not, returns the result of invoking the value supplier.- Parameters:
key
- the keyfunction
- the supplier that provides the value if no mapping exists forkey
- Returns:
- the value associated with the key, if one exists, or the result of
invoking
ifAbsent
if not
-
containsKey
boolean containsKey(double key)Returns whether or not the key is present in the map.- Parameters:
key
- the key- Returns:
- if a mapping exists in this map for the key
-
tap
Description copied from interface:RichIterable
Executes the Procedure for each element in the iterable and returnsthis
.Example using a Java 8 lambda expression:
RichIterable<Person> tapped = people.tap(person -> LOGGER.info(person.getName()));
Example using an anonymous inner class:
RichIterable<Person> tapped = people.tap(new Procedure<Person>() { public void value(Person person) { LOGGER.info(person.getName()); } });
- Specified by:
tap
in interfaceRichIterable<V>
- See Also:
RichIterable.each(Procedure)
,RichIterable.forEach(Procedure)
-
forEachKey
Iterates through each key in the map, invoking the procedure for each.- Parameters:
procedure
- the procedure to invoke for each key
-
forEachKeyValue
Iterates through each key/value pair in the map, invoking the procedure for each.- Parameters:
procedure
- the procedure to invoke for each key/value pair
-
select
Return a copy of this map containing only the key/value pairs that match the predicate.- Parameters:
predicate
- the predicate to determine which key/value pairs in this map should be included in the returned map- Returns:
- a copy of this map with the matching key/value pairs
-
reject
Return a copy of this map containing only the key/value pairs that do not match the predicate.- Parameters:
predicate
- the predicate to determine which key/value pairs in this map should be excluded from the returned map- Returns:
- a copy of this map without the matching key/value pairs
-
toImmutable
ImmutableDoubleObjectMap<V> toImmutable()Returns a copy of this map that is immutable (if this map is mutable) or itself if it is already immutable.- Returns:
- an immutable map that is equivalent to this one
-
keySet
MutableDoubleSet keySet()Returns a set containing all the keys in this map. The set is backed by the map, so any modifications to the returned set will affect this map.- Returns:
- a mutable set containing the keys in this map
-
keysView
LazyDoubleIterable keysView()Returns a view of the keys in this map. This iterable is backed by the map, so any modifications to the underlying map will be reflected in the keys returned by the iterable.- Returns:
- a view of the keys in this map
- Since:
- 5.0
-
keyValuesView
RichIterable<DoubleObjectPair<V>> keyValuesView()Returns a view of the key/value pairs in this map. This iterable is backed by the map, so any modifications to the underlying map will be reflected in the pairs returned by the iterable.- Returns:
- a view of the keys in this map
- Since:
- 5.0
-
flipUniqueValues
ObjectDoubleMap<V> flipUniqueValues()Return the ObjectDoubleMap that is obtained by flipping the direction of this map and making the associations from value to key.- Throws:
IllegalStateException
- if the ObjectDoubleMap contains duplicate values.- Since:
- 9.0
-