values
Returns a MutableCollection of all values in this map. Note that this collection may contain duplicate values.
Since Kotlin
1.0Samples
import kotlin.test.*
import java.util.*
fun main() {
//sampleStart
val map = mutableMapOf(1 to "one", 2 to "two", -2 to "two")
val values = map.values
println(values) // [one, two, two]
values.removeAll { it == "two" }
println(values) // [one]
println(map) // {1=one}
// values.add("v") // will fail with UnsupportedOperationException
//sampleEnd
}
Returns a MutableCollection of all values in this map. Note that this collection may contain duplicate values.
Since Kotlin
1.1Samples
import kotlin.test.*
import java.util.*
fun main() {
//sampleStart
val map = mutableMapOf(1 to "one", 2 to "two", -2 to "two")
val values = map.values
println(values) // [one, two, two]
values.removeAll { it == "two" }
println(values) // [one]
println(map) // {1=one}
// values.add("v") // will fail with UnsupportedOperationException
//sampleEnd
}
Returns a MutableCollection of all values in this map. Note that this collection may contain duplicate values.
Since Kotlin
1.0Samples
import kotlin.test.*
import java.util.*
fun main() {
//sampleStart
val map = mutableMapOf(1 to "one", 2 to "two", -2 to "two")
val values = map.values
println(values) // [one, two, two]
values.removeAll { it == "two" }
println(values) // [one]
println(map) // {1=one}
// values.add("v") // will fail with UnsupportedOperationException
//sampleEnd
}
Returns a MutableCollection of all values in this map. Note that this collection may contain duplicate values.
Since Kotlin
1.3Samples
import kotlin.test.*
import java.util.*
fun main() {
//sampleStart
val map = mutableMapOf(1 to "one", 2 to "two", -2 to "two")
val values = map.values
println(values) // [one, two, two]
values.removeAll { it == "two" }
println(values) // [one]
println(map) // {1=one}
// values.add("v") // will fail with UnsupportedOperationException
//sampleEnd
}
Returns a MutableCollection of all values in this map. Note that this collection may contain duplicate values.
Since Kotlin
1.8Samples
import kotlin.test.*
import java.util.*
fun main() {
//sampleStart
val map = mutableMapOf(1 to "one", 2 to "two", -2 to "two")
val values = map.values
println(values) // [one, two, two]
values.removeAll { it == "two" }
println(values) // [one]
println(map) // {1=one}
// values.add("v") // will fail with UnsupportedOperationException
//sampleEnd
}
Returns a MutableCollection of all values in this map. Note that this collection may contain duplicate values.
Since Kotlin
1.8Samples
import kotlin.test.*
import java.util.*
fun main() {
//sampleStart
val map = mutableMapOf(1 to "one", 2 to "two", -2 to "two")
val values = map.values
println(values) // [one, two, two]
values.removeAll { it == "two" }
println(values) // [one]
println(map) // {1=one}
// values.add("v") // will fail with UnsupportedOperationException
//sampleEnd
}