public final class Iterables extends Object
Note: This class includes codes copied from Apache Commons Lang, Google Guava and other open source projects under the Apache License 2.0. The methods copied from other libraries/frameworks/projects may be modified in this class.
This is a utility class for iterable data structures, including Collection/Array/Iterator.
The methods in this class should only read the input Collection/Array/Iterator parameters, not modify them.
N,
Iterators,
Maps,
StringUtil| Modifier and Type | Method and Description |
|---|---|
static <T extends Number> |
averageDouble(Collection<? extends T> c)
Returns
OptionalDouble.empty() if the specified Array/Collection is null or empty, or fromIndex == toIndex. |
static <T extends Number> |
averageDouble(Collection<? extends T> c,
int fromIndex,
int toIndex)
Returns
OptionalDouble.empty() if the specified Array/Collection is null or empty, or fromIndex == toIndex. |
static <T,E extends Exception> |
averageDouble(Collection<? extends T> c,
int fromIndex,
int toIndex,
Throwables.ToDoubleFunction<? super T,E> func)
Returns
OptionalDouble.empty() if the specified Array/Collection is null or empty, or fromIndex == toIndex. |
static <T,E extends Exception> |
averageDouble(Collection<? extends T> c,
Throwables.ToDoubleFunction<? super T,E> func)
Returns
OptionalDouble.empty() if the specified Array/Collection is null or empty, or fromIndex == toIndex. |
static <T extends Number> |
averageDouble(T[] a)
Returns
OptionalDouble.empty() if the specified Array/Collection is null or empty, or fromIndex == toIndex. |
static <T extends Number> |
averageDouble(T[] a,
int fromIndex,
int toIndex)
Returns
OptionalDouble.empty() if the specified Array/Collection is null or empty, or fromIndex == toIndex. |
static <T,E extends Exception> |
averageDouble(T[] a,
int fromIndex,
int toIndex,
Throwables.ToDoubleFunction<? super T,E> func)
Returns
OptionalDouble.empty() if the specified Array/Collection is null or empty, or fromIndex == toIndex. |
static <T,E extends Exception> |
averageDouble(T[] a,
Throwables.ToDoubleFunction<? super T,E> func)
Returns
OptionalDouble.empty() if the specified Array/Collection is null or empty, or fromIndex == toIndex. |
static <T extends Number> |
averageInt(Collection<? extends T> c)
Returns
OptionalDouble.empty() if the specified Array/Collection is null or empty, or fromIndex == toIndex. |
static <T extends Number> |
averageInt(Collection<? extends T> c,
int fromIndex,
int toIndex)
Returns
OptionalDouble.empty() if the specified Array/Collection is null or empty, or fromIndex == toIndex. |
static <T,E extends Exception> |
averageInt(Collection<? extends T> c,
int fromIndex,
int toIndex,
Throwables.ToIntFunction<? super T,E> func)
Returns
OptionalDouble.empty() if the specified Array/Collection is null or empty, or fromIndex == toIndex. |
static <T,E extends Exception> |
averageInt(Collection<? extends T> c,
Throwables.ToIntFunction<? super T,E> func)
Returns
OptionalDouble.empty() if the specified Array/Collection is null or empty, or fromIndex == toIndex. |
static <T extends Number> |
averageInt(T[] a)
Returns
OptionalDouble.empty() if the specified Array/Collection is null or empty, or fromIndex == toIndex. |
static <T extends Number> |
averageInt(T[] a,
int fromIndex,
int toIndex)
Returns
OptionalDouble.empty() if the specified Array/Collection is null or empty, or fromIndex == toIndex. |
static <T,E extends Exception> |
averageInt(T[] a,
int fromIndex,
int toIndex,
Throwables.ToIntFunction<? super T,E> func)
Returns
OptionalDouble.empty() if the specified Array/Collection is null or empty, or fromIndex == toIndex. |
static <T,E extends Exception> |
averageInt(T[] a,
Throwables.ToIntFunction<? super T,E> func)
Returns
OptionalDouble.empty() if the specified Array/Collection is null or empty, or fromIndex == toIndex. |
static <T extends Number> |
averageLong(Collection<? extends T> c)
Returns
OptionalDouble.empty() if the specified Array/Collection is null or empty, or fromIndex == toIndex. |
static <T extends Number> |
averageLong(Collection<? extends T> c,
int fromIndex,
int toIndex)
Returns
OptionalDouble.empty() if the specified Array/Collection is null or empty, or fromIndex == toIndex. |
static <T,E extends Exception> |
averageLong(Collection<? extends T> c,
int fromIndex,
int toIndex,
Throwables.ToLongFunction<? super T,E> func)
Returns
OptionalDouble.empty() if the specified Array/Collection is null or empty, or fromIndex == toIndex. |
static <T,E extends Exception> |
averageLong(Collection<? extends T> c,
Throwables.ToLongFunction<? super T,E> func)
Returns
OptionalDouble.empty() if the specified Array/Collection is null or empty, or fromIndex == toIndex. |
static <T extends Number> |
averageLong(T[] a)
Returns
OptionalDouble.empty() if the specified Array/Collection is null or empty, or fromIndex == toIndex. |
static <T extends Number> |
averageLong(T[] a,
int fromIndex,
int toIndex)
Returns
OptionalDouble.empty() if the specified Array/Collection is null or empty, or fromIndex == toIndex. |
static <T,E extends Exception> |
averageLong(T[] a,
int fromIndex,
int toIndex,
Throwables.ToLongFunction<? super T,E> func)
Returns
OptionalDouble.empty() if the specified Array/Collection is null or empty, or fromIndex == toIndex. |
static <T,E extends Exception> |
averageLong(T[] a,
Throwables.ToLongFunction<? super T,E> func)
Returns
OptionalDouble.empty() if the specified Array/Collection is null or empty, or fromIndex == toIndex. |
static u.OptionalInt |
indexOf(Collection<?> c,
Object objToFind) |
static u.OptionalInt |
indexOf(Object[] a,
Object objToFind) |
static <T extends Comparable<? super T>> |
kthLargest(Collection<? extends T> c,
int k)
Returns
Nullable.empty() if the specified Array/Collection is null or empty, or its length/size is less than k. |
static <T> u.Nullable<T> |
kthLargest(Collection<? extends T> c,
int k,
Comparator<? super T> cmp)
Returns
Nullable.empty() if the specified Array/Collection is null or empty, or its length/size is less than k. |
static <T extends Comparable<? super T>> |
kthLargest(T[] a,
int k)
Returns
Nullable.empty() if the specified Array/Collection is null or empty, or its length/size is less than k. |
static <T> u.Nullable<T> |
kthLargest(T[] a,
int k,
Comparator<? super T> cmp)
Returns
Nullable.empty() if the specified Array/Collection is null or empty, or its length/size is less than k. |
static u.OptionalInt |
lastIndexOf(Collection<?> c,
Object objToFind) |
static u.OptionalInt |
lastIndexOf(Object[] a,
Object objToFind) |
static u.OptionalByte |
max(byte... a)
Returns
OptionalByte.empty() if the specified Array/Collection is null or empty. |
static u.OptionalChar |
max(char... a)
Returns
OptionalChar.empty() if the specified Array/Collection is null or empty. |
static <T extends Comparable<? super T>> |
max(Collection<? extends T> c)
Returns
Nullable.empty() if the specified Array/Collection is null or empty. |
static <T> u.Nullable<T> |
max(Collection<? extends T> c,
Comparator<? super T> cmp)
Returns
Nullable.empty() if the specified Array/Collection is null or empty. |
static u.OptionalDouble |
max(double... a)
Returns
OptionalDouble.empty() if the specified Array/Collection is null or empty. |
static u.OptionalFloat |
max(float... a)
Returns
OptionalFloat.empty() if the specified Array/Collection is null or empty. |
static u.OptionalInt |
max(int... a)
Returns
OptionalInt.empty() if the specified Array/Collection is null or empty. |
static <T extends Comparable<? super T>> |
max(Iterator<? extends T> iter)
Returns
Nullable.empty() if the specified Array/Collection is null or empty. |
static <T> u.Nullable<T> |
max(Iterator<? extends T> iter,
Comparator<? super T> cmp)
Returns
Nullable.empty() if the specified Array/Collection is null or empty. |
static u.OptionalLong |
max(long... a)
Returns
OptionalLong.empty() if the specified Array/Collection is null or empty. |
static u.OptionalShort |
max(short... a)
Returns
OptionalShort.empty() if the specified Array/Collection is null or empty. |
static <T extends Comparable<? super T>> |
max(T[] a)
Returns
Nullable.empty() if the specified Array/Collection is null or empty. |
static <T> u.Nullable<T> |
max(T[] a,
Comparator<? super T> cmp)
Returns
Nullable.empty() if the specified Array/Collection is null or empty. |
static <T> u.Nullable<T> |
maxBy(Collection<? extends T> c,
Function<? super T,? extends Comparable> keyMapper)
Returns
Nullable.empty() if the specified Array/Collection is null or empty. |
static <T> u.Nullable<T> |
maxBy(Iterator<? extends T> iter,
Function<? super T,? extends Comparable> keyMapper)
Returns
Nullable.empty() if the specified Array/Collection is null or empty. |
static <T> u.Nullable<T> |
maxBy(T[] a,
Function<? super T,? extends Comparable> keyMapper)
Returns
Nullable.empty() if the specified Array/Collection is null or empty. |
static <T extends Comparable<? super T>> |
median(Collection<? extends T> c)
Returns
Nullable.empty() if the specified Array/Collection is null or empty. |
static <T> u.Nullable<T> |
median(Collection<? extends T> c,
Comparator<? super T> cmp)
Returns
Nullable.empty() if the specified Array/Collection is null or empty. |
static <T extends Comparable<? super T>> |
median(T[] a)
Returns
Nullable.empty() if the specified Array/Collection is null or empty. |
static <T> u.Nullable<T> |
median(T[] a,
Comparator<? super T> cmp)
Returns
Nullable.empty() if the specified Array/Collection is null or empty. |
static <T> u.Nullable<T> |
medianBy(Collection<? extends T> c,
Function<? super T,? extends Comparable> keyMapper)
Returns
Nullable.empty() if the specified Array/Collection is null or empty. |
static <T> u.Nullable<T> |
medianBy(T[] a,
Function<? super T,? extends Comparable> keyMapper)
Returns
Nullable.empty() if the specified Array/Collection is null or empty. |
static u.OptionalByte |
min(byte... a)
Returns
OptionalByte.empty() if the specified Array/Collection is null or empty. |
static u.OptionalChar |
min(char... a)
Returns
OptionalChar.empty() if the specified Array/Collection is null or empty. |
static <T extends Comparable<? super T>> |
min(Collection<? extends T> c)
Returns
Nullable.empty() if the specified Array/Collection is null or empty. |
static <T> u.Nullable<T> |
min(Collection<? extends T> c,
Comparator<? super T> cmp)
Returns
Nullable.empty() if the specified Array/Collection is null or empty. |
static u.OptionalDouble |
min(double... a)
Returns
OptionalDouble.empty() if the specified Array/Collection is null or empty. |
static u.OptionalFloat |
min(float... a)
Returns
OptionalFloat.empty() if the specified Array/Collection is null or empty. |
static u.OptionalInt |
min(int... a)
Returns
OptionalInt.empty() if the specified Array/Collection is null or empty. |
static <T extends Comparable<? super T>> |
min(Iterator<? extends T> iter)
Returns
Nullable.empty() if the specified Array/Collection is null or empty. |
static <T> u.Nullable<T> |
min(Iterator<? extends T> iter,
Comparator<? super T> cmp)
Returns
Nullable.empty() if the specified Array/Collection is null or empty. |
static u.OptionalLong |
min(long... a)
Returns
OptionalLong.empty() if the specified Array/Collection is null or empty. |
static u.OptionalShort |
min(short... a)
Returns
OptionalShort.empty() if the specified Array/Collection is null or empty. |
static <T extends Comparable<? super T>> |
min(T[] a)
Returns
Nullable.empty() if the specified Array/Collection is null or empty. |
static <T> u.Nullable<T> |
min(T[] a,
Comparator<? super T> cmp)
Returns
Nullable.empty() if the specified Array/Collection is null or empty. |
static <T> u.Nullable<T> |
minBy(Collection<? extends T> c,
Function<? super T,? extends Comparable> keyMapper)
Returns
Nullable.empty() if the specified Array/Collection is null or empty. |
static <T> u.Nullable<T> |
minBy(Iterator<? extends T> iter,
Function<? super T,? extends Comparable> keyMapper)
Returns
Nullable.empty() if the specified Array/Collection is null or empty. |
static <T> u.Nullable<T> |
minBy(T[] a,
Function<? super T,? extends Comparable> keyMapper)
Returns
Nullable.empty() if the specified Array/Collection is null or empty. |
static <T> boolean |
padLeft(List<T> list,
int minLen,
T objToAdd) |
static <T> boolean |
padRight(Collection<T> c,
int minLen,
T objToAdd) |
@SafeVarargs public static u.OptionalChar min(char... a)
OptionalChar.empty() if the specified Array/Collection is null or empty.a - @SafeVarargs public static u.OptionalByte min(byte... a)
OptionalByte.empty() if the specified Array/Collection is null or empty.a - @SafeVarargs public static u.OptionalShort min(short... a)
OptionalShort.empty() if the specified Array/Collection is null or empty.a - @SafeVarargs public static u.OptionalInt min(int... a)
OptionalInt.empty() if the specified Array/Collection is null or empty.a - @SafeVarargs public static u.OptionalLong min(long... a)
OptionalLong.empty() if the specified Array/Collection is null or empty.a - @SafeVarargs public static u.OptionalFloat min(float... a)
OptionalFloat.empty() if the specified Array/Collection is null or empty.a - @SafeVarargs public static u.OptionalDouble min(double... a)
OptionalDouble.empty() if the specified Array/Collection is null or empty.a - @SafeVarargs public static u.OptionalChar max(char... a)
OptionalChar.empty() if the specified Array/Collection is null or empty.a - @SafeVarargs public static u.OptionalByte max(byte... a)
OptionalByte.empty() if the specified Array/Collection is null or empty.a - @SafeVarargs public static u.OptionalShort max(short... a)
OptionalShort.empty() if the specified Array/Collection is null or empty.a - @SafeVarargs public static u.OptionalInt max(int... a)
OptionalInt.empty() if the specified Array/Collection is null or empty.a - @SafeVarargs public static u.OptionalLong max(long... a)
OptionalLong.empty() if the specified Array/Collection is null or empty.a - @SafeVarargs public static u.OptionalFloat max(float... a)
OptionalFloat.empty() if the specified Array/Collection is null or empty.a - @SafeVarargs public static u.OptionalDouble max(double... a)
OptionalDouble.empty() if the specified Array/Collection is null or empty.a - public static <T extends Comparable<? super T>> u.Nullable<T> min(T[] a)
Nullable.empty() if the specified Array/Collection is null or empty.a - public static <T> u.Nullable<T> min(T[] a, Comparator<? super T> cmp)
Nullable.empty() if the specified Array/Collection is null or empty.a - cmp - public static <T extends Comparable<? super T>> u.Nullable<T> min(Collection<? extends T> c)
Nullable.empty() if the specified Array/Collection is null or empty.c - public static <T> u.Nullable<T> min(Collection<? extends T> c, Comparator<? super T> cmp)
Nullable.empty() if the specified Array/Collection is null or empty.c - cmp - public static <T extends Comparable<? super T>> u.Nullable<T> min(Iterator<? extends T> iter)
Nullable.empty() if the specified Array/Collection is null or empty.iter - public static <T> u.Nullable<T> min(Iterator<? extends T> iter, Comparator<? super T> cmp)
Nullable.empty() if the specified Array/Collection is null or empty.iter - cmp - public static <T> u.Nullable<T> minBy(T[] a, Function<? super T,? extends Comparable> keyMapper)
Nullable.empty() if the specified Array/Collection is null or empty.a - cmp - public static <T> u.Nullable<T> minBy(Collection<? extends T> c, Function<? super T,? extends Comparable> keyMapper)
Nullable.empty() if the specified Array/Collection is null or empty.c - cmp - public static <T> u.Nullable<T> minBy(Iterator<? extends T> iter, Function<? super T,? extends Comparable> keyMapper)
Nullable.empty() if the specified Array/Collection is null or empty.iter - cmp - public static <T extends Comparable<? super T>> u.Nullable<T> max(T[] a)
Nullable.empty() if the specified Array/Collection is null or empty.a - public static <T> u.Nullable<T> max(T[] a, Comparator<? super T> cmp)
Nullable.empty() if the specified Array/Collection is null or empty.a - cmp - public static <T extends Comparable<? super T>> u.Nullable<T> max(Collection<? extends T> c)
Nullable.empty() if the specified Array/Collection is null or empty.c - public static <T> u.Nullable<T> max(Collection<? extends T> c, Comparator<? super T> cmp)
Nullable.empty() if the specified Array/Collection is null or empty.c - public static <T extends Comparable<? super T>> u.Nullable<T> max(Iterator<? extends T> iter)
Nullable.empty() if the specified Array/Collection is null or empty.iter - public static <T> u.Nullable<T> max(Iterator<? extends T> iter, Comparator<? super T> cmp)
Nullable.empty() if the specified Array/Collection is null or empty.iter - cmp - public static <T> u.Nullable<T> maxBy(T[] a, Function<? super T,? extends Comparable> keyMapper)
Nullable.empty() if the specified Array/Collection is null or empty.a - cmp - public static <T> u.Nullable<T> maxBy(Collection<? extends T> c, Function<? super T,? extends Comparable> keyMapper)
Nullable.empty() if the specified Array/Collection is null or empty.c - cmp - public static <T> u.Nullable<T> maxBy(Iterator<? extends T> iter, Function<? super T,? extends Comparable> keyMapper)
Nullable.empty() if the specified Array/Collection is null or empty.iter - cmp - public static <T extends Comparable<? super T>> u.Nullable<T> median(T[] a)
Nullable.empty() if the specified Array/Collection is null or empty.a - public static <T extends Comparable<? super T>> u.Nullable<T> median(Collection<? extends T> c)
Nullable.empty() if the specified Array/Collection is null or empty.c - public static <T> u.Nullable<T> median(T[] a, Comparator<? super T> cmp)
Nullable.empty() if the specified Array/Collection is null or empty.a - cmp - public static <T> u.Nullable<T> median(Collection<? extends T> c, Comparator<? super T> cmp)
Nullable.empty() if the specified Array/Collection is null or empty.c - cmp - public static <T> u.Nullable<T> medianBy(T[] a, Function<? super T,? extends Comparable> keyMapper)
Nullable.empty() if the specified Array/Collection is null or empty.a - keyMapper - public static <T> u.Nullable<T> medianBy(Collection<? extends T> c, Function<? super T,? extends Comparable> keyMapper)
Nullable.empty() if the specified Array/Collection is null or empty.c - keyMapper - public static <T extends Comparable<? super T>> u.Nullable<T> kthLargest(Collection<? extends T> c, int k)
Nullable.empty() if the specified Array/Collection is null or empty, or its length/size is less than k.c - k - public static <T extends Comparable<? super T>> u.Nullable<T> kthLargest(T[] a, int k)
Nullable.empty() if the specified Array/Collection is null or empty, or its length/size is less than k.a - k - public static <T> u.Nullable<T> kthLargest(Collection<? extends T> c, int k, Comparator<? super T> cmp)
Nullable.empty() if the specified Array/Collection is null or empty, or its length/size is less than k.c - k - cmp - public static <T> u.Nullable<T> kthLargest(T[] a, int k, Comparator<? super T> cmp)
Nullable.empty() if the specified Array/Collection is null or empty, or its length/size is less than k.a - k - cmp - public static <T extends Number> u.OptionalDouble averageInt(T[] a)
OptionalDouble.empty() if the specified Array/Collection is null or empty, or fromIndex == toIndex.T - a - public static <T extends Number> u.OptionalDouble averageInt(T[] a, int fromIndex, int toIndex)
OptionalDouble.empty() if the specified Array/Collection is null or empty, or fromIndex == toIndex.T - a - fromIndex - toIndex - public static <T,E extends Exception> u.OptionalDouble averageInt(T[] a, Throwables.ToIntFunction<? super T,E> func) throws E extends Exception
OptionalDouble.empty() if the specified Array/Collection is null or empty, or fromIndex == toIndex.T - E - a - func - E - the eE extends Exceptionpublic static <T,E extends Exception> u.OptionalDouble averageInt(T[] a, int fromIndex, int toIndex, Throwables.ToIntFunction<? super T,E> func) throws E extends Exception
OptionalDouble.empty() if the specified Array/Collection is null or empty, or fromIndex == toIndex.T - E - a - fromIndex - toIndex - func - E - the eE extends Exceptionpublic static <T extends Number> u.OptionalDouble averageInt(Collection<? extends T> c)
OptionalDouble.empty() if the specified Array/Collection is null or empty, or fromIndex == toIndex.T - c - public static <T extends Number> u.OptionalDouble averageInt(Collection<? extends T> c, int fromIndex, int toIndex)
OptionalDouble.empty() if the specified Array/Collection is null or empty, or fromIndex == toIndex.T - c - fromIndex - toIndex - public static <T,E extends Exception> u.OptionalDouble averageInt(Collection<? extends T> c, Throwables.ToIntFunction<? super T,E> func) throws E extends Exception
OptionalDouble.empty() if the specified Array/Collection is null or empty, or fromIndex == toIndex.T - E - c - func - E - the eE extends Exceptionpublic static <T,E extends Exception> u.OptionalDouble averageInt(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.ToIntFunction<? super T,E> func) throws E extends Exception
OptionalDouble.empty() if the specified Array/Collection is null or empty, or fromIndex == toIndex.T - E - c - fromIndex - toIndex - func - E - the eE extends Exceptionpublic static <T extends Number> u.OptionalDouble averageLong(T[] a)
OptionalDouble.empty() if the specified Array/Collection is null or empty, or fromIndex == toIndex.T - a - public static <T extends Number> u.OptionalDouble averageLong(T[] a, int fromIndex, int toIndex)
OptionalDouble.empty() if the specified Array/Collection is null or empty, or fromIndex == toIndex.T - a - fromIndex - toIndex - public static <T,E extends Exception> u.OptionalDouble averageLong(T[] a, Throwables.ToLongFunction<? super T,E> func) throws E extends Exception
OptionalDouble.empty() if the specified Array/Collection is null or empty, or fromIndex == toIndex.T - E - a - func - E - the eE extends Exceptionpublic static <T,E extends Exception> u.OptionalDouble averageLong(T[] a, int fromIndex, int toIndex, Throwables.ToLongFunction<? super T,E> func) throws E extends Exception
OptionalDouble.empty() if the specified Array/Collection is null or empty, or fromIndex == toIndex.T - E - a - fromIndex - toIndex - func - E - the eE extends Exceptionpublic static <T extends Number> u.OptionalDouble averageLong(Collection<? extends T> c)
OptionalDouble.empty() if the specified Array/Collection is null or empty, or fromIndex == toIndex.T - c - public static <T extends Number> u.OptionalDouble averageLong(Collection<? extends T> c, int fromIndex, int toIndex)
OptionalDouble.empty() if the specified Array/Collection is null or empty, or fromIndex == toIndex.T - c - fromIndex - toIndex - public static <T,E extends Exception> u.OptionalDouble averageLong(Collection<? extends T> c, Throwables.ToLongFunction<? super T,E> func) throws E extends Exception
OptionalDouble.empty() if the specified Array/Collection is null or empty, or fromIndex == toIndex.T - E - c - func - E - the eE extends Exceptionpublic static <T,E extends Exception> u.OptionalDouble averageLong(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.ToLongFunction<? super T,E> func) throws E extends Exception
OptionalDouble.empty() if the specified Array/Collection is null or empty, or fromIndex == toIndex.T - E - c - fromIndex - toIndex - func - E - the eE extends Exceptionpublic static <T extends Number> u.OptionalDouble averageDouble(T[] a)
OptionalDouble.empty() if the specified Array/Collection is null or empty, or fromIndex == toIndex.T - a - public static <T extends Number> u.OptionalDouble averageDouble(T[] a, int fromIndex, int toIndex)
OptionalDouble.empty() if the specified Array/Collection is null or empty, or fromIndex == toIndex.T - a - fromIndex - toIndex - public static <T,E extends Exception> u.OptionalDouble averageDouble(T[] a, Throwables.ToDoubleFunction<? super T,E> func) throws E extends Exception
OptionalDouble.empty() if the specified Array/Collection is null or empty, or fromIndex == toIndex.T - E - a - func - E - the eE extends Exceptionpublic static <T,E extends Exception> u.OptionalDouble averageDouble(T[] a, int fromIndex, int toIndex, Throwables.ToDoubleFunction<? super T,E> func) throws E extends Exception
OptionalDouble.empty() if the specified Array/Collection is null or empty, or fromIndex == toIndex.T - E - a - fromIndex - toIndex - func - E - the eE extends Exceptionpublic static <T extends Number> u.OptionalDouble averageDouble(Collection<? extends T> c)
OptionalDouble.empty() if the specified Array/Collection is null or empty, or fromIndex == toIndex.T - c - public static <T extends Number> u.OptionalDouble averageDouble(Collection<? extends T> c, int fromIndex, int toIndex)
OptionalDouble.empty() if the specified Array/Collection is null or empty, or fromIndex == toIndex.T - c - fromIndex - toIndex - public static <T,E extends Exception> u.OptionalDouble averageDouble(Collection<? extends T> c, Throwables.ToDoubleFunction<? super T,E> func) throws E extends Exception
OptionalDouble.empty() if the specified Array/Collection is null or empty, or fromIndex == toIndex.T - E - c - func - E - the eE extends Exceptionpublic static <T,E extends Exception> u.OptionalDouble averageDouble(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.ToDoubleFunction<? super T,E> func) throws E extends Exception
OptionalDouble.empty() if the specified Array/Collection is null or empty, or fromIndex == toIndex.T - E - c - fromIndex - toIndex - func - E - the eE extends Exceptionpublic static u.OptionalInt indexOf(Object[] a, Object objToFind)
public static u.OptionalInt indexOf(Collection<?> c, Object objToFind)
public static u.OptionalInt lastIndexOf(Object[] a, Object objToFind)
public static u.OptionalInt lastIndexOf(Collection<?> c, Object objToFind)
public static <T> boolean padLeft(List<T> list, int minLen, T objToAdd)
public static <T> boolean padRight(Collection<T> c, int minLen, T objToAdd)
Copyright © 2021. All rights reserved.