Package org.apache.calcite.runtime
Class SortedMultiMap<K,V>
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap<K,java.util.List<V>>
-
- org.apache.calcite.runtime.SortedMultiMap<K,V>
-
- Type Parameters:
K
- Key typeV
- Value type
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.util.Map<K,java.util.List<V>>
public class SortedMultiMap<K,V> extends java.util.HashMap<K,java.util.List<V>>
Map that allows you to partition values into lists according to a common key, and then convert those lists into an iterator of sorted arrays.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SortedMultiMap()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Iterator<V[]>
arrays(java.util.Comparator<V> comparator)
void
putMulti(K key, V value)
static <V> java.util.Iterator<V[]>
singletonArrayIterator(java.util.Comparator<V> comparator, java.util.List<V> list)
Shortcut method if the partition key is empty.-
Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
-
-
-
Method Detail
-
singletonArrayIterator
public static <V> java.util.Iterator<V[]> singletonArrayIterator(java.util.Comparator<V> comparator, java.util.List<V> list)
Shortcut method if the partition key is empty. We know that we would end up with a map with just one entry, so save ourselves the trouble of all that hashing.
-
-