Kotlin Collection 공식 문서를 정리 한 글입니다. Collection의 retrieve collection parts operator에 대해 알아봅니다.
Github repo 에서 아래에 적힌 Kotlin 코드들을 확인 하실 수 있습니다.
Write operations operator
- mutableCollection의 element를 추가 / 삭제하는데 사용되는 operator
Adding elements
add()
/addAll()
/+
등의 연산자가 활용 됨
1 |
|
Removing elements
remove()
/removeAll()
/-
등의 연산자가 활용 됨retain()
→ operation 함수의 결과 값이 true 인 것만 남기고 나머지 element들은 제거
1 |
|
출처 : https://kotlinlang.org/docs/collection-plus-minus.html
"Android" 카테고리의 최근 포스팅
카테고리 모든 글 보기Kotlin - 코루틴 동작 원리 ( Continuation / CPS / State Machine ) | 2025. 04. 23 |
---|---|
JVM - Runtime Data Area - Thread | 2025. 04. 21 |
JVM - Runtime Data Area - Heap | 2025. 04. 21 |
JVM - Runtime Data Area - Method | 2025. 04. 19 |
JVM - Interned string | 2025. 04. 18 |
Android - 직렬화 | 2025. 04. 17 |
Hilt - ComponentScope | 2025. 04. 16 |
Kotlin - Channel | 2025. 04. 15 |
Android - ViewModel 에 대해서 | 2025. 04. 14 |
Android - Bundle 이란 | 2025. 04. 13 |