Class SortedMultiMap<K,V>

java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<K,List<V>>
org.apache.calcite.runtime.SortedMultiMap<K,V>
Type Parameters:
K - Key type
V - Value type
All Implemented Interfaces:
Serializable, Cloneable, Map<K,List<V>>

public class SortedMultiMap<K,V> extends HashMap<K,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:
  • Constructor Details

    • SortedMultiMap

      public SortedMultiMap()
  • Method Details

    • putMulti

      public void putMulti(K key, V value)
    • arrays

      public Iterator<V[]> arrays(Comparator<V> comparator)
    • singletonArrayIterator

      public static <V> Iterator<V[]> singletonArrayIterator(Comparator<V> comparator, 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.