Interface IntDoubleMap
- All Superinterfaces:
DoubleIterable
,DoubleValuesMap
,PrimitiveIterable
- All Known Subinterfaces:
ImmutableIntDoubleMap
,MutableIntDoubleMap
- All Known Implementing Classes:
IntDoubleHashMap
,SynchronizedIntDoubleMap
,UnmodifiableIntDoubleMap
public interface IntDoubleMap extends DoubleValuesMap
This file was automatically generated from template file primitivePrimitiveMap.stg.
- Since:
- 3.0.
-
Method Summary
Modifier and Type Method Description boolean
containsKey(int key)
Returns whether or not the key is present in the map.boolean
equals(Object o)
Follows the same general contract asMap.equals(Object)
.DoubleIntMap
flipUniqueValues()
Return the DoubleIntMap that is obtained by flipping the direction of this map and making the associations from value to key.void
forEachKey(IntProcedure procedure)
Iterates through each key in the map, invoking the procedure for each.void
forEachKeyValue(IntDoubleProcedure procedure)
Iterates through each key/value pair in the map, invoking the procedure for each.double
get(int key)
Retrieves the value associated with the key.double
getIfAbsent(int key, double ifAbsent)
Retrieves the value associated with the key, returning the specified default value if no such mapping exists.double
getOrThrow(int key)
Retrieves the value associated with the key, throwing anIllegalStateException
if no such mapping exists.int
hashCode()
Follows the same general contract asMap.hashCode()
.MutableIntSet
keySet()
Returns a set containing all the keys in this map.LazyIntIterable
keysView()
Returns a view of the keys in this map.RichIterable<IntDoublePair>
keyValuesView()
Returns a view of the key/value pairs in this map.IntDoubleMap
reject(IntDoublePredicate predicate)
Return a copy of this map containing only the key/value pairs that do not match the predicate.IntDoubleMap
select(IntDoublePredicate predicate)
Return a copy of this map containing only the key/value pairs that match the predicate.ImmutableIntDoubleMap
toImmutable()
Returns a copy of this map that is immutable (if this map is mutable) or itself if it is already immutable.String
toString()
Follows the same general contract asAbstractMap.toString()
Methods inherited from interface org.eclipse.collections.api.DoubleIterable
allSatisfy, anySatisfy, asLazy, average, averageIfEmpty, chunk, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, contains, containsAll, containsAll, count, detectIfNone, doubleIterator, each, flatCollect, forEach, injectInto, max, maxIfEmpty, median, medianIfEmpty, min, minIfEmpty, noneSatisfy, reduce, reduceIfEmpty, reject, select, sum, summaryStatistics, toArray, toArray, toBag, toList, toSet, toSortedArray, toSortedList
Methods inherited from interface org.eclipse.collections.api.map.primitive.DoubleValuesMap
collect, containsValue, forEachValue, reject, select, tap, values
Methods inherited from interface org.eclipse.collections.api.PrimitiveIterable
appendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size
-
Method Details
-
get
double get(int key)Retrieves the value associated with the key. If no mapping exists for the key, the default value (usually0
) is returned.- Parameters:
key
- the key- Returns:
- the value associated with the key, or the default value if no such mapping exists
-
getIfAbsent
double getIfAbsent(int key, double ifAbsent)Retrieves the value associated with the key, returning the specified default value if no such mapping exists.- Parameters:
key
- the keyifAbsent
- the default value to return if no mapping exists forkey
- Returns:
- the value associated with the key, or
ifAbsent
if no such mapping exists.
-
getOrThrow
double getOrThrow(int key)Retrieves the value associated with the key, throwing anIllegalStateException
if no such mapping exists.- Parameters:
key
- the key- Returns:
- the value associated with the key
- Throws:
IllegalStateException
- if no mapping exists for the key
-
containsKey
boolean containsKey(int 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
-
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
-
keysView
LazyIntIterable 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<IntDoublePair> 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
DoubleIntMap flipUniqueValues()Return the DoubleIntMap that is obtained by flipping the direction of this map and making the associations from value to key.- Throws:
IllegalStateException
- if the DoubleIntMap contains duplicate values.- Since:
- 9.0
-
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
-
equals
Follows the same general contract asMap.equals(Object)
. -
hashCode
int hashCode()Follows the same general contract asMap.hashCode()
. -
toString
String toString()Follows the same general contract asAbstractMap.toString()
- Specified by:
toString
in interfacePrimitiveIterable
- Overrides:
toString
in classObject
- Returns:
- a string representation of this IntDoubleMap
- See Also:
AbstractCollection.toString()
-
toImmutable
ImmutableIntDoubleMap 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
MutableIntSet 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
-