| Modifier and Type | Method and Description |
|---|---|
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.
|
Integer |
getKey() |
E |
getValue() |
static <E> Ord<E> |
of(int n,
E e)
Creates an Ord.
|
static <E> Iterable<Ord<E>> |
reverse(E... elements)
Iterates over an array in reverse order.
|
static <E> Iterable<Ord<E>> |
reverse(Iterable<? extends E> elements)
Iterates over a list in reverse order.
|
E |
setValue(E value) |
static <E> List<Ord<E>> |
zip(E[] elements)
Returns a numbered list based on an array.
|
static <E> Iterable<Ord<E>> |
zip(Iterable<? extends E> iterable)
Creates an iterable of
Ords over an iterable. |
static <E> Iterator<Ord<E>> |
zip(Iterator<? extends E> iterator)
Creates an iterator of
Ords over an iterator. |
static <E> List<Ord<E>> |
zip(List<? extends E> elements)
Returns a numbered list.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcomparingByKey, comparingByKey, comparingByValue, comparingByValue, equals, hashCodepublic final int i
public final E e
public Ord(int i,
E e)
public static <E> Ord<E> of(int n, E e)
public static <E> Iterable<Ord<E>> zip(Iterable<? extends E> iterable)
Ords over an iterable.public static <E> Iterator<Ord<E>> zip(Iterator<? extends E> iterator)
Ords over an iterator.public static <E> Iterable<Ord<E>> reverse(E... elements)
Given the array ["a", "b", "c"], returns (2, "c") then (1, "b") then (0, "a").
public static <E> Iterable<Ord<E>> reverse(Iterable<? extends E> elements)
Given the list ["a", "b", "c"], returns (2, "c") then (1, "b") then (0, "a").
public static <T> void forEach(Iterable<T> iterable, ObjIntConsumer<? super T> action)
T - Element typeiterable - Iterableaction - The action to be performed for each elementIterable.forEach(java.util.function.Consumer),
Map.forEach(java.util.function.BiConsumer)public static <T> void forEach(T[] ts,
ObjIntConsumer<? super T> action)
T - Element typets - Arrayaction - The action to be performed for each elementIterable.forEach(java.util.function.Consumer),
Map.forEach(java.util.function.BiConsumer)Copyright © 2012-2021 Apache Software Foundation. All Rights Reserved.