Spec-Zone.ru › Kotlin 2

записи

kotlin-stdlib/kotlin.collections/HashMap/записи

Требования к платформе и версии: Common (1.0), JS (1.1), Native (1.3), Wasm-JS (1.8), Wasm-WASI (1.8)

expect open override val entries: MutableSet<MutableMap.MutableEntry<K, V>>

Возвращает MutableSet всех пар ключ/значение в этой карте.

Примеры

import kotlin.test.*
import java.util.*

fun main() { 
   //sampleStart 
   val map = mutableMapOf(1 to "one", 2 to "two")
val entries = map.entries
println(entries) // [1=one, 2=two]

entries.first().setValue("*ONE*")
println(entries) // [1=*ONE*, 2=two]

entries.clear()
println("map.isEmpty() is ${map.isEmpty()}") // true 
   //sampleEnd
}

© 2010–2026 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-hash-map/entries.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API