본문 바로가기
[RxJava] #3 리액티브 연산자 입문 - ReactiveX 문서의 연산자 부분을 살펴보면 다양한 연산자(operator)함수가 존재한다. 이 연산자들은 버전이 높아지면서 계속 늘고 있다. 이 연산자들을 모두 알아야 리액티브 프로그래밍을 할 수 있는 것은 아니다. - for, if while 문처럼 프로그래밍 언어에서 제공하는 키워드들을 사용하는 대신 RxJava 의 연산자로 비동기 프로그래밍에 필요한 주요 로직을 만들 수 있다. - 리액티브 연산자의 특징은 언어 특성과 크게 연관이 없다. 리액티브 연산자는 함수라고 한다. 형식만 놓고 보면 Observable 등의 클래스에 포함되어 있으므로 자바 관점에서는 메서드이다. 하지만 함수형 프로그래밍의 원리에 따르면 리엑티브 연산자는 부수 효과가 없는 순수 함수(pure function)이다. - .. 2019. 6. 4.
[android] RxAndroid 맛보기 [android] RxAndroid 맛보기 http://www.vogella.com/tutorials/RxJava/article.htmlhttps://code.tutsplus.com/tutorials/getting-started-with-reactivex-on-android--cms-24387https://realm.io/kr/news/rxandroid/ -Observable.just() 는 Observable 을 생성한다.이렇게 생성된 Observable 에 subscribe 가 붙으면 곧바로 just() 에 전달된 녀석이 onNext() 로 전달된다.List list = Arrays.asList(“Android”, “Ubuntu”, “Mac OS”);Observable listObservable = .. 2018. 3. 10.
[Kotlin] Kotlin 의 숨겨진 비용 #3 [Kotlin] Kotlin 의 숨겨진 비용 #3 https://medium.com/@BladeCoder/exploring-kotlins-hidden-costs-part-3-3bf6e0dbf0a4 Delegated property -class Example{ var p: String by Delegate()} property 에 delegate 를 사용할 경우에 해당 delegate 는 operator function 인 getValue 와 setValue 를 구현해야 한다.해당 function 들은 object instance 와 property metadata 를 받는다. public final class Example{ @NonNull private final Delegate p$delegate =.. 2018. 1. 18.
[Kotlin Tutorial] Operator overload 와 convention #2 [Kotlin Tutorial] Operator overload 와 convention #2 출처 : Kotlin in action 7.3. Destructuring declarations and component functions -val p = Point(10, 20)val (x, y) = p // destructuringprintln(x)println(y) -destructuring 도 convention 을 사용한다.componentN 이 호출된다. ( N 은 숫자 )val (a, b) = p // val a = p.component1()// val b = p.component2() -data class 는 compiler 가 primaryConstructor 에 정의된 모든 property 에 .. 2017. 8. 29.
[Kotlin Tutorial] Operator overload 와 convention #1 - Chap7. Operator overloading and other conventions [Kotlin Tutorial] Operator overload 와 convention #1 - Chap7. Operator overloading and other conventions 참조 : Kotlin in action -Java 에는 특정 class 에 결속되어 있는 언어적 기능이 있다.예를 들어 Iterable 를 구현하면 for loop 에서 쓸 수 있고, AutoCloseable 을 구현하면 try-with-resources 에서 사용할 수 있다. Kotlin 도 비슷한 것들이 있다.그러나 specific type 에 결속된 것이 아니라 specific name 에 결속되는 기능들이 있다.예를 들어 plus 라는 이름으로 class 에 function 을 추가하면, + operator 를 해.. 2017. 8. 24.
[Kotlin Tutorial] Kotlin 의 Type system - Chap6. The Kotlin type system [Kotlin Tutorial] Kotlin 의 Type system - Chap6. The Kotlin type system 출처 : Kotlin in action 6.1. Nullability 6.1.1. Nullable types -Kotlin 은 nullable types 를 지원한다.nullable type 이라는 것은 어떤 variable 이 null 을 가질 수 있는지를 명시하는 것이다. -nullable 하지 않은 곳에 null 을 넣으면 compile error 가 난다.기본 type 은 nullable 하지 않으며, nullable 을 만드려면 type 뒤에 ? 를 붙여주면 된다.어떤 타입이든 뒤에 ? 를 붙여줄 수 있다.fun strLenSafe(s: String?) = … 6.1.2.. 2017. 8. 18.
[Kotlin Tutorial] Kotlin 기초 #1 - Chap2. Kotlin basics [Kotlin Tutorial] Kotlin 기초 #1 - Chap2. Kotlin basics 참조 : Kotlin in Action 2.1. Basic elements : Functions and variables 2.1.1. Hello, world! -fun main(args: Array){ println(“Hello, world!”)} fun 는 function 을 정의하는 keywordtype 은 variable 이름 다음에 옴function이 class 정의 안에 있지 않아도 된다Array 가 class 이다 ( Java 는 아니징 ) -> Kotlin 에서는 모든 것이 Object 이다System.out.println 대신 println; (semicolon) 넣을 필요 없다 ( option.. 2017. 7. 25.
Objective-C 의 기본 ( Basic Objective-C ) Object-C 의 기본 ( Basic Objective-C ) 출처 : http://www.tutorialspoint.com/objective_c/ > - OOP 언어로 Smalltalk-style 을 C 언어 에 가미한 언어이다. Apple 의 OSX 와 iOS 에서 공식적으로 사용되는 언어이다. > - Object-C 는 OOP 의 4가지 조건 ( Encapsulation, Data hiding, Inheritance, Polymorphism ) 을 모두 만족시키는 언어이다. - Foundation Framework 는 아래 명시된 기능들을 비롯해 많은 기능을 제공한다. * NSArray, NSDictionary, NSSet 과 같은 data type 을 제공 * file, string 등 많은 u.. 2015. 6. 16.
[JavaScript/Tutorial] Operator 사용 type cast, conversion, control 문, ==, === comparator. Operator 사용, Type cast & conversion, Control문, == & === comparator [이전강좌] Type 에 대한 기본 정보. ( Object, Array, Function, Type check ) Type cast & conversion Type Cast 는 Constructor 나 conversion 함수 등를 통해 할 수 있다. 예를 들면 String 을 Number 형으로 변형할 때는 아래와 같은 방식으로 할 수도 있고, Number( stringObejct ) 아래와 같이 variable 앞에 + 하나를 붙임으로서도 할 수 있다. +stringObject String 을 Float 이나 Int 로 변형할때는 아래의 conversion 함수들을 통해서 할 수 있.. 2013. 5. 13.
반응형