Kotlin - Collection 타입

CODEDRAGON Development/Algorithm, DataStructure

반응형


 

 

Collection 타입

·         kotlin.collections 패키지에는  Iterable, Collection, List, Set, Map 클래스하며 이클래스는 컬렉션 타입의 클래스입니다.

·         Collection 타입의 클래스들은 mutable객체(Read/Write) immutable 객체(Read Only)형태로 구분됩니다.

·         kotlin.collection.List 인터페이스로 표현되는 객체는 immutable형태이므로 size(), get() 함수만 제공됩니다.

·         kotlin.collection.MutableList 인터페이스로 표현되는 객체는 mutable형태이므로 size(), get() 함수 이외에 add(), set() 같은 함수도 제공됩니다.

 

 

 

상속도

수정 ...


 


 

 

 

Package kotlin.collections

https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/index.html

 

 

 

 

Iterable

interface Iterable<out T>

 

https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-iterable/index.html#kotlin.collections.Iterable

 

 

 

 

Collection

interface Collection<out E> : Iterable<E>

 

https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-collection/index.html#kotlin.collections.Collection

 

 

 

MutableCollection

interface MutableCollection<E> : 

    Collection<E>, 

    MutableIterable<E>

 

 

 

https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-collection/index.html

 

 

 

MutableIterable

interface MutableIterable<out T> : Iterable<T>

 

https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-iterable/index.html

 

 

 

MutableList

interface MutableList<E> : List<E>, MutableCollection<E>

 

https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html

 

 

 

List

interface List<out E> : Collection<E>

 

 

https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html#kotlin.collections.List

 

 

 

 

Set

interface Set<out E> : Collection<E>

 

https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-set/index.html#kotlin.collections.Set

 

 

 

Map

interface Map<K, out V>

 

https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-map/index.html#kotlin.collections.Map