-
[Kotlin] Collection hierachyKotlin/Collection 2021. 8. 26. 14:45
read-only interface (Mutable이 붙지 않은 것들)- element의 값을 변경 불가
mutable interface (Mutable이 붙은 것들)- element의 값을 변경 가능( 삭제,변경,추가)
interface Iterable<out T>
Classes that inherit from this interface can be represented as a sequence of elements that can be iterated over.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-iterable/
interface Collection<out E> : Iterable<E>
A generic collection of elements. Methods in this interface support only read-only access to the collection;
read/write access is supported through the MutableCollection interface.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-collection/
interface MutableIterable<out T> : Iterable<T>
Classes that inherit from this interface can be represented as a sequence of elements that can be iterated over and that supports removing elements during iteration.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-iterable/
interface MutableCollection<E> : Collection<E>, MutableIterable<E>
A generic collection of elements that supports adding and removing elements.
interface List<out E> : Collection<E>
A generic ordered collection of elements. Methods in this interface support only read-only access to the list; read/write access is supported through the MutableList interface.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/#kotlin.collections.List
interface Set<out E> : Collection<E>
A generic unordered collection of elements that does not support duplicate elements. Methods in this interface support only read-only access to the set; read/write access is supported through the MutableSet interface.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-set/#kotlin.collections.Set
interface MutableList<E> : List<E>, MutableCollection<E>
A generic ordered collection of elements that supports adding and removing elements.
interface MutableSet<E> : Set<E>, MutableCollection<E>
A generic unordered collection of elements that does not support duplicate elements, and supports adding and removing elements.
interface Map<K, out V>
A collection that holds pairs of objects (keys and values) and supports efficiently retrieving the value corresponding to each key. Map keys are unique; the map holds only one value for each key. Methods in this interface support only read-only access to the map; read-write access is supported through the MutableMap interface.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-map/#kotlin.collections.Map
interface MutableMap<K, V> : Map<K, V>
A modifiable collection that holds pairs of objects (keys and values) and supports efficiently retrieving the value corresponding to each key. Map keys are unique; the map holds only one value for each key.
@file:Suppress("ACTUAL_WITHOUT_EXPECT") // for building kotlin-stdlib-minimal-for-test package kotlin.collections @SinceKotlin("1.1") public actual typealias RandomAccess = java.util.RandomAccess @SinceKotlin("1.1") public actual typealias ArrayList<E> = java.util.ArrayList<E> @SinceKotlin("1.1") public actual typealias LinkedHashMap<K, V> = java.util.LinkedHashMap<K, V> @SinceKotlin("1.1") public actual typealias HashMap<K, V> = java.util.HashMap<K, V> @SinceKotlin("1.1") public actual typealias LinkedHashSet<E> = java.util.LinkedHashSet<E> @SinceKotlin("1.1") public actual typealias HashSet<E> = java.util.HashSet<E>
'Kotlin > Collection' 카테고리의 다른 글
[Kotlin] List,Set,Map (0) 2021.09.05