Package rx.internal.operators
Class OperatorToMultimap<T,K,V>
java.lang.Object
rx.internal.operators.OperatorToMultimap<T,K,V>
- Type Parameters:
T- the value type of the inputK- the multimap-key typeV- the multimap-value type
- All Implemented Interfaces:
Func1<Subscriber<? super Map<K,,Collection<V>>>, Subscriber<? super T>> Function,Observable.Operator<Map<K,Collection<V>>, T>
public final class OperatorToMultimap<T,K,V>
extends Object
implements Observable.Operator<Map<K,Collection<V>>,T>
Maps the elements of the source observable into a multimap
(Map<K, Collection<V>>) where each
key entry has a collection of the source's values.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classThe default collection factory for a key in the multimap returning an ArrayList independent of the key.static final classThe default multimap factory returning a HashMap. -
Field Summary
FieldsModifier and TypeFieldDescription(package private) final Func1<? super K, ? extends Collection<V>> private final Func0<? extends Map<K, Collection<V>>> -
Constructor Summary
ConstructorsConstructorDescriptionOperatorToMultimap(Func1<? super T, ? extends K> keySelector, Func1<? super T, ? extends V> valueSelector) ToMultimap with key selector, custom value selector, default HashMap factory and default ArrayList collection factory.OperatorToMultimap(Func1<? super T, ? extends K> keySelector, Func1<? super T, ? extends V> valueSelector, Func0<? extends Map<K, Collection<V>>> mapFactory) ToMultimap with key selector, custom value selector, custom Map factory and default ArrayList collection factory.OperatorToMultimap(Func1<? super T, ? extends K> keySelector, Func1<? super T, ? extends V> valueSelector, Func0<? extends Map<K, Collection<V>>> mapFactory, Func1<? super K, ? extends Collection<V>> collectionFactory) ToMultimap with key selector, custom value selector, custom Map factory and custom collection factory. -
Method Summary
Modifier and TypeMethodDescriptionSubscriber<? super T> call(Subscriber<? super Map<K, Collection<V>>> subscriber)
-
Field Details
-
keySelector
-
valueSelector
-
mapFactory
-
collectionFactory
-
-
Constructor Details
-
OperatorToMultimap
public OperatorToMultimap(Func1<? super T, ? extends K> keySelector, Func1<? super T, ? extends V> valueSelector) ToMultimap with key selector, custom value selector, default HashMap factory and default ArrayList collection factory.- Parameters:
keySelector- the function extracting the map-key from the main valuevalueSelector- the function extracting the map-value from the main value
-
OperatorToMultimap
public OperatorToMultimap(Func1<? super T, ? extends K> keySelector, Func1<? super T, ? extends V> valueSelector, Func0<? extends Map<K, Collection<V>>> mapFactory) ToMultimap with key selector, custom value selector, custom Map factory and default ArrayList collection 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
-
OperatorToMultimap
public OperatorToMultimap(Func1<? super T, ? extends K> keySelector, Func1<? super T, ? extends V> valueSelector, Func0<? extends Map<K, Collection<V>>> mapFactory, Func1<? super K, ? extends Collection<V>> collectionFactory) ToMultimap with key selector, custom value selector, custom Map factory and custom collection 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 intocollectionFactory- function that returns a Collection for a particular key to store values into
-
-
Method Details