---
title: "LazyLayoutKeyIndexMap"
description: "A key-index mapping that can be used by the [LazyLayoutItemProvider] to keep track of indices and
keys in [LazyLayout]."
type: "interface"
---

<div class='type'>Interface</div>


<a id='references'></a>

<div class='sourceset sourceset-common'>Common</div>



```kotlin
interface LazyLayoutKeyIndexMap
```


A key-index mapping that can be used by the `LazyLayoutItemProvider` to keep track of indices and
keys in `LazyLayout`.


## Functions

```kotlin
fun getIndex(key: Any): Int
```


#### Returns

| | |
| --- | --- |
|  | current index for given `key` or `-1` if not found. |



```kotlin
fun getKey(index: Int): Any?
```


#### Returns

| | |
| --- | --- |
|  | key for a given `index` if it is known, or null otherwise. |




