Class SqlFunctions.ProductComparableListEnumerator<E extends java.lang.Comparable>
- java.lang.Object
-
- org.apache.calcite.linq4j.CartesianProductEnumerator<java.util.List<E>,FlatLists.ComparableList<E>>
-
- org.apache.calcite.runtime.SqlFunctions.ProductComparableListEnumerator<E>
-
- Type Parameters:
E
- element type
- All Implemented Interfaces:
java.lang.AutoCloseable
,Enumerator<FlatLists.ComparableList<E>>
- Enclosing class:
- SqlFunctions
private static class SqlFunctions.ProductComparableListEnumerator<E extends java.lang.Comparable> extends CartesianProductEnumerator<java.util.List<E>,FlatLists.ComparableList<E>>
Enumerates over the cartesian product of the given lists, returning a comparable list for each row.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) E[]
flatElements
(package private) java.util.List<E>
list
private int
ordinality
private boolean
withOrdinality
-
Fields inherited from class org.apache.calcite.linq4j.CartesianProductEnumerator
elements
-
-
Constructor Summary
Constructors Constructor Description ProductComparableListEnumerator(java.util.List<Enumerator<java.util.List<E>>> enumerators, int fieldCount, boolean withOrdinality)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FlatLists.ComparableList<E>
current()
Gets the current element in the collection.-
Methods inherited from class org.apache.calcite.linq4j.CartesianProductEnumerator
close, moveNext, reset
-
-
-
-
Constructor Detail
-
ProductComparableListEnumerator
ProductComparableListEnumerator(java.util.List<Enumerator<java.util.List<E>>> enumerators, int fieldCount, boolean withOrdinality)
-
-
Method Detail
-
current
public FlatLists.ComparableList<E> current()
Description copied from interface:Enumerator
Gets the current element in the collection.After an enumerator is created or after the
Enumerator.reset()
method is called, theEnumerator.moveNext()
method must be called to advance the enumerator to the first element of the collection before reading the value of thecurrent
property; otherwise,current
is undefined.This method also throws
NoSuchElementException
if the last call tomoveNext
returnedfalse
, which indicates the end of the collection.This method does not move the position of the enumerator, and consecutive calls to
current
return the same object until eithermoveNext
orreset
is called.An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated. The next call to
moveNext
orreset
may, at the discretion of the implementation, throw aConcurrentModificationException
. If the collection is modified betweenmoveNext
andcurrent
,current
returns the element that it is set to, even if the enumerator is already invalidated.- Returns:
- Current element
-
-