일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- Class
- variable
- pushnamed
- package
- python
- 웹크롤러
- Yocto
- Android
- DART
- Flutter
- 크롤러
- kotlin
- function
- animation
- Collection
- 콜렉션
- textstyle
- crawler
- text
- 파이썬
- set
- 코틀린
- 함수
- List
- ML
- 다트
- 클래스
- import
- map
- 플러터
- Today
- Total
목록kotlin (40)
조용한 담장
코틀린의 collection 의 transformation 에 대해 살펴보자. 원문 https://kotlinlang.org/docs/reference/collection-transformations.html 을 보며 정리. 한 collection 에서 다른 형태로 변형시키는 확장 함수들을 제공한다. Mapping 다른 collection 의 element 로 부터 mapping transformation 을 만든다. 기본 함수는 map() 이다. inline fun Iterable.map( transform: (T) -> R ): List 주어진 람다 함수를 각 element 에 적용하여 그 결과를 가진 List 를 리턴한다. element 의 순서는 원본의 collection 과 같다. mapInde..
코틀린의 operation 에 대해 살펴보자. 원문 https://kotlinlang.org/docs/reference/collection-operations.html 을 보며 정리. standard library 에 정의된 collection operation 은 collection interface 의 member functions 와 extension functions 로 되어 있다. member functions 은 isEmpty(), get() 같은 collection type 의 필수적인 동작이 구현되어 있다. 자신의 collection interface 를 구현하고자 한다면 member function 은 반드시 구현해야 한다. 쉬운 방법은 collection interface 의 골격이 되..
코틀린(kotlin) 의 시퀀스(sequence) 를 살펴보자. 원문 https://kotlinlang.org/docs/reference/sequences.html 을 보며 정리. kotlin standard library 는 collection 과 함께 또다른 container type 인 sequences (Sequence) 를 가지고 있다. 여러 단계를 포함하는 Iterable 을 수행할 때에는 각 단계의 처리는 바로 끝나고 즉각 그 결과를 리턴한다. sequences 의 여러 단계 처리는 전체 단계가 처리된 결과가 요구됬을 때에 실제 연산이 일어나며 느리게(나중에) 처리된다. (executed lazily) 동작 수행의 순서 또한 다르다. Sequence 은 각각 하나의 element 에 대해 모..
코틀린(kotlin) collection 의 range(범위) and progression(수열) 에 대해 살펴보자. 원문 https://kotlinlang.org/docs/reference/ranges.html 을 보며 정리. 특정 범위의 값(range of values) 을 생성하는 방법에는 kotlin.ranges 패키지에 있는 rangeTo() 함수가 있으며 이 함수의 연산자 인 .. 를 사용한다. operator fun T.rangeTo( that: T ): ClosedRange operator fun Double.rangeTo( that: Double ): ClosedFloatingPointRange operator fun Float.rangeTo( that: Float ): ClosedFlo..