entryAt abstract method

  1. @doNotStore
PresentMapEntry<K, V> entryAt(
  1. int index
)

Returns the map entry at the given index.

The index must be a valid index of this map, which means that index must be non-negative and less than length.

Lifecycle

The returned entry can be used to update the value at the index, using IndexedMapEntry.setOrUpdate, but should not be stored for later use, as it may become invalid after a map operation.

Example

final map = IndexMap<String, bool>();

map['a'] = true;
map['b'] = false;

final entry = map.entryAt(1);
print(entry.key); // 'b'
print(entry.value); // false
print(entry.index); // 1

entry.setOrUpdate(true);
print(map); // {a: true, b: true}

Implementation

@doNotStore
PresentMapEntry<K, V> entryAt(int index);