Package io.openems.common.utils
Class CollectorUtils
java.lang.Object
io.openems.common.utils.CollectorUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic final <INPUT,
FIRST_KEY, SECOND_KEY, VALUE>
Collector<INPUT, ?, Map<FIRST_KEY, Map<SECOND_KEY, VALUE>>> toDoubleMap
(Function<INPUT, FIRST_KEY> firstKeyMapper, Function<INPUT, SECOND_KEY> secondKeyMapper, Function<INPUT, VALUE> valueMapper) static final <KEY extends Comparable<KEY>,
KEY2 extends Comparable<KEY2>, VALUE>
Collector<Map.Entry<KEY, Map<KEY2, VALUE>>, ?, com.google.common.collect.TreeBasedTable<KEY, KEY2, VALUE>> Creates aCollector
which collects the given input to aTreeBasedTable
.
-
Method Details
-
toDoubleMap
public static final <INPUT,FIRST_KEY, Collector<INPUT,SECOND_KEY, VALUE> ?, toDoubleMapMap<FIRST_KEY, Map<SECOND_KEY, VALUE>>> (Function<INPUT, FIRST_KEY> firstKeyMapper, Function<INPUT, SECOND_KEY> secondKeyMapper, Function<INPUT, VALUE> valueMapper) - Type Parameters:
INPUT
- the input of the collectionFIRST_KEY
- the key of the first mapSECOND_KEY
- the key of the second mapVALUE
- the value of the second map- Parameters:
firstKeyMapper
- the mapper-function of the first keysecondKeyMapper
- the mapper-function of the second keyvalueMapper
- the mapper-function of the value- Returns:
- the
Collector
-
toTreeBasedTable
public static final <KEY extends Comparable<KEY>,KEY2 extends Comparable<KEY2>, Collector<Map.Entry<KEY,VALUE> Map<KEY2, toTreeBasedTable()VALUE>>, ?, com.google.common.collect.TreeBasedTable<KEY, KEY2, VALUE>> Creates aCollector
which collects the given input to aTreeBasedTable
.- Type Parameters:
KEY
- the type of the first map keyKEY2
- the type of the second map keyVALUE
- the type of the value- Returns:
- the
Collector
-