Package org.apache.calcite.linq4j
Class LookupImpl<K,V>
- java.lang.Object
-
- org.apache.calcite.linq4j.DefaultEnumerable<T>
-
- org.apache.calcite.linq4j.AbstractEnumerable<Grouping<K,V>>
-
- org.apache.calcite.linq4j.LookupImpl<K,V>
-
- Type Parameters:
K
- Key typeV
- Value type
- All Implemented Interfaces:
java.lang.Iterable<Grouping<K,V>>
,java.util.Map<K,Enumerable<V>>
,Enumerable<Grouping<K,V>>
,ExtendedEnumerable<Grouping<K,V>>
,ExtendedOrderedEnumerable<Grouping<K,V>>
,Lookup<K,V>
,OrderedEnumerable<Grouping<K,V>>
,RawEnumerable<Grouping<K,V>>
class LookupImpl<K,V> extends AbstractEnumerable<Grouping<K,V>> implements Lookup<K,V>
Implementation ofLookup
that uses an underlying map.
-
-
Constructor Summary
Constructors Constructor Description LookupImpl(java.util.Map<K,java.util.List<V>> map)
Creates a MultiMapImpl.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <TResult> Enumerable<TResult>
applyResultSelector(Function2<K,Enumerable<V>,TResult> resultSelector)
Applies a transform function to each key and its associated values and returns the results.void
clear()
boolean
containsKey(java.lang.Object key)
boolean
containsValue(java.lang.Object value)
java.util.Set<java.util.Map.Entry<K,Enumerable<V>>>
entrySet()
Enumerator<Grouping<K,V>>
enumerator()
Returns an enumerator that iterates through a collection.Enumerable<V>
get(java.lang.Object key)
boolean
isEmpty()
java.util.Set<K>
keySet()
Enumerable<V>
put(K key, Enumerable<V> value)
void
putAll(java.util.Map<? extends K,? extends Enumerable<V>> m)
Enumerable<V>
remove(java.lang.Object key)
int
size()
java.util.Collection<Enumerable<V>>
values()
Enumerable<V>
valuesEnumerable()
Returns an enumerable over the values in this lookup, in map order.-
Methods inherited from class org.apache.calcite.linq4j.AbstractEnumerable
iterator
-
Methods inherited from class org.apache.calcite.linq4j.DefaultEnumerable
aggregate, aggregate, aggregate, all, any, any, asEnumerable, asOrderedQueryable, asQueryable, average, average, average, average, average, average, average, average, average, average, cast, concat, contains, contains, correlateJoin, count, count, createOrderedEnumerable, defaultIfEmpty, defaultIfEmpty, distinct, distinct, elementAt, elementAtOrDefault, except, except, first, first, firstOrDefault, firstOrDefault, foreach, getThis, getThisOrdered, groupBy, groupBy, groupBy, groupBy, groupBy, groupBy, groupBy, groupBy, groupBy, groupBy, groupJoin, groupJoin, intersect, intersect, into, join, join, join, last, last, lastOrDefault, lastOrDefault, longCount, longCount, max, max, max, max, max, max, max, max, max, max, max, max, min, min, min, min, min, min, min, min, min, min, min, min, ofType, orderBy, orderBy, orderByDescending, orderByDescending, removeAll, reverse, select, select, selectMany, selectMany, selectMany, selectMany, sequenceEqual, sequenceEqual, single, single, singleOrDefault, singleOrDefault, skip, skipWhile, skipWhile, sum, sum, sum, sum, sum, sum, sum, sum, sum, sum, take, takeWhile, takeWhile, thenBy, thenBy, thenByDescending, thenByDescending, toList, toLookup, toLookup, toLookup, toLookup, toMap, toMap, toMap, toMap, union, union, where, where, zip
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.calcite.linq4j.Enumerable
asQueryable
-
Methods inherited from interface org.apache.calcite.linq4j.ExtendedEnumerable
aggregate, aggregate, aggregate, all, any, any, asEnumerable, average, average, average, average, average, average, average, average, average, average, cast, concat, contains, contains, correlateJoin, count, count, defaultIfEmpty, defaultIfEmpty, distinct, distinct, elementAt, elementAtOrDefault, except, except, first, first, firstOrDefault, firstOrDefault, foreach, groupBy, groupBy, groupBy, groupBy, groupBy, groupBy, groupBy, groupBy, groupBy, groupBy, groupJoin, groupJoin, intersect, intersect, into, join, join, join, last, last, lastOrDefault, lastOrDefault, longCount, longCount, max, max, max, max, max, max, max, max, max, max, max, max, min, min, min, min, min, min, min, min, min, min, min, min, ofType, orderBy, orderBy, orderByDescending, orderByDescending, removeAll, reverse, select, select, selectMany, selectMany, selectMany, selectMany, sequenceEqual, sequenceEqual, single, single, singleOrDefault, singleOrDefault, skip, skipWhile, skipWhile, sum, sum, sum, sum, sum, sum, sum, sum, sum, sum, take, takeWhile, takeWhile, toList, toLookup, toLookup, toLookup, toLookup, toMap, toMap, toMap, toMap, union, union, where, where, zip
-
-
-
-
Method Detail
-
enumerator
public Enumerator<Grouping<K,V>> enumerator()
Description copied from interface:RawEnumerable
Returns an enumerator that iterates through a collection.- Specified by:
enumerator
in interfaceRawEnumerable<K>
-
containsKey
public boolean containsKey(java.lang.Object key)
-
containsValue
public boolean containsValue(java.lang.Object value)
-
get
public Enumerable<V> get(java.lang.Object key)
-
put
public Enumerable<V> put(K key, Enumerable<V> value)
-
remove
public Enumerable<V> remove(java.lang.Object key)
-
putAll
public void putAll(java.util.Map<? extends K,? extends Enumerable<V>> m)
-
values
public java.util.Collection<Enumerable<V>> values()
-
entrySet
public java.util.Set<java.util.Map.Entry<K,Enumerable<V>>> entrySet()
-
applyResultSelector
public <TResult> Enumerable<TResult> applyResultSelector(Function2<K,Enumerable<V>,TResult> resultSelector)
Description copied from interface:Lookup
Applies a transform function to each key and its associated values and returns the results.- Specified by:
applyResultSelector
in interfaceLookup<K,V>
- Type Parameters:
TResult
- Result type- Parameters:
resultSelector
- Result selector- Returns:
- Enumerable over results
-
valuesEnumerable
public Enumerable<V> valuesEnumerable()
Returns an enumerable over the values in this lookup, in map order. If the map is sorted, the values will be emitted sorted by key.
-
-