Package org.apache.calcite.linq4j
Class Ord<E>
java.lang.Object
org.apache.calcite.linq4j.Ord<E>
- Type Parameters:
E
- Element type
Pair of an element and an ordinal.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
static <T> void
forEach
(Iterable<T> iterable, ObjIntConsumer<? super T> action) Applies an action to every element of an iterable, passing the zero-based ordinal of the element to the action.static <T> void
forEach
(T[] ts, ObjIntConsumer<? super T> action) Applies an action to every element of an array, passing the zero-based ordinal of the element to the action.getKey()
getValue()
int
hashCode()
static <E> Ord<E>
of
(int n, E e) Creates an Ord.reverse
(E... elements) Iterates over an array in reverse order.Iterates over a list in reverse order.zip
(E[] elements) Returns a numbered list based on an array.Creates an iterable ofOrd
s over an iterable.Creates an iterator ofOrd
s over an iterator.Returns a numbered list.
-
Field Details
-
i
public final int i -
e
-
-
Constructor Details
-
Ord
Creates an Ord.
-
-
Method Details
-
of
Creates an Ord. -
hashCode
public int hashCode() -
equals
-
zip
Creates an iterable ofOrd
s over an iterable. -
zip
Creates an iterator ofOrd
s over an iterator. -
zip
Returns a numbered list based on an array. -
zip
Returns a numbered list. -
reverse
Iterates over an array in reverse order.Given the array ["a", "b", "c"], returns (2, "c") then (1, "b") then (0, "a").
-
reverse
Iterates over a list in reverse order.Given the list ["a", "b", "c"], returns (2, "c") then (1, "b") then (0, "a").
-
getKey
-
getValue
-
setValue
-
forEach
Applies an action to every element of an iterable, passing the zero-based ordinal of the element to the action.- Type Parameters:
T
- Element type- Parameters:
iterable
- Iterableaction
- The action to be performed for each element- See Also:
-
forEach
Applies an action to every element of an array, passing the zero-based ordinal of the element to the action.- Type Parameters:
T
- Element type- Parameters:
ts
- Arrayaction
- The action to be performed for each element- See Also:
-