코틀린 언어 정리 4-11
Collection operations
Write operations
컬렉션에 요소를 추가, 삭제, 갱신하는 등의 연산들입니다. 여기서는 List, Set, Map 등에 공통적으로 적용할 수 있는 일반적인 개념의 함수들만 소개 합니다. 보다 자세한, 각 자료 구조에 특화된 내용들은 코틀린 언어 학습 사이트(kotlinlang.org)의 List Specific Operations, Map Specific Operations 를 참조하실 수 있습니다.
Adding elements
함수들
add, addAll
+, +=
주의: 연산자 오버로딩한 함수들(+, +=)을 사용하려면 컬렉션을 val로 선언해야 합니다.
Removing elements
함수들
remove, removeAll
retainAll
clear
-, -=
주의: 연산자 오버로딩한 함수들(-, -=)을 사용하려면 컬렉션을 val로 선언해야 합니다.
Updating elements
List Specific Operations, Map Specific Operations 를 참조합니다.
전체 예제
'코틀린( Kotlin )' 카테고리의 다른 글
코틀린 5-2 Reflection - Callable References (0) | 2020.04.15 |
---|---|
코틀린 5-1 Reflection - Class References & Bound Class References (0) | 2020.04.14 |
코틀린 4-10 Collection operations - Aggregation Operations (0) | 2020.04.14 |
코틀린 4-9 Collection operations - Collection Ordering( 컬렉션 정렬 ) (0) | 2020.04.13 |
코틀린 4-8 Collection operations - Retrieving Single Elements( 단일 요소 검색 ) (0) | 2020.04.13 |