# IntFloatMap

# IntFloatMap

Artifact:[androidx.collection:collection](https://developer.android.com/jetpack/androidx/releases/collection)  
[View Source](https://cs.android.com/search?q=file:androidx/collection/IntFloatMap.kt+class:androidx.collection.IntFloatMap)  
Added in[1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/collection/IntFloatMap "View this page in Java")
Common/AllAndroid/JVMNative/C/iOSJavaScript
  - Cmn  

  ```
  sealed class IntFloatMap
```  
Known direct subclasses  
[MutableIntFloatMap](https://developer.android.com/reference/kotlin/androidx/collection/MutableIntFloatMap)  

|-------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [MutableIntFloatMap](https://developer.android.com/reference/kotlin/androidx/collection/MutableIntFloatMap) | [MutableIntFloatMap](https://developer.android.com/reference/kotlin/androidx/collection/MutableIntFloatMap)is a container with a[MutableMap](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-map/index.html)-like interface for[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)primitive keys and[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)primitive values. |

*** ** * ** ***

[IntFloatMap](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap)is a container with a[Map](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html)-like interface for[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)primitive keys and[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)primitive values.

The underlying implementation is designed to avoid allocations from boxing, and insertion, removal, retrieval, and iteration operations. Allocations may still happen on insertion when the underlying storage needs to grow to accommodate newly added entries to the table. In addition, this implementation minimizes memory usage by avoiding the use of separate objects to hold key/value pairs.

This implementation makes no guarantee as to the order of the keys and values stored, nor does it make guarantees that the order remains constant over time.

This implementation is not thread-safe: if multiple threads access this container concurrently, and one or more threads modify the structure of the map (insertion or removal for instance), the calling code must provide the appropriate synchronization. Multiple threads are safe to read from this map concurrently if no write is happening.

This implementation is read-only and only allows data to be queried. A mutable implementation is provided by[MutableIntFloatMap](https://developer.android.com/reference/kotlin/androidx/collection/MutableIntFloatMap).  

|                                                  See also                                                   |
|-------------------------------------------------------------------------------------------------------------|---|
| [MutableIntFloatMap](https://developer.android.com/reference/kotlin/androidx/collection/MutableIntFloatMap) |   |
| [ScatterMap](https://developer.android.com/reference/kotlin/androidx/collection/ScatterMap)                 |   |

## Summary

|                                           ### Protected constructors                                            |
|-----------------------------------------------------------------------------------------------------------------|-----|
| [IntFloatMap](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#IntFloatMap())`()` | Cmn |

|                                         ### Public functions                                          |
|-------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----|
| `inline `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)          | [all](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#all(kotlin.Function2))`(predicate: (`[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`, `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`) `->` `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`)` Returns true if all entries match the given[predicate](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#all(kotlin.Function2)).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | Cmn |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                   | [any](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#any())`()` Returns`true`if this map has at least one entry.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | Cmn |
| `inline `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)          | [any](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#any(kotlin.Function2))`(predicate: (`[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`, `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`) `->` `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`)` Returns true if at least one entry matches the given[predicate](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#any(kotlin.Function2)).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | Cmn |
| `inline operator `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [contains](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#contains(kotlin.Int))`(key: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Returns true if the specified[key](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#contains(kotlin.Int))is present in this map, false otherwise.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | Cmn |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                   | [containsKey](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#containsKey(kotlin.Int))`(key: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Returns true if the specified[key](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#containsKey(kotlin.Int))is present in this map, false otherwise.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | Cmn |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                   | [containsValue](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#containsValue(kotlin.Float))`(value: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`)` Returns true if the specified[value](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#containsValue(kotlin.Float))is present in this map, false otherwise.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | Cmn |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                           | [count](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#count())`()` Returns the number of entries in this map.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | Cmn |
| `inline `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                  | [count](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#count(kotlin.Function2))`(predicate: (`[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`, `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`) `->` `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`)` Returns the number of entries matching the given[predicate](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#count(kotlin.Function2)).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | Cmn |
| `open operator `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)   | [equals](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#equals(kotlin.Any))`(other: `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`?)` Compares the specified object[other](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#equals(kotlin.Any))with this hash map for equality.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | Cmn |
| `inline `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                | [forEach](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#forEach(kotlin.Function2))`(block: (key: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`, value: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`) `->` `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)`)` Iterates over every key/value pair stored in this map by invoking the specified[block](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#forEach(kotlin.Function2))lambda.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | Cmn |
| `inline `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                | [forEachKey](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#forEachKey(kotlin.Function1))`(block: (key: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`) `->` `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)`)` Iterates over every key stored in this map by invoking the specified[block](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#forEachKey(kotlin.Function1))lambda.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | Cmn |
| `inline `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                | [forEachValue](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#forEachValue(kotlin.Function1))`(block: (value: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`) `->` `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)`)` Iterates over every value stored in this map by invoking the specified[block](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#forEachValue(kotlin.Function1))lambda.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | Cmn |
| `operator `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)            | [get](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#get(kotlin.Int))`(key: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Returns the value corresponding to the given[key](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#get(kotlin.Int)).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | Cmn |
| [Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)                       | [getOrDefault](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#getOrDefault(kotlin.Int,kotlin.Float))`(key: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`, defaultValue: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`)` Returns the value to which the specified[key](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#getOrDefault(kotlin.Int,kotlin.Float))is mapped, or[defaultValue](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#getOrDefault(kotlin.Int,kotlin.Float))if this map contains no mapping for the key.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | Cmn |
| `inline `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)              | [getOrElse](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#getOrElse(kotlin.Int,kotlin.Function0))`(key: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`, defaultValue: () `->` `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`)` Returns the value for the given[key](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#getOrElse(kotlin.Int,kotlin.Function0))if the value is present and not null.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | Cmn |
| `open `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                    | [hashCode](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#hashCode())`()` Returns the hash code value for this map.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | Cmn |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                   | [isEmpty](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#isEmpty())`()` Indicates whether this map is empty.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | Cmn |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                   | [isNotEmpty](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#isNotEmpty())`()` Returns`true`if this map is not empty.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | Cmn |
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)                     | [joinToString](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence))`(` ` separator: `[CharSequence](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html)`,` ` prefix: `[CharSequence](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html)`,` ` postfix: `[CharSequence](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html)`,` ` limit: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` truncated: `[CharSequence](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html) `)` Creates a String from the entries, separated by[separator](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence))and using[prefix](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence))before and[postfix](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence))after, if supplied.                                                                                                                                                                                                                                                                                                                                                                                     | Cmn |
| `inline `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)            | [joinToString](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence,kotlin.Function2))`(` ` separator: `[CharSequence](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html)`,` ` prefix: `[CharSequence](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html)`,` ` postfix: `[CharSequence](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html)`,` ` limit: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` truncated: `[CharSequence](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html)`,` ` crossinline transform: (key: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`, value: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`) `->` `[CharSequence](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html) `)` Creates a String from the entries, separated by[separator](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence,kotlin.Function2))and using[prefix](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence,kotlin.Function2))before and[postfix](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence,kotlin.Function2))after, if supplied. | Cmn |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                   | [none](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#none())`()` Returns`true`if this map has no entries.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | Cmn |
| `open `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)              | [toString](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#toString())`()` Returns a string representation of this map.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | Cmn |

|                            ### Public properties                            |
|-----------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----|
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [capacity](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#capacity()) Returns the number of key-value pairs that can be stored in this map without requiring internal storage reallocation. | Cmn |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [size](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#size()) Returns the number of key-value pairs in this map.                                                                            | Cmn |

## Protected constructors

### IntFloatMap

Cmn  

```
protected IntFloatMap()
```

## Public functions

### all

Cmn  
Added in[1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)  

```
inline fun all(predicate: (Int, Float) -> Boolean): Boolean
```

Returns true if all entries match the given[predicate](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#all(kotlin.Function2)).  

### any

Cmn  
Added in[1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)  

```
fun any(): Boolean
```

Returns`true`if this map has at least one entry.  

### any

Cmn  
Added in[1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)  

```
inline fun any(predicate: (Int, Float) -> Boolean): Boolean
```

Returns true if at least one entry matches the given[predicate](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#any(kotlin.Function2)).  

### contains

Cmn  
Added in[1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)  

```
inline operator fun contains(key: Int): Boolean
```

Returns true if the specified[key](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#contains(kotlin.Int))is present in this map, false otherwise.  

### containsKey

Cmn  
Added in[1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)  

```
fun containsKey(key: Int): Boolean
```

Returns true if the specified[key](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#containsKey(kotlin.Int))is present in this map, false otherwise.  

### containsValue

Cmn  
Added in[1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)  

```
fun containsValue(value: Float): Boolean
```

Returns true if the specified[value](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#containsValue(kotlin.Float))is present in this map, false otherwise.  

### count

Cmn  
Added in[1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)  

```
fun count(): Int
```

Returns the number of entries in this map.  

### count

Cmn  
Added in[1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)  

```
inline fun count(predicate: (Int, Float) -> Boolean): Int
```

Returns the number of entries matching the given[predicate](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#count(kotlin.Function2)).  

### equals

Cmn  

```
open operator fun equals(other: Any?): Boolean
```

Compares the specified object[other](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#equals(kotlin.Any))with this hash map for equality. The two objects are considered equal if[other](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#equals(kotlin.Any)):

- Is a[IntFloatMap](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap)

- Has the same[size](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#size())as this map

- Contains key/value pairs equal to this map's pair

### forEach

Cmn  
Added in[1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)  

```
inline fun forEach(block: (key: Int, value: Float) -> Unit): Unit
```

Iterates over every key/value pair stored in this map by invoking the specified[block](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#forEach(kotlin.Function2))lambda.  

### forEachKey

Cmn  
Added in[1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)  

```
inline fun forEachKey(block: (key: Int) -> Unit): Unit
```

Iterates over every key stored in this map by invoking the specified[block](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#forEachKey(kotlin.Function1))lambda.  

### forEachValue

Cmn  
Added in[1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)  

```
inline fun forEachValue(block: (value: Float) -> Unit): Unit
```

Iterates over every value stored in this map by invoking the specified[block](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#forEachValue(kotlin.Function1))lambda.  

### get

Cmn  
Added in[1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)  

```
operator fun get(key: Int): Float
```

Returns the value corresponding to the given[key](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#get(kotlin.Int)).  

|                                                           Throws                                                            |
|-----------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------|
| [kotlin.NoSuchElementException](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-no-such-element-exception/index.html) | if[key](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#get(kotlin.Int))is not in the map |

### getOrDefault

Cmn  
Added in[1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)  

```
fun getOrDefault(key: Int, defaultValue: Float): Float
```

Returns the value to which the specified[key](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#getOrDefault(kotlin.Int,kotlin.Float))is mapped, or[defaultValue](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#getOrDefault(kotlin.Int,kotlin.Float))if this map contains no mapping for the key.  

### getOrElse

Cmn  
Added in[1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)  

```
inline fun getOrElse(key: Int, defaultValue: () -> Float): Float
```

Returns the value for the given[key](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#getOrElse(kotlin.Int,kotlin.Function0))if the value is present and not null. Otherwise, returns the result of the[defaultValue](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#getOrElse(kotlin.Int,kotlin.Function0))function.  

### hashCode

Cmn  

```
open fun hashCode(): Int
```

Returns the hash code value for this map. The hash code the sum of the hash codes of each key/value pair.  

### isEmpty

Cmn  
Added in[1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)  

```
fun isEmpty(): Boolean
```

Indicates whether this map is empty.  

### isNotEmpty

Cmn  
Added in[1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)  

```
fun isNotEmpty(): Boolean
```

Returns`true`if this map is not empty.  

### joinToString

Cmn  
Added in[1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)  

```
fun joinToString(
    separator: CharSequence = ", ",
    prefix: CharSequence = "",
    postfix: CharSequence = "",
    limit: Int = -1,
    truncated: CharSequence = "..."
): String
```

Creates a String from the entries, separated by[separator](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence))and using[prefix](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence))before and[postfix](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence))after, if supplied.

When a non-negative value of[limit](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence))is provided, a maximum of[limit](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence))items are used to generate the string. If the collection holds more than[limit](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence))items, the string is terminated with[truncated](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence)).  

### joinToString

Cmn  

```
inline fun joinToString(
    separator: CharSequence = ", ",
    prefix: CharSequence = "",
    postfix: CharSequence = "",
    limit: Int = -1,
    truncated: CharSequence = "...",
    crossinline transform: (key: Int, value: Float) -> CharSequence
): String
```

Creates a String from the entries, separated by[separator](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence,kotlin.Function2))and using[prefix](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence,kotlin.Function2))before and[postfix](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence,kotlin.Function2))after, if supplied. Each entry is created with[transform](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence,kotlin.Function2)).

When a non-negative value of[limit](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence,kotlin.Function2))is provided, a maximum of[limit](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence,kotlin.Function2))items are used to generate the string. If the collection holds more than[limit](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence,kotlin.Function2))items, the string is terminated with[truncated](https://developer.android.com/reference/kotlin/androidx/collection/IntFloatMap#joinToString(kotlin.CharSequence,kotlin.CharSequence,kotlin.CharSequence,kotlin.Int,kotlin.CharSequence,kotlin.Function2)).  

### none

Cmn  
Added in[1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)  

```
fun none(): Boolean
```

Returns`true`if this map has no entries.  

### toString

Cmn  

```
open fun toString(): String
```

Returns a string representation of this map. The map is denoted in the string by the`{}`. Each key/value pair present in the map is represented inside '{}`by a substring of the form `key=value`, and pairs are separated by `, \`.

## Public properties

### capacity

Cmn  
Added in[1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)  

```
val capacity: Int
```

Returns the number of key-value pairs that can be stored in this map without requiring internal storage reallocation.  

### size

Cmn  
Added in[1.4.0](https://developer.android.com/jetpack/androidx/releases/collection#1.4.0)  

```
val size: Int
```

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