【클래스 다이어그램】kotlin.collections 패키지의 최상위 인터페이스

Kotlin 표준 라이브러리에 포함 된 kotlin.collections 패키지에 존재하는 최상위 인터페이스의 클래스 다이어그램.

뮤터블인 것은 스테레오 타입《mutable》로 했다.

Iterator 계열





Iterable, Collection 시스템





Map 시스템





기타





PlantUML



PlantUMLuml
@startuml
'
ListIterator -up-|> Iterator
MutableIterator -left-|> Iterator
MutableListIterator -left-|> ListIterator
MutableListIterator -up-|> MutableIterator
'
Collection -up-|> Iterable
List -up-|> Collection
Set -up-|> Collection
MutableIterable -left-|> Iterable
MutableCollection -left-|> Collection
MutableCollection -up-|> MutableIterable
MutableList -left-|> List
MutableList -up-|> MutableCollection
MutableSet -left-|> Set
MutableSet -up-|> MutableCollection
'
MutableMap -left-|> Map
'
interface Iterator<T> {
hasNext(): Boolean
next(): T
}
interface ListIterator<T> {
hasPrevious(): Boolean
nextIndex(): Int
previous(): T
previousIndex(): Int
}
interface MutableIterator<T> <<mutable>> {
remove()
}
interface MutableListIterator<T> <<mutable>> {
add(element: T)
set(element: T)
}
'
interface Iterable<T> {
iterator(): Iterator<T>
}
interface Collection<E> {
val size: Int
contains(element: E): Boolean
containsAll(elements: Collection<E>): Boolean
isEmpty(): Boolean
}
interface List<E> {
get(index: Int): E
indexOf(element: E): Int
lastIndexOf(element: E): Int
listIterator(): ListIterator<E>
listIterator(index: Int): ListIterator<E>
subList(fromIndex: Int, toIndex: Int): List<E>
}
interface Set<E> {
}
interface MutableIterable<T> <<mutable>> {
iterator(): MutableIterator<T>
}
interface MutableCollection<E> <<mutable>> {
add(element: E): Boolean
addAll(elements: Collection<E>): Boolean
clear()
remove(element: E): Boolean
removeAll(elements: Collection<E>): Boolean
retainAll(elements: Collection<E>): Boolean
}
interface MutableList<E> <<mutable>> {
add(index: Int, element: E)
addAll(index: Int, elements: Collection<E>): Boolean
listIterator(): MutableListIterator<E>
listIterator(index: Int): MutableListIterator<E>
removeAt(index: Int): E
set(index: Int, element: E): E
subList(fromIndex: Int, toIndex: Int): MutableList<E>
}
interface MutableSet<E> <<mutable>> {
}
'
interface Map<K, V> {
val entries: Set<Entry<K, V>>
val keys: Set<K>
val size: Int
val values: Collection<V>
containsKey(key: K): Boolean
containsValue(value: V): Boolean
get(key: K): V?
getOrDefault(key: K, defaultValue: V): V
isEmpty(): Boolean
}
interface MutableMap<K, V> <<mutable>> {
val entries: MutableSet<MutableEntry<K, V>>
val keys: MutableSet<K>
val values: MutableCollection<V>
clear()
put(key: K, value: V): V?
putAll(from: Map<out K, V>)
remove(key: K): V?
remove(key: K, value: V): Boolean
}
'
interface RandomAccess {
}
interface Grouping {
keyOf(element: T): K
sourceIterator(): Iterator<T>
}
'
skinparam class {
BackgroundColor<<mutable>> Wheat
}
@enduml

좋은 웹페이지 즐겨찾기