Package rx.internal.operators
Class OperatorToMap<T,K,V>
- java.lang.Object
-
- rx.internal.operators.OperatorToMap<T,K,V>
-
- Type Parameters:
T
- the value type of the inputK
- the map-key typeV
- the map-value type
- All Implemented Interfaces:
Func1<Subscriber<? super java.util.Map<K,V>>,Subscriber<? super T>>
,Function
,Observable.Operator<java.util.Map<K,V>,T>
public final class OperatorToMap<T,K,V> extends java.lang.Object implements Observable.Operator<java.util.Map<K,V>,T>
Maps the elements of the source observable into a java.util.Map instance and emits that once the source observable completes.- See Also:
- Issue #96
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
OperatorToMap.DefaultToMapFactory<K,V>
The default map factory.
-
Field Summary
Fields Modifier and Type Field Description (package private) Func1<? super T,? extends K>
keySelector
private Func0<? extends java.util.Map<K,V>>
mapFactory
(package private) Func1<? super T,? extends V>
valueSelector
-
Constructor Summary
Constructors Constructor Description OperatorToMap(Func1<? super T,? extends K> keySelector, Func1<? super T,? extends V> valueSelector)
ToMap with key selector, value selector and default HashMap factory.OperatorToMap(Func1<? super T,? extends K> keySelector, Func1<? super T,? extends V> valueSelector, Func0<? extends java.util.Map<K,V>> mapFactory)
ToMap with key selector, value selector and custom Map factory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Subscriber<? super T>
call(Subscriber<? super java.util.Map<K,V>> subscriber)
-
-
-
Constructor Detail
-
OperatorToMap
public OperatorToMap(Func1<? super T,? extends K> keySelector, Func1<? super T,? extends V> valueSelector)
ToMap with key selector, value selector and default HashMap factory.- Parameters:
keySelector
- the function extracting the map-key from the main valuevalueSelector
- the function extracting the map-value from the main value
-
OperatorToMap
public OperatorToMap(Func1<? super T,? extends K> keySelector, Func1<? super T,? extends V> valueSelector, Func0<? extends java.util.Map<K,V>> mapFactory)
ToMap with key selector, value selector and custom Map factory.- Parameters:
keySelector
- the function extracting the map-key from the main valuevalueSelector
- the function extracting the map-value from the main valuemapFactory
- function that returns a Map instance to store keys and values into
-
-
Method Detail
-
call
public Subscriber<? super T> call(Subscriber<? super java.util.Map<K,V>> subscriber)
-
-