Class N

java.lang.Object
com.landawn.abacus.util.N

public final class N 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.

Class N is a general java utility class. It provides the most daily used operations for Object/primitive types/String/Array/Collection/Map/Bean...:

When to throw exception? It's designed to avoid throwing any unnecessary exception if the contract defined by method is not broken. for example, if user tries to reverse a null or empty String. the input String will be returned. But exception will be thrown if try to add element to a null Object array or collection.

An empty String/Array/Collection/Map/Iterator/Iterable/InputStream/Reader will always be a preferred choice than a null for the return value of a method.
There are only fromIndex/startIndex and {toIndex/endIndex} parameters in the methods defined in class CommonUtil/N, no offset/count parameters.
Version:
$Revision: 0.8 $ 07/03/10
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final BigDecimal[]
    An empty immutable/unmodifiable BigDecimal array.
    static final BigInteger[]
    An empty immutable/unmodifiable BigInteger array.
    static final boolean[]
    An empty immutable/unmodifiable boolean array.
    static final Boolean[]
    An empty immutable/unmodifiable Boolean array.
    static final byte[]
    An empty immutable/unmodifiable byte array.
    static final Byte[]
    An empty immutable/unmodifiable Byte array.
    static final Calendar[]
    /** An empty immutable/unmodifiable Calendar array.
    static final char[]
    An empty immutable/unmodifiable char array.
    static final Character[]
    An empty immutable/unmodifiable Character array.
    static final Date[]
    An empty immutable/unmodifiable java.sql.Date array.
    static final double[]
    An empty immutable/unmodifiable double array.
    static final Double[]
    An empty immutable/unmodifiable Double array.
    static final float[]
    An empty immutable/unmodifiable float array.
    static final Float[]
    An empty immutable/unmodifiable Float array.
    static final int[]
    An empty immutable/unmodifiable int array.
    static final Integer[]
    An empty immutable/unmodifiable Integer array.
    static final Date[]
    An empty immutable/unmodifiable java.util.Date array.
    static final LocalDate[]
    /** An empty immutable/unmodifiable LocalDate array.
    static final LocalDateTime[]
    /** An empty immutable/unmodifiable LocalDateTime array.
    static final LocalTime[]
    /** An empty immutable/unmodifiable LocalTime array.
    static final long[]
    An empty immutable/unmodifiable long array.
    static final Long[]
    An empty immutable/unmodifiable Long array.
    static final Object[]
    An empty immutable/unmodifiable Object array.
    static final short[]
    An empty immutable/unmodifiable short array.
    static final Short[]
    An empty immutable/unmodifiable Short array.
    static final String[]
    An empty immutable/unmodifiable String array.
    static final Time[]
    An empty immutable/unmodifiable Time array.
    static final Timestamp[]
    An empty immutable/unmodifiable Timestamp array.
    static final int
    The index value when an element is not found in a list or array: -1.
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean[]
    add(boolean[] a, boolean elementToAdd)
    Returns a new array with elements copied from the specified array and the specified element added at the end.
    static byte[]
    add(byte[] a, byte elementToAdd)
    Returns a new array with elements copied from the specified array and the specified element added at the end.
    static char[]
    add(char[] a, char elementToAdd)
    Returns a new array with elements copied from the specified array and the specified element added at the end.
    static double[]
    add(double[] a, double elementToAdd)
    Returns a new array with elements copied from the specified array and the specified element added at the end.
    static float[]
    add(float[] a, float elementToAdd)
    Returns a new array with elements copied from the specified array and the specified element added at the end.
    static int[]
    add(int[] a, int elementToAdd)
    Returns a new array with elements copied from the specified array and the specified element added at the end.
    static long[]
    add(long[] a, long elementToAdd)
    Returns a new array with elements copied from the specified array and the specified element added at the end.
    static short[]
    add(short[] a, short elementToAdd)
    Returns a new array with elements copied from the specified array and the specified element added at the end.
    static String[]
    add(String[] a, String elementToAdd)
    Returns a new array with elements copied from the specified array and the specified element added at the end.
    static <T> T[]
    add(T[] a, T elementToAdd)
    Returns a new array with elements copied from the specified array and the specified element added at the end.
    static boolean[]
    addAll(boolean[] a, boolean... elementsToAdd)
    Returns a new array with elements copied from the specified array and the specified element added at the end.
    static byte[]
    addAll(byte[] a, byte... elementsToAdd)
    Returns a new array with elements copied from the specified array and the specified elements added at the end.
    static char[]
    addAll(char[] a, char... elementsToAdd)
    Returns a new array with elements copied from the specified array and the specified element added at the end.
    static double[]
    addAll(double[] a, double... elementsToAdd)
    Returns a new array with elements copied from the specified array and the specified elements added at the end.
    static float[]
    addAll(float[] a, float... elementsToAdd)
    Returns a new array with elements copied from the specified array and the specified elements added at the end.
    static int[]
    addAll(int[] a, int... elementsToAdd)
    Returns a new array with elements copied from the specified array and the specified elements added at the end.
    static long[]
    addAll(long[] a, long... elementsToAdd)
    Returns a new array with elements copied from the specified array and the specified elements added at the end.
    static short[]
    addAll(short[] a, short... elementsToAdd)
    Returns a new array with elements copied from the specified array and the specified elements added at the end.
    static String[]
    addAll(String[] a, String... elementsToAdd)
    Returns a new array with elements copied from the specified array and the specified elements added at the end.
    static <T> boolean
    addAll(Collection<T> c, Iterable<? extends T> elementsToAdd)
    Adds all the elements in elementsToAdd to a given collection.
    static <T> boolean
    addAll(Collection<T> c, Iterator<? extends T> elementsToAdd)
    Adds all the elements in elementsToAdd to a given collection.
    static <T> boolean
    addAll(Collection<T> c, T... elementsToAdd)
    Adds all the elements in elementsToAdd to a given collection.
    static <T> T[]
    addAll(T[] a, T... elementsToAdd)
    Returns a new array with elements copied from the specified array and the specified elements added at the end.
    static boolean
    Checks if all of the CharSequences are empty (""), null or whitespace only.
    static boolean
     
    static boolean
     
    static boolean
     
    static <A, B> boolean
    allEmpty(A[] a, B[] b)
     
    static <A, B, C> boolean
    allEmpty(A[] a, B[] b, C[] c)
     
    static boolean
    Checks if all of the CharSequences are empty ("") or null.
    static boolean
     
    static boolean
     
    static boolean
     
    static boolean
     
    static boolean
     
    static boolean
    allFalse(boolean[] a)
     
    static <T> boolean
    allMatch(Iterable<? extends T> c, Predicate<? super T> filter)
     
    static <T> boolean
    allMatch(Iterator<? extends T> iter, Predicate<? super T> filter)
     
    static <T> boolean
    allMatch(T[] a, Predicate<? super T> filter)
     
    static <A, B> boolean
    allNull(A a, B b)
     
    static <A, B, C> boolean
    allNull(A a, B b, C c)
     
    static boolean
     
    static <T> boolean
    allNull(T... a)
     
    static boolean
    allTrue(boolean[] a)
     
    static boolean
    Checks if any of the CharSequences are empty ("") or null or whitespace only.
    static boolean
     
    static boolean
     
    static boolean
     
    static <A, B> boolean
    anyEmpty(A[] a, B[] b)
     
    static <A, B, C> boolean
    anyEmpty(A[] a, B[] b, C[] c)
     
    static boolean
    Checks if any of the CharSequences are empty ("") or null.
    static boolean
     
    static boolean
     
    static boolean
     
    static boolean
     
    static boolean
     
    static boolean
    anyFalse(boolean[] a)
     
    static <T> boolean
    anyMatch(Iterable<? extends T> c, Predicate<? super T> filter)
     
    static <T> boolean
    anyMatch(Iterator<? extends T> iter, Predicate<? super T> filter)
     
    static <T> boolean
    anyMatch(T[] a, Predicate<? super T> filter)
     
    static <A, B> boolean
    anyNull(A a, B b)
     
    static <A, B, C> boolean
    anyNull(A a, B b, C c)
     
    static boolean
     
    static <T> boolean
    anyNull(T... a)
     
    static boolean
    anyTrue(boolean[] a)
     
    static <T, E extends Exception>
    void
    applyToEach(List<T> c, Throwables.Function<? super T,? extends T,E> converter)
    Updates each element in the specified List with specified function converter.
    static <T, E extends Exception>
    void
    applyToEach(T[] a, Throwables.Function<? super T,? extends T,E> converter)
    Updates each element in the specified array with specified function converter.
    static <T> T[]
    asArray(T... a)
    The input array is returned.
    static <T> ArrayBlockingQueue<T>
    Returns a modifiable ArrayBlockingQueue with specified elements.
    static <T> ArrayDeque<T>
    asArrayDeque(T... a)
    Returns a modifiable ArrayDeque with specified elements.
    static <T> ConcurrentLinkedDeque<T>
    Returns a modifiable ConcurrentLinkedDeque with specified elements.
    static <T> ConcurrentLinkedQueue<T>
    Returns a modifiable ConcurrentLinkedQueue with specified elements.
    static <T extends Delayed>
    DelayQueue<T>
    asDelayQueue(T... a)
    Returns a modifiable DelayQueue with specified elements.
    static <T> Deque<T>
    asDeque(T... a)
    Returns a modifiable Deque with specified elements.
    static <T> LinkedBlockingDeque<T>
    Returns a modifiable LinkedBlockingDeque with specified elements.
    static <T> LinkedBlockingQueue<T>
    Returns a modifiable LinkedBlockingQueue with specified elements.
    static <K, V> Map<K,V>
    Deprecated. 
    static <K, V> Map<K,V>
    asLinkedHashMap(K k1, V v1)
    Returns a modifiable LinkedHashMap with specified keys/values.
    static <K, V> Map<K,V>
    asLinkedHashMap(K k1, V v1, K k2, V v2)
    Returns a modifiable LinkedHashMap with specified keys/values.
    static <K, V> Map<K,V>
    asLinkedHashMap(K k1, V v1, K k2, V v2, K k3, V v3)
    Returns a modifiable LinkedHashMap with specified keys/values.
    static <K, V> Map<K,V>
    asLinkedHashMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4)
    Returns a modifiable LinkedHashMap with specified keys/values.
    static <K, V> Map<K,V>
    asLinkedHashMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5)
    Returns a modifiable LinkedHashMap with specified keys/values.
    static <K, V> Map<K,V>
    asLinkedHashMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6)
    Returns a modifiable LinkedHashMap with specified keys/values.
    static <K, V> Map<K,V>
    asLinkedHashMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7)
    Returns a modifiable LinkedHashMap with specified keys/values.
    static <T> Set<T>
    Returns a modifiable LinkedHashSet with specified element.
    static <T> Set<T>
    Returns a modifiable LinkedHashSet with specified elements.
    static <T> Set<T>
    asLinkedHashSet(T e1, T e2)
    Returns a modifiable LinkedHashSet with specified elements.
    static <T> Set<T>
    asLinkedHashSet(T e1, T e2, T e3)
    Returns a modifiable LinkedHashSet with specified elements.
    static <T> Set<T>
    asLinkedHashSet(T e1, T e2, T e3, T e4)
    Returns a modifiable LinkedHashSet with specified elements.
    static <T> Set<T>
    asLinkedHashSet(T e1, T e2, T e3, T e4, T e5)
    Returns a modifiable LinkedHashSet with specified elements.
    static <T> Set<T>
    asLinkedHashSet(T e1, T e2, T e3, T e4, T e5, T e6)
    Returns a modifiable LinkedHashSet with specified elements.
    static <T> Set<T>
    asLinkedHashSet(T e1, T e2, T e3, T e4, T e5, T e6, T e7)
    Returns a modifiable LinkedHashSet with specified elements.
    static <T> LinkedList<T>
    Returns a modifiable LinkedList with specified element.
    static <T> LinkedList<T>
    asLinkedList(T... a)
    Returns a modifiable LinkedList with specified elements.
    static <T> LinkedList<T>
    asLinkedList(T e1, T e2)
    Returns a modifiable LinkedList with specified elements.
    static <T> LinkedList<T>
    asLinkedList(T e1, T e2, T e3)
    Returns a modifiable LinkedList with specified elements.
    static <T> LinkedList<T>
    asLinkedList(T e1, T e2, T e3, T e4)
    Returns a modifiable LinkedList with specified elements.
    static <T> LinkedList<T>
    asLinkedList(T e1, T e2, T e3, T e4, T e5)
    Returns a modifiable LinkedList with specified elements.
    static <T> LinkedList<T>
    asLinkedList(T e1, T e2, T e3, T e4, T e5, T e6)
    Returns a modifiable LinkedList with specified elements.
    static <T> LinkedList<T>
    asLinkedList(T e1, T e2, T e3, T e4, T e5, T e6, T e7)
    Returns a modifiable LinkedList with specified elements.
    static <T> List<T>
    asList(T e)
    Returns a modifiable List with specified element.
    static <T> List<T>
    asList(T... a)
    Returns a modifiable List with specified elements.
    static <T> List<T>
    asList(T e1, T e2)
    Returns a modifiable List with specified elements.
    static <T> List<T>
    asList(T e1, T e2, T e3)
    Returns a modifiable List with specified elements.
    static <T> List<T>
    asList(T e1, T e2, T e3, T e4)
    Returns a modifiable List with specified elements.
    static <T> List<T>
    asList(T e1, T e2, T e3, T e4, T e5)
    Returns a modifiable List with specified elements.
    static <T> List<T>
    asList(T e1, T e2, T e3, T e4, T e5, T e6)
    Returns a modifiable List with specified elements.
    static <T> List<T>
    asList(T e1, T e2, T e3, T e4, T e5, T e6, T e7)
    Returns a modifiable List with specified elements.
    static <T> List<T>
    asList(T e1, T e2, T e3, T e4, T e5, T e6, T e7, T e8)
    Returns a modifiable List with specified elements.
    static <T> List<T>
    asList(T e1, T e2, T e3, T e4, T e5, T e6, T e7, T e8, T e9)
    Returns a modifiable List with specified elements.
    static <K, V> Map<K,V>
    asMap(Object... a)
    Deprecated. 
    static <K, V> Map<K,V>
    asMap(K k1, V v1)
    Returns a modifiable Map with specified key/value.
    static <K, V> Map<K,V>
    asMap(K k1, V v1, K k2, V v2)
    Returns a modifiable Map with specified keys/values.
    static <K, V> Map<K,V>
    asMap(K k1, V v1, K k2, V v2, K k3, V v3)
    Returns a modifiable Map with specified keys/values.
    static <K, V> Map<K,V>
    asMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4)
    Returns a modifiable Map with specified keys/values.
    static <K, V> Map<K,V>
    asMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5)
    Returns a modifiable Map with specified keys/values.
    static <K, V> Map<K,V>
    asMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6)
    Returns a modifiable Map with specified keys/values.
    static <K, V> Map<K,V>
    asMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7)
    Returns a modifiable Map with specified keys/values.
    static <T> Multiset<T>
    asMultiset(T... a)
    Returns a modifiable Multiset with specified elements.
    static <T> NavigableSet<T>
    Returns a modifiable NavigableSet with specified elements.
    static <T> PriorityQueue<T>
    Returns a modifiable PriorityQueue with specified elements.
    static Map<String,Object>
    Deprecated. 
    static Map<String,Object>
    asProps(String propName, Object propValue)
    Returns a modifiable Map with specified key/value.
    static Map<String,Object>
    asProps(String propName1, Object propValue1, String propName2, Object propValue2)
    Returns a modifiable Map with specified keys/values.
    static Map<String,Object>
    asProps(String propName1, Object propValue1, String propName2, Object propValue2, String propName3, Object propValue3)
    Returns a modifiable Map with specified keys/values.
    static Map<String,Object>
    asProps(String propName1, Object propValue1, String propName2, Object propValue2, String propName3, Object propValue3, String propName4, Object propValue4)
    Returns a modifiable Map with specified keys/values.
    static Map<String,Object>
    asProps(String propName1, Object propValue1, String propName2, Object propValue2, String propName3, Object propValue3, String propName4, Object propValue4, String propName5, Object propValue5)
    Returns a modifiable Map with specified keys/values.
    static <T> Queue<T>
    asQueue(T... a)
    Returns a modifiable Queue with specified elements.
    static <T> Set<T>
    asSet(T e)
    Returns a modifiable Set with specified element.
    static <T> Set<T>
    asSet(T... a)
    Returns a modifiable Set with specified elements.
    static <T> Set<T>
    asSet(T e1, T e2)
    Returns a modifiable Set with specified elements.
    static <T> Set<T>
    asSet(T e1, T e2, T e3)
    Returns a modifiable Set with specified elements.
    static <T> Set<T>
    asSet(T e1, T e2, T e3, T e4)
    Returns a modifiable Set with specified elements.
    static <T> Set<T>
    asSet(T e1, T e2, T e3, T e4, T e5)
    Returns a modifiable Set with specified elements.
    static <T> Set<T>
    asSet(T e1, T e2, T e3, T e4, T e5, T e6)
    Returns a modifiable Set with specified elements.
    static <T> Set<T>
    asSet(T e1, T e2, T e3, T e4, T e5, T e6, T e7)
    Returns a modifiable Set with specified elements.
    static <T> Set<T>
    asSet(T e1, T e2, T e3, T e4, T e5, T e6, T e7, T e8)
    Returns a modifiable Set with specified elements.
    static <T> Set<T>
    asSet(T e1, T e2, T e3, T e4, T e5, T e6, T e7, T e8, T e9)
    Returns a modifiable Set with specified elements.
    static <T> List<T>
    Wrap the specified value with a singleton list.
    static <K, V> Map<K,V>
    asSingletonMap(K key, V value)
    Wrap the specified key/value with a singleton map.
    static <T> Set<T>
    Wrap the specified value with a singleton set.
    static <T> SortedSet<T>
    asSortedSet(T... a)
    Returns a modifiable SortedSet with specified elements.
    static <R> ObjIterator<R>
    asynCall(Collection<? extends Callable<? extends R>> commands)
    Executes the specified commands/tasks asynchronous and immediately returns an iterator for iterating the result lazily.
    static <R> ObjIterator<R>
    asynCall(Collection<? extends Callable<? extends R>> commands, Executor executor)
    Executes the specified commands/tasks asynchronous and immediately returns an iterator for iterating the result lazily.
    Executes the provided command asynchronously.
    asyncExecute(Throwables.Runnable<? extends Exception> cmd, int retryTimes, long retryIntervallInMillisInMillis, Predicate<? super Exception> retryCondition)
    Executes a Runnable task asynchronously with the possibility of retrying in case of failure.
    asyncExecute(Throwables.Runnable<? extends Exception> command, long delayInMillis)
    Executes the provided command asynchronously after a specified delay.
    asyncExecute(Throwables.Runnable<? extends Exception> command, Executor executor)
     
    static <R> List<ContinuableFuture<R>>
    asyncExecute(Collection<? extends Callable<R>> commands)
     
    static <R> List<ContinuableFuture<R>>
    asyncExecute(Collection<? extends Callable<R>> commands, Executor executor)
     
    static <R> ContinuableFuture<R>
    asyncExecute(Callable<R> command)
    Executes the provided command asynchronously.
    static <R> ContinuableFuture<R>
    asyncExecute(Callable<R> cmd, int retryTimes, long retryIntervallInMillisInMillis, BiPredicate<? super R,? super Exception> retryCondition)
    Executes a Runnable task asynchronously with the possibility of retrying in case of failure.
    static <R> ContinuableFuture<R>
    asyncExecute(Callable<R> command, long delayInMillis)
    Executes the provided command asynchronously after a specified delay.
    static <R> ContinuableFuture<R>
    asyncExecute(Callable<R> command, Executor executor)
     
    asyncExecute(List<? extends Throwables.Runnable<? extends Exception>> commands)
     
    asyncExecute(List<? extends Throwables.Runnable<? extends Exception>> commands, Executor executor)
     
    asynRun(Collection<? extends Throwables.Runnable<? extends Exception>> commands)
    Executes the specified commands/tasks asynchronous and immediately returns an iterator for iterating the result lazily.
    asynRun(Collection<? extends Throwables.Runnable<? extends Exception>> commands, Executor executor)
    Executes the specified commands/tasks asynchronous and immediately returns an iterator for iterating the result lazily.
    static double
    average(byte... a)
    Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
    static double
    average(byte[] a, int fromIndex, int toIndex)
    Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
    static double
    average(char... a)
    Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
    static double
    average(char[] a, int fromIndex, int toIndex)
    Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
    static double
    average(double... a)
    Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
    static double
    average(double[] a, int fromIndex, int toIndex)
    Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
    static double
    average(float... a)
    Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
    static double
    average(float[] a, int fromIndex, int toIndex)
    Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
    static double
    average(int... a)
    Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
    static double
    average(int[] a, int fromIndex, int toIndex)
    Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
    static double
    average(long... a)
    Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
    static double
    average(long[] a, int fromIndex, int toIndex)
    Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
    static double
    average(short... a)
    Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
    static double
    average(short[] a, int fromIndex, int toIndex)
    Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
    static BigDecimal
    Calculates the average of an Array/Collection.
    static <T> BigDecimal
    averageBigDecimal(Iterable<? extends T> c, Function<? super T,BigDecimal> func)
    Calculates the average of an Array/Collection.
    static BigDecimal
    Calculates the average of an Array/Collection.
    static <T> BigDecimal
    averageBigInteger(Iterable<? extends T> c, Function<? super T,BigInteger> func)
    Calculates the average of an Array/Collection.
    static <T extends Number>
    double
    averageDouble(Iterable<? extends T> c)
    Calculates the average of an Array/Collection.
    static <T> double
    averageDouble(Iterable<? extends T> c, ToDoubleFunction<? super T> func)
    Calculates the average of an Array/Collection.
    static <T extends Number>
    double
    averageDouble(Collection<? extends T> c, int fromIndex, int toIndex)
    Calculates the average of an Array/Collection within the specified range.
    static <T> double
    averageDouble(Collection<? extends T> c, int fromIndex, int toIndex, ToDoubleFunction<? super T> func)
    Calculates the average of an Array/Collection within the specified range.
    static <T extends Number>
    double
    Calculates the average of an Array/Collection.
    static <T extends Number>
    double
    averageDouble(T[] a, int fromIndex, int toIndex)
    Calculates the average of an Array/Collection within the specified range.
    static <T> double
    averageDouble(T[] a, int fromIndex, int toIndex, ToDoubleFunction<? super T> func)
    Calculates the average of an Array/Collection within the specified range.
    static <T> double
    averageDouble(T[] a, ToDoubleFunction<? super T> func)
    Calculates the average of an Array/Collection.
    static <T extends Number>
    double
    averageInt(Iterable<? extends T> c)
    Calculates the average of an Array/Collection.
    static <T> double
    averageInt(Iterable<? extends T> c, ToIntFunction<? super T> func)
    Calculates the average of an Array/Collection.
    static <T extends Number>
    double
    averageInt(Collection<? extends T> c, int fromIndex, int toIndex)
    Calculates the average of an Array/Collection within the specified range.
    static <T> double
    averageInt(Collection<? extends T> c, int fromIndex, int toIndex, ToIntFunction<? super T> func)
    Calculates the average of an Array/Collection within the specified range.
    static <T extends Number>
    double
    averageInt(T[] a)
    Calculates the average of an Array/Collection.
    static <T extends Number>
    double
    averageInt(T[] a, int fromIndex, int toIndex)
    Calculates the average of an Array/Collection within the specified range.
    static <T> double
    averageInt(T[] a, int fromIndex, int toIndex, ToIntFunction<? super T> func)
    Calculates the average of an Array/Collection within the specified range.
    static <T> double
    averageInt(T[] a, ToIntFunction<? super T> func)
    Calculates the average of an Array/Collection.
    static <T extends Number>
    double
    averageLong(Iterable<? extends T> c)
    Calculates the average of an Array/Collection.
    static <T> double
    averageLong(Iterable<? extends T> c, ToLongFunction<? super T> func)
    Calculates the average of an Array/Collection.
    static <T extends Number>
    double
    averageLong(Collection<? extends T> c, int fromIndex, int toIndex)
    Calculates the average of an Array/Collection within the specified range.
    static <T> double
    averageLong(Collection<? extends T> c, int fromIndex, int toIndex, ToLongFunction<? super T> func)
    Calculates the average of an Array/Collection within the specified range.
    static <T extends Number>
    double
    averageLong(T[] a)
    Calculates the average of an Array/Collection.
    static <T extends Number>
    double
    averageLong(T[] a, int fromIndex, int toIndex)
    Calculates the average of an Array/Collection within the specified range.
    static <T> double
    averageLong(T[] a, int fromIndex, int toIndex, ToLongFunction<? super T> func)
    Calculates the average of an Array/Collection within the specified range.
    static <T> double
    averageLong(T[] a, ToLongFunction<? super T> func)
    Calculates the average of an Array/Collection.
    static int
    binarySearch(byte[] a, byte valueToFind)
    static int
    binarySearch(byte[] a, int fromIndex, int toIndex, byte valueToFind)
    static int
    binarySearch(char[] a, char valueToFind)
    static int
    binarySearch(char[] a, int fromIndex, int toIndex, char valueToFind)
    static int
    binarySearch(double[] a, double valueToFind)
    static int
    binarySearch(double[] a, int fromIndex, int toIndex, double valueToFind)
    static int
    binarySearch(float[] a, float valueToFind)
    static int
    binarySearch(float[] a, int fromIndex, int toIndex, float valueToFind)
    static int
    binarySearch(int[] a, int valueToFind)
    static int
    binarySearch(int[] a, int fromIndex, int toIndex, int valueToFind)
    static int
    binarySearch(long[] a, int fromIndex, int toIndex, long valueToFind)
    static int
    binarySearch(long[] a, long valueToFind)
    static int
    binarySearch(short[] a, int fromIndex, int toIndex, short valueToFind)
    static int
    binarySearch(short[] a, short valueToFind)
    static int
    binarySearch(Object[] a, int fromIndex, int toIndex, Object valueToFind)
    static int
    binarySearch(Object[] a, Object valueToFind)
    static <T extends Comparable<? super T>>
    int
    binarySearch(List<? extends T> list, int fromIndex, int toIndex, T valueToFind)
     
    static <T> int
    binarySearch(List<? extends T> list, int fromIndex, int toIndex, T valueToFind, Comparator<? super T> cmp)
     
    static <T extends Comparable<? super T>>
    int
    binarySearch(List<? extends T> list, T valueToFind)
    static <T> int
    binarySearch(List<? extends T> list, T valueToFind, Comparator<? super T> cmp)
     
    static <T> int
    binarySearch(T[] a, int fromIndex, int toIndex, T valueToFind, Comparator<? super T> cmp)
    static <T> int
    binarySearch(T[] a, T valueToFind, Comparator<? super T> cmp)
    static <T, R, E extends Exception>
    List<R>
    callByBatch(Iterable<? extends T> iter, int batchSize, Throwables.Function<? super List<T>,R,E> batchAction)
    Executes a given function on batches of elements from the provided iterable.
    static <T, R, E extends Exception, E2 extends Exception>
    List<R>
    callByBatch(Iterable<? extends T> iter, int batchSize, Throwables.IntObjConsumer<? super T,E> elementConsumer, Throwables.Callable<? extends R,E2> batchAction)
    Executes a given consumer on each element from the provided iterable in batches, then executes a batch action after each batch.
    static <T, R, E extends Exception>
    List<R>
    callByBatch(Iterator<? extends T> iter, int batchSize, Throwables.Function<? super List<T>,R,E> batchAction)
    Executes a given function on batches of elements from the provided iterator.
    static <T, R, E extends Exception, E2 extends Exception>
    List<R>
    callByBatch(Iterator<? extends T> iter, int batchSize, Throwables.IntObjConsumer<? super T,E> elementConsumer, Throwables.Callable<? extends R,E2> batchAction)
    Executes a given consumer on each element from the provided iterator in batches, then executes a batch action after each batch.
    static <T, R, E extends Exception>
    List<R>
    callByBatch(T[] a, int batchSize, Throwables.Function<? super List<T>,R,E> batchAction)
    Executes a given function on batches of elements from the provided array.
    static <T, R, E extends Exception, E2 extends Exception>
    List<R>
    callByBatch(T[] a, int batchSize, Throwables.IntObjConsumer<? super T,E> elementConsumer, Throwables.Callable<? extends R,E2> batchAction)
    Executes a given consumer on batches of elements from the provided array, then executes a batch action after each batch.
    static <R> List<R>
    callInParallel(Collection<? extends Callable<? extends R>> commands)
    Executes and complete the input commands in parallel.
    static <R> List<R>
    callInParallel(Collection<? extends Callable<? extends R>> commands, Executor executor)
    Executes and complete the input commands in parallel.
    static <R, R2> Tuple.Tuple2<R,R2>
    callInParallel(Callable<R> command, Callable<R2> command2)
    Executes and complete the input commands in parallel.
    static <R, R2, R3>
    Tuple.Tuple3<R,R2,R3>
    callInParallel(Callable<R> command, Callable<R2> command2, Callable<R3> command3)
    Executes and complete the input commands in parallel.
    static <R, R2, R3, R4>
    Tuple.Tuple4<R,R2,R3,R4>
    callInParallel(Callable<R> command, Callable<R2> command2, Callable<R3> command3, Callable<R4> command4)
    Executes and complete the input commands in parallel.
    static <R, R2, R3, R4, R5>
    Tuple.Tuple5<R,R2,R3,R4,R5>
    callInParallel(Callable<R> command, Callable<R2> command2, Callable<R3> command3, Callable<R4> command4, Callable<R5> command5)
    Executes and complete the input commands in parallel.
    static <T> T
    callUninterruptibly(long timeoutInMillis, Throwables.LongFunction<? extends T,InterruptedException> cmd)
    Note: Copied from Google Guava under Apache License v2.0

    If a thread is interrupted during such a call, the call continues to block until the result is available or the timeout elapses, and only then re-interrupts the thread.
    static <T> T
    Note: Copied from Google Guava under Apache License v2.0

    If a thread is interrupted during such a call, the call continues to block until the result is available or the timeout elapses, and only then re-interrupts the thread.
    static <T> T
    Note: Copied from Google Guava under Apache License v2.0

    If a thread is interrupted during such a call, the call continues to block until the result is available or the timeout elapses, and only then re-interrupts the thread.
    static <T> u.Nullable<T>
    castIfAssignable(Object val, com.landawn.abacus.type.Type<? extends T> targetType)
    Casts the given object to the specified target type if possible using the provided Type instance.
    static <T> u.Nullable<T>
    castIfAssignable(Object val, Class<? extends T> targetType)
    Casts the given object to the specified target type if possible.
    static <T extends CharSequence>
    T
    checkArgNotBlank(T arg, String msg)
    Checks if a CharSequence is NOT null, empty ("") or whitespace only.
    static boolean[]
    checkArgNotEmpty(boolean[] arg, String argNameOrErrorMsg)
    Checks if the specified arg is null or empty, and throws IllegalArgumentException if it is.
    static byte[]
    checkArgNotEmpty(byte[] arg, String argNameOrErrorMsg)
    Checks if the specified arg is null or empty, and throws IllegalArgumentException if it is.
    static char[]
    checkArgNotEmpty(char[] arg, String argNameOrErrorMsg)
    Checks if the specified arg is null or empty, and throws IllegalArgumentException if it is.
    static double[]
    checkArgNotEmpty(double[] arg, String argNameOrErrorMsg)
    Checks if the specified arg is null or empty, and throws IllegalArgumentException if it is.
    static float[]
    checkArgNotEmpty(float[] arg, String argNameOrErrorMsg)
    Checks if the specified arg is null or empty, and throws IllegalArgumentException if it is.
    static int[]
    checkArgNotEmpty(int[] arg, String argNameOrErrorMsg)
    Checks if the specified arg is null or empty, and throws IllegalArgumentException if it is.
    static long[]
    checkArgNotEmpty(long[] arg, String argNameOrErrorMsg)
    Checks if the specified arg is null or empty, and throws IllegalArgumentException if it is.
    static short[]
    checkArgNotEmpty(short[] arg, String argNameOrErrorMsg)
    Checks if the specified arg is null or empty, and throws IllegalArgumentException if it is.
    static <T> Multiset<T>
    checkArgNotEmpty(Multiset<T> arg, String argNameOrErrorMsg)
    Checks if the specified arg is null or empty, and throws IllegalArgumentException if it is.
    static <T> T[]
    checkArgNotEmpty(T[] arg, String argNameOrErrorMsg)
    Checks if the specified arg is null or empty, and throws IllegalArgumentException if it is.
    static <T extends CharSequence>
    T
    checkArgNotEmpty(T arg, String argNameOrErrorMsg)
    Checks if the specified arg is null or empty, and throws IllegalArgumentException if it is.
    static byte
    checkArgNotNegative(byte arg, String argNameOrErrorMsg)
    Checks if the specified arg is not negative, and throws IllegalArgumentException if it is.
    static double
    checkArgNotNegative(double arg, String argNameOrErrorMsg)
    Checks if the specified arg is not negative, and throws IllegalArgumentException if it is.
    static float
    checkArgNotNegative(float arg, String argNameOrErrorMsg)
    Checks if the specified arg is not negative, and throws IllegalArgumentException if it is.
    static int
    checkArgNotNegative(int arg, String argNameOrErrorMsg)
    Checks if the specified arg is not negative, and throws IllegalArgumentException if it is.
    static long
    checkArgNotNegative(long arg, String argNameOrErrorMsg)
    Checks if the specified arg is not negative, and throws IllegalArgumentException if it is.
    static short
    checkArgNotNegative(short arg, String argNameOrErrorMsg)
    Checks if the specified arg is not negative, and throws IllegalArgumentException if it is.
    static <T> T
    Check arg not null.
    static <T> T
    checkArgNotNull(T obj, String errorMessage)
    Check arg not null.
    static byte
    checkArgPositive(byte arg, String argNameOrErrorMsg)
    Checks if the specified arg is positive, and throws IllegalArgumentException if it is not.
    static double
    checkArgPositive(double arg, String argNameOrErrorMsg)
    Checks if the specified arg is positive, and throws IllegalArgumentException if it is not.
    static float
    checkArgPositive(float arg, String argNameOrErrorMsg)
    Checks if the specified arg is positive, and throws IllegalArgumentException if it is not.
    static int
    checkArgPositive(int arg, String argNameOrErrorMsg)
    Checks if the specified arg is positive, and throws IllegalArgumentException if it is not.
    static long
    checkArgPositive(long arg, String argNameOrErrorMsg)
    Checks if the specified arg is positive, and throws IllegalArgumentException if it is not.
    static short
    checkArgPositive(short arg, String argNameOrErrorMsg)
    Checks if the specified arg is positive, and throws IllegalArgumentException if it is not.
    static void
    checkArgument(boolean expression)
    Ensures the truth of an expression involving one or more parameters to the calling method.
    static void
    checkArgument(boolean expression, String errorMessage)
    Ensures the truth of an expression involving one or more parameters to the calling method.
    static void
    checkArgument(boolean b, String errorMessageTemplate, boolean p)
    Ensures the truth of an expression involving one or more parameters to the calling method.
    static void
    checkArgument(boolean b, String errorMessageTemplate, boolean p1, boolean p2)
    Ensures the truth of an expression involving one or more parameters to the calling method.
    static void
    checkArgument(boolean b, String errorMessageTemplate, boolean p1, boolean p2, boolean p3)
    Ensures the truth of an expression involving one or more parameters to the calling method.
    static void
    checkArgument(boolean b, String errorMessageTemplate, byte p)
    Ensures the truth of an expression involving one or more parameters to the calling method.
    static void
    checkArgument(boolean b, String errorMessageTemplate, char p)
    Ensures the truth of an expression involving one or more parameters to the calling method.
    static void
    checkArgument(boolean b, String errorMessageTemplate, double p)
    Ensures the truth of an expression involving one or more parameters to the calling method.
    static void
    checkArgument(boolean b, String errorMessageTemplate, double p1, double p2)
    Ensures the truth of an expression involving one or more parameters to the calling method.
    static void
    checkArgument(boolean b, String errorMessageTemplate, double p1, double p2, double p3)
    Ensures the truth of an expression involving one or more parameters to the calling method.
    static void
    checkArgument(boolean b, String errorMessageTemplate, float p)
    Ensures the truth of an expression involving one or more parameters to the calling method.
    static void
    checkArgument(boolean b, String errorMessageTemplate, float p1, float p2)
    Ensures the truth of an expression involving one or more parameters to the calling method.
    static void
    checkArgument(boolean b, String errorMessageTemplate, float p1, float p2, float p3)
    Ensures the truth of an expression involving one or more parameters to the calling method.
    static void
    checkArgument(boolean b, String errorMessageTemplate, int p)
    Ensures the truth of an expression involving one or more parameters to the calling method.
    static void
    checkArgument(boolean b, String errorMessageTemplate, int p1, int p2)
    Ensures the truth of an expression involving one or more parameters to the calling method.
    static void
    checkArgument(boolean b, String errorMessageTemplate, int p1, int p2, int p3)
    Ensures the truth of an expression involving one or more parameters to the calling method.
    static void
    checkArgument(boolean b, String errorMessageTemplate, long p)
    Ensures the truth of an expression involving one or more parameters to the calling method.
    static void
    checkArgument(boolean b, String errorMessageTemplate, long p1, long p2)
    Ensures the truth of an expression involving one or more parameters to the calling method.
    static void
    checkArgument(boolean b, String errorMessageTemplate, long p1, long p2, long p3)
    Ensures the truth of an expression involving one or more parameters to the calling method.
    static void
    checkArgument(boolean b, String errorMessageTemplate, short p)
    Ensures the truth of an expression involving one or more parameters to the calling method.
    static void
    checkArgument(boolean b, String errorMessageTemplate, Object p)
    Ensures the truth of an expression involving one or more parameters to the calling method.
    static void
    checkArgument(boolean b, String errorMessageTemplate, Object p1, Object p2)
    Ensures the truth of an expression involving one or more parameters to the calling method.
    static void
    checkArgument(boolean b, String errorMessageTemplate, Object p1, Object p2, Object p3)
    Ensures the truth of an expression involving one or more parameters to the calling method.
    static void
    checkArgument(boolean b, Supplier<String> errorMessageSupplier)
     
    static void
    Check if the specified Array contains any null element.
    static void
    checkElementNotNull(Object[] a, String argNameOrErrorMsg)
    Check if the specified Array contains any null element.
    static void
    Check if the specified Collection contains any null element.
    static void
    checkElementNotNull(Collection<?> c, String argNameOrErrorMsg)
    Check if the specified Collection contains any null element.
    static void
    checkFromIndexSize(int fromIndex, int size, int length)
    Check from index size.
    static void
    checkFromToIndex(int fromIndex, int toIndex, int length)
    Check from to index.
    static void
    checkIndex(int index, int length)
     
    static void
    Check if the specified Map contains any null key.
    static void
    checkKeyNotNull(Map<?,?> m, String argNameOrErrorMsg)
    Check if the specified Map contains any null key.
    static void
    checkState(boolean expression)
    Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.
    static void
    checkState(boolean expression, String errorMessage)
    Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.
    static void
    checkState(boolean b, String errorMessageTemplate, double p)
    Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.
    static void
    checkState(boolean b, String errorMessageTemplate, double p1, double p2)
    Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.
    static void
    checkState(boolean b, String errorMessageTemplate, double p1, double p2, double p3)
    Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.
    static void
    checkState(boolean b, String errorMessageTemplate, float p)
    Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.
    static void
    checkState(boolean b, String errorMessageTemplate, float p1, float p2)
    Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.
    static void
    checkState(boolean b, String errorMessageTemplate, float p1, float p2, float p3)
    Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.
    static void
    checkState(boolean b, String errorMessageTemplate, int p)
    Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.
    static void
    checkState(boolean b, String errorMessageTemplate, int p1, int p2)
    Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.
    static void
    checkState(boolean b, String errorMessageTemplate, int p1, int p2, int p3)
    Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.
    static void
    checkState(boolean b, String errorMessageTemplate, long p)
    Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.
    static void
    checkState(boolean b, String errorMessageTemplate, long p1, long p2)
    Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.
    static void
    checkState(boolean b, String errorMessageTemplate, long p1, long p2, long p3)
    Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.
    static void
    checkState(boolean b, String errorMessageTemplate, Object p)
    Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.
    static void
    checkState(boolean b, String errorMessageTemplate, Object p1, Object p2)
    Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.
    static void
    checkState(boolean b, String errorMessageTemplate, Object p1, Object p2, Object p3)
    Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.
    static void
    checkState(boolean b, Supplier<String> errorMessageSupplier)
     
    static void
    Check if the specified Map contains any null value.
    static void
    checkValueNotNull(Map<?,?> m, String argNameOrErrorMsg)
    Check if the specified Map contains any null value.
    static boolean[]
    clone(boolean[] original)
    Clone the original array.
    static boolean[][]
    clone(boolean[][] original)
    Clone the original array and its sub arrays.
    static boolean[][][]
    clone(boolean[][][] original)
    Clone the original array and its sub arrays.
    static byte[]
    clone(byte[] original)
    Clone the original array.
    static byte[][]
    clone(byte[][] original)
    Clone the original array and its sub arrays.
    static byte[][][]
    clone(byte[][][] original)
    Clone the original array and its sub arrays.
    static char[]
    clone(char[] original)
    Clone the original array.
    static char[][]
    clone(char[][] original)
    Clone the original array and its sub arrays.
    static char[][][]
    clone(char[][][] original)
    Clone the original array and its sub arrays.
    static double[]
    clone(double[] original)
    Clone the original array.
    static double[][]
    clone(double[][] original)
    Clone the original array and its sub arrays.
    static double[][][]
    clone(double[][][] original)
    Clone the original array and its sub arrays.
    static float[]
    clone(float[] original)
    Clone the original array.
    static float[][]
    clone(float[][] original)
    Clone the original array and its sub arrays.
    static float[][][]
    clone(float[][][] original)
    Clone the original array and its sub arrays.
    static int[]
    clone(int[] original)
    Clone the original array.
    static int[][]
    clone(int[][] original)
    Clone the original array and its sub arrays.
    static int[][][]
    clone(int[][][] original)
    Clone the original array and its sub arrays.
    static long[]
    clone(long[] original)
    Clone the original array.
    static long[][]
    clone(long[][] original)
    Clone the original array and its sub arrays.
    static long[][][]
    clone(long[][][] original)
    Clone the original array and its sub arrays.
    static short[]
    clone(short[] original)
    Clone the original array.
    static short[][]
    clone(short[][] original)
    Clone the original array and its sub arrays.
    static short[][][]
    clone(short[][][] original)
    Clone the original array and its sub arrays.
    static <T> T
    clone(Object obj, Class<? extends T> targetType)
    Deeply copy by: obj -> serialize -> kryo/Json -> deserialize -> new object.
    static <T> T
    clone(T obj)
    Clones the given object.
    static <T> T[]
    clone(T[] original)
    Clone the original array.
    static <T> T[][]
    clone(T[][] original)
    Clone the original array and its sub arrays.
    static <T> T[][][]
    clone(T[][][] original)
    Clone the original array and its sub arrays.
    static <T> Set<T>
    commonSet(Collection<? extends Collection<? extends T>> c)
    Returns a Set containing the common elements of the given collections.
    static <T> Set<T>
    commonSet(Collection<? extends T> a, Collection<?> b)
    Returns a Set containing the common elements of two given collections.
    static int
    compare(boolean[] a, boolean[] b)
    Compares two arrays lexicographically.
    static int
    compare(boolean[] a, int fromIndexA, boolean[] b, int fromIndexB, int len)
    Compares two arrays lexicographically over the specified range.
    static int
    compare(boolean a, boolean b)
     
    static int
    compare(byte[] a, byte[] b)
    Compares two arrays lexicographically.
    static int
    compare(byte[] a, int fromIndexA, byte[] b, int fromIndexB, int len)
    Compares two arrays lexicographically over the specified range.
    static int
    compare(byte a, byte b)
     
    static int
    compare(char[] a, char[] b)
    Compares two arrays lexicographically.
    static int
    compare(char[] a, int fromIndexA, char[] b, int fromIndexB, int len)
    Compares two arrays lexicographically over the specified range.
    static int
    compare(double[] a, double[] b)
    Compares two arrays lexicographically.
    static int
    compare(double[] a, int fromIndexA, double[] b, int fromIndexB, int len)
    Compares two arrays lexicographically over the specified range.
    static int
    compare(double a, double b)
     
    static int
    compare(float[] a, float[] b)
    Compares two arrays lexicographically.
    static int
    compare(float[] a, int fromIndexA, float[] b, int fromIndexB, int len)
    Compares two arrays lexicographically over the specified range.
    static int
    compare(float a, float b)
     
    static int
    compare(int[] a, int[] b)
    Compares two arrays lexicographically.
    static int
    compare(int[] a, int fromIndexA, int[] b, int fromIndexB, int len)
    Compares two arrays lexicographically over the specified range.
    static int
    compare(int a, int b)
     
    static int
    compare(long[] a, int fromIndexA, long[] b, int fromIndexB, int len)
    Compares two arrays lexicographically over the specified range.
    static int
    compare(long[] a, long[] b)
    Compares two arrays lexicographically.
    static int
    compare(long a, long b)
     
    static int
    compare(short[] a, int fromIndexA, short[] b, int fromIndexB, int len)
    Compares two arrays lexicographically over the specified range.
    static int
    compare(short[] a, short[] b)
    Compares two arrays lexicographically.
    static int
    compare(short a, short b)
     
    static <T extends Comparable<? super T>>
    int
    compare(Iterable<T> a, Iterable<T> b)
    Compares two iterables lexicographically.
    static <T> int
    compare(Iterable<T> a, Iterable<T> b, Comparator<? super T> cmp)
    Compares two iterables using the specified comparator.
    static <T> int
    compare(Collection<T> a, int fromIndexA, Collection<T> b, int fromIndexB, int len)
    Compares two collections lexicographically over the specified range.
    static <T> int
    compare(Collection<T> a, int fromIndexA, Collection<T> b, int fromIndexB, int len, Comparator<? super T> cmp)
    Compares two collections lexicographically over the specified range using the specified comparator.
    static <T extends Comparable<? super T>>
    int
    compare(Iterator<T> a, Iterator<T> b)
    Compares two iterators lexicographically.
    static <T> int
    compare(Iterator<T> a, Iterator<T> b, Comparator<? super T> cmp)
    Compares two iterators using the specified comparator.
    static <T extends Comparable<? super T>>
    int
    compare(T[] a, int fromIndexA, T[] b, int fromIndexB, int len)
    Compares two arrays lexicographically over the specified range.
    static <T> int
    compare(T[] a, int fromIndexA, T[] b, int fromIndexB, int len, Comparator<? super T> cmp)
    Compares two arrays lexicographically over the specified range using the specified comparator.
    static <T extends Comparable<? super T>>
    int
    compare(T[] a, T[] b)
    Compares two arrays lexicographically.
    static <T> int
    compare(T[] a, T[] b, Comparator<? super T> cmp)
    Compares two arrays using the specified comparator.
    static <T1 extends Comparable<T1>, T2 extends Comparable<T2>>
    int
    compare(T1 a1, T1 b1, T2 a2, T2 b2)
    Continue to compare the pairs of values (a1, b1), (a2, b2) until they're not equal.
    static <T1 extends Comparable<T1>, T2 extends Comparable<T2>, T3 extends Comparable<T3>>
    int
    compare(T1 a1, T1 b1, T2 a2, T2 b2, T3 a3, T3 b3)
    Continue to compare the pairs of values (a1, b1), (a2, b2), (a3, b3) until they're not equal.
    static <T1 extends Comparable<T1>, T2 extends Comparable<T2>, T3 extends Comparable<T3>, T4 extends Comparable<T4>>
    int
    compare(T1 a1, T1 b1, T2 a2, T2 b2, T3 a3, T3 b3, T4 a4, T4 b4)
    Deprecated.
    please use Builder.ComparisonBuilder
    static <T1 extends Comparable<T1>, T2 extends Comparable<T2>, T3 extends Comparable<T3>, T4 extends Comparable<T4>, T5 extends Comparable<T5>>
    int
    compare(T1 a1, T1 b1, T2 a2, T2 b2, T3 a3, T3 b3, T4 a4, T4 b4, T5 a5, T5 b5)
    Deprecated.
    please use Builder.ComparisonBuilder
    static <T1 extends Comparable<T1>, T2 extends Comparable<T2>, T3 extends Comparable<T3>, T4 extends Comparable<T4>, T5 extends Comparable<T5>, T6 extends Comparable<T6>>
    int
    compare(T1 a1, T1 b1, T2 a2, T2 b2, T3 a3, T3 b3, T4 a4, T4 b4, T5 a5, T5 b5, T6 a6, T6 b6)
    Deprecated.
    please use Builder.ComparisonBuilder
    static <T1 extends Comparable<T1>, T2 extends Comparable<T2>, T3 extends Comparable<T3>, T4 extends Comparable<T4>, T5 extends Comparable<T5>, T6 extends Comparable<T6>, T7 extends Comparable<T7>>
    int
    compare(T1 a1, T1 b1, T2 a2, T2 b2, T3 a3, T3 b3, T4 a4, T4 b4, T5 a5, T5 b5, T6 a6, T6 b6, T7 a7, T7 b7)
    Deprecated.
    please use Builder.ComparisonBuilder
    static <T extends Comparable<? super T>>
    int
    compare(T a, T b)
     
    static <T> int
    compare(T a, T b, Comparator<? super T> cmp)
    Returns 0 if the arguments are identical and c.compare(a, b) otherwise.
    static int
    compareByProps(Object bean1, Object bean2, Collection<String> propNamesToCompare)
    Deprecated.
    call getPropValue by reflection apis during comparing or sorting may have huge impact to performance.
    static int
    Compares two arrays of strings lexicographically, ignoring case differences.
    static int
    Compares two strings lexicographically, ignoring case differences.
    static int
    compareUnsigned(byte[] a, byte[] b)
    Compares two arrays lexicographically, treating the values as unsigned.
    static int
    compareUnsigned(byte[] a, int fromIndexA, byte[] b, int fromIndexB, int len)
    Compares two subarrays lexicographically, treating the values as unsigned.
    static int
    compareUnsigned(byte a, byte b)
     
    static int
    compareUnsigned(int[] a, int[] b)
    Compares two arrays lexicographically, treating the values as unsigned.
    static int
    compareUnsigned(int[] a, int fromIndexA, int[] b, int fromIndexB, int len)
    Compares two subarrays lexicographically, treating the values as unsigned.
    static int
    compareUnsigned(int a, int b)
     
    static int
    compareUnsigned(long[] a, int fromIndexA, long[] b, int fromIndexB, int len)
    Compares two subarrays lexicographically, treating the values as unsigned.
    static int
    compareUnsigned(long[] a, long[] b)
    Compares two arrays lexicographically, treating the values as unsigned.
    static int
    compareUnsigned(long a, long b)
     
    static int
    compareUnsigned(short[] a, int fromIndexA, short[] b, int fromIndexB, int len)
    Compares two subarrays lexicographically, treating the values as unsigned.
    static int
    compareUnsigned(short[] a, short[] b)
    Compares two arrays lexicographically, treating the values as unsigned.
    static int
    compareUnsigned(short a, short b)
     
    static boolean[]
    concat(boolean[]... aa)
    Concatenates multiple boolean arrays into a new array.
    static boolean[]
    concat(boolean[] a, boolean[] b)
    Concatenates two boolean arrays into a new array.
    static byte[]
    concat(byte[]... aa)
    Concatenates multiple byte arrays into a new array.
    static byte[]
    concat(byte[] a, byte[] b)
    Concatenates two byte arrays into a new array.
    static char[]
    concat(char[]... aa)
    Concatenates multiple char arrays into a new array.
    static char[]
    concat(char[] a, char[] b)
    Concatenates two char arrays into a new array.
    static double[]
    concat(double[]... aa)
    Concatenates multiple double arrays into a new array.
    static double[]
    concat(double[] a, double[] b)
    Concatenates two double arrays into a new array.
    static float[]
    concat(float[]... aa)
    Concatenates multiple float arrays into a new array.
    static float[]
    concat(float[] a, float[] b)
    Concatenates two float arrays into a new array.
    static int[]
    concat(int[]... aa)
    Concatenates multiple int arrays into a new array.
    static int[]
    concat(int[] a, int[] b)
    Concatenates two int arrays into a new array.
    static long[]
    concat(long[]... aa)
    Concatenates multiple long arrays into a new array.
    static long[]
    concat(long[] a, long[] b)
    Concatenates two long arrays into a new array.
    static short[]
    concat(short[]... aa)
    Concatenates multiple short arrays into a new array.
    static short[]
    concat(short[] a, short[] b)
    Concatenates two short arrays into a new array.
    static <T> List<T>
    concat(Iterable<? extends T>... a)
    Concatenates multiple iterables into a new list.
    static <T> List<T>
    concat(Iterable<? extends T> a, Iterable<? extends T> b)
    Concatenates two iterables into a new list.
    static <T> List<T>
    concat(Collection<? extends Iterable<? extends T>> c)
    Concatenates multiple iterables into a new list.
    static <T, C extends Collection<T>>
    C
    concat(Collection<? extends Iterable<? extends T>> c, IntFunction<? extends C> supplier)
    Concatenates multiple iterables into a new collection.
    static <T> ObjIterator<T>
    concat(Iterator<? extends T>... a)
    Concatenates multiple iterators into a new ObjIterator.
    static <T> ObjIterator<T>
    concat(Iterator<? extends T> a, Iterator<? extends T> b)
    Concatenates two iterators into a new ObjIterator.
    static <T> T[]
    concat(T[]... aa)
    Concatenates multiple arrays into a new array.
    static <T> T[]
    concat(T[] a, T[] b)
    Concatenates two arrays into a new array.
    static boolean
    contains(boolean[] a, boolean valueToFind)
    Checks if the specified array contains the specified value.
    static boolean
    contains(byte[] a, byte valueToFind)
    Checks if the specified array contains the specified value.
    static boolean
    contains(char[] a, char valueToFind)
    Checks if the specified array contains the specified value.
    static boolean
    contains(double[] a, double valueToFind)
    Checks if the specified array contains the specified value.
    static boolean
    contains(float[] a, float valueToFind)
    Checks if the specified array contains the specified value.
    static boolean
    contains(int[] a, int valueToFind)
    Checks if the specified array contains the specified value.
    static boolean
    contains(long[] a, long valueToFind)
    Checks if the specified array contains the specified value.
    static boolean
    contains(short[] a, short valueToFind)
    Checks if the specified array contains the specified value.
    static boolean
    contains(Iterable<?> c, Object valueToFind)
    Checks if the specified Iterable contains the specified value.
    static boolean
    contains(Object[] a, Object valueToFind)
    Checks if the specified array contains the specified value.
    static boolean
    contains(Collection<?> c, Object valueToFind)
    Checks if the specified Collection contains the specified value.
    static boolean
    contains(Iterator<?> iter, Object valueToFind)
    Checks if the specified Iterator contains the specified value.
    static boolean
    containsAll(Iterable<?> c, Collection<?> valuesToFind)
    Checks if the specified Iterable contains all the elements in the specified valuesToFind Collection.
    static boolean
    containsAll(Collection<?> c, Object... valuesToFind)
    Checks if the specified Collection contains all the elements in the specified valuesToFind array.
    static boolean
    containsAll(Collection<?> c, Collection<?> valuesToFind)
    Checks if the specified Collection contains all the elements in the specified valuesToFind Collection.
    static boolean
    containsAll(Iterator<?> iter, Collection<?> valuesToFind)
    Checks if the specified Iterator contains all the elements in the specified valuesToFind Collection.
    static boolean
    containsAny(Iterable<?> c, Set<?> valuesToFind)
    Checks if the specified Iterable contains any elements from the specified valuesToFind Set.
    static boolean
    containsAny(Collection<?> c, Object... valuesToFind)
    Checks if the specified Collection contains any elements from the specified valuesToFind array.
    static boolean
    containsAny(Collection<?> c, Collection<?> valuesToFind)
    Checks if the specified Collection contains any elements from the specified valuesToFind Collection.
    static boolean
    containsAny(Iterator<?> iter, Set<?> valuesToFind)
    Checks if the specified Iterator contains any elements from the specified valuesToFind Set.
    static <T> T
    convert(Object srcObj, com.landawn.abacus.type.Type<? extends T> targetType)
    Converts the given source object to the specified target type using the provided Type instance.
    static <T> T
    convert(Object srcObj, Class<? extends T> targetType)
    Converts the given source object to the specified target type.
    static void
    copy(boolean[] src, int srcPos, boolean[] dest, int destPos, int length)
     
    static void
    copy(byte[] src, int srcPos, byte[] dest, int destPos, int length)
     
    static void
    copy(char[] src, int srcPos, char[] dest, int destPos, int length)
     
    static void
    copy(double[] src, int srcPos, double[] dest, int destPos, int length)
     
    static void
    copy(float[] src, int srcPos, float[] dest, int destPos, int length)
     
    static void
    copy(int[] src, int srcPos, int[] dest, int destPos, int length)
     
    static void
    copy(long[] src, int srcPos, long[] dest, int destPos, int length)
     
    static void
    copy(short[] src, int srcPos, short[] dest, int destPos, int length)
     
    static void
    copy(Object[] src, int srcPos, Object[] dest, int destPos, int length)
     
    static <T> T
    copy(Object sourceBean, boolean ignoreUnmatchedProperty, Set<String> ignoredPropNames, Class<? extends T> targetType)
    Returns a new instance of specified targetType with properties copied from the given source bean, except the properties specified in the ignoredPropNames set.
    static void
    copy(Object src, int srcPos, Object dest, int destPos, int length)
     
    static <T> T
    copy(Object sourceBean, Class<? extends T> targetType)
    Returns a new instance of specified targetType with properties copied from the given source bean.
    static <T> T
    copy(Object sourceBean, Collection<String> selectPropNames, Class<? extends T> targetType)
    Returns a new instance of specified targetType with properties copied from the given source bean with selected properties.
    static <T> T
    copy(Object sourceBean, Collection<String> selectPropNames, Function<String,String> propNameConverter, Class<? extends T> targetType)
    Returns a new instance of specified targetType with properties copied from the given source bean with selected properties.
    static <T> T
    copy(Object sourceBean, BiPredicate<? super String,?> propFilter, Class<? extends T> targetType)
    Returns a new instance of specified targetType with properties copied from the given source bean, filtered by the specified predicate.
    static <T> T
    copy(Object sourceBean, BiPredicate<? super String,?> propFilter, Function<String,String> propNameConverter, Class<? extends T> targetType)
    Returns a new instance of specified targetType with properties copied from the given source bean, filtered by the specified predicate.
    static <T> void
    copy(List<? extends T> src, int srcPos, List<? super T> dest, int destPos, int length)
    Copies a portion of one list into another.
    static <T> void
    copy(List<? extends T> src, List<? super T> dest)
    Copies all of the elements from one list into another.
    static <T> T
    copy(T sourceBean)
    Returns a copy of the given source bean.
    static <T> T
    copy(T sourceBean, Collection<String> selectPropNames)
    Returns a copy of the given source bean with selected properties.
    static <T> T
    copy(T sourceBean, BiPredicate<? super String,?> propFilter)
    Returns a copy of the given source bean with properties filtered by the specified predicate.
    static boolean[]
    copyOf(boolean[] original, int newLength)
     
    static byte[]
    copyOf(byte[] original, int newLength)
     
    static char[]
    copyOf(char[] original, int newLength)
     
    static double[]
    copyOf(double[] original, int newLength)
     
    static float[]
    copyOf(float[] original, int newLength)
     
    static int[]
    copyOf(int[] original, int newLength)
     
    static long[]
    copyOf(long[] original, int newLength)
     
    static short[]
    copyOf(short[] original, int newLength)
     
    static <T> T[]
    copyOf(T[] original, int newLength)
     
    static <T, U> T[]
    copyOf(U[] original, int newLength, Class<? extends T[]> newType)
     
    static boolean[]
    copyOfRange(boolean[] original, int fromIndex, int toIndex)
    Copy all the elements in original, through to-from.
    static boolean[]
    copyOfRange(boolean[] original, int fromIndex, int toIndex, int step)
    Copy all the elements in original, through to-from, by step.
    static byte[]
    copyOfRange(byte[] original, int fromIndex, int toIndex)
    Copy all the elements in original, through to-from.
    static byte[]
    copyOfRange(byte[] original, int fromIndex, int toIndex, int step)
    Copy all the elements in original, through to-from, by step.
    static char[]
    copyOfRange(char[] original, int fromIndex, int toIndex)
    Copy all the elements in original, through to-from.
    static char[]
    copyOfRange(char[] original, int fromIndex, int toIndex, int step)
    Copy all the elements in original, through to-from, by step.
    static double[]
    copyOfRange(double[] original, int fromIndex, int toIndex)
    Copy all the elements in original, through to-from.
    static double[]
    copyOfRange(double[] original, int fromIndex, int toIndex, int step)
    Copy all the elements in original, through to-from, by step.
    static float[]
    copyOfRange(float[] original, int fromIndex, int toIndex)
    Copy all the elements in original, through to-from.
    static float[]
    copyOfRange(float[] original, int fromIndex, int toIndex, int step)
    Copy all the elements in original, through to-from, by step.
    static int[]
    copyOfRange(int[] original, int fromIndex, int toIndex)
    Copy all the elements in original, through to-from.
    static int[]
    copyOfRange(int[] original, int fromIndex, int toIndex, int step)
    Copy all the elements in original, through to-from, by step.
    static long[]
    copyOfRange(long[] original, int fromIndex, int toIndex)
    Copy all the elements in original, through to-from.
    static long[]
    copyOfRange(long[] original, int fromIndex, int toIndex, int step)
    Copy all the elements in original, through to-from, by step.
    static short[]
    copyOfRange(short[] original, int fromIndex, int toIndex)
    Copy all the elements in original, through to-from.
    static short[]
    copyOfRange(short[] original, int fromIndex, int toIndex, int step)
    Copy all the elements in original, through to-from, by step.
    static String
    copyOfRange(String str, int fromIndex, int toIndex)
    Copy all the chars in original, through to-from.
    static String
    copyOfRange(String str, int fromIndex, int toIndex, int step)
    Copy all the chars in original, through to-from, by step.
    static <T> List<T>
    copyOfRange(List<T> c, int fromIndex, int toIndex)
    Copy all the elements in original, through to-from.
    static <T> List<T>
    copyOfRange(List<T> c, int fromIndex, int toIndex, int step)
    Copy all the elements in original, through to-from, by step.
    static <T> T[]
    copyOfRange(T[] original, int fromIndex, int toIndex)
    Copy all the elements in original, through to-from.
    static <T> T[]
    copyOfRange(T[] original, int fromIndex, int toIndex, int step)
    Copy all the elements in original, through to-from, by step.
    static <T> T[]
    copyOfRange(T[] original, int fromIndex, int toIndex, int step, Class<? extends T[]> newType)
    Copy all the elements in original, through to-from, by step.
    static <T, U> T[]
    copyOfRange(U[] original, int fromIndex, int toIndex, Class<? extends T[]> newType)
    static <T, E extends Exception>
    T[]
    copyThenApplyToEach(T[] a, Throwables.Function<? super T,? extends T,E> converter)
    Copies the specified array first, then applies the provided converter function to each element of the copy.
    static int
    count(boolean[] a, int fromIndex, int toIndex, BooleanPredicate filter)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static int
    count(boolean[] a, BooleanPredicate filter)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static int
    count(byte[] a, int fromIndex, int toIndex, BytePredicate filter)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static int
    count(byte[] a, BytePredicate filter)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static int
    count(char[] a, int fromIndex, int toIndex, CharPredicate filter)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static int
    count(char[] a, CharPredicate filter)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static int
    count(double[] a, int fromIndex, int toIndex, DoublePredicate filter)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static int
    count(double[] a, DoublePredicate filter)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static int
    count(float[] a, int fromIndex, int toIndex, FloatPredicate filter)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static int
    count(float[] a, FloatPredicate filter)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static int
    count(int[] a, int fromIndex, int toIndex, IntPredicate filter)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static int
    count(int[] a, IntPredicate filter)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static int
    count(long[] a, int fromIndex, int toIndex, LongPredicate filter)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static int
    count(long[] a, LongPredicate filter)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static int
    count(short[] a, int fromIndex, int toIndex, ShortPredicate filter)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static int
    count(short[] a, ShortPredicate filter)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static <T> int
    count(Iterable<? extends T> c, Predicate<? super T> filter)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static <T> int
    count(Collection<? extends T> c, int fromIndex, int toIndex, Predicate<? super T> filter)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static int
    count(Iterator<?> iter)
    Counts the number of elements in the given iterator.
    static <T> int
    count(Iterator<? extends T> iter, Predicate<? super T> filter)
    Counts the number of elements in the given iterator that match the provided predicate.
    static <T> int
    count(T[] a, int fromIndex, int toIndex, Predicate<? super T> filter)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static <T> int
    count(T[] a, Predicate<? super T> filter)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static <T, K> Map<K,Integer>
    countBy(Iterable<? extends T> c, Function<? super T,? extends K> keyExtractor)
     
    static <T, K, M extends Map<K, Integer>>
    M
    countBy(Iterable<? extends T> c, Function<? super T,? extends K> keyExtractor, Supplier<M> mapSupplier)
     
    static <T, K> Map<K,Integer>
    countBy(Iterator<? extends T> iter, Function<? super T,? extends K> keyExtractor)
     
    static <T, K, M extends Map<K, Integer>>
    M
    countBy(Iterator<? extends T> iter, Function<? super T,? extends K> keyExtractor, Supplier<M> mapSupplier)
     
    static boolean
    deepEquals(Object[] a, int fromIndexA, Object[] b, int fromIndexB, int len)
     
    static boolean
     
    static boolean
    compare a and b by Arrays.equals(Object[], Object[]) if both of them are array.
    static int
     
    static int
    Deep hash code.
    static int
    deepHashCode(Object[] a, int fromIndex, int toIndex)
    Deep hash code.
    static String
     
    static String
    Deep to string.
    static String
    deepToString(Object[] a, int fromIndex, int toIndex)
    Deep to string.
    static String
    deepToString(Object[] a, String defaultIfNull)
    Deep to string.
    static <T extends CharSequence>
    T
    defaultIfBlank(T str, Supplier<? extends T> getterForDefaultStr)
    Returns the default value provided by specified Supplier if the specified object is blank or itself if the specified object is not blank.
    static <T extends CharSequence>
    T
    defaultIfBlank(T str, T defaultStr)
    Returns the specified default value if the specified object is blank or itself if the specified object is not blank.
    static <T extends CharSequence>
    T
    defaultIfEmpty(T str, Supplier<? extends T> getterForDefaultStr)
    Returns the default value provided by specified Supplier if the specified object is empty or itself if the specified object is not empty.
    static <T extends CharSequence>
    T
    defaultIfEmpty(T str, T defaultStr)
    Returns the specified default value if the specified object is empty or itself if the specified object is not empty.
    static boolean
    Returns the default value of the given type if the specified object is null or itself if the specified object is not null.
    static boolean
    defaultIfNull(Boolean b, boolean defaultForNull)
    Returns the specified default value if the specified object is null or itself if the specified object is not null.
    static byte
    Returns the default value of the given type if the specified object is null or itself if the specified object is not null.
    static byte
    defaultIfNull(Byte b, byte defaultForNull)
    Returns the specified default value if the specified object is null or itself if the specified object is not null.
    static char
    Returns the default value of the given type if the specified object is null or itself if the specified object is not null.
    static char
    defaultIfNull(Character c, char defaultForNull)
    Returns the specified default value if the specified object is null or itself if the specified object is not null.
    static double
    Returns the default value of the given type if the specified object is null or itself if the specified object is not null.
    static double
    defaultIfNull(Double b, double defaultForNull)
    Returns the specified default value if the specified object is null or itself if the specified object is not null.
    static float
    Returns the default value of the given type if the specified object is null or itself if the specified object is not null.
    static float
    defaultIfNull(Float b, float defaultForNull)
    Returns the specified default value if the specified object is null or itself if the specified object is not null.
    static int
    Returns the default value of the given type if the specified object is null or itself if the specified object is not null.
    static int
    defaultIfNull(Integer b, int defaultForNull)
    Returns the specified default value if the specified object is null or itself if the specified object is not null.
    static long
    Returns the default value of the given type if the specified object is null or itself if the specified object is not null.
    static long
    defaultIfNull(Long b, long defaultForNull)
    Returns the specified default value if the specified object is null or itself if the specified object is not null.
    static short
    Returns the default value of the given type if the specified object is null or itself if the specified object is not null.
    static short
    defaultIfNull(Short b, short defaultForNull)
    Returns the specified default value if the specified object is null or itself if the specified object is not null.
    static <T> T
    defaultIfNull(T obj, Supplier<? extends T> supplierForDefault)
    Returns the default value provided by specified Supplier if the specified object is null or itself if the specified object is not null.
    static <T> T
    defaultIfNull(T obj, T defaultForNull)
    Returns the specified default value if the specified object is null or itself if the specified object is not null.
    static <T> T
    Returns the default value of the given class type.
    static boolean[]
    deleteAllByIndices(boolean[] a, int... indices)
    Returns a new array with elements copied from the specified array except the element at the specified positions.
    static byte[]
    deleteAllByIndices(byte[] a, int... indices)
    Returns a new array with elements copied from the specified array except the element at the specified positions.
    static char[]
    deleteAllByIndices(char[] a, int... indices)
    Returns a new array with elements copied from the specified array except the element at the specified positions.
    static double[]
    deleteAllByIndices(double[] a, int... indices)
    Returns a new array with elements copied from the specified array except the element at the specified positions.
    static float[]
    deleteAllByIndices(float[] a, int... indices)
    Returns a new array with elements copied from the specified array except the element at the specified positions.
    static int[]
    deleteAllByIndices(int[] a, int... indices)
    Returns a new array with elements copied from the specified array except the element at the specified positions.
    static long[]
    deleteAllByIndices(long[] a, int... indices)
    Returns a new array with elements copied from the specified array except the element at the specified positions.
    static short[]
    deleteAllByIndices(short[] a, int... indices)
    Returns a new array with elements copied from the specified array except the element at the specified positions.
    static String[]
    deleteAllByIndices(String[] a, int... indices)
    Returns a new array with elements copied from the specified array except the element at the specified positions.
    static boolean
    deleteAllByIndices(List<?> list, int... indices)
    Removes the elements at the specified positions from the specified List.
    static <T> T[]
    deleteAllByIndices(T[] a, int... indices)
    Returns a new array with elements copied from the specified array except the element at the specified positions.
    static boolean[]
    deleteByIndex(boolean[] a, int index)
    Returns a new array with elements copied from the specified array except the element at the specified position.
    static byte[]
    deleteByIndex(byte[] a, int index)
    Returns a new array with elements copied from the specified array except the element at the specified position.
    static char[]
    deleteByIndex(char[] a, int index)
    Returns a new array with elements copied from the specified array except the element at the specified position.
    static double[]
    deleteByIndex(double[] a, int index)
    Returns a new array with elements copied from the specified array except the element at the specified position.
    static float[]
    deleteByIndex(float[] a, int index)
    Returns a new array with elements copied from the specified array except the element at the specified position.
    static int[]
    deleteByIndex(int[] a, int index)
    Returns a new array with elements copied from the specified array except the element at the specified position.
    static long[]
    deleteByIndex(long[] a, int index)
    Returns a new array with elements copied from the specified array except the element at the specified position.
    static short[]
    deleteByIndex(short[] a, int index)
    Returns a new array with elements copied from the specified array except the element at the specified position.
    static <T> T[]
    deleteByIndex(T[] a, int index)
    Returns a new array with elements copied from the specified array except the element at the specified position.
    static boolean[]
    deleteRange(boolean[] a, int fromIndex, int toIndex)
    Returns a new array with the specified range of elements removed
    The original array remains unchanged.
    static byte[]
    deleteRange(byte[] a, int fromIndex, int toIndex)
    Returns a new array with the specified range of elements removed
    The original array remains unchanged.
    static char[]
    deleteRange(char[] a, int fromIndex, int toIndex)
    Returns a new array with the specified range of elements removed
    The original array remains unchanged.
    static double[]
    deleteRange(double[] a, int fromIndex, int toIndex)
    Returns a new array with the specified range of elements removed
    The original array remains unchanged.
    static float[]
    deleteRange(float[] a, int fromIndex, int toIndex)
    Returns a new array with the specified range of elements removed
    The original array remains unchanged.
    static int[]
    deleteRange(int[] a, int fromIndex, int toIndex)
    Returns a new array with the specified range of elements removed
    The original array remains unchanged.
    static long[]
    deleteRange(long[] a, int fromIndex, int toIndex)
    Returns a new array with the specified range of elements removed
    The original array remains unchanged.
    static short[]
    deleteRange(short[] a, int fromIndex, int toIndex)
    Returns a new array with the specified range of elements removed
    The original array remains unchanged.
    static String[]
    deleteRange(String[] a, int fromIndex, int toIndex)
    Returns a new array with the specified range of elements removed
    The original array remains unchanged.
    static String
    deleteRange(String str, int fromIndex, int toIndex)
    Returns a new String with the specified range of chars removed
    The original String remains unchanged.
    static <T> boolean
    deleteRange(List<T> c, int fromIndex, int toIndex)
    Deletes a range of elements from the given list.
    static <T> T[]
    deleteRange(T[] a, int fromIndex, int toIndex)
    Returns a new array with the specified range of elements removed
    The original array remains unchanged.
    static boolean[]
    difference(boolean[] a, boolean[] b)
    Returns all the elements in the specified Array/Collection a but not in b.
    static byte[]
    difference(byte[] a, byte[] b)
    Returns all the elements in the specified Array/Collection a but not in b.
    static char[]
    difference(char[] a, char[] b)
    Returns all the elements in the specified Array/Collection a but not in b.
    static double[]
    difference(double[] a, double[] b)
    Returns all the elements in the specified Array/Collection a but not in b.
    static float[]
    difference(float[] a, float[] b)
    Returns all the elements in the specified Array/Collection a but not in b.
    static int[]
    difference(int[] a, int[] b)
    Returns all the elements in the specified Array/Collection a but not in b.
    static long[]
    difference(long[] a, long[] b)
    Returns all the elements in the specified Array/Collection a but not in b.
    static short[]
    difference(short[] a, short[] b)
    Returns all the elements in the specified Array/Collection a but not in b.
    static <T> List<T>
    difference(Collection<? extends T> a, Collection<?> b)
    Returns all the elements in the specified Array/Collection a but not in b.
    static <T> List<T>
    difference(T[] a, Object[] b)
    Returns all the elements in the specified Array/Collection a but not in b.
    static boolean
    disjoint(Object[] a, Object[] b)
    Returns true if the two specified arrays/collections have no elements in common.
    static boolean
    Returns true if the two specified arrays/collections have no elements in common.
    static boolean[]
    distinct(boolean[] a)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static boolean[]
    distinct(boolean[] a, int fromIndex, int toIndex)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static byte[]
    distinct(byte[] a)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static byte[]
    distinct(byte[] a, int fromIndex, int toIndex)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static char[]
    distinct(char[] a)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static char[]
    distinct(char[] a, int fromIndex, int toIndex)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static double[]
    distinct(double[] a)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static double[]
    distinct(double[] a, int fromIndex, int toIndex)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static float[]
    distinct(float[] a)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static float[]
    distinct(float[] a, int fromIndex, int toIndex)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static int[]
    distinct(int[] a)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static int[]
    distinct(int[] a, int fromIndex, int toIndex)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static long[]
    distinct(long[] a)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static long[]
    distinct(long[] a, int fromIndex, int toIndex)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static short[]
    distinct(short[] a)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static short[]
    distinct(short[] a, int fromIndex, int toIndex)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static <T> List<T>
    distinct(Iterable<? extends T> c)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static <T> List<T>
    distinct(Collection<? extends T> c, int fromIndex, int toIndex)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static <T> List<T>
    distinct(Iterator<? extends T> iter)
     
    static <T> List<T>
    distinct(T[] a)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static <T> List<T>
    distinct(T[] a, int fromIndex, int toIndex)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static <T> List<T>
    distinctBy(Iterable<? extends T> c, Function<? super T,?> keyMapper)
    Distinct by the value mapped from keyMapper.
    static <T, C extends Collection<T>>
    C
    distinctBy(Iterable<? extends T> c, Function<? super T,?> keyMapper, Supplier<C> supplier)
    Distinct by the value mapped from keyMapper.
    static <T> List<T>
    distinctBy(Collection<? extends T> c, int fromIndex, int toIndex, Function<? super T,?> keyMapper)
    Distinct by the value mapped from keyMapper.
    static <T> List<T>
    distinctBy(Iterator<? extends T> iter, Function<? super T,?> keyMapper)
    Distinct by the value mapped from keyMapper.
    static <T, C extends Collection<T>>
    C
    distinctBy(Iterator<? extends T> iter, Function<? super T,?> keyMapper, Supplier<C> supplier)
    Distinct by the value mapped from keyMapper.
    static <T> List<T>
    distinctBy(T[] a, int fromIndex, int toIndex, Function<? super T,?> keyMapper)
    Distinct by the value mapped from keyMapper.
    static <T> List<T>
    distinctBy(T[] a, Function<? super T,?> keyMapper)
    Distinct by the value mapped from keyMapper.
    static <T, C extends Collection<T>>
    C
    distinctBy(T[] a, Function<? super T,?> keyMapper, Supplier<C> supplier)
    Distinct by the value mapped from keyMapper.
    static <T> List<T>
    dropWhile(Iterable<? extends T> c, Predicate<? super T> filter)
    Returns a list containing the elements of the input iterable after dropping the elements that satisfy the provided predicate.
    static <T> List<T>
    dropWhile(T[] a, Predicate<? super T> filter)
    Returns a list containing the elements of the input array after dropping the elements that satisfy the provided predicate.
    static DataSet
    Returns an unmodifiable empty DataSet.
    Returns an empty immutable/unmodifiable InputStream.
    static <T> Iterator<T>
    Returns an empty immutable/unmodifiable Iterator.
    static <T> List<T>
    Returns an empty immutable/unmodifiable List.
    static <T> ListIterator<T>
    Returns an empty immutable/unmodifiable ListIterator.
    static <K, V> Map<K,V>
    Returns an empty immutable/unmodifiable Map.
    static <K, V> NavigableMap<K,V>
    Returns an empty immutable/unmodifiable NavigableMap.
    static <T> NavigableSet<T>
    Returns an empty immutable/unmodifiable NavigableSet.
    static <T> Set<T>
    Returns an empty immutable/unmodifiable Set.
    static <K, V> SortedMap<K,V>
    Returns an empty immutable/unmodifiable SortedMap.
    static <T> SortedSet<T>
    Returns an empty immutable/unmodifiable SortedSet.
    static <E extends Enum<E>>
    ImmutableList<E>
    enumListOf(Class<E> enumClass)
    Returns an immutable/unmodifiable list of all the enum constants in the specified enum class.
    static <E extends Enum<E>>
    ImmutableBiMap<E,String>
    enumMapOf(Class<E> enumClass)
    Returns an immutable/unmodifiable bi-directional map of all the enum constants in the specified enum class to their names.
    static <E extends Enum<E>>
    ImmutableSet<E>
    enumSetOf(Class<E> enumClass)
    Returns an immutable/unmodifiable set of all the enum constants in the specified enum class.
    static boolean
    equals(boolean[] a, boolean[] b)
     
    static boolean
    equals(boolean[] a, int fromIndexA, boolean[] b, int fromIndexB, int len)
     
    static boolean
    equals(boolean a, boolean b)
     
    static boolean
    equals(byte[] a, byte[] b)
     
    static boolean
    equals(byte[] a, int fromIndexA, byte[] b, int fromIndexB, int len)
     
    static boolean
    equals(byte a, byte b)
     
    static boolean
    equals(char[] a, char[] b)
     
    static boolean
    equals(char[] a, int fromIndexA, char[] b, int fromIndexB, int len)
     
    static boolean
    equals(char a, char b)
     
    static boolean
    equals(double[] a, double[] b)
     
    static boolean
    equals(double[] a, int fromIndexA, double[] b, int fromIndexB, int len)
     
    static boolean
    equals(double a, double b)
     
    static boolean
    equals(float[] a, float[] b)
     
    static boolean
    equals(float[] a, int fromIndexA, float[] b, int fromIndexB, int len)
     
    static boolean
    equals(float a, float b)
     
    static boolean
    equals(int[] a, int[] b)
     
    static boolean
    equals(int[] a, int fromIndexA, int[] b, int fromIndexB, int len)
     
    static boolean
    equals(int a, int b)
     
    static boolean
    equals(long[] a, int fromIndexA, long[] b, int fromIndexB, int len)
     
    static boolean
    equals(long[] a, long[] b)
     
    static boolean
    equals(long a, long b)
     
    static boolean
    equals(short[] a, int fromIndexA, short[] b, int fromIndexB, int len)
     
    static boolean
    equals(short[] a, short[] b)
     
    static boolean
    equals(short a, short b)
     
    static boolean
    equals(Object[] a, int fromIndexA, Object[] b, int fromIndexB, int len)
     
    static boolean
    equals(Object[] a, Object[] b)
     
    static boolean
    compare a and b by Arrays.equals(Object[], Object[]) if both of them are array.
    static boolean
     
    static boolean
     
    static boolean
    equalsByProps(Object bean1, Object bean2, Collection<String> propNamesToCompare)
     
    static boolean
    equalsIgnoreCase(String[] a, int fromIndexA, String[] b, int fromIndexB, int len)
    Equals ignore case.
    static boolean
    Equals ignore case.
    static boolean
    Equals ignore case.
    static void
    erase(Object bean, String... propNames)
    Erases the properties of the given bean object.
    static void
    erase(Object bean, Collection<String> propNames)
    Erases the properties of the given bean object.
    static void
    Erases all the properties of the given bean object.
    static <T> List<T>
    exclude(Collection<? extends T> c, Object objToExclude)
    Returns a new List with specified objToExclude excluded.
    static <T> List<T>
    excludeAll(Collection<? extends T> c, Collection<?> objsToExclude)
    Returns a new List with specified objsToExclude excluded.
    static <T> Set<T>
    excludeAllToSet(Collection<? extends T> c, Collection<?> objsToExclude)
    Returns a new Set with specified objsToExclude excluded.
    static <T> Set<T>
    excludeToSet(Collection<? extends T> c, Object objToExclude)
    Returns a new Set with specified objToExclude excluded.
    static void
    execute(Throwables.Runnable<? extends Exception> cmd, int retryTimes, long retryIntervallInMillis, Predicate<? super Exception> retryCondition)
    Executes a command with the possibility of retrying in case of failure.
    static <R> R
    execute(Callable<R> cmd, int retryTimes, long retryIntervallInMillis, BiPredicate<? super R,? super Exception> retryCondition)
    Executes a Callable task with the possibility of retrying in case of failure.
    static void
    fill(boolean[] a, boolean val)
     
    static void
    fill(boolean[] a, int fromIndex, int toIndex, boolean val)
     
    static void
    fill(byte[] a, byte val)
     
    static void
    fill(byte[] a, int fromIndex, int toIndex, byte val)
     
    static void
    fill(char[] a, char val)
     
    static void
    fill(char[] a, int fromIndex, int toIndex, char val)
     
    static void
    fill(double[] a, double val)
     
    static void
    fill(double[] a, int fromIndex, int toIndex, double val)
     
    static void
    fill(float[] a, float val)
     
    static void
    fill(float[] a, int fromIndex, int toIndex, float val)
     
    static void
    fill(int[] a, int val)
     
    static void
    fill(int[] a, int fromIndex, int toIndex, int val)
     
    static void
    fill(long[] a, int fromIndex, int toIndex, long val)
     
    static void
    fill(long[] a, long val)
     
    static void
    fill(short[] a, int fromIndex, int toIndex, short val)
     
    static void
    fill(short[] a, short val)
     
    static <T> T
    fill(Class<? extends T> beanClass)
    Fill the properties of the bean with random values.
    static <T> List<T>
    fill(Class<? extends T> beanClass, int count)
    Fill the properties of the bean with random values.
    static void
    fill(Object bean)
    Fill the properties of the bean with random values.
    static void
    fill(Object[] a, int fromIndex, int toIndex, Object val)
     
    static void
    fill(Object[] a, Object val)
     
    static <T> void
    fill(List<? super T> list, int fromIndex, int toIndex, T val)
    The specified value will be added/inserted into the specified List.
    static <T> void
    fill(List<? super T> list, T val)
     
    static boolean[]
    filter(boolean[] a, int fromIndex, int toIndex, BooleanPredicate filter)
     
    static boolean[]
    filter(boolean[] a, int fromIndex, int toIndex, BooleanPredicate filter, int max)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static boolean[]
    filter(boolean[] a, int max, BooleanPredicate filter)
     
    static boolean[]
    filter(boolean[] a, BooleanPredicate filter)
     
    static byte[]
    filter(byte[] a, int fromIndex, int toIndex, BytePredicate filter)
     
    static byte[]
    filter(byte[] a, int fromIndex, int toIndex, BytePredicate filter, int max)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static byte[]
    filter(byte[] a, BytePredicate filter)
     
    static byte[]
    filter(byte[] a, BytePredicate filter, int max)
     
    static char[]
    filter(char[] a, int fromIndex, int toIndex, CharPredicate filter)
     
    static char[]
    filter(char[] a, int fromIndex, int toIndex, CharPredicate filter, int max)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static char[]
    filter(char[] a, CharPredicate filter)
     
    static char[]
    filter(char[] a, CharPredicate filter, int max)
     
    static double[]
    filter(double[] a, int fromIndex, int toIndex, DoublePredicate filter)
     
    static double[]
    filter(double[] a, int fromIndex, int toIndex, DoublePredicate filter, int max)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static double[]
    filter(double[] a, DoublePredicate filter)
     
    static double[]
    filter(double[] a, DoublePredicate filter, int max)
     
    static float[]
    filter(float[] a, int fromIndex, int toIndex, FloatPredicate filter)
     
    static float[]
    filter(float[] a, int fromIndex, int toIndex, FloatPredicate filter, int max)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static float[]
    filter(float[] a, FloatPredicate filter)
     
    static float[]
    filter(float[] a, FloatPredicate filter, int max)
     
    static int[]
    filter(int[] a, int fromIndex, int toIndex, IntPredicate filter)
     
    static int[]
    filter(int[] a, int fromIndex, int toIndex, IntPredicate filter, int max)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static int[]
    filter(int[] a, IntPredicate filter)
     
    static int[]
    filter(int[] a, IntPredicate filter, int max)
     
    static long[]
    filter(long[] a, int fromIndex, int toIndex, LongPredicate filter)
     
    static long[]
    filter(long[] a, int fromIndex, int toIndex, LongPredicate filter, int max)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static long[]
    filter(long[] a, LongPredicate filter)
     
    static long[]
    filter(long[] a, LongPredicate filter, int max)
     
    static short[]
    filter(short[] a, int fromIndex, int toIndex, ShortPredicate filter)
     
    static short[]
    filter(short[] a, int fromIndex, int toIndex, ShortPredicate filter, int max)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static short[]
    filter(short[] a, ShortPredicate filter)
     
    static short[]
    filter(short[] a, ShortPredicate filter, int max)
     
    static <T> List<T>
    filter(Iterable<? extends T> c, Predicate<? super T> filter)
     
    static <T> List<T>
    filter(Iterable<? extends T> c, Predicate<? super T> filter, int max)
     
    static <T, C extends Collection<T>>
    C
    filter(Iterable<? extends T> c, Predicate<? super T> filter, int max, IntFunction<C> supplier)
     
    static <T, C extends Collection<T>>
    C
    filter(Iterable<? extends T> c, Predicate<? super T> filter, IntFunction<C> supplier)
     
    static <T> List<T>
    filter(Collection<? extends T> c, int fromIndex, int toIndex, Predicate<? super T> filter)
     
    static <T> List<T>
    filter(Collection<? extends T> c, int fromIndex, int toIndex, Predicate<? super T> filter, int max)
     
    static <T, C extends Collection<T>>
    C
    filter(Collection<? extends T> c, int fromIndex, int toIndex, Predicate<? super T> filter, int max, IntFunction<C> supplier)
     
    static <T, C extends Collection<T>>
    C
    filter(Collection<? extends T> c, int fromIndex, int toIndex, Predicate<? super T> filter, IntFunction<C> supplier)
     
    static <T> List<T>
    filter(T[] a, int fromIndex, int toIndex, Predicate<? super T> filter)
    Returns a list of values filtered by the specified predicate.
    static <T> List<T>
    filter(T[] a, int fromIndex, int toIndex, Predicate<? super T> filter, int max)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static <T, C extends Collection<T>>
    C
    filter(T[] a, int fromIndex, int toIndex, Predicate<? super T> filter, int max, IntFunction<C> supplier)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static <T, C extends Collection<T>>
    C
    filter(T[] a, int fromIndex, int toIndex, Predicate<? super T> filter, IntFunction<C> supplier)
    Returns a list of values filtered by the specified predicate.
    static <T> List<T>
    filter(T[] a, Predicate<? super T> filter)
    Returns a list of values filtered by the specified predicate.
    static <T> List<T>
    filter(T[] a, Predicate<? super T> filter, int max)
    Returns a list of values filtered by the specified predicate.
    static <T, C extends Collection<T>>
    C
    filter(T[] a, Predicate<? super T> filter, int max, IntFunction<C> supplier)
    Returns a list of values filtered by the specified predicate.
    static <T, C extends Collection<T>>
    C
    filter(T[] a, Predicate<? super T> filter, IntFunction<C> supplier)
    Returns a list of values filtered by the specified predicate.
    static <T> u.Nullable<T>
    findFirst(Iterable<? extends T> c, Predicate<? super T> predicate)
     
    static <T> u.Nullable<T>
    findFirst(Iterator<? extends T> iter, Predicate<? super T> predicate)
     
    static <T> u.Nullable<T>
    findFirst(T[] a, Predicate<? super T> predicate)
     
    static <T> u.OptionalInt
    findFirstIndex(Collection<? extends T> c, Predicate<? super T> predicate)
    Find first index.
    static <T, U> u.OptionalInt
    findFirstIndex(Collection<? extends T> c, U u, BiPredicate<? super T,? super U> predicate)
    Find first index.
    static <T> u.OptionalInt
    findFirstIndex(T[] a, Predicate<? super T> predicate)
    Find first index.
    static <T, U> u.OptionalInt
    findFirstIndex(T[] a, U u, BiPredicate<? super T,? super U> predicate)
    Find first index.
    static <T> u.Optional<T>
    findFirstNonNull(Iterable<? extends T> c, Predicate<? super T> predicate)
    Find first non null.
    static <T> u.Optional<T>
    findFirstNonNull(Iterator<? extends T> iter, Predicate<? super T> predicate)
     
    static <T> u.Optional<T>
    findFirstNonNull(T[] a, Predicate<? super T> predicate)
    Find first non null.
    static <T> u.Nullable<T>
    findLast(Iterable<? extends T> c, Predicate<? super T> predicate)
     
    static <T> u.Nullable<T>
    findLast(T[] a, Predicate<? super T> predicate)
     
    static <T> u.OptionalInt
    findLastIndex(Collection<? extends T> c, Predicate<? super T> predicate)
    Find last index.
    static <T, U> u.OptionalInt
    findLastIndex(Collection<? extends T> c, U u, BiPredicate<? super T,? super U> predicate)
     
    static <T> u.OptionalInt
    findLastIndex(T[] a, Predicate<? super T> predicate)
    Find last index.
    static <T, U> u.OptionalInt
    findLastIndex(T[] a, U u, BiPredicate<? super T,? super U> predicate)
    Find last index.
    static <T> u.Optional<T>
    findLastNonNull(Iterable<? extends T> c, Predicate<? super T> predicate)
    Find last non null.
    static <T> u.Optional<T>
    findLastNonNull(T[] a, Predicate<? super T> predicate)
    Find last non null.
    static <T> u.Nullable<T>
    firstElement(Iterable<? extends T> c)
    Returns the first element in the given Iterable wrapped in a Nullable.
    static <T> u.Nullable<T>
    firstElement(Iterator<? extends T> iter)
    Returns the first element in the given Iterator wrapped in a Nullable.
    static <T> List<T>
    firstElements(Iterable<? extends T> c, int n)
    Returns a list containing the first n elements from the given Iterable.
    static <T> List<T>
    firstElements(Iterator<? extends T> iter, int n)
    Returns a list containing the first n elements from the given Iterator.
    static <K, V> u.Optional<Map.Entry<K,V>>
    firstEntry(Map<K,V> map)
     
    static <T extends CharSequence>
    u.Optional<T>
    firstNonBlank(T... a)
     
    static <T extends CharSequence>
    u.Optional<T>
    firstNonBlank(T a, T b)
     
    static <T extends CharSequence>
    u.Optional<T>
    firstNonBlank(T a, T b, T c)
     
    static <T extends CharSequence>
    u.Optional<T>
    firstNonEmpty(T... a)
     
    static <T> u.Optional<T[]>
    firstNonEmpty(T[] a, T[] b)
     
    static <T> u.Optional<T[]>
    firstNonEmpty(T[] a, T[] b, T[] c)
     
    static <T extends Collection<?>>
    u.Optional<T>
    firstNonEmpty(T a, T b)
     
    static <T extends Collection<?>>
    u.Optional<T>
    firstNonEmpty(T a, T b, T c)
     
    static <T> u.Optional<T>
    firstNonNull(Iterable<? extends T> c)
    Returns the first non-null value from the provided iterable.
    static <T> u.Optional<T>
    firstNonNull(Iterator<? extends T> iter)
    Returns the first non-null value from the provided iterator.
    static <T> u.Optional<T>
    firstNonNull(T... a)
    Returns the first non-null value among the provided values.
    static <T> u.Optional<T>
    firstNonNull(T a, T b)
    Returns the first non-null value among the two provided values.
    static <T> u.Optional<T>
    firstNonNull(T a, T b, T c)
    Returns the first non-null value among the three provided values.
    static <T> T
    firstOrDefaultIfEmpty(Iterable<? extends T> c, T defaultValueForEmpty)
    First or default if empty.
    static <T> T
    firstOrDefaultIfEmpty(Iterator<? extends T> iter, T defaultValueForEmpty)
    First or default if empty.
    static <T> T
    firstOrDefaultIfEmpty(T[] a, T defaultValueForEmpty)
    First or default if empty.
    static <T> T
    firstOrNullIfEmpty(Iterable<? extends T> c)
    First or null if empty.
    static <T> T
    firstOrNullIfEmpty(Iterator<? extends T> iter)
    First or null if empty.
    static <T> T
    First or null if empty.
    static <T, R> List<R>
    flatmap(Iterable<? extends T> c, Function<? super T,? extends R[]> mapper)
     
    static <T, R, C extends Collection<R>>
    C
    flatmap(Iterable<? extends T> c, Function<? super T,? extends R[]> mapper, IntFunction<? extends C> supplier)
     
    static <T, R> List<R>
    flatmap(Collection<? extends T> c, int fromIndex, int toIndex, Function<? super T,? extends R[]> mapper)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static <T, R, C extends Collection<R>>
    C
    flatmap(Collection<? extends T> c, int fromIndex, int toIndex, Function<? super T,? extends R[]> mapper, IntFunction<? extends C> supplier)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static <T, R> List<R>
    flatmap(T[] a, int fromIndex, int toIndex, Function<? super T,? extends R[]> mapper)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static <T, R, C extends Collection<R>>
    C
    flatmap(T[] a, int fromIndex, int toIndex, Function<? super T,? extends R[]> mapper, IntFunction<? extends C> supplier)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static <T, R> List<R>
    flatmap(T[] a, Function<? super T,? extends R[]> mapper)
     
    static <T, R, C extends Collection<R>>
    C
    flatmap(T[] a, Function<? super T,? extends R[]> mapper, IntFunction<? extends C> supplier)
     
    static <T, R> List<R>
    flatMap(Iterable<? extends T> c, Function<? super T,? extends Collection<? extends R>> mapper)
     
    static <T, R, C extends Collection<R>>
    C
    flatMap(Iterable<? extends T> c, Function<? super T,? extends Collection<? extends R>> mapper, IntFunction<? extends C> supplier)
     
    static <T, U, R> List<R>
    flatMap(Iterable<? extends T> c, Function<? super T,? extends Collection<? extends U>> mapper, Function<? super U,? extends Collection<? extends R>> mapper2)
     
    static <T, U, R, C extends Collection<R>>
    C
    flatMap(Iterable<? extends T> c, Function<? super T,? extends Collection<? extends U>> mapper, Function<? super U,? extends Collection<? extends R>> mapper2, IntFunction<? extends C> supplier)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static <T, R> List<R>
    flatMap(Collection<? extends T> c, int fromIndex, int toIndex, Function<? super T,? extends Collection<? extends R>> mapper)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static <T, R, C extends Collection<R>>
    C
    flatMap(Collection<? extends T> c, int fromIndex, int toIndex, Function<? super T,? extends Collection<? extends R>> mapper, IntFunction<? extends C> supplier)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static <T, R> List<R>
    flatMap(T[] a, int fromIndex, int toIndex, Function<? super T,? extends Collection<? extends R>> mapper)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static <T, R, C extends Collection<R>>
    C
    flatMap(T[] a, int fromIndex, int toIndex, Function<? super T,? extends Collection<? extends R>> mapper, IntFunction<? extends C> supplier)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static <T, R> List<R>
    flatMap(T[] a, Function<? super T,? extends Collection<? extends R>> mapper)
    Transforms an array of elements into a list by applying a given function to each element and flattening the result.
    static <T, R, C extends Collection<R>>
    C
    flatMap(T[] a, Function<? super T,? extends Collection<? extends R>> mapper, IntFunction<? extends C> supplier)
     
    static <T, U, R> List<R>
    flatMap(T[] a, Function<? super T,? extends Collection<? extends U>> mapper, Function<? super U,? extends Collection<? extends R>> mapper2)
     
    static <T, U, R, C extends Collection<R>>
    C
    flatMap(T[] a, Function<? super T,? extends Collection<? extends U>> mapper, Function<? super U,? extends Collection<? extends R>> mapper2, IntFunction<? extends C> supplier)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static boolean[]
    flatten(boolean[][] a)
    Flattens a two-dimensional boolean array into a one-dimensional boolean array.
    static byte[]
    flatten(byte[][] a)
    Flattens a two-dimensional byte array into a one-dimensional byte array.
    static char[]
    flatten(char[][] a)
    Flattens a two-dimensional char array into a one-dimensional char array.
    static double[]
    flatten(double[][] a)
    Flattens a two-dimensional double array into a one-dimensional double array.
    static float[]
    flatten(float[][] a)
    Flattens a two-dimensional float array into a one-dimensional float array.
    static int[]
    flatten(int[][] a)
    Flattens a two-dimensional int array into a one-dimensional int array.
    static long[]
    flatten(long[][] a)
    Flattens a two-dimensional long array into a one-dimensional long array.
    static short[]
    flatten(short[][] a)
    Flattens a two-dimensional short array into a one-dimensional short array.
    static <T> List<T>
    flatten(Iterable<? extends Iterable<? extends T>> c)
    Flattens an Iterable of Iterable<T> into a one-dimensional List.
    static <T, C extends Collection<T>>
    C
    flatten(Iterable<? extends Iterable<? extends T>> c, IntFunction<? extends C> supplier)
    Flattens an Iterable of Iterable<T> into a one-dimensional Collection.
    static <T> ObjIterator<T>
    flatten(Iterator<? extends Iterator<? extends T>> iters)
    Flattens an Iterator of Iterator<T> into a one-dimensional Iterator.
    static <T> T[]
    flatten(T[][] a)
    Flattens a two-dimensional array into a one-dimensional array.
    static <T> T[]
    flatten(T[][] a, Class<T> componentType)
    Flattens a two-dimensional array into a one-dimensional array.
    static List<?>
    Flattens each element of the provided Iterable if it's an Iterable itself, otherwise just adds it to the result List.
    static <T, C extends Collection<T>>
    C
    flattenEachElement(Iterable<?> c, Supplier<? extends C> supplier)
    Flattens each element of the provided Iterable if it's an Iterable itself, otherwise just adds it to the result Collection.
    static <E extends Exception>
    void
    forEach(int startInclusive, int endExclusive, int step, Throwables.IntConsumer<E> action)
     
    static <E extends Exception>
    void
    forEach(int startInclusive, int endExclusive, int step, Throwables.Runnable<E> action)
    Executes the provided action for each value in the range defined by startInclusive, endExclusive and step.
    static <T, E extends Exception>
    void
    forEach(int startInclusive, int endExclusive, int step, T a, Throwables.IntObjConsumer<? super T,E> action)
     
    static <E extends Exception>
    void
    forEach(int startInclusive, int endExclusive, Throwables.IntConsumer<E> action)
     
    static <E extends Exception>
    void
    forEach(int startInclusive, int endExclusive, Throwables.Runnable<E> action)
    Executes the provided action for each value in the range defined by startInclusive and endExclusive.
    static <T, E extends Exception>
    void
    forEach(int startInclusive, int endExclusive, T a, Throwables.IntObjConsumer<? super T,E> action)
     
    static <A, B, E extends Exception>
    void
    forEach(A[] a, B[] b, A valueForNoneA, B valueForNoneB, Throwables.BiConsumer<? super A,? super B,E> action)
     
    static <A, B, C, E extends Exception>
    void
    forEach(A[] a, B[] b, C[] c, A valueForNoneA, B valueForNoneB, C valueForNoneC, Throwables.TriConsumer<? super A,? super B,? super C,E> action)
     
    static <A, B, C, E extends Exception>
    void
    forEach(A[] a, B[] b, C[] c, Throwables.TriConsumer<? super A,? super B,? super C,E> action)
     
    static <A, B, E extends Exception>
    void
    forEach(A[] a, B[] b, Throwables.BiConsumer<? super A,? super B,E> action)
     
    static <T, E extends Exception>
    void
    forEach(Iterable<? extends T> c, Throwables.Consumer<? super T,E> action)
     
    static <T, E extends Exception>
    void
    forEach(Iterable<? extends T> c, Throwables.Consumer<? super T,E> elementConsumer, int processThreadNum)
     
    static <T, E extends Exception>
    void
    forEach(Iterable<? extends T> c, Throwables.Consumer<? super T,E> elementConsumer, int processThreadNum, Executor executor)
     
    static <T, T2, T3, E extends Exception, E2 extends Exception, E3 extends Exception>
    void
    forEach(Iterable<? extends T> c, Throwables.Function<? super T,? extends Iterable<T2>,E> flatMapper, Throwables.Function<? super T2,? extends Iterable<T3>,E2> flatMapper2, Throwables.TriConsumer<? super T,? super T2,? super T3,E3> action)
     
    static <T, U, E extends Exception, E2 extends Exception>
    void
    forEach(Iterable<? extends T> c, Throwables.Function<? super T,? extends Iterable<U>,E> flatMapper, Throwables.BiConsumer<? super T,? super U,E2> action)
     
    static <A, B, E extends Exception>
    void
    forEach(Iterable<A> a, Iterable<B> b, A valueForNoneA, B valueForNoneB, Throwables.BiConsumer<? super A,? super B,E> action)
     
    static <A, B, E extends Exception>
    void
    forEach(Iterable<A> a, Iterable<B> b, Throwables.BiConsumer<? super A,? super B,E> action)
     
    static <A, B, C, E extends Exception>
    void
    forEach(Iterable<A> a, Iterable<B> b, Iterable<C> c, A valueForNoneA, B valueForNoneB, C valueForNoneC, Throwables.TriConsumer<? super A,? super B,? super C,E> action)
     
    static <A, B, C, E extends Exception>
    void
    forEach(Iterable<A> a, Iterable<B> b, Iterable<C> c, Throwables.TriConsumer<? super A,? super B,? super C,E> action)
     
    static <T, E extends Exception>
    void
    forEach(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.Consumer<? super T,E> action)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static <T, E extends Exception>
    void
    forEach(Iterator<? extends T> iter, Throwables.Consumer<? super T,E> action)
     
    static <T, E extends Exception>
    void
    forEach(Iterator<? extends T> iter, Throwables.Consumer<? super T,E> elementConsumer, int processThreadNum)
     
    static <T, E extends Exception>
    void
    forEach(Iterator<? extends T> iter, Throwables.Consumer<? super T,E> elementConsumer, int processThreadNum, Executor executor)
     
    static <T, T2, T3, E extends Exception, E2 extends Exception, E3 extends Exception>
    void
    forEach(Iterator<? extends T> iter, Throwables.Function<? super T,? extends Iterable<T2>,E> flatMapper, Throwables.Function<? super T2,? extends Iterable<T3>,E2> flatMapper2, Throwables.TriConsumer<? super T,? super T2,? super T3,E3> action)
     
    static <T, U, E extends Exception, E2 extends Exception>
    void
    forEach(Iterator<? extends T> iter, Throwables.Function<? super T,? extends Iterable<U>,E> flatMapper, Throwables.BiConsumer<? super T,? super U,E2> action)
     
    static <A, B, E extends Exception>
    void
    forEach(Iterator<A> a, Iterator<B> b, A valueForNoneA, B valueForNoneB, Throwables.BiConsumer<? super A,? super B,E> action)
     
    static <A, B, E extends Exception>
    void
    forEach(Iterator<A> a, Iterator<B> b, Throwables.BiConsumer<? super A,? super B,E> action)
     
    static <A, B, C, E extends Exception>
    void
    forEach(Iterator<A> a, Iterator<B> b, Iterator<C> c, A valueForNoneA, B valueForNoneB, C valueForNoneC, Throwables.TriConsumer<? super A,? super B,? super C,E> action)
     
    static <A, B, C, E extends Exception>
    void
    forEach(Iterator<A> a, Iterator<B> b, Iterator<C> c, Throwables.TriConsumer<? super A,? super B,? super C,E> action)
     
    static <K, V, E extends Exception>
    void
    forEach(Map<K,V> map, Throwables.BiConsumer<? super K,? super V,E> action)
     
    static <K, V, E extends Exception>
    void
    forEach(Map<K,V> map, Throwables.Consumer<? super Map.Entry<K,V>,E> action)
     
    static <T, E extends Exception>
    void
    forEach(T[] a, int fromIndex, int toIndex, Throwables.Consumer<? super T,E> action)
     
    static <T, E extends Exception>
    void
    forEach(T[] a, Throwables.Consumer<? super T,E> action)
     
    static <T, T2, T3, E extends Exception, E2 extends Exception, E3 extends Exception>
    void
    forEach(T[] a, Throwables.Function<? super T,? extends Iterable<T2>,E> flatMapper, Throwables.Function<? super T2,? extends Iterable<T3>,E2> flatMapper2, Throwables.TriConsumer<? super T,? super T2,? super T3,E3> action)
     
    static <T, U, E extends Exception, E2 extends Exception>
    void
    forEach(T[] a, Throwables.Function<? super T,? extends Iterable<U>,E> flatMapper, Throwables.BiConsumer<? super T,? super U,E2> action)
     
    static <T, E extends Exception>
    void
    forEachIndexed(Iterable<? extends T> c, Throwables.IntObjConsumer<? super T,E> action)
     
    static <T, E extends Exception>
    void
    forEachIndexed(Iterable<? extends T> c, Throwables.IntObjConsumer<? super T,E> elementConsumer, int processThreadNum)
     
    static <T, E extends Exception>
    void
    forEachIndexed(Iterable<? extends T> c, Throwables.IntObjConsumer<? super T,E> elementConsumer, int processThreadNum, Executor executor)
     
    static <T, E extends Exception>
    void
    forEachIndexed(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.IntObjConsumer<? super T,E> action)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static <T, E extends Exception>
    void
    forEachIndexed(Iterator<? extends T> iter, Throwables.IntObjConsumer<? super T,E> action)
     
    static <T, E extends Exception>
    void
    forEachIndexed(Iterator<? extends T> iter, Throwables.IntObjConsumer<? super T,E> elementConsumer, int processThreadNum)
     
    static <T, E extends Exception>
    void
    forEachIndexed(Iterator<? extends T> iter, Throwables.IntObjConsumer<? super T,E> elementConsumer, int processThreadNum, Executor executor)
     
    static <K, V, E extends Exception>
    void
    forEachIndexed(Map<K,V> map, Throwables.IntBiObjConsumer<? super K,? super V,E> action)
     
    static <K, V, E extends Exception>
    void
    forEachIndexed(Map<K,V> map, Throwables.IntObjConsumer<? super Map.Entry<K,V>,E> action)
     
    static <T, E extends Exception>
    void
    forEachIndexed(T[] a, int fromIndex, int toIndex, Throwables.IntObjConsumer<? super T,E> action)
     
    static <T, E extends Exception>
    void
    forEachIndexed(T[] a, Throwables.IntObjConsumer<? super T,E> action)
     
    static <T, E extends Exception>
    void
    forEachNonNull(Iterable<? extends T> c, Throwables.Consumer<? super T,E> action)
    For each non null.
    static <T, T2, T3, E extends Exception, E2 extends Exception, E3 extends Exception>
    void
    forEachNonNull(Iterable<? extends T> c, Throwables.Function<? super T,? extends Iterable<T2>,E> flatMapper, Throwables.Function<? super T2,? extends Iterable<T3>,E2> flatMapper2, Throwables.TriConsumer<? super T,? super T2,? super T3,E3> action)
    For each non null.
    static <T, U, E extends Exception, E2 extends Exception>
    void
    forEachNonNull(Iterable<? extends T> c, Throwables.Function<? super T,? extends Iterable<U>,E> flatMapper, Throwables.BiConsumer<? super T,? super U,E2> action)
    For each non null.
    static <T, T2, T3, E extends Exception, E2 extends Exception, E3 extends Exception>
    void
    forEachNonNull(Iterator<? extends T> iter, Throwables.Function<? super T,? extends Iterable<T2>,E> flatMapper, Throwables.Function<? super T2,? extends Iterable<T3>,E2> flatMapper2, Throwables.TriConsumer<? super T,? super T2,? super T3,E3> action)
    For each non null.
    static <T, U, E extends Exception, E2 extends Exception>
    void
    forEachNonNull(Iterator<? extends T> iter, Throwables.Function<? super T,? extends Iterable<U>,E> flatMapper, Throwables.BiConsumer<? super T,? super U,E2> action)
    For each non null.
    static <T, E extends Exception>
    void
    forEachNonNull(T[] a, Throwables.Consumer<? super T,E> action)
    For each non null.
    static <T, T2, T3, E extends Exception, E2 extends Exception, E3 extends Exception>
    void
    forEachNonNull(T[] a, Throwables.Function<? super T,? extends Iterable<T2>,E> flatMapper, Throwables.Function<? super T2,? extends Iterable<T3>,E2> flatMapper2, Throwables.TriConsumer<? super T,? super T2,? super T3,E3> action)
    For each non null.
    static <T, U, E extends Exception, E2 extends Exception>
    void
    forEachNonNull(T[] a, Throwables.Function<? super T,? extends Iterable<U>,E> flatMapper, Throwables.BiConsumer<? super T,? super U,E2> action)
    For each non null.
    static <T, E extends Exception>
    void
    forEachPair(Iterable<? extends T> c, int increment, Throwables.BiConsumer<? super T,? super T,E> action)
    For each pair.
    static <T, E extends Exception>
    void
    forEachPair(Iterable<? extends T> c, Throwables.BiConsumer<? super T,? super T,E> action)
    For each pair.
    static <T, E extends Exception>
    void
    forEachPair(Iterator<? extends T> iter, int increment, Throwables.BiConsumer<? super T,? super T,E> action)
    For each pair.
    static <T, E extends Exception>
    void
    forEachPair(Iterator<? extends T> iter, Throwables.BiConsumer<? super T,? super T,E> action)
    For each pair.
    static <T, E extends Exception>
    void
    forEachPair(T[] a, int increment, Throwables.BiConsumer<? super T,? super T,E> action)
    For each pair.
    static <T, E extends Exception>
    void
    forEachPair(T[] a, Throwables.BiConsumer<? super T,? super T,E> action)
    For each pair.
    static <T, E extends Exception>
    void
    forEachTriple(Iterable<? extends T> c, int increment, Throwables.TriConsumer<? super T,? super T,? super T,E> action)
    For each triple.
    static <T, E extends Exception>
    void
    forEachTriple(Iterable<? extends T> c, Throwables.TriConsumer<? super T,? super T,? super T,E> action)
    For each triple.
    static <T, E extends Exception>
    void
    forEachTriple(Iterator<? extends T> iter, int increment, Throwables.TriConsumer<? super T,? super T,? super T,E> action)
    For each triple.
    static <T, E extends Exception>
    void
    forEachTriple(Iterator<? extends T> iter, Throwables.TriConsumer<? super T,? super T,? super T,E> action)
    For each triple.
    static <T, E extends Exception>
    void
    forEachTriple(T[] a, int increment, Throwables.TriConsumer<? super T,? super T,? super T,E> action)
    For each triple.
    static <T, E extends Exception>
    void
    forEachTriple(T[] a, Throwables.TriConsumer<? super T,? super T,? super T,E> action)
    For each triple.
    static String
     
    static String
     
    static String
    formatJson(String json, JSONSerializationConfig config, com.landawn.abacus.type.Type<?> transferType)
     
    static String
    formatJson(String json, JSONSerializationConfig config, Class<?> transferType)
     
    static String
    formatJson(String json, com.landawn.abacus.type.Type<?> transferType)
     
    static String
    formatJson(String json, Class<?> transferType)
     
    static String
     
    static String
     
    static String
    formatXml(String xml, XMLSerializationConfig config, com.landawn.abacus.type.Type<?> transferType)
     
    static String
    formatXml(String xml, XMLSerializationConfig config, Class<?> transferType)
     
    static String
    formatXml(String xml, com.landawn.abacus.type.Type<?> transferType)
     
    static String
    formatXml(String xml, Class<?> transferType)
     
    static <T> T[]
    fprintln(String format, T... args)
    Prints a formatted string and an array of arguments, following the syntax rules of String.format(String, Object...).
    static <T> T
    fromJson(File json, JSONDeserializationConfig config, com.landawn.abacus.type.Type<? extends T> targetType)
     
    static <T> T
    fromJson(File json, JSONDeserializationConfig config, Class<? extends T> targetType)
     
    static <T> T
    fromJson(File json, com.landawn.abacus.type.Type<? extends T> targetType)
     
    static <T> T
    fromJson(File json, Class<? extends T> targetType)
     
    static <T> T
    fromJson(InputStream json, JSONDeserializationConfig config, com.landawn.abacus.type.Type<? extends T> targetType)
     
    static <T> T
    fromJson(InputStream json, JSONDeserializationConfig config, Class<? extends T> targetType)
     
    static <T> T
    fromJson(InputStream json, com.landawn.abacus.type.Type<? extends T> targetType)
     
    static <T> T
    fromJson(InputStream json, Class<? extends T> targetType)
     
    static <T> T
    fromJson(Reader json, JSONDeserializationConfig config, com.landawn.abacus.type.Type<? extends T> targetType)
     
    static <T> T
    fromJson(Reader json, JSONDeserializationConfig config, Class<? extends T> targetType)
     
    static <T> T
    fromJson(Reader json, com.landawn.abacus.type.Type<? extends T> targetType)
     
    static <T> T
    fromJson(Reader json, Class<? extends T> targetType)
     
    static <T> T
    fromJson(String json, int fromIndex, int toIndex, JSONDeserializationConfig config, com.landawn.abacus.type.Type<? extends T> targetType)
     
    static <T> T
    fromJson(String json, int fromIndex, int toIndex, JSONDeserializationConfig config, Class<? extends T> targetType)
     
    static <T> T
    fromJson(String json, int fromIndex, int toIndex, com.landawn.abacus.type.Type<? extends T> targetType)
     
    static <T> T
    fromJson(String json, int fromIndex, int toIndex, Class<? extends T> targetType)
     
    static <T> T
    fromJson(String json, JSONDeserializationConfig config, com.landawn.abacus.type.Type<? extends T> targetType)
     
    static <T> T
    fromJson(String json, JSONDeserializationConfig config, Class<? extends T> targetType)
     
    static <T> T
    fromJson(String json, com.landawn.abacus.type.Type<? extends T> targetType)
     
    static <T> T
    fromJson(String json, Class<? extends T> targetType)
     
    static <T> T
    fromJson(String json, T defaultIfNull, com.landawn.abacus.type.Type<? extends T> targetType)
     
    static <T> T
    fromJson(String json, T defaultIfNull, Class<? extends T> targetType)
     
    static <T> T
    fromXml(File xml, XMLDeserializationConfig config, com.landawn.abacus.type.Type<? extends T> targetType)
     
    static <T> T
    fromXml(File xml, XMLDeserializationConfig config, Class<? extends T> targetType)
     
    static <T> T
    fromXml(File xml, com.landawn.abacus.type.Type<? extends T> targetType)
     
    static <T> T
    fromXml(File xml, Class<? extends T> targetType)
     
    static <T> T
    fromXml(InputStream xml, XMLDeserializationConfig config, com.landawn.abacus.type.Type<? extends T> targetType)
     
    static <T> T
    fromXml(InputStream xml, XMLDeserializationConfig config, Class<? extends T> targetType)
     
    static <T> T
    fromXml(InputStream xml, com.landawn.abacus.type.Type<? extends T> targetType)
     
    static <T> T
    fromXml(InputStream xml, Class<? extends T> targetType)
     
    static <T> T
    fromXml(Reader xml, XMLDeserializationConfig config, com.landawn.abacus.type.Type<? extends T> targetType)
     
    static <T> T
    fromXml(Reader xml, XMLDeserializationConfig config, Class<? extends T> targetType)
     
    static <T> T
    fromXml(Reader xml, com.landawn.abacus.type.Type<? extends T> targetType)
     
    static <T> T
    fromXml(Reader xml, Class<? extends T> targetType)
     
    static <T> T
    fromXml(String xml, XMLDeserializationConfig config, com.landawn.abacus.type.Type<? extends T> targetType)
     
    static <T> T
    fromXml(String xml, XMLDeserializationConfig config, Class<? extends T> targetType)
     
    static <T> T
    fromXml(String xml, com.landawn.abacus.type.Type<? extends T> targetType)
     
    static <T> T
    fromXml(String xml, Class<? extends T> targetType)
     
    static <T extends Comparable<? super T>>
    boolean
    geAndLe(T value, T min, T max)
    Returns true is min <= value <= max, otherwise false is returned.
    static <T> boolean
    geAndLe(T value, T min, T max, Comparator<? super T> cmp)
    Returns true is min <= value <= max, otherwise false is returned.
    static <T extends Comparable<? super T>>
    boolean
    geAndLt(T value, T min, T max)
    Returns true is min <= value < max, otherwise false is returned.
    static <T> boolean
    geAndLt(T value, T min, T max, Comparator<? super T> cmp)
    Returns true is min <= value < max, otherwise false is returned.
    static <T> T
    getElement(Iterable<? extends T> c, int index)
    Retrieves an element from an Iterable at a specified index.
    static <T> T
    getElement(Iterator<? extends T> iter, long index)
    Retrieves an element from an Iterator at a specified index.
    static <T> u.Nullable<T>
    getOnlyElement(Iterable<? extends T> c)
    Returns the only element in the given Iterable.
    static <T> u.Nullable<T>
    getOnlyElement(Iterator<? extends T> iter)
    Returns the only element in the given Iterator.
    getPropNames(Class<?> beanClass)
    Retrieves the property names of the given bean class.
    static List<String>
    getPropNames(Class<?> beanClass, Set<String> propNameToExclude)
    Retrieves the property names of the given bean class excluding the specified property names.
    static List<String>
    Retrieves the property names of the given bean object.
    static List<String>
    getPropNames(Object bean, boolean ignoreNullValue)
    Retrieves the property names of the given bean object.
    static <T> T
    getPropValue(Object bean, String propName)
    Retrieves the value of the specified property from the given bean object.
    static <T> T
    getPropValue(Object bean, String propName, boolean ignoreUnmatchedProperty)
    Retrieves the value of the specified property from the given bean object.
    static <T extends Comparable<? super T>>
    boolean
    greaterEqual(T a, T b)
    Returns true is a >= b, otherwise false is returned.
    static <T> boolean
    greaterEqual(T a, T b, Comparator<? super T> cmp)
    Returns true is a >= b, otherwise false is returned.
    static <T extends Comparable<? super T>>
    boolean
    greaterThan(T a, T b)
    Returns true is a > b, otherwise false is returned.
    static <T> boolean
    greaterThan(T a, T b, Comparator<? super T> cmp)
    Returns true is a > b, otherwise false is returned.
    static <T, K> Map<K,List<T>>
    groupBy(Iterable<? extends T> c, Function<? super T,? extends K> keyExtractor)
     
    static <T, K, V> Map<K,List<V>>
    groupBy(Iterable<? extends T> c, Function<? super T,? extends K> keyExtractor, Function<? super T,? extends V> valueExtractor)
     
    static <T, K, V, M extends Map<K, List<V>>>
    M
    groupBy(Iterable<? extends T> c, Function<? super T,? extends K> keyExtractor, Function<? super T,? extends V> valueExtractor, Supplier<M> mapSupplier)
     
    static <T, K, M extends Map<K, List<T>>>
    M
    groupBy(Iterable<? extends T> c, Function<? super T,? extends K> keyExtractor, Supplier<M> mapSupplier)
     
    static <T, K, R> Map<K,R>
    groupBy(Iterable<? extends T> c, Function<? super T,? extends K> keyExtractor, Collector<? super T,?,R> collector)
     
    static <T, K, R, M extends Map<K, R>>
    M
    groupBy(Iterable<? extends T> c, Function<? super T,? extends K> keyExtractor, Collector<? super T,?,R> collector, Supplier<M> mapSupplier)
     
    static <T, K> Map<K,List<T>>
    groupBy(Iterator<? extends T> iter, Function<? super T,? extends K> keyExtractor)
     
    static <T, K, V> Map<K,List<V>>
    groupBy(Iterator<? extends T> iter, Function<? super T,? extends K> keyExtractor, Function<? super T,? extends V> valueExtractor)
     
    static <T, K, V, M extends Map<K, List<V>>>
    M
    groupBy(Iterator<? extends T> iter, Function<? super T,? extends K> keyExtractor, Function<? super T,? extends V> valueExtractor, Supplier<M> mapSupplier)
     
    static <T, K, M extends Map<K, List<T>>>
    M
    groupBy(Iterator<? extends T> iter, Function<? super T,? extends K> keyExtractor, Supplier<M> mapSupplier)
     
    static <K, T, R> Map<K,R>
    groupBy(Iterator<? extends T> iter, Function<? super T,? extends K> keyExtractor, Collector<? super T,?,R> collector)
     
    static <K, T, R, M extends Map<K, R>>
    M
    groupBy(Iterator<? extends T> iter, Function<? super T,? extends K> keyExtractor, Collector<? super T,?,R> collector, Supplier<M> mapSupplier)
     
    static <T, K> Map<K,List<T>>
    groupBy(T[] a, int fromIndex, int toIndex, Function<? super T,? extends K> keyExtractor)
     
    static <T, K, M extends Map<K, List<T>>>
    M
    groupBy(T[] a, int fromIndex, int toIndex, Function<? super T,? extends K> keyExtractor, Supplier<M> mapSupplier)
     
    static <T, K> Map<K,List<T>>
    groupBy(T[] a, Function<? super T,? extends K> keyExtractor)
     
    static <T, K, M extends Map<K, List<T>>>
    M
    groupBy(T[] a, Function<? super T,? extends K> keyExtractor, Supplier<M> mapSupplier)
     
    static <T extends Comparable<? super T>>
    boolean
    gtAndLe(T value, T min, T max)
    Returns true is min < value <= max, otherwise false is returned.
    static <T> boolean
    gtAndLe(T value, T min, T max, Comparator<? super T> cmp)
    Returns true is min < value <= max, otherwise false is returned.
    static <T extends Comparable<? super T>>
    boolean
    gtAndLt(T value, T min, T max)
    Returns true is min < value < max, otherwise false is returned.
    static <T> boolean
    gtAndLt(T value, T min, T max, Comparator<? super T> cmp)
    Returns true is min < value < max, otherwise false is returned.
    static boolean
    hasDuplicates(boolean[] a)
    Checks if the given array has duplicate elements.
    static boolean
    hasDuplicates(byte[] a)
    Checks if the given array has duplicate elements.
    static boolean
    hasDuplicates(byte[] a, boolean isSorted)
    Checks if the given array has duplicate elements.
    static boolean
    hasDuplicates(char[] a)
    Checks if the given array has duplicate elements.
    static boolean
    hasDuplicates(char[] a, boolean isSorted)
    Checks if the given array has duplicate elements.
    static boolean
    hasDuplicates(double[] a)
    Checks if the given array has duplicate elements.
    static boolean
    hasDuplicates(double[] a, boolean isSorted)
    Checks if the given array has duplicate elements.
    static boolean
    hasDuplicates(float[] a)
    Checks if the given array has duplicate elements.
    static boolean
    hasDuplicates(float[] a, boolean isSorted)
    Checks if the given array has duplicate elements.
    static boolean
    hasDuplicates(int[] a)
    Checks if the given array has duplicate elements.
    static boolean
    hasDuplicates(int[] a, boolean isSorted)
    Checks if the given array has duplicate elements.
    static boolean
    hasDuplicates(long[] a)
    Checks if the given array has duplicate elements.
    static boolean
    hasDuplicates(long[] a, boolean isSorted)
    Checks if the given array has duplicate elements.
    static boolean
    hasDuplicates(short[] a)
    Checks if the given array has duplicate elements.
    static boolean
    hasDuplicates(short[] a, boolean isSorted)
    Checks if the given array has duplicate elements.
    static boolean
    Checks if the given collection has duplicate elements.
    static boolean
    hasDuplicates(Collection<?> c, boolean isSorted)
    Checks if the given collection has duplicate elements.
    static <T> boolean
    Checks if the given array has duplicate elements.
    static <T> boolean
    hasDuplicates(T[] a, boolean isSorted)
    Checks if the given array has duplicate elements.
    static int
    hashCode(boolean value)
     
    static int
    hashCode(boolean[] a)
     
    static int
    hashCode(boolean[] a, int fromIndex, int toIndex)
     
    static int
    hashCode(byte value)
     
    static int
    hashCode(byte[] a)
     
    static int
    hashCode(byte[] a, int fromIndex, int toIndex)
     
    static int
    hashCode(char value)
     
    static int
    hashCode(char[] a)
     
    static int
    hashCode(char[] a, int fromIndex, int toIndex)
     
    static int
    hashCode(double value)
     
    static int
    hashCode(double[] a)
     
    static int
    hashCode(double[] a, int fromIndex, int toIndex)
     
    static int
    hashCode(float value)
     
    static int
    hashCode(float[] a)
     
    static int
    hashCode(float[] a, int fromIndex, int toIndex)
     
    static int
    hashCode(int value)
     
    static int
    hashCode(int[] a)
     
    static int
    hashCode(int[] a, int fromIndex, int toIndex)
     
    static int
    hashCode(long value)
     
    static int
    hashCode(long[] a)
     
    static int
    hashCode(long[] a, int fromIndex, int toIndex)
     
    static int
    hashCode(short value)
     
    static int
    hashCode(short[] a)
     
    static int
    hashCode(short[] a, int fromIndex, int toIndex)
     
    static int
     
    static int
     
    static int
    hashCode(Object[] a, int fromIndex, int toIndex)
     
    static <C extends CharSequence, E extends Exception>
    void
    ifNotEmpty(C c, Throwables.Consumer<? super C,E> cmd)
    Executes the provided action if the given CharSequence is not empty.
    static <M extends Map, E extends Exception>
    void
    ifNotEmpty(M m, Throwables.Consumer<? super M,E> cmd)
    Executes the provided action if the given map is not empty.
    static <T, E extends Exception>
    void
    ifNotNull(T obj, Throwables.Consumer<? super T,E> cmd)
     
    static <E1 extends Exception, E2 extends Exception>
    void
    ifOrElse(boolean b, Throwables.Runnable<E1> actionForTrue, Throwables.Runnable<E2> actionForFalse)
    Executes the provided actions based on the boolean condition.
    static <R, E extends Exception>
    u.Nullable<R>
    ifOrEmpty(boolean b, Throwables.Supplier<R,E> supplier)
    Returns a Nullable with value got from the specified supplier if b is true, otherwise returns an empty Nullable if b is false.
    static int
    indexOf(boolean[] a, boolean valueToFind)
     
    static int
    indexOf(boolean[] a, boolean valueToFind, int fromIndex)
     
    static int
    indexOf(byte[] a, byte valueToFind)
     
    static int
    indexOf(byte[] a, byte valueToFind, int fromIndex)
     
    static int
    indexOf(char[] a, char valueToFind)
     
    static int
    indexOf(char[] a, char valueToFind, int fromIndex)
     
    static int
    indexOf(double[] a, double valueToFind)
     
    static int
    indexOf(double[] a, double valueToFind, double tolerance)
    Finds the index of the given value within a given tolerance in the array.
    static int
    indexOf(double[] a, double valueToFind, double tolerance, int fromIndex)
    Finds the index of the given value in the array starting at the given index.
    static int
    indexOf(double[] a, double valueToFind, int fromIndex)
     
    static int
    indexOf(float[] a, float valueToFind)
     
    static int
    indexOf(float[] a, float valueToFind, int fromIndex)
     
    static int
    indexOf(int[] a, int valueToFind)
     
    static int
    indexOf(int[] a, int valueToFind, int fromIndex)
     
    static int
    indexOf(long[] a, long valueToFind)
     
    static int
    indexOf(long[] a, long valueToFind, int fromIndex)
     
    static int
    indexOf(short[] a, short valueToFind)
     
    static int
    indexOf(short[] a, short valueToFind, int fromIndex)
     
    static int
    indexOf(Object[] a, Object valueToFind)
     
    static int
    indexOf(Object[] a, Object valueToFind, int fromIndex)
     
    static int
    indexOf(Collection<?> c, Object valueToFind)
     
    static int
    indexOf(Collection<?> c, Object valueToFind, int fromIndex)
     
    static int
    indexOf(Iterator<?> iter, Object valueToFind)
    Returns the index of the first occurrence of the specified value in the given iterator.
    static int
    indexOf(Iterator<?> iter, Object valueToFind, int fromIndex)
    Returns the index of the first occurrence of the specified value in the given iterator, starting the search from the specified index.
    static int
    indexOfIgnoreCase(String[] a, String valueToFind)
     
    static int
    indexOfIgnoreCase(String[] a, String valueToFind, int fromIndex)
     
    static int
    indexOfSubList(List<?> sourceList, List<?> subListToFind)
    Index of sub list.
    static int
    indexOfSubList(List<?> sourceList, List<?> subListToFind, int fromIndex)
    Index of sub list.
    static int[]
    indicesOfAll(Object[] a, Object valueToFind)
     
    static int[]
    indicesOfAll(Object[] a, Object valueToFind, int startIndex)
     
    static int[]
    indicesOfAll(Collection<?> c, Object valueToFind)
     
    static int[]
    indicesOfAll(Collection<?> c, Object valueToFind, int startIndex)
     
    static <T> int[]
    indicesOfAll(Collection<? extends T> c, Predicate<? super T> predicate)
     
    static <T> int[]
    indicesOfAll(Collection<? extends T> c, Predicate<? super T> predicate, int fromIndex)
     
    static <T> int[]
    indicesOfAll(T[] a, Predicate<? super T> predicate)
     
    static <T> int[]
    indicesOfAll(T[] a, Predicate<? super T> predicate, int startIndex)
     
    static <T extends Comparable<? super T>>
    int[]
    indicesOfAllMax(Collection<? extends T> c)
     
    static <T> int[]
    indicesOfAllMax(Collection<? extends T> c, Comparator<? super T> cmp)
     
    static <T extends Comparable<? super T>>
    int[]
     
    static <T> int[]
    indicesOfAllMax(T[] a, Comparator<? super T> cmp)
     
    static <T extends Comparable<? super T>>
    int[]
    indicesOfAllMin(Collection<? extends T> c)
     
    static <T> int[]
    indicesOfAllMin(Collection<? extends T> c, Comparator<? super T> cmp)
     
    static <T extends Comparable<? super T>>
    int[]
     
    static <T> int[]
    indicesOfAllMin(T[] a, Comparator<? super T> cmp)
     
    static boolean[]
    insert(boolean[] a, int index, boolean elementToInsert)
    Inserts a boolean value into a given boolean array at a specified index.
    static byte[]
    insert(byte[] a, int index, byte elementToInsert)
    Returns a new array with elements copied from the specified array and the specified element inserted at the specified index.
    static char[]
    insert(char[] a, int index, char elementToInsert)
    Returns a new array with elements copied from the specified array and the specified element inserted at the specified index.
    static double[]
    insert(double[] a, int index, double elementToInsert)
    Returns a new array with elements copied from the specified array and the specified element inserted at the specified index.
    static float[]
    insert(float[] a, int index, float elementToInsert)
    Returns a new array with elements copied from the specified array and the specified element inserted at the specified index.
    static int[]
    insert(int[] a, int index, int elementToInsert)
    Returns a new array with elements copied from the specified array and the specified element inserted at the specified index.
    static long[]
    insert(long[] a, int index, long elementToInsert)
    Returns a new array with elements copied from the specified array and the specified element inserted at the specified index.
    static short[]
    insert(short[] a, int index, short elementToInsert)
    Returns a new array with elements copied from the specified array and the specified element inserted at the specified index.
    static String[]
    insert(String[] a, int index, String elementToInsert)
    Returns a new array with elements copied from the specified array and the specified element inserted at the specified index.
    static String
    insert(String str, int index, String strToInsert)
    Returns a new String with chars copied from the specified String and the specified String inserted at the specified index.
    static <T> T[]
    insert(T[] a, int index, T elementToInsert)
    Returns a new array with elements copied from the specified array and the specified element inserted at the specified index.
    static boolean[]
    insertAll(boolean[] a, int index, boolean... elementsToInsert)
    Returns a new array with elements copied from the specified array and the specified elements inserted at the specified index.
    static byte[]
    insertAll(byte[] a, int index, byte... elementsToInsert)
    Returns a new array with elements copied from the specified array and the specified elements inserted at the specified index.
    static char[]
    insertAll(char[] a, int index, char... elementsToInsert)
    Returns a new array with elements copied from the specified array and the specified elements inserted at the specified index.
    static double[]
    insertAll(double[] a, int index, double... elementsToInsert)
    Returns a new array with elements copied from the specified array and the specified elements inserted at the specified index.
    static float[]
    insertAll(float[] a, int index, float... elementsToInsert)
    Returns a new array with elements copied from the specified array and the specified elements inserted at the specified index.
    static int[]
    insertAll(int[] a, int index, int... elementsToInsert)
    Returns a new array with elements copied from the specified array and the specified elements inserted at the specified index.
    static long[]
    insertAll(long[] a, int index, long... elementsToInsert)
    Returns a new array with elements copied from the specified array and the specified elements inserted at the specified index.
    static short[]
    insertAll(short[] a, int index, short... elementsToInsert)
    Returns a new array with elements copied from the specified array and the specified elements inserted at the specified index.
    static String[]
    insertAll(String[] a, int index, String... elementsToInsert)
    Returns a new array with elements copied from the specified array and the specified elements inserted at the specified index.
    static <T> boolean
    insertAll(List<T> list, int index, Collection<? extends T> elementsToInsert)
    Inserts the specified elements at the specified position in the list.
    static <T> boolean
    insertAll(List<T> list, int index, T... elementsToInsert)
    Inserts the specified elements at the specified position in the list.
    static <T> T[]
    insertAll(T[] a, int index, T... elementsToInsert)
    Returns a new array with elements copied from the specified array and the specified elements inserted at the specified index.
    static boolean[]
    intersection(boolean[] a, boolean[] b)
    Returns the elements in the specified Array/Collection a and b.
    static byte[]
    intersection(byte[] a, byte[] b)
    Returns the elements in the specified Array/Collection a and b.
    static char[]
    intersection(char[] a, char[] b)
    Returns the elements in the specified Array/Collection a and b.
    static double[]
    intersection(double[] a, double[] b)
    Returns the elements in the specified Array/Collection a and b.
    static float[]
    intersection(float[] a, float[] b)
    Returns the elements in the specified Array/Collection a and b.
    static int[]
    intersection(int[] a, int[] b)
    Returns the elements in the specified Array/Collection a and b.
    static long[]
    intersection(long[] a, long[] b)
    Returns the elements in the specified Array/Collection a and b.
    static short[]
    intersection(short[] a, short[] b)
    Returns the elements in the specified Array/Collection a and b.
    static <T> List<T>
    intersection(Collection<? extends Collection<? extends T>> c)
    Returns the elements in all the specified collections.
    static <T> List<T>
    intersection(Collection<? extends T> a, Collection<?> b)
    Returns the elements in the specified Array/Collection a and b.
    static <T> List<T>
    intersection(Collection<? extends T> a, Collection<?> b, boolean ignoreOcurrences)
    Return only the elements in the first collection that are contained in the specified second collection.
    static <T> List<T>
    intersection(T[] a, Object[] b)
    Returns the elements in the specified Array/Collection a and b.
    static <T extends Comparable<? super T>>
    boolean
    isBetween(T value, T min, T max)
    static <T> boolean
    isBetween(T value, T min, T max, Comparator<? super T> cmp)
    static boolean
    Checks if the specified CharSequence is null or blank.
    static boolean
    isEmpty(boolean[] a)
    Checks if is null or empty.
    static boolean
    isEmpty(byte[] a)
    Checks if is null or empty.
    static boolean
    isEmpty(char[] a)
    Checks if is null or empty.
    static boolean
    isEmpty(double[] a)
    Checks if is null or empty.
    static boolean
    isEmpty(float[] a)
    Checks if is null or empty.
    static boolean
    isEmpty(int[] a)
    Checks if is null or empty.
    static boolean
    isEmpty(long[] a)
    Checks if is null or empty.
    static boolean
    isEmpty(short[] a)
    Checks if is null or empty.
    static boolean
    Checks if is null or empty.
    static boolean
    isEmpty(Multimap<?,?,?> m)
    Checks if is null or empty.
    static boolean
    Checks if is null or empty.
    static boolean
    Checks if is null or empty.
    static boolean
    Checks if the specified CharSequence is null or empty.
    static boolean
    isEmpty(Iterable<?> iter)
    Not null or empty.
    static boolean
    Checks if is null or empty.
    static boolean
    Checks if is null or empty.
    static boolean
    isEmpty(Iterator<?> iter)
    Not null or empty.
    static boolean
    isEmpty(Map<?,?> m)
    Checks if is null or empty.
    static boolean
    Returns true if the given Collections contain exactly the same elements with exactly the same cardinalities.
    static boolean
    Returns true if the specified boolean is Boolean.FALSE, not null or Boolean.TRUE.
    static boolean
    Returns true if the specified boolean is null or Boolean.TRUE.
    static boolean
    Returns true if the specified boolean is null or Boolean.FALSE.
    static boolean
    Returns true if subColl is a proper sub-collection of coll, that is, if the cardinality of e in subColl is less than or equal to the cardinality of e in coll, for each element e in subColl, and there is at least one element f such that the cardinality of f in coll is strictly greater than the cardinality of f in subColl.
    static boolean
    isSorted(boolean[] a)
     
    static boolean
    isSorted(boolean[] a, int fromIndex, int toIndex)
     
    static boolean
    isSorted(byte[] a)
     
    static boolean
    isSorted(byte[] a, int fromIndex, int toIndex)
     
    static boolean
    isSorted(char[] a)
     
    static boolean
    isSorted(char[] a, int fromIndex, int toIndex)
     
    static boolean
    isSorted(double[] a)
     
    static boolean
    isSorted(double[] a, int fromIndex, int toIndex)
     
    static boolean
    isSorted(float[] a)
     
    static boolean
    isSorted(float[] a, int fromIndex, int toIndex)
     
    static boolean
    isSorted(int[] a)
     
    static boolean
    isSorted(int[] a, int fromIndex, int toIndex)
     
    static boolean
    isSorted(long[] a)
     
    static boolean
    isSorted(long[] a, int fromIndex, int toIndex)
     
    static boolean
    isSorted(short[] a)
     
    static boolean
    isSorted(short[] a, int fromIndex, int toIndex)
     
    static <T extends Comparable<? super T>>
    boolean
    isSorted(Collection<? extends T> c)
     
    static <T extends Comparable<? super T>>
    boolean
    isSorted(Collection<? extends T> c, int fromIndex, int toIndex)
     
    static <T> boolean
    isSorted(Collection<? extends T> c, int fromIndex, int toIndex, Comparator<? super T> cmp)
     
    static <T> boolean
    isSorted(Collection<? extends T> c, Comparator<? super T> cmp)
     
    static <T extends Comparable<? super T>>
    boolean
    isSorted(T[] a)
     
    static <T extends Comparable<? super T>>
    boolean
    isSorted(T[] a, int fromIndex, int toIndex)
     
    static <T> boolean
    isSorted(T[] a, int fromIndex, int toIndex, Comparator<? super T> cmp)
     
    static <T> boolean
    isSorted(T[] a, Comparator<? super T> cmp)
     
    static boolean
    isSubCollection(Collection<?> subColl, Collection<?> coll)
    Returns true if subColl is a sub-collection of coll, that is, if the cardinality of e in subColl is less than or equal to the cardinality of e in coll, for each element e in subColl.
    static boolean
    Returns true if the specified boolean is Boolean.TRUE, not null or Boolean.FALSE.
    static <T> Iterator<T>
    iterate(Iterable<? extends T> iterable)
    Returns an iterator over the elements in the specified iterable.
    static <T> ObjIterator<T>
    iterate(T[] a)
    Returns an iterator over the elements in the specified array.
    static <T> ObjIterator<T>
    iterate(T[] a, int fromIndex, int toIndex)
    Returns an iterator over the elements in the specified array, starting from the 'fromIndex' and ending before the 'toIndex'.
    static String
    Json 2 XML.
    static String
    json2Xml(String json, Class<?> transferType)
    Json 2 XML.
    static byte
    kthLargest(byte[] a, int k)
    Returns the kth largest element in the specified array/collection.
    static byte
    kthLargest(byte[] a, int fromIndex, int toIndex, int k)
    Returns the kth largest element in the specified array/collection within the given range.
    static char
    kthLargest(char[] a, int k)
    Returns the kth largest element in the specified array/collection.
    static char
    kthLargest(char[] a, int fromIndex, int toIndex, int k)
    Returns the kth largest element in the specified array/collection within the given range.
    static double
    kthLargest(double[] a, int k)
    Returns the kth largest element in the specified array/collection.
    static double
    kthLargest(double[] a, int fromIndex, int toIndex, int k)
    Returns the kth largest element in the specified array/collection within the given range.
    static float
    kthLargest(float[] a, int k)
    Returns the kth largest element in the specified array/collection.
    static float
    kthLargest(float[] a, int fromIndex, int toIndex, int k)
    Returns the kth largest element in the specified array/collection within the given range.
    static int
    kthLargest(int[] a, int k)
    Returns the kth largest element in the specified array/collection.
    static int
    kthLargest(int[] a, int fromIndex, int toIndex, int k)
    Returns the kth largest element in the specified array/collection within the given range.
    static long
    kthLargest(long[] a, int k)
    Returns the kth largest element in the specified array/collection.
    static long
    kthLargest(long[] a, int fromIndex, int toIndex, int k)
    Returns the kth largest element in the specified array/collection within the given range.
    static short
    kthLargest(short[] a, int k)
    Returns the kth largest element in the specified array/collection.
    static short
    kthLargest(short[] a, int fromIndex, int toIndex, int k)
    Returns the kth largest element in the specified array/collection within the given range.
    static <T extends Comparable<? super T>>
    T
    kthLargest(Collection<? extends T> c, int k)
    Returns the kth largest element in the specified array/collection.
    static <T extends Comparable<? super T>>
    T
    kthLargest(Collection<? extends T> c, int fromIndex, int toIndex, int k)
    Returns the kth largest element in the specified array/collection within the given range.
    static <T> T
    kthLargest(Collection<? extends T> c, int fromIndex, int toIndex, int k, Comparator<? super T> cmp)
    Returns the kth largest element in the specified array/collection within the given range.
    static <T> T
    kthLargest(Collection<? extends T> c, int k, Comparator<? super T> cmp)
    Returns the kth largest element in the specified array/collection.
    static <T extends Comparable<? super T>>
    T
    kthLargest(T[] a, int k)
    Returns the kth largest element in the specified array/collection.
    static <T extends Comparable<? super T>>
    T
    kthLargest(T[] a, int fromIndex, int toIndex, int k)
    Returns the kth largest element in the specified array/collection within the given range.
    static <T> T
    kthLargest(T[] a, int fromIndex, int toIndex, int k, Comparator<? super T> cmp)
    Returns the kth largest element in the specified array/collection within the given range.
    static <T> T
    kthLargest(T[] a, int k, Comparator<? super T> cmp)
    Returns the kth largest element in the specified array/collection.
    static <T> u.Nullable<T>
    lastElement(Iterable<? extends T> c)
    Returns the last element in the given Iterable wrapped in a Nullable.
    static <T> u.Nullable<T>
    lastElement(Iterator<? extends T> iter)
    Returns the last element in the given Iterator wrapped in a Nullable.
    static <T> List<T>
    lastElements(Iterable<? extends T> c, int n)
    Returns a list containing the last 'n' elements from the given Iterable.
    static <T> List<T>
    lastElements(Iterator<? extends T> iter, int n)
    Returns a list containing the last n elements from the given Iterator.
    static <K, V> u.Optional<Map.Entry<K,V>>
    lastEntry(Map<K,V> map)
     
    static int
    lastIndexOf(boolean[] a, boolean valueToFind)
    Last index of.
    static int
    lastIndexOf(boolean[] a, boolean valueToFind, int startIndexFromBack)
    Last index of.
    static int
    lastIndexOf(byte[] a, byte valueToFind)
    Last index of.
    static int
    lastIndexOf(byte[] a, byte valueToFind, int startIndexFromBack)
    Last index of.
    static int
    lastIndexOf(char[] a, char valueToFind)
    Last index of.
    static int
    lastIndexOf(char[] a, char valueToFind, int startIndexFromBack)
    Last index of.
    static int
    lastIndexOf(double[] a, double valueToFind)
    Last index of.
    static int
    lastIndexOf(double[] a, double valueToFind, double tolerance)
    Finds the last index of the given value within a given tolerance in the array.
    static int
    lastIndexOf(double[] a, double valueToFind, double tolerance, int startIndexFromBack)
    Finds the last index of the given value in the array starting at the given index.
    static int
    lastIndexOf(double[] a, double valueToFind, int startIndexFromBack)
    Last index of.
    static int
    lastIndexOf(float[] a, float valueToFind)
    Last index of.
    static int
    lastIndexOf(float[] a, float valueToFind, int startIndexFromBack)
    Last index of.
    static int
    lastIndexOf(int[] a, int valueToFind)
    Last index of.
    static int
    lastIndexOf(int[] a, int valueToFind, int startIndexFromBack)
    Last index of.
    static int
    lastIndexOf(long[] a, long valueToFind)
    Last index of.
    static int
    lastIndexOf(long[] a, long valueToFind, int startIndexFromBack)
    Last index of.
    static int
    lastIndexOf(short[] a, short valueToFind)
    Last index of.
    static int
    lastIndexOf(short[] a, short valueToFind, int startIndexFromBack)
    Last index of.
    static int
    lastIndexOf(Object[] a, Object valueToFind)
    Last index of.
    static int
    lastIndexOf(Object[] a, Object valueToFind, int startIndexFromBack)
    Last index of.
    static int
    lastIndexOf(Collection<?> c, Object valueToFind)
    Last index of.
    static int
    lastIndexOf(Collection<?> c, Object valueToFind, int startIndexFromBack)
    Last index of.
    static int
    lastIndexOfIgnoreCase(String[] a, String valueToFind)
     
    static int
    lastIndexOfIgnoreCase(String[] a, String valueToFind, int startIndexFromBack)
     
    static int
    lastIndexOfSubList(List<?> sourceList, List<?> subListToFind)
    Last index of sub list.
    static int
    lastIndexOfSubList(List<?> sourceList, List<?> subListToFind, int startIndexFromBack)
    Last index of sub list.
    static <T> u.Optional<T>
    lastNonNull(Iterable<? extends T> c)
    Returns the last non-null value from the provided iterable.
    static <T> u.Optional<T>
    lastNonNull(Iterator<? extends T> iter)
    Returns the last non-null value from the provided iterator.
    static <T> u.Optional<T>
    lastNonNull(T... a)
    Returns the last non-null value from the provided array of values.
    static <T> u.Optional<T>
    lastNonNull(T a, T b)
    Returns the last non-null value from the provided values.
    static <T> u.Optional<T>
    lastNonNull(T a, T b, T c)
    Returns the last non-null value from the provided values.
    static <T> T
    lastOrDefaultIfEmpty(Iterable<? extends T> c, T defaultValueForEmpty)
    Last or default if empty.
    static <T> T
    lastOrDefaultIfEmpty(Iterator<? extends T> iter, T defaultValueForEmpty)
    Last or default if empty.
    static <T> T
    lastOrDefaultIfEmpty(T[] a, T defaultValueForEmpty)
    Last or default if empty.
    static <T> T
    lastOrNullIfEmpty(Iterable<? extends T> c)
    Last or null if empty.
    static <T> T
    lastOrNullIfEmpty(Iterator<? extends T> iter)
    Last or null if empty.
    static <T> T
    Last or null if empty.
    static <T> Supplier<T>
    lazyInit(Supplier<T> supplier)
    Creates a lazy-initialized supplier from the provided supplier.
    static <T, E extends Exception>
    Throwables.Supplier<T,E>
    Creates a lazy-initialized supplier from the provided supplier.
    static int
    len(boolean[] a)
    Returns the length/size of the specified Array/Collection/Map, or 0 if it's empty or null.
    static int
    len(byte[] a)
    Returns the length/size of the specified Array/Collection/Map, or 0 if it's empty or null.
    static int
    len(char[] a)
    Returns the length/size of the specified Array/Collection/Map, or 0 if it's empty or null.
    static int
    len(double[] a)
    Returns the length/size of the specified Array/Collection/Map, or 0 if it's empty or null.
    static int
    len(float[] a)
    Returns the length/size of the specified Array/Collection/Map, or 0 if it's empty or null.
    static int
    len(int[] a)
    Returns the length/size of the specified Array/Collection/Map, or 0 if it's empty or null.
    static int
    len(long[] a)
    Returns the length/size of the specified Array/Collection/Map, or 0 if it's empty or null.
    static int
    len(short[] a)
    Returns the length/size of the specified Array/Collection/Map, or 0 if it's empty or null.
    static int
    Returns the length of the specified CharSequence, or 0 if it's empty or null.
    static int
    len(Object[] a)
    Returns the length/size of the specified Array/Collection/Map, or 0 if it's empty or null.
    static <T extends Comparable<? super T>>
    boolean
    lessEqual(T a, T b)
    Returns true is a <= b, otherwise false is returned.
    static <T> boolean
    lessEqual(T a, T b, Comparator<? super T> cmp)
    Returns true is a <= b, otherwise false is returned.
    static <T extends Comparable<? super T>>
    boolean
    lessThan(T a, T b)
    Returns true is a < b, otherwise false is returned.
    static <T> boolean
    lessThan(T a, T b, Comparator<? super T> cmp)
    Returns true is a < b, otherwise false is returned.
    static <T, R> List<R>
    map(Iterable<? extends T> c, Function<? super T,? extends R> mapper)
     
    static <T, R, C extends Collection<R>>
    C
    map(Iterable<? extends T> c, Function<? super T,? extends R> mapper, IntFunction<? extends C> supplier)
     
    static <T, R> List<R>
    map(Collection<? extends T> c, int fromIndex, int toIndex, Function<? super T,? extends R> mapper)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static <T, R, C extends Collection<R>>
    C
    map(Collection<? extends T> c, int fromIndex, int toIndex, Function<? super T,? extends R> mapper, IntFunction<? extends C> supplier)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static <T, R> List<R>
    map(T[] a, int fromIndex, int toIndex, Function<? super T,? extends R> mapper)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static <T, R, C extends Collection<R>>
    C
    map(T[] a, int fromIndex, int toIndex, Function<? super T,? extends R> mapper, IntFunction<? extends C> supplier)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static <T, R> List<R>
    map(T[] a, Function<? super T,? extends R> mapper)
    Transforms an array of elements into a list by applying a given function to each element.
    static <T, R, C extends Collection<R>>
    C
    map(T[] a, Function<? super T,? extends R> mapper, IntFunction<? extends C> supplier)
     
    static <T> boolean[]
    mapToBoolean(Collection<? extends T> c, int fromIndex, int toIndex, ToBooleanFunction<? super T> mapper)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static <T> boolean[]
    mapToBoolean(Collection<? extends T> c, ToBooleanFunction<? super T> mapper)
    Map to boolean.
    static <T> boolean[]
    mapToBoolean(T[] a, int fromIndex, int toIndex, ToBooleanFunction<? super T> mapper)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static <T> boolean[]
    mapToBoolean(T[] a, ToBooleanFunction<? super T> mapper)
    Map to boolean.
    static <T> byte[]
    mapToByte(Collection<? extends T> c, int fromIndex, int toIndex, ToByteFunction<? super T> mapper)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static <T> byte[]
    mapToByte(Collection<? extends T> c, ToByteFunction<? super T> mapper)
    Map to byte.
    static <T> byte[]
    mapToByte(T[] a, int fromIndex, int toIndex, ToByteFunction<? super T> mapper)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static <T> byte[]
    mapToByte(T[] a, ToByteFunction<? super T> mapper)
    Map to byte.
    static <T> char[]
    mapToChar(Collection<? extends T> c, int fromIndex, int toIndex, ToCharFunction<? super T> mapper)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static <T> char[]
    mapToChar(Collection<? extends T> c, ToCharFunction<? super T> mapper)
    Map to char.
    static <T> char[]
    mapToChar(T[] a, int fromIndex, int toIndex, ToCharFunction<? super T> mapper)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static <T> char[]
    mapToChar(T[] a, ToCharFunction<? super T> mapper)
    Map to char.
    static double[]
    mapToDouble(int[] a, IntToDoubleFunction mapper)
     
    static double[]
    mapToDouble(long[] a, LongToDoubleFunction mapper)
     
    static <T> double[]
    mapToDouble(Collection<? extends T> c, int fromIndex, int toIndex, ToDoubleFunction<? super T> mapper)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static <T> double[]
    mapToDouble(Collection<? extends T> c, ToDoubleFunction<? super T> mapper)
    Map to double.
    static <T> double[]
    mapToDouble(T[] a, int fromIndex, int toIndex, ToDoubleFunction<? super T> mapper)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static <T> double[]
    mapToDouble(T[] a, ToDoubleFunction<? super T> mapper)
    Map to double.
    static <T> float[]
    mapToFloat(Collection<? extends T> c, int fromIndex, int toIndex, ToFloatFunction<? super T> mapper)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static <T> float[]
    mapToFloat(Collection<? extends T> c, ToFloatFunction<? super T> mapper)
    Map to float.
    static <T> float[]
    mapToFloat(T[] a, int fromIndex, int toIndex, ToFloatFunction<? super T> mapper)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static <T> float[]
    mapToFloat(T[] a, ToFloatFunction<? super T> mapper)
    Map to float.
    static int[]
    mapToInt(double[] a, DoubleToIntFunction mapper)
     
    static int[]
    mapToInt(long[] a, LongToIntFunction mapper)
     
    static <T> int[]
    mapToInt(Collection<? extends T> c, int fromIndex, int toIndex, ToIntFunction<? super T> mapper)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static <T> int[]
    mapToInt(Collection<? extends T> c, ToIntFunction<? super T> mapper)
    Map to int.
    static <T> int[]
    mapToInt(T[] a, int fromIndex, int toIndex, ToIntFunction<? super T> mapper)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static <T> int[]
    mapToInt(T[] a, ToIntFunction<? super T> mapper)
    Map to int.
    static long[]
    mapToLong(double[] a, DoubleToLongFunction mapper)
     
    static long[]
    mapToLong(int[] a, IntToLongFunction mapper)
     
    static <T> long[]
    mapToLong(Collection<? extends T> c, int fromIndex, int toIndex, ToLongFunction<? super T> mapper)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static <T> long[]
    mapToLong(Collection<? extends T> c, ToLongFunction<? super T> mapper)
    Map to long.
    static <T> long[]
    mapToLong(T[] a, int fromIndex, int toIndex, ToLongFunction<? super T> mapper)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static <T> long[]
    mapToLong(T[] a, ToLongFunction<? super T> mapper)
    Map to long.
    static <T> short[]
    mapToShort(Collection<? extends T> c, int fromIndex, int toIndex, ToShortFunction<? super T> mapper)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static <T> short[]
    mapToShort(Collection<? extends T> c, ToShortFunction<? super T> mapper)
    Map to short.
    static <T> short[]
    mapToShort(T[] a, int fromIndex, int toIndex, ToShortFunction<? super T> mapper)
    Mostly it's designed for one-step operation to complete the operation in one step.
    static <T> short[]
    mapToShort(T[] a, ToShortFunction<? super T> mapper)
    Map to short.
    static byte
    max(byte... a)
    Returns the maximum value among the provided values.
    static byte
    max(byte[] a, int fromIndex, int toIndex)
    Returns the maximum value among the given range in the specified Array/Collection.
    static byte
    max(byte a, byte b)
    Returns the maximum value among the provided values.
    static byte
    max(byte a, byte b, byte c)
    Returns the maximum value among the provided values.
    static char
    max(char... a)
    Returns the maximum value among the provided values.
    static char
    max(char[] a, int fromIndex, int toIndex)
    Returns the maximum value among the given range in the specified Array/Collection.
    static char
    max(char a, char b)
    Returns the maximum value among the provided values.
    static char
    max(char a, char b, char c)
    Returns the maximum value among the provided values.
    static double
    max(double... a)
    Returns the maximum value among the provided values.
    static double
    max(double[] a, int fromIndex, int toIndex)
    Returns the maximum value among the given range in the specified Array/Collection.
    static double
    max(double a, double b)
    Returns the maximum value among the provided values.
    static double
    max(double a, double b, double c)
    Returns the maximum value among the provided values.
    static float
    max(float... a)
    Returns the maximum value among the provided values.
    static float
    max(float[] a, int fromIndex, int toIndex)
    Returns the maximum value among the given range in the specified Array/Collection.
    static float
    max(float a, float b)
    Returns the maximum value among the provided values.
    static float
    max(float a, float b, float c)
    Returns the maximum value among the provided values.
    static int
    max(int... a)
    Returns the maximum value among the provided values.
    static int
    max(int[] a, int fromIndex, int toIndex)
    Returns the maximum value among the given range in the specified Array/Collection.
    static int
    max(int a, int b)
    Returns the maximum value among the provided values.
    static int
    max(int a, int b, int c)
    Returns the maximum value among the provided values.
    static long
    max(long... a)
    Returns the maximum value among the provided values.
    static long
    max(long[] a, int fromIndex, int toIndex)
    Returns the maximum value among the given range in the specified Array/Collection.
    static long
    max(long a, long b)
    Returns the maximum value among the provided values.
    static long
    max(long a, long b, long c)
    Returns the maximum value among the provided values.
    static short
    max(short... a)
    Returns the maximum value among the provided values.
    static short
    max(short[] a, int fromIndex, int toIndex)
    Returns the maximum value among the given range in the specified Array/Collection.
    static short
    max(short a, short b)
    Returns the maximum value among the provided values.
    static short
    max(short a, short b, short c)
    Returns the maximum value among the provided values.
    static <T extends Comparable<? super T>>
    T
    max(Iterable<? extends T> c)
    Returns the maximum value among the provided values based on their natural ordering.
    static <T> T
    max(Iterable<? extends T> c, Comparator<? super T> cmp)
    Returns the maximum value among the provided values according to the provided comparator.
    static <T extends Comparable<? super T>>
    T
    max(Collection<? extends T> c, int fromIndex, int toIndex)
    Returns the minimum value among the given range in the specified Array/Collection based on their natural ordering.
    static <T> T
    max(Collection<? extends T> c, int fromIndex, int toIndex, Comparator<? super T> cmp)
    Returns the maximum value among the given range in the specified Array/Collection according to the provided comparator.
    static <T extends Comparable<? super T>>
    T
    max(Iterator<? extends T> iter)
    Returns the maximum value among the provided values based on their natural ordering.
    static <T> T
    max(Iterator<? extends T> iter, Comparator<? super T> cmp)
    Returns the maximum value among the provided values according to the provided comparator.
    static <T extends Comparable<? super T>>
    T
    max(T[] a)
    Returns the maximum value among the provided values based on their natural ordering.
    static <T extends Comparable<? super T>>
    T
    max(T[] a, int fromIndex, int toIndex)
    Returns the minimum value among the given range in the specified Array/Collection based on their natural ordering.
    static <T> T
    max(T[] a, int fromIndex, int toIndex, Comparator<? super T> cmp)
    Returns the maximum value among the given range in the specified Array/Collection according to the provided comparator.
    static <T> T
    max(T[] a, Comparator<? super T> cmp)
    Returns the maximum value among the provided values according to the provided comparator.
    static <T extends Comparable<? super T>>
    T
    max(T a, T b)
    Returns the maximum value among the provided values based on their natural ordering.
    static <T> T
    max(T a, T b, Comparator<? super T> cmp)
    Returns the maximum value among the provided values according to the provided comparator.
    static <T extends Comparable<? super T>>
    T
    max(T a, T b, T c)
    Returns the maximum value among the provided values based on their natural ordering.
    static <T> T
    max(T a, T b, T c, Comparator<? super T> cmp)
    Returns the maximum value among the provided values according to the provided comparator.
    static <T extends Comparable<? super T>>
    List<T>
    maxAll(Iterable<? extends T> c)
    Returns a list of all the maximum values in the provided values, based on their natural ordering.
    static <T> List<T>
    maxAll(Iterable<? extends T> c, Comparator<? super T> cmp)
    Returns a list of all the maximum values in the provided values, based on the provided comparator.
    static <T extends Comparable<? super T>>
    List<T>
    maxAll(Iterator<? extends T> iter)
    Returns a list of all the maximum values in the provided values, based on their natural ordering.
    static <T> List<T>
    maxAll(Iterator<? extends T> iter, Comparator<? super T> cmp)
    Returns a list of all the maximum values in the provided values, based on the provided comparator.
    static <T extends Comparable<? super T>>
    List<T>
    maxAll(T[] a)
    Returns a list of all the maximum values in the provided values, based on their natural ordering.
    static <T> List<T>
    maxAll(T[] a, Comparator<? super T> cmp)
    Returns a list of all the maximum values in the provided values, based on the provided comparator.
    static <T> double
    maxDoubleOrDefaultIfEmpty(Iterable<? extends T> c, ToDoubleFunction<? super T> valueExtractor, double defaultValue)
    Returns the maximum double value extracted from the specified iterable c by valueExtractor, or defaultValue if a is null or empty.
    static <T> double
    maxDoubleOrDefaultIfEmpty(Iterator<? extends T> iter, ToDoubleFunction<? super T> valueExtractor, double defaultValue)
    Returns the maximum double value extracted from the specified iterator iter by valueExtractor, or defaultValue if a is null or empty.
    static <T> double
    maxDoubleOrDefaultIfEmpty(T[] a, ToDoubleFunction<? super T> valueExtractor, double defaultValue)
    Returns the maximum double value extracted from the specified array a by valueExtractor, or defaultValue if a is null or empty.
    static <T> int
    maxIntOrDefaultIfEmpty(Iterable<? extends T> c, ToIntFunction<? super T> valueExtractor, int defaultValue)
    Returns the maximum int value extracted from the specified iterable c by valueExtractor, or defaultValue if a is null or empty.
    static <T> int
    maxIntOrDefaultIfEmpty(Iterator<? extends T> iter, ToIntFunction<? super T> valueExtractor, int defaultValue)
    Returns the maximum int value extracted from the specified iterator iter by valueExtractor, or defaultValue if a is null or empty.
    static <T> int
    maxIntOrDefaultIfEmpty(T[] a, ToIntFunction<? super T> valueExtractor, int defaultValue)
    Returns the maximum int value extracted from the specified array a by valueExtractor, or defaultValue if a is null or empty.
    static <T> long
    maxLongOrDefaultIfEmpty(Iterable<? extends T> c, ToLongFunction<? super T> valueExtractor, long defaultValue)
    Returns the maximum long value extracted from the specified iterable c by valueExtractor, or defaultValue if a is null or empty.
    static <T> long
    maxLongOrDefaultIfEmpty(Iterator<? extends T> iter, ToLongFunction<? super T> valueExtractor, long defaultValue)
    Returns the maximum long value extracted from the specified iterator iter by valueExtractor, or defaultValue if a is null or empty.
    static <T> long
    maxLongOrDefaultIfEmpty(T[] a, ToLongFunction<? super T> valueExtractor, long defaultValue)
    Returns the maximum long value extracted from the specified array a by valueExtractor, or defaultValue if a is null or empty.
    static <T, R extends Comparable<? super R>>
    R
    maxOrDefaultIfEmpty(Iterable<? extends T> c, Function<? super T,? extends R> valueExtractor, R defaultValue)
    Returns the maximum value extracted from the specified collection c by valueExtractor, or defaultValue if c is null or empty.
    static <T, R extends Comparable<? super R>>
    R
    maxOrDefaultIfEmpty(Iterator<? extends T> iter, Function<? super T,? extends R> valueExtractor, R defaultValue)
    Returns the maximum value extracted from the specified iterator iter by valueExtractor, or defaultValue if iter is null or empty.
    static <T, R extends Comparable<? super R>>
    R
    maxOrDefaultIfEmpty(T[] a, Function<? super T,? extends R> valueExtractor, R defaultValue)
    Returns the maximum value extracted from the specified array a by valueExtractor, or defaultValue if a is null or empty.
    static byte
    median(byte... a)
    Returns the length / 2 + 1 largest value in the specified array.
    static byte
    median(byte[] a, int fromIndex, int toIndex)
    Returns the median of the specified values within the given range
    static byte
    median(byte a, byte b, byte c)
    Returns the median of provided values.
    static char
    median(char... a)
    Returns the length / 2 + 1 largest value in the specified array.
    static char
    median(char[] a, int fromIndex, int toIndex)
    Returns the median of the specified values within the given range
    static char
    median(char a, char b, char c)
    Returns the median of provided values.
    static double
    median(double... a)
    Returns the length / 2 + 1 largest value in the specified array.
    static double
    median(double[] a, int fromIndex, int toIndex)
    Returns the median of the specified values within the given range
    static double
    median(double a, double b, double c)
    Returns the median of provided values.
    static float
    median(float... a)
    Returns the length / 2 + 1 largest value in the specified array.
    static float
    median(float[] a, int fromIndex, int toIndex)
    Returns the median of the specified values within the given range
    static float
    median(float a, float b, float c)
    Returns the median of provided values.
    static int
    median(int... a)
    Returns the length / 2 + 1 largest value in the specified array.
    static int
    median(int[] a, int fromIndex, int toIndex)
    Returns the median of the specified values within the given range
    static int
    median(int a, int b, int c)
    Returns the median of provided values.
    static long
    median(long... a)
    Returns the length / 2 + 1 largest value in the specified array.
    static long
    median(long[] a, int fromIndex, int toIndex)
    Returns the median of the specified values within the given range
    static long
    median(long a, long b, long c)
    Returns the median of provided values.
    static short
    median(short... a)
    Returns the length / 2 + 1 largest value in the specified array.
    static short
    median(short[] a, int fromIndex, int toIndex)
    Returns the median of the specified values within the given range
    static short
    median(short a, short b, short c)
    Returns the median of provided values.
    static <T extends Comparable<? super T>>
    T
    median(Collection<? extends T> c)
    Returns the length / 2 + 1 largest value in the provided values based on the provided comparator.
    static <T extends Comparable<? super T>>
    T
    median(Collection<? extends T> c, int fromIndex, int toIndex)
    Returns the median of the specified values within the given range
    static <T> T
    median(Collection<? extends T> c, int fromIndex, int toIndex, Comparator<? super T> cmp)
    Returns the median of the specified values within the given range based on the provided comparator.
    static <T> T
    median(Collection<? extends T> c, Comparator<? super T> cmp)
    Returns the length / 2 + 1 largest value in the provided values based on the provided comparator.
    static <T extends Comparable<? super T>>
    T
    median(T[] a)
    Returns the length / 2 + 1 largest value in the specified array.
    static <T extends Comparable<? super T>>
    T
    median(T[] a, int fromIndex, int toIndex)
    Returns the median of the specified values within the given range
    static <T> T
    median(T[] a, int fromIndex, int toIndex, Comparator<? super T> cmp)
    Returns the median of the specified values within the given range based on the provided comparator.
    static <T> T
    median(T[] a, Comparator<? super T> cmp)
    Returns the length / 2 + 1 largest value in the provided values based on the provided comparator.
    static <T extends Comparable<? super T>>
    T
    median(T a, T b, T c)
    Returns the median of provided values.
    static <T> T
    median(T a, T b, T c, Comparator<? super T> cmp)
    Returns the median of the provided values based on the provided comparator.
    static DataSet
    Merges two given DataSets into a single DataSet.
    static DataSet
    Merges three given DataSets into a single DataSet.
    static <T> List<T>
    merge(Iterable<? extends T> a, Iterable<? extends T> b, BiFunction<? super T,? super T,MergeResult> nextSelector)
     
    static <T> T
    merge(Object sourceBean, T targetBean)
    Merges the properties from the source object into the target object.
    static <T> T
    merge(Object sourceBean, T targetBean, boolean ignoreUnmatchedProperty, Set<String> ignoredPropNames)
    Merges the properties from the source object into the target object, except the properties specified in the ignoredPropNames set.
    static <T> T
    merge(Object sourceBean, T targetBean, boolean ignoreUnmatchedProperty, Set<String> ignoredPropNames, BinaryOperator<?> mergeFunc)
    Merges the properties from the source object into the target object using the specified merge function, except the properties specified in the ignoredPropNames set.
    static <T> T
    merge(Object sourceBean, T targetBean, Collection<String> selectPropNames)
    Merges the selected properties from the source object into the target object.
    static <T> T
    merge(Object sourceBean, T targetBean, Collection<String> selectPropNames, BinaryOperator<?> mergeFunc)
    Merges the selected properties from the source object into the target object using the specified merge function.
    static <T> T
    merge(Object sourceBean, T targetBean, Collection<String> selectPropNames, Function<String,String> propNameConverter)
    Merges the selected properties from the source object into the target object.
    static <T> T
    merge(Object sourceBean, T targetBean, Collection<String> selectPropNames, Function<String,String> propNameConverter, BinaryOperator<?> mergeFunc)
    Merges the selected properties from the source object into the target object using the specified merge function.
    static <T> T
    merge(Object sourceBean, T targetBean, BinaryOperator<?> mergeFunc)
    Merges the properties from the source object into the target object using the specified merge function.
    static <T> T
    merge(Object sourceBean, T targetBean, BiPredicate<? super String,?> propFilter)
    Merges the filtered properties from the source object into the target object, The source object's properties will overwrite the same properties in the target object.
    static <T> T
    merge(Object sourceBean, T targetBean, BiPredicate<? super String,?> propFilter, BinaryOperator<?> mergeFunc)
    Merges the filtered properties from the source object into the target object using the specified merge function.
    static <T> T
    merge(Object sourceBean, T targetBean, BiPredicate<? super String,?> propFilter, Function<String,String> propNameConverter)
    Merges the filtered properties from the source object into the target object using the specified merge function.
    static <T> T
    merge(Object sourceBean, T targetBean, BiPredicate<? super String,?> propFilter, Function<String,String> propNameConverter, BinaryOperator<?> mergeFunc)
    Merges the filtered properties from the source object into the target object using the specified merge function.
    static <T> T
    merge(Object sourceBean, T targetBean, Function<String,String> propNameConverter, BinaryOperator<?> mergeFunc)
    Merges the properties from the source object into the target object using the specified merge function.
    static DataSet
    merge(Collection<? extends DataSet> dss)
    Merges a collection of DataSets into a single DataSet.
    static DataSet
    merge(Collection<? extends DataSet> dss, boolean requiresSameColumns)
    Merges a collection of DataSets into a single DataSet.
    static <T> List<T>
    merge(Collection<? extends Iterable<? extends T>> c, BiFunction<? super T,? super T,MergeResult> nextSelector)
     
    static <T, C extends Collection<T>>
    C
    merge(Collection<? extends Iterable<? extends T>> c, BiFunction<? super T,? super T,MergeResult> nextSelector, IntFunction<? extends C> supplier)
     
    static <T> List<T>
    merge(T[] a, T[] b, BiFunction<? super T,? super T,MergeResult> nextSelector)
     
    static byte
    min(byte... a)
    Returns the minimum value among the provided values.
    static byte
    min(byte[] a, int fromIndex, int toIndex)
    Returns the minimum value among the given range in the specified Array/Collection.
    static byte
    min(byte a, byte b)
    Returns the minimum value among the provided values.
    static byte
    min(byte a, byte b, byte c)
    Returns the minimum value among the provided values.
    static char
    min(char... a)
    Returns the minimum value among the provided values.
    static char
    min(char[] a, int fromIndex, int toIndex)
    Returns the minimum value among the given range in the specified Array/Collection.
    static char
    min(char a, char b)
    Returns the minimum value among the provided values.
    static char
    min(char a, char b, char c)
    Returns the minimum value among the provided values.
    static double
    min(double... a)
    Returns the minimum value among the provided values.
    static double
    min(double[] a, int fromIndex, int toIndex)
    Returns the minimum value among the given range in the specified Array/Collection.
    static double
    min(double a, double b)
    Returns the minimum value among the provided values.
    static double
    min(double a, double b, double c)
    Returns the minimum value among the provided values.
    static float
    min(float... a)
    Returns the minimum value among the provided values.
    static float
    min(float[] a, int fromIndex, int toIndex)
    Returns the minimum value among the given range in the specified Array/Collection.
    static float
    min(float a, float b)
    Returns the minimum value among the provided values.
    static float
    min(float a, float b, float c)
    Returns the minimum value among the provided values.
    static int
    min(int... a)
    Returns the minimum value among the provided values.
    static int
    min(int[] a, int fromIndex, int toIndex)
    Returns the minimum value among the given range in the specified Array/Collection.
    static int
    min(int a, int b)
    Returns the minimum value among the provided values.
    static int
    min(int a, int b, int c)
    Returns the minimum value among the provided values.
    static long
    min(long... a)
    Returns the minimum value among the provided values.
    static long
    min(long[] a, int fromIndex, int toIndex)
    Returns the minimum value among the given range in the specified Array/Collection.
    static long
    min(long a, long b)
    Returns the minimum value among the provided values.
    static long
    min(long a, long b, long c)
    Returns the minimum value among the provided values.
    static short
    min(short... a)
    Returns the minimum value among the provided values.
    static short
    min(short[] a, int fromIndex, int toIndex)
    Returns the minimum value among the given range in the specified Array/Collection.
    static short
    min(short a, short b)
    Returns the minimum value among the provided values.
    static short
    min(short a, short b, short c)
    Returns the minimum value among the provided values.
    static <T extends Comparable<? super T>>
    T
    min(Iterable<? extends T> c)
    Returns the minimum value among the provided values based on their natural ordering.
    static <T> T
    min(Iterable<? extends T> c, Comparator<? super T> cmp)
    Returns the minimum value among the provided values according to the provided comparator.
    static <T extends Comparable<? super T>>
    T
    min(Collection<? extends T> c, int fromIndex, int toIndex)
    Returns the minimum value among the given range in the specified Array/Collection based on their natural ordering.
    static <T> T
    min(Collection<? extends T> c, int fromIndex, int toIndex, Comparator<? super T> cmp)
    Returns the minimum value among the given range in the specified Array/Collection according to the provided comparator.
    static <T extends Comparable<? super T>>
    T
    min(Iterator<? extends T> iter)
    Returns the minimum value among the provided values based on their natural ordering.
    static <T> T
    min(Iterator<? extends T> iter, Comparator<? super T> cmp)
    Returns the minimum value among the provided values according to the provided comparator.
    static <T extends Comparable<? super T>>
    T
    min(T[] a)
    Returns the minimum value among the provided values based on their natural ordering.
    static <T extends Comparable<? super T>>
    T
    min(T[] a, int fromIndex, int toIndex)
    Returns the minimum value among the given range in the specified Array/Collection based on their natural ordering.
    static <T> T
    min(T[] a, int fromIndex, int toIndex, Comparator<? super T> cmp)
    Returns the minimum value among the given range in the specified Array/Collection according to the provided comparator.
    static <T> T
    min(T[] a, Comparator<? super T> cmp)
    Returns the minimum value among the provided values according to the provided comparator.
    static <T extends Comparable<? super T>>
    T
    min(T a, T b)
    Returns the minimum value among the provided values based on their natural ordering.
    static <T> T
    min(T a, T b, Comparator<? super T> cmp)
    Returns the minimum value among the provided values according to the provided comparator.
    static <T extends Comparable<? super T>>
    T
    min(T a, T b, T c)
    Returns the minimum value among the three provided values based on their natural ordering.
    static <T> T
    min(T a, T b, T c, Comparator<? super T> cmp)
    Returns the minimum value among the provided values according to the provided comparator.
    static <T extends Comparable<? super T>>
    List<T>
    minAll(Iterable<? extends T> c)
    Returns a list of all the minimum values in the provided values, based on their natural ordering.
    static <T> List<T>
    minAll(Iterable<? extends T> c, Comparator<? super T> cmp)
    Returns a list of all the minimum values in the provided array, based on the provided comparator.
    static <T extends Comparable<? super T>>
    List<T>
    minAll(Iterator<? extends T> iter)
    Returns a list of all the minimum values in the provided values, based on their natural ordering.
    static <T> List<T>
    minAll(Iterator<? extends T> iter, Comparator<? super T> cmp)
    Returns a list of all the minimum values in the provided array, based on the provided comparator.
    static <T extends Comparable<? super T>>
    List<T>
    minAll(T[] a)
    Returns a list of all the minimum values in the provided values, based on their natural ordering.
    static <T> List<T>
    minAll(T[] a, Comparator<? super T> cmp)
    Returns a list of all the minimum values in the provided array, based on the provided comparator.
    static <T> double
    minDoubleOrDefaultIfEmpty(Iterable<? extends T> c, ToDoubleFunction<? super T> valueExtractor, double defaultValue)
    Returns the minimum double value extracted from the specified iterable c by valueExtractor, or defaultValue if a is null or empty.
    static <T> double
    minDoubleOrDefaultIfEmpty(Iterator<? extends T> iter, ToDoubleFunction<? super T> valueExtractor, double defaultValue)
    Returns the minimum double value extracted from the specified iterator iter by valueExtractor, or defaultValue if a is null or empty.
    static <T> double
    minDoubleOrDefaultIfEmpty(T[] a, ToDoubleFunction<? super T> valueExtractor, double defaultValue)
    Returns the minimum double value extracted from the specified array a by valueExtractor, or defaultValue if a is null or empty.
    static <T> int
    minIntOrDefaultIfEmpty(Iterable<? extends T> c, ToIntFunction<? super T> valueExtractor, int defaultValue)
    Returns the minimum int value extracted from the specified iterable c by valueExtractor, or defaultValue if a is null or empty.
    static <T> int
    minIntOrDefaultIfEmpty(Iterator<? extends T> iter, ToIntFunction<? super T> valueExtractor, int defaultValue)
    Returns the minimum int value extracted from the specified iterator iter by valueExtractor, or defaultValue if a is null or empty.
    static <T> int
    minIntOrDefaultIfEmpty(T[] a, ToIntFunction<? super T> valueExtractor, int defaultValue)
    Returns the minimum int value extracted from the specified array a by valueExtractor, or defaultValue if a is null or empty.
    static <T> long
    minLongOrDefaultIfEmpty(Iterable<? extends T> c, ToLongFunction<? super T> valueExtractor, long defaultValue)
    Returns the minimum long value extracted from the specified iterable c by valueExtractor, or defaultValue if a is null or empty.
    static <T> long
    minLongOrDefaultIfEmpty(Iterator<? extends T> iter, ToLongFunction<? super T> valueExtractor, long defaultValue)
    Returns the minimum long value extracted from the specified iterator iter by valueExtractor, or defaultValue if a is null or empty.
    static <T> long
    minLongOrDefaultIfEmpty(T[] a, ToLongFunction<? super T> valueExtractor, long defaultValue)
    Returns the minimum long value extracted from the specified array a by valueExtractor, or defaultValue if a is null or empty.
    static <T extends Comparable<? super T>>
    Pair<T,T>
    minMax(Iterable<? extends T> c)
    Returns a pair of the minimum and maximum values in the specified Iterable.
    static <T> Pair<T,T>
    minMax(Iterable<? extends T> c, Comparator<? super T> cmp)
    Returns a pair of the minimum and maximum values in the specified Iterable, based on the provided comparator.
    static <T extends Comparable<? super T>>
    Pair<T,T>
    minMax(Iterator<? extends T> iter)
    Returns a pair of the minimum and maximum values in the specified Iterator.
    static <T> Pair<T,T>
    minMax(Iterator<? extends T> iter, Comparator<? super T> cmp)
    Returns a pair of the minimum and maximum values in the specified Iterator, based on the provided comparator.
    static <T extends Comparable<? super T>>
    Pair<T,T>
    minMax(T[] a)
    Returns a pair of the minimum and maximum values in the specified array.
    static <T> Pair<T,T>
    minMax(T[] a, Comparator<? super T> cmp)
    Returns a pair of the minimum and maximum values in the specified array, based on the provided comparator.
    static <T, R extends Comparable<? super R>>
    R
    minOrDefaultIfEmpty(Iterable<? extends T> c, Function<? super T,? extends R> valueExtractor, R defaultValue)
    Returns the minimum value extracted from the specified collection c by valueExtractor, or defaultValue if c is null or empty.
    static <T, R extends Comparable<? super R>>
    R
    minOrDefaultIfEmpty(Iterator<? extends T> iter, Function<? super T,? extends R> valueExtractor, R defaultValue)
    Returns the minimum value extracted from the specified iterator iter by valueExtractor, or defaultValue if iter is null or empty.
    static <T, R extends Comparable<? super R>>
    R
    minOrDefaultIfEmpty(T[] a, Function<? super T,? extends R> valueExtractor, R defaultValue)
    Returns the minimum value extracted from the specified array a by valueExtractor, or defaultValue if a is null or empty.
    static int
    mismatch(boolean[] a, boolean[] b)
    Finds and returns the index of the first mismatch between two arrays.
    static int
    mismatch(boolean[] a, int fromIndexA, boolean[] b, int fromIndexB, int len)
    Finds and returns the index of the first mismatch between two boolean arrays starting from specified indices.
    static int
    mismatch(byte[] a, byte[] b)
    Finds and returns the index of the first mismatch between two arrays.
    static int
    mismatch(byte[] a, int fromIndexA, byte[] b, int fromIndexB, int len)
    Finds and returns the index of the first mismatch between two byte arrays starting from specified indices.
    static int
    mismatch(char[] a, char[] b)
    Finds and returns the index of the first mismatch between two arrays.
    static int
    mismatch(char[] a, int fromIndexA, char[] b, int fromIndexB, int len)
    Finds and returns the index of the first mismatch between two char arrays starting from specified indices.
    static int
    mismatch(double[] a, double[] b)
    Finds and returns the index of the first mismatch between two arrays.
    static int
    mismatch(double[] a, int fromIndexA, double[] b, int fromIndexB, int len)
    Finds and returns the index of the first mismatch between two double arrays starting from specified indices.
    static int
    mismatch(float[] a, float[] b)
    Finds and returns the index of the first mismatch between two arrays.
    static int
    mismatch(float[] a, int fromIndexA, float[] b, int fromIndexB, int len)
    Finds and returns the index of the first mismatch between two float arrays starting from specified indices.
    static int
    mismatch(int[] a, int[] b)
    Finds and returns the index of the first mismatch between two arrays.
    static int
    mismatch(int[] a, int fromIndexA, int[] b, int fromIndexB, int len)
    Finds and returns the index of the first mismatch between two int arrays starting from specified indices.
    static int
    mismatch(long[] a, int fromIndexA, long[] b, int fromIndexB, int len)
    Finds and returns the index of the first mismatch between two long arrays starting from specified indices.
    static int
    mismatch(long[] a, long[] b)
    Finds and returns the index of the first mismatch between two arrays.
    static int
    mismatch(short[] a, int fromIndexA, short[] b, int fromIndexB, int len)
    Finds and returns the index of the first mismatch between two short arrays starting from specified indices.
    static int
    mismatch(short[] a, short[] b)
    Finds and returns the index of the first mismatch between two arrays.
    static <T extends Comparable<? super T>>
    int
    mismatch(Iterable<T> a, Iterable<T> b)
    Finds and returns the index of the first mismatch between two iterables.
    static <T> int
    mismatch(Iterable<T> a, Iterable<T> b, Comparator<? super T> cmp)
    Finds and returns the index of the first mismatch between two iterables using the specified comparator.
    static <T> int
    mismatch(Collection<T> a, int fromIndexA, Collection<T> b, int fromIndexB, int len)
    Finds and returns the index of the first mismatch between two collections starting from specified indices.
    static <T> int
    mismatch(Collection<T> a, int fromIndexA, Collection<T> b, int fromIndexB, int len, Comparator<? super T> cmp)
    Finds and returns the index of the first mismatch between two collections starting from specified indices.
    static <T extends Comparable<? super T>>
    int
    mismatch(Iterator<T> a, Iterator<T> b)
    Finds and returns the index of the first mismatch between two iterators.
    static <T> int
    mismatch(Iterator<T> a, Iterator<T> b, Comparator<? super T> cmp)
    Finds and returns the index of the first mismatch between two iterators using the specified comparator.
    static <T extends Comparable<? super T>>
    int
    mismatch(T[] a, int fromIndexA, T[] b, int fromIndexB, int len)
    Finds and returns the index of the first mismatch between two arrays starting from specified indices.
    static <T> int
    mismatch(T[] a, int fromIndexA, T[] b, int fromIndexB, int len, Comparator<? super T> cmp)
    Finds and returns the index of the first mismatch between two arrays starting from specified indices.
    static <T extends Comparable<? super T>>
    int
    mismatch(T[] a, T[] b)
    Finds and returns the index of the first mismatch between two arrays.
    static <T> int
    mismatch(T[] a, T[] b, Comparator<? super T> cmp)
    Finds and returns the index of the first mismatch between two arrays.
    static void
    moveRange(boolean[] a, int fromIndex, int toIndex, int newPositionStartIndex)
    Moves a range of elements in the given array to a new position within the array.
    static void
    moveRange(byte[] a, int fromIndex, int toIndex, int newPositionStartIndex)
    Moves a range of elements in the given array to a new position within the array.
    static void
    moveRange(char[] a, int fromIndex, int toIndex, int newPositionStartIndex)
    Moves a range of elements in the given array to a new position within the array.
    static void
    moveRange(double[] a, int fromIndex, int toIndex, int newPositionStartIndex)
    Moves a range of elements in the given array to a new position within the array.
    static void
    moveRange(float[] a, int fromIndex, int toIndex, int newPositionStartIndex)
    Moves a range of elements in the given array to a new position within the array.
    static void
    moveRange(int[] a, int fromIndex, int toIndex, int newPositionStartIndex)
    Moves a range of elements in the given array to a new position within the array.
    static void
    moveRange(long[] a, int fromIndex, int toIndex, int newPositionStartIndex)
    Moves a range of elements in the given array to a new position within the array.
    static void
    moveRange(short[] a, int fromIndex, int toIndex, int newPositionStartIndex)
    Moves a range of elements in the given array to a new position within the array.
    static String
    moveRange(String str, int fromIndex, int toIndex, int newPositionStartIndex)
    Returns a new string with the specified range moved to the new position.
    static <T> boolean
    moveRange(List<T> c, int fromIndex, int toIndex, int newPositionStartIndex)
    Moves a range of elements in the given list to a new position within the list.
    static <T> void
    moveRange(T[] a, int fromIndex, int toIndex, int newPositionStartIndex)
    Moves a range of elements in the given array to a new position within the array.
    static void
    negate(boolean[] a)
    Negates boolean values in the specified boolean array
    static void
    negate(boolean[] a, int fromIndex, int toIndex)
    Negates boolean values fromIndex to toIndex in the specified boolean array
    static Boolean
    Note: copied from Apache commons Lang under Apache license v2.0
    static <T> T
    newArray(Class<?> componentType, int length)
     
    static <T> T
    newArray(Class<?> componentType, int... dimensions)
     
    static <T> ArrayDeque<T>
    New array deque.
    static <T> ArrayDeque<T>
    newArrayDeque(int numElements)
    Constructs an empty array deque with an initial capacity sufficient to hold the specified number of elements.
    static <E> ArrayDeque<E>
    newArrayDeque(Collection<? extends E> c)
    Constructs a deque containing the elements of the specified collection, in the order they are returned by the collection's iterator.
    static <T> ArrayList<T>
    New array list.
    static <T> ArrayList<T>
    newArrayList(int initialCapacity)
    New array list.
    static <T> ArrayList<T>
    newArrayList(Collection<? extends T> c)
    New array list.
    static <T> T
    newBean(Class<T> targetType)
     
    static <T> T
    newBean(Class<T> targetType, String beanName)
     
    static <K, V> BiMap<K,V>
    New bi map.
    static <K, V> BiMap<K,V>
    newBiMap(int initialCapacity)
    New bi map.
    static <K, V> BiMap<K,V>
    newBiMap(int initialCapacity, float loadFactor)
    New bi map.
    static <K, V> BiMap<K,V>
    newBiMap(Class<? extends Map> keyMapType, Class<? extends Map> valueMapType)
    New bi map.
    static <K, V> BiMap<K,V>
    newBiMap(Supplier<? extends Map<K,V>> keyMapSupplier, Supplier<? extends Map<V,K>> valueMapSupplier)
    New bi map.
    static <T> Collection<T>
    newCollection(Class<? extends Collection> targetType)
     
    static <T> Collection<T>
    newCollection(Class<? extends Collection> targetType, int size)
     
    static <K, V> ConcurrentHashMap<K,V>
    New concurrent hash map.
    static <K, V> ConcurrentHashMap<K,V>
    newConcurrentHashMap(int initialCapacity)
    New concurrent hash map.
    static <K, V> ConcurrentHashMap<K,V>
    newConcurrentHashMap(Map<? extends K,? extends V> m)
    New concurrent hash map.
    static <T> Set<T>
    New hash set.
    static <T> Set<T>
    newConcurrentHashSet(int initialCapacity)
    New hash set.
    static <T> Set<T>
    New hash set.
    static DataSet
    newDataSet(String keyColumnName, String valueColumnName, Map<?,?> m)
    Creates a new DataSet from the provided Map.
    static DataSet
    newDataSet(String columnName, Collection<?> column)
    Creates a new DataSet with single column from the provided Collection.
    static DataSet
    Creates a new DataSet with the specified rows.
    static DataSet
    newDataSet(Collection<?> rows, Map<String,Object> properties)
    Creates a new DataSet with the specified rows and properties.
    static DataSet
    newDataSet(Collection<String> columnNames, Object[][] rowList)
    Creates a new DataSet with the specified column names and rows.
    static DataSet
    newDataSet(Collection<String> columnNames, Collection<?> rows)
    Creates a new DataSet with the specified column names and rows.
    static DataSet
    newDataSet(Collection<String> columnNames, Collection<?> rows, Map<String,Object> properties)
    Creates a new DataSet with the specified column names, rows, and properties.
    static <C extends Collection<?>>
    DataSet
    Creates a new DataSet from the provided Map.
    static DataSet
    Creates a new empty DataSet.
    static DataSet
    Creates a new empty DataSet with the specified column names.
    static DataSet
    newEmptyDataSet(Collection<String> columnNames, Map<String,Object> properties)
    Creates a new empty DataSet with the specified column names and properties.
    static <K, V> Map.Entry<K,V>
    newEntry(K key, V value)
     
    static <K, V> Map<K,V>
    New hash map.
    static <K, V> Map<K,V>
    newHashMap(int initialCapacity)
    New hash map.
    static <K, V> Map<K,V>
    newHashMap(Collection<? extends V> c, Function<? super V,? extends K> keyMapper)
    New hash map.
    static <K, V> Map<K,V>
    newHashMap(Map<? extends K,? extends V> m)
    New hash map.
    static <T> Set<T>
    New hash set.
    static <T> Set<T>
    newHashSet(int initialCapacity)
    New hash set.
    static <T> Set<T>
    newHashSet(Collection<? extends T> c)
    New hash set.
    static <K, V> IdentityHashMap<K,V>
    New identity hash map.
    static <K, V> IdentityHashMap<K,V>
    newIdentityHashMap(int initialCapacity)
    New identity hash map.
    static <K, V> IdentityHashMap<K,V>
    newIdentityHashMap(Map<? extends K,? extends V> m)
    New identity hash map.
    static <K, V> ImmutableEntry<K,V>
    newImmutableEntry(K key, V value)
    New immutable/unmodifiable entry.
    static <T> T
     
    static <K, V> Map<K,V>
    New linked hash map.
    static <K, V> Map<K,V>
    newLinkedHashMap(int initialCapacity)
    New linked hash map.
    static <K, V> Map<K,V>
    newLinkedHashMap(Collection<? extends V> c, Function<? super V,? extends K> keyMapper)
    New linked hash map.
    static <K, V> Map<K,V>
    newLinkedHashMap(Map<? extends K,? extends V> m)
    New linked hash map.
    static <T> Set<T>
    New linked hash set.
    static <T> Set<T>
    newLinkedHashSet(int initialCapacity)
    New linked hash set.
    static <T> Set<T>
    newLinkedHashSet(Collection<? extends T> c)
    New linked hash set.
    static <T> LinkedList<T>
    New linked list.
    static <T> LinkedList<T>
    newLinkedList(Collection<? extends T> c)
    New linked list.
    static <K, E> ListMultimap<K,E>
    Returns a ListMultimap backed by LinkedHashMap.
    static <K, E> ListMultimap<K,E>
    newLinkedListMultimap(int initialCapacity)
    Returns a ListMultimap backed by LinkedHashMap.
    static <K, E> ListMultimap<K,E>
    newLinkedListMultimap(Map<? extends K,? extends E> m)
    Returns a ListMultimap backed by LinkedHashMap.
    static <K, E> SetMultimap<K,E>
    Returns a SetMultimap backed by LinkedHashMap.
    static <K, E> SetMultimap<K,E>
    newLinkedSetMultimap(int initialCapacity)
    Returns a SetMultimap backed by LinkedHashMap.
    static <K, E> SetMultimap<K,E>
    newLinkedSetMultimap(Map<? extends K,? extends E> m)
    Returns a SetMultimap backed by LinkedHashMap.
    static <K, E> ListMultimap<K,E>
    New list multimap.
    static <K, E> ListMultimap<K,E>
    newListMultimap(int initialCapacity)
    New list multimap.
    static <K, E> ListMultimap<K,E>
    newListMultimap(Class<? extends Map> mapType)
    New list multimap.
    static <K, E> ListMultimap<K,E>
    newListMultimap(Class<? extends Map> mapType, Class<? extends List> valueType)
    New list multimap.
    static <T, K> ListMultimap<K,T>
    newListMultimap(Collection<? extends T> c, Function<? super T,? extends K> keyMapper)
     
    static <T, K, E> ListMultimap<K,E>
    newListMultimap(Collection<? extends T> c, Function<? super T,? extends K> keyMapper, Function<? super T,? extends E> valueExtractor)
     
    static <K, E> ListMultimap<K,E>
    newListMultimap(Supplier<? extends Map<K,List<E>>> mapSupplier, Supplier<? extends List<E>> valueSupplier)
    New list multimap.
    static <K, E> ListMultimap<K,E>
    newListMultimap(Map<? extends K,? extends E> m)
    New list multimap.
    static <K, V> Map<K,V>
    newMap(Class<? extends Map> targetType)
     
    static <K, V> Map<K,V>
    newMap(Class<? extends Map> targetType, int size)
     
    static <K, E, V extends Collection<E>>
    Multimap<K,E,V>
    newMultimap(Supplier<? extends Map<K,V>> mapSupplier, Supplier<? extends V> valueSupplier)
     
    static <T> Multiset<T>
     
    static <T> Multiset<T>
    newMultiset(int initialCapacity)
     
    static <T> Multiset<T>
    newMultiset(Class<? extends Map> valueMapType)
     
    static <T> Multiset<T>
    newMultiset(Collection<? extends T> c)
     
    static <T> Multiset<T>
    newMultiset(Supplier<? extends Map<T,?>> mapSupplier)
     
    static <T> T
    newProxyInstance(Class<?>[] interfaceClasses, InvocationHandler h)
    Creates a new proxy instance for the specified interfaces using the provided invocation handler.
    static <T> T
    newProxyInstance(Class<T> interfaceClass, InvocationHandler h)
    Creates a new proxy instance for the specified interface using the provided invocation handler.
    static <E> Set<E>
    Returns a set backed by the specified map.
    static <K, E> SetMultimap<K,E>
    New set multimap.
    static <K, E> SetMultimap<K,E>
    newSetMultimap(int initialCapacity)
    New set multimap.
    static <K, E> SetMultimap<K,E>
    newSetMultimap(Class<? extends Map> mapType)
    New set multimap.
    static <K, E> SetMultimap<K,E>
    newSetMultimap(Class<? extends Map> mapType, Class<? extends Set> valueType)
    New set multimap.
    static <T, K> SetMultimap<K,T>
    newSetMultimap(Collection<? extends T> c, Function<? super T,? extends K> keyMapper)
     
    static <T, K, E> SetMultimap<K,E>
    newSetMultimap(Collection<? extends T> c, Function<? super T,? extends K> keyMapper, Function<? super T,? extends E> valueExtractor)
     
    static <K, E> SetMultimap<K,E>
    newSetMultimap(Supplier<? extends Map<K,Set<E>>> mapSupplier, Supplier<? extends Set<E>> valueSupplier)
    New set multimap.
    static <K, E> SetMultimap<K,E>
    newSetMultimap(Map<? extends K,? extends E> m)
    New set multimap.
    static <K extends Comparable<? super K>, E>
    ListMultimap<K,E>
    Returns a ListMultimap backed by SortedMap.
    static <K extends Comparable<? super K>, E>
    ListMultimap<K,E>
    newSortedListMultimap(Map<? extends K,? extends E> m)
    Returns a ListMultimap backed by SortedMap.
    static <K extends Comparable<? super K>, E>
    SetMultimap<K,E>
    Returns a SetMultimap backed by SortedMap.
    static <K extends Comparable<? super K>, E>
    SetMultimap<K,E>
    newSortedSetMultimap(Map<? extends K,? extends E> m)
    Returns a SetMultimap backed by SortedMap.
    static <K extends Comparable<? super K>, V>
    TreeMap<K,V>
    New tree map.
    static <C, K extends C, V>
    TreeMap<K,V>
    newTreeMap(Comparator<C> comparator)
    New tree map.
    static <K extends Comparable<? super K>, V>
    TreeMap<K,V>
    newTreeMap(Map<? extends K,? extends V> m)
    New tree map.
    static <K, V> TreeMap<K,V>
    newTreeMap(SortedMap<K,? extends V> m)
    New tree map.
    static <T extends Comparable<? super T>>
    TreeSet<T>
    New tree set.
    static <T extends Comparable<? super T>>
    TreeSet<T>
    newTreeSet(Collection<? extends T> c)
    New tree set.
    static <T> TreeSet<T>
    newTreeSet(Comparator<? super T> comparator)
    New tree set.
    static <T> TreeSet<T>
    New tree set.
    static <T> boolean
    nMatch(Iterable<? extends T> c, int atLeast, int atMost, Predicate<? super T> filter)
    Checks if a certain number of elements in the iterable match the provided predicate.
    static <T> boolean
    nMatch(Iterator<? extends T> iter, int atLeast, int atMost, Predicate<? super T> filter)
    Checks if a certain number of elements in the iterator match the provided predicate.
    static <T> boolean
    nMatch(T[] a, int atLeast, int atMost, Predicate<? super T> filter)
    Checks if a certain number of elements in the array match the provided predicate.
    static <T> boolean
    noneMatch(Iterable<? extends T> c, Predicate<? super T> filter)
     
    static <T> boolean
    noneMatch(Iterator<? extends T> iter, Predicate<? super T> filter)
     
    static <T> boolean
    noneMatch(T[] a, Predicate<? super T> filter)
     
    static boolean
     
    static boolean
    notEmpty(boolean[] a)
    Not null or empty.
    static boolean
    notEmpty(byte[] a)
    Not null or empty.
    static boolean
    notEmpty(char[] a)
    Not null or empty.
    static boolean
    notEmpty(double[] a)
    Not null or empty.
    static boolean
    notEmpty(float[] a)
    Not null or empty.
    static boolean
    notEmpty(int[] a)
    Not null or empty.
    static boolean
    notEmpty(long[] a)
    Not null or empty.
    static boolean
    notEmpty(short[] a)
    Not null or empty.
    static boolean
    Not null or empty.
    static boolean
    notEmpty(Multimap<?,?,?> m)
    Not null or empty.
    static boolean
    Not null or empty.
    static boolean
    Not null or empty.
    static boolean
     
    static boolean
    notEmpty(Iterable<?> iter)
    Not null or empty.
    static boolean
    Not null or empty.
    static boolean
    Not null or empty.
    static boolean
    notEmpty(Iterator<?> iter)
    Not null or empty.
    static boolean
    notEmpty(Map<?,?> m)
    Not null or empty.
    static boolean[]
    nullToEmpty(boolean[] a)
    Null to empty.
    static byte[]
    nullToEmpty(byte[] a)
    Null to empty.
    static char[]
    nullToEmpty(char[] a)
    Null to empty.
    static double[]
    nullToEmpty(double[] a)
    Null to empty.
    static float[]
    nullToEmpty(float[] a)
    Null to empty.
    static int[]
    nullToEmpty(int[] a)
    Null to empty.
    static long[]
    nullToEmpty(long[] a)
    Null to empty.
    static short[]
    nullToEmpty(short[] a)
    Null to empty.
    static <K, V> ImmutableBiMap<K,V>
    Returns an empty immutable/unmodifiable map if the specified ImmutableBiMap is null, otherwise itself is returned.
    static <T> ImmutableCollection<T>
    Returns an empty immutable/unmodifiable Collection if the specified ImmutableCollection is null, otherwise itself is returned.
    static <T> ImmutableList<T>
    Returns an empty immutable/unmodifiable list if the specified ImmutableList is null, otherwise itself is returned.
    static <K, V> ImmutableMap<K,V>
    Returns an empty immutable/unmodifiable map if the specified ImmutableMap is null, otherwise itself is returned.
    static <K, V> ImmutableNavigableMap<K,V>
    Returns an empty immutable/unmodifiable map if the specified ImmutableNavigableMap is null, otherwise itself is returned.
    static <T> ImmutableNavigableSet<T>
    Returns an empty immutable/unmodifiable list if the specified ImmutableNavigableSet is null, otherwise itself is returned.
    static <T> ImmutableSet<T>
    Returns an empty immutable/unmodifiable list if the specified ImmutableSet is null, otherwise itself is returned.
    static <K, V> ImmutableSortedMap<K,V>
    Returns an empty immutable/unmodifiable map if the specified ImmutableSortedMap is null, otherwise itself is returned.
    static <T> ImmutableSortedSet<T>
    Returns an empty immutable/unmodifiable list if the specified ImmutableSortedSet is null, otherwise itself is returned.
    static Object[]
    Null to empty.
    static String
     
    static String[]
    Null to empty.
    static BigDecimal[]
    Null to empty.
    static BigInteger[]
    Null to empty.
    static Date[]
    Null to empty.
    static Time[]
    Null to empty.
    static Timestamp[]
    Null to empty.
    static Calendar[]
    Null to empty.
    static <T> Collection<T>
    Returns an empty immutable/unmodifiable list if the specified Collection is null, otherwise itself is returned.
    static Date[]
    Null to empty.
    static <T> Iterator<T>
    Returns an empty immutable/unmodifiable Iterator if the specified Iterator is null, otherwise itself is returned.
    static <T> List<T>
    nullToEmpty(List<T> list)
    Returns an empty immutable/unmodifiable list if the specified List is null, otherwise itself is returned.
    static <T> ListIterator<T>
    Returns an empty immutable/unmodifiable ListIterator if the specified ListIterator is null, otherwise itself is returned.
    static <K, V> Map<K,V>
    nullToEmpty(Map<K,V> map)
    Returns an empty immutable/unmodifiable map if the specified Map is null, otherwise itself is returned.
    static <K, V> NavigableMap<K,V>
    Returns an empty immutable/unmodifiable NavigableMap if the specified NavigableMap is null, otherwise itself is returned.
    static <T> NavigableSet<T>
    Returns an empty immutable/unmodifiable NavigableSet if the specified NavigableSet is null, otherwise itself is returned.
    static <T> Set<T>
    nullToEmpty(Set<T> set)
    Returns an empty immutable/unmodifiable set if the specified Set is null, otherwise itself is returned.
    static <K, V> SortedMap<K,V>
    Returns an empty immutable/unmodifiable SortedMap if the specified SortedMap is null, otherwise itself is returned.
    static <T> SortedSet<T>
    Returns an empty immutable/unmodifiable SortedSet if the specified SortedSet is null, otherwise itself is returned.
    static <T> T[]
    nullToEmpty(T[] a, Class<T[]> arrayType)
    Null to empty.
    static String[]
    Converts the specified String array to an empty String[0] if it's null and each null element String to empty String "".
    static <T> Map<T,Integer>
    occurrencesMap(Iterable<? extends T> c)
    Returns a map with the occurrences of each element in the given iterable collection.
    static <T> Map<T,Integer>
    occurrencesMap(Iterable<? extends T> c, Supplier<Map<T,Integer>> mapSupplier)
    Returns a map with the occurrences of each element in the given iterable collection.
    static <T> Map<T,Integer>
    occurrencesMap(Iterator<? extends T> iter)
    Returns a map with the occurrences of each element in the given iterator.
    static <T> Map<T,Integer>
    occurrencesMap(Iterator<? extends T> iter, Supplier<Map<T,Integer>> mapSupplier)
    Returns a map with the occurrences of each element in the given iterator.
    static <T> Map<T,Integer>
    Returns a map with the occurrences of each element in the given array.
    static <T> Map<T,Integer>
    occurrencesMap(T[] a, Supplier<Map<T,Integer>> mapSupplier)
    Returns a map with the occurrences of each element in the given array.
    static int
    occurrencesOf(boolean[] a, boolean valueToFind)
    Counts the occurrences of a specific boolean value in a boolean array.
    static int
    occurrencesOf(byte[] a, byte valueToFind)
    Counts the occurrences of a specific byte value in a byte array.
    static int
    occurrencesOf(char[] a, char valueToFind)
    Counts the occurrences of a specific char value in a char array.
    static int
    occurrencesOf(double[] a, double valueToFind)
    Counts the occurrences of a specific double value in a double array.
    static int
    occurrencesOf(float[] a, float valueToFind)
    Counts the occurrences of a specific float value in a float array.
    static int
    occurrencesOf(int[] a, int valueToFind)
    Counts the occurrences of a specific int value in a int array.
    static int
    occurrencesOf(long[] a, long valueToFind)
    Counts the occurrences of a specific long value in a long array.
    static int
    occurrencesOf(short[] a, short valueToFind)
    Counts the occurrences of a specific short value in a short array.
    static int
    occurrencesOf(Iterable<?> c, Object valueToFind)
    Counts the occurrences of a specific Object value in an Iterable.
    static int
    occurrencesOf(Object[] a, Object valueToFind)
    Counts the occurrences of a specific Object value in an Object array.
    static int
    occurrencesOf(String str, char valueToFind)
    Counts the occurrences of a specific character in a String.
    static int
    occurrencesOf(String str, String valueToFind)
    Counts the occurrences of a specific String value in another String.
    static int
    occurrencesOf(Iterator<?> iter, Object valueToFind)
    Counts the occurrences of a specific Object value in an Iterator.
    static <T> boolean
    padLeft(List<T> list, int minSize, T objToAdd)
    Appends the provided object to the beginning of the list till the list has at least the specified minimum size.
    static <T> boolean
    padRight(Collection<T> c, int minSize, T objToAdd)
    Appends the provided object to the end of the list till the list has at least the specified minimum size.
    static void
    parallelSort(byte[] a)
     
    static void
    parallelSort(byte[] a, int fromIndex, int toIndex)
     
    static void
    parallelSort(char[] a)
     
    static void
    parallelSort(char[] a, int fromIndex, int toIndex)
     
    static void
    parallelSort(double[] a)
     
    static void
    parallelSort(double[] a, int fromIndex, int toIndex)
     
    static void
    parallelSort(float[] a)
     
    static void
    parallelSort(float[] a, int fromIndex, int toIndex)
     
    static void
    parallelSort(int[] a)
     
    static void
    parallelSort(int[] a, int fromIndex, int toIndex)
     
    static void
    parallelSort(long[] a)
     
    static void
    parallelSort(long[] a, int fromIndex, int toIndex)
     
    static void
    parallelSort(short[] a)
     
    static void
    parallelSort(short[] a, int fromIndex, int toIndex)
     
    static <T extends Comparable<? super T>>
    void
    parallelSort(List<? extends T> list)
     
    static <T extends Comparable<? super T>>
    void
    parallelSort(List<? extends T> list, int fromIndex, int toIndex)
     
    static <T> void
    parallelSort(List<? extends T> list, int fromIndex, int toIndex, Comparator<? super T> cmp)
     
    static <T> void
    parallelSort(List<? extends T> list, Comparator<? super T> cmp)
     
    static <T extends Comparable<? super T>>
    void
    parallelSort(T[] a)
     
    static <T extends Comparable<? super T>>
    void
    parallelSort(T[] a, int fromIndex, int toIndex)
     
    static <T> void
    parallelSort(T[] a, int fromIndex, int toIndex, Comparator<? super T> cmp)
     
    static <T> void
    parallelSort(T[] a, Comparator<? super T> cmp)
     
    static <T, U extends Comparable<? super U>>
    void
    parallelSortBy(List<? extends T> list, Function<? super T,? extends U> keyMapper)
    Parallel sort by.
    static <T, U extends Comparable<? super U>>
    void
    parallelSortBy(T[] a, Function<? super T,? extends U> keyMapper)
    Parallel sort by.
    static <T> void
    parallelSortByDouble(List<? extends T> list, ToDoubleFunction<? super T> keyMapper)
    Parallel sort by double.
    static <T> void
    parallelSortByDouble(T[] a, ToDoubleFunction<? super T> keyMapper)
    Parallel sort by double.
    static <T> void
    parallelSortByFloat(List<? extends T> list, ToFloatFunction<? super T> keyMapper)
    Parallel sort by float.
    static <T> void
    parallelSortByFloat(T[] a, ToFloatFunction<? super T> keyMapper)
    Parallel sort by float.
    static <T> void
    parallelSortByInt(List<? extends T> list, ToIntFunction<? super T> keyMapper)
    Parallel sort by int.
    static <T> void
    parallelSortByInt(T[] a, ToIntFunction<? super T> keyMapper)
    Parallel sort by int.
    static <T> void
    parallelSortByLong(List<? extends T> list, ToLongFunction<? super T> keyMapper)
    Parallel sort by long.
    static <T> void
    parallelSortByLong(T[] a, ToLongFunction<? super T> keyMapper)
    Parallel sort by long.
    percentiles(byte[] sortedArray)
    Calculates the percentiles of the provided sorted array of bytes.
    percentiles(char[] sortedArray)
    Calculates the percentiles of the provided sorted array of characters.
    percentiles(double[] sortedArray)
    Calculates the percentiles of the provided sorted array of doubles.
    percentiles(float[] sortedArray)
    Calculates the percentiles of the provided sorted array of floats.
    percentiles(int[] sortedArray)
    Calculates the percentiles of the provided sorted array of integers.
    percentiles(long[] sortedArray)
    Calculates the percentiles of the provided sorted array of longs.
    percentiles(short[] sortedArray)
    Calculates the percentiles of the provided sorted array of shorts.
    static <T> Map<Percentage,T>
    percentiles(List<T> sortedList)
    Calculates the percentiles of the provided sorted list.
    static <T> Map<Percentage,T>
    percentiles(T[] sortedArray)
    Calculates the percentiles of the provided sorted array.
    static <T> T
    println(T obj)
    Prints the given object to the standard output stream (System.out) and returns the object.
    static boolean
    registerConverter(Class<?> srcClass, BiFunction<?,Class<?>,?> converter)
    Registers a converter for a specific source class.
    static boolean[]
    remove(boolean[] a, boolean valueToRemove)
    Returns a new array with elements copied from the specified array except the first occurrence of the specified value.
    static byte[]
    remove(byte[] a, byte valueToRemove)
    Returns a new array with elements copied from the specified array except the first occurrence of the specified value.
    static char[]
    remove(char[] a, char valueToRemove)
    Returns a new array with elements copied from the specified array except the first occurrence of the specified value.
    static double[]
    remove(double[] a, double valueToRemove)
    Returns a new array with elements copied from the specified array except the first occurrence of the specified value.
    static float[]
    remove(float[] a, float valueToRemove)
    Returns a new array with elements copied from the specified array except the first occurrence of the specified value.
    static int[]
    remove(int[] a, int valueToRemove)
    Returns a new array with elements copied from the specified array except the first occurrence of the specified value.
    static long[]
    remove(long[] a, long valueToRemove)
    Returns a new array with elements copied from the specified array except the first occurrence of the specified value.
    static short[]
    remove(short[] a, short valueToRemove)
    Returns a new array with elements copied from the specified array except the first occurrence of the specified value.
    static String[]
    remove(String[] a, String valueToRemove)
    Returns a new array with elements copied from the specified array except the first occurrence of the specified value.
    static <T> boolean
    remove(Collection<T> c, T valueToRemove)
    Removes the first occurrence of the specified value from the given collection.
    static <T> T[]
    remove(T[] a, T valueToRemove)
    Returns a new array with elements copied from the specified array except the first occurrence of the specified value.
    static boolean[]
    removeAll(boolean[] a, boolean... valuesToRemove)
    Returns a new array with elements copied from the specified array except all occurrences of the specified values.
    static byte[]
    removeAll(byte[] a, byte... valuesToRemove)
    Returns a new array with elements copied from the specified array except all occurrences of the specified values.
    static char[]
    removeAll(char[] a, char... valuesToRemove)
    Returns a new array with elements copied from the specified array except all occurrences of the specified values.
    static double[]
    removeAll(double[] a, double... valuesToRemove)
    Returns a new array with elements copied from the specified array except all occurrences of the specified values.
    static float[]
    removeAll(float[] a, float... valuesToRemove)
    Returns a new array with elements copied from the specified array except all occurrences of the specified values.
    static int[]
    removeAll(int[] a, int... valuesToRemove)
    Returns a new array with elements copied from the specified array except all occurrences of the specified values.
    static long[]
    removeAll(long[] a, long... valuesToRemove)
    Returns a new array with elements copied from the specified array except all occurrences of the specified values.
    static short[]
    removeAll(short[] a, short... valuesToRemove)
    Returns a new array with elements copied from the specified array except all occurrences of the specified values.
    static String[]
    removeAll(String[] a, String... valuesToRemove)
    Returns a new array with elements copied from the specified array except all occurrences of the specified values.
    static <T> boolean
    removeAll(Collection<T> c, Iterable<?> valuesToRemove)
    Removes all occurrences of the specified values from the given collection.
    static <T> boolean
    removeAll(Collection<T> c, Iterator<?> valuesToRemove)
    Removes all occurrences of the specified values from the given collection.
    static <T> boolean
    removeAll(Collection<T> c, T... valuesToRemove)
    Removes all occurrences of the specified values from the given collection.
    static <T> T[]
    removeAll(T[] a, T... valuesToRemove)
    Returns a new array with elements copied from the specified array except all occurrences of the specified values.
    static boolean[]
    removeAllOccurrences(boolean[] a, boolean valueToRemove)
    Returns a new array with elements copied from the specified array except all occurrence of the specified value.
    static byte[]
    removeAllOccurrences(byte[] a, byte valueToRemove)
    Returns a new array with elements copied from the specified array except all occurrence of the specified value.
    static char[]
    removeAllOccurrences(char[] a, char valueToRemove)
    Returns a new array with elements copied from the specified array except all occurrence of the specified value.
    static double[]
    removeAllOccurrences(double[] a, double valueToRemove)
    Returns a new array with elements copied from the specified array except all occurrence of the specified value.
    static float[]
    removeAllOccurrences(float[] a, float valueToRemove)
    Returns a new array with elements copied from the specified array except all occurrence of the specified value.
    static int[]
    removeAllOccurrences(int[] a, int valueToRemove)
    Returns a new array with elements copied from the specified array except all occurrence of the specified value.
    static long[]
    removeAllOccurrences(long[] a, long valueToRemove)
    Returns a new array with elements copied from the specified array except all occurrence of the specified value.
    static short[]
    removeAllOccurrences(short[] a, short valueToRemove)
    Returns a new array with elements copied from the specified array except all occurrence of the specified value.
    static String[]
    removeAllOccurrences(String[] a, String valueToRemove)
    Returns a new array with elements copied from the specified array except all occurrence of the specified value.
    static <T> boolean
    removeAllOccurrences(Collection<T> c, T valueToRemove)
    Removes all occurrences of the specified value from the given collection.
    static <T> T[]
    removeAllOccurrences(T[] a, T valueToRemove)
    Returns a new array with elements copied from the specified array except all occurrence of the specified value.
    static boolean[]
    removeDuplicates(boolean[] a)
    Returns a new array with elements from the input array but without any duplicates.
    static boolean[]
    removeDuplicates(boolean[] a, int fromIndex, int toIndex)
    Returns a new array with duplicate elements removed within the specified range.
    static byte[]
    removeDuplicates(byte[] a)
    Returns a new array with elements from the input array but without any duplicates.
    static byte[]
    removeDuplicates(byte[] a, boolean isSorted)
    Returns a new array with elements from the input array but without any duplicates.
    static byte[]
    removeDuplicates(byte[] a, int fromIndex, int toIndex, boolean isSorted)
    Returns a new array with duplicate elements removed within the specified range.
    static char[]
    removeDuplicates(char[] a)
    Returns a new array with elements from the input array but without any duplicates.
    static char[]
    removeDuplicates(char[] a, boolean isSorted)
    Returns a new array with elements from the input array but without any duplicates.
    static char[]
    removeDuplicates(char[] a, int fromIndex, int toIndex, boolean isSorted)
    Returns a new array with duplicate elements removed within the specified range.
    static double[]
    removeDuplicates(double[] a)
    Returns a new array with elements from the input array but without any duplicates.
    static double[]
    removeDuplicates(double[] a, boolean isSorted)
    Returns a new array with elements from the input array but without any duplicates.
    static double[]
    removeDuplicates(double[] a, int fromIndex, int toIndex, boolean isSorted)
    Returns a new array with duplicate elements removed within the specified range.
    static float[]
    removeDuplicates(float[] a)
    Returns a new array with elements from the input array but without any duplicates.
    static float[]
    removeDuplicates(float[] a, boolean isSorted)
    Returns a new array with elements from the input array but without any duplicates.
    static float[]
    removeDuplicates(float[] a, int fromIndex, int toIndex, boolean isSorted)
    Returns a new array with duplicate elements removed within the specified range.
    static int[]
    Returns a new array with elements from the input array but without any duplicates.
    static int[]
    removeDuplicates(int[] a, boolean isSorted)
    Returns a new array with elements from the input array but without any duplicates.
    static int[]
    removeDuplicates(int[] a, int fromIndex, int toIndex, boolean isSorted)
    Returns a new array with duplicate elements removed within the specified range.
    static long[]
    removeDuplicates(long[] a)
    Returns a new array with elements from the input array but without any duplicates.
    static long[]
    removeDuplicates(long[] a, boolean isSorted)
    Returns a new array with elements from the input array but without any duplicates.
    static long[]
    removeDuplicates(long[] a, int fromIndex, int toIndex, boolean isSorted)
    Returns a new array with duplicate elements removed within the specified range.
    static short[]
    removeDuplicates(short[] a)
    Returns a new array with elements from the input array but without any duplicates.
    static short[]
    removeDuplicates(short[] a, boolean isSorted)
    Returns a new array with elements from the input array but without any duplicates.
    static short[]
    removeDuplicates(short[] a, int fromIndex, int toIndex, boolean isSorted)
    Returns a new array with duplicate elements removed within the specified range.
    static String[]
    Returns a new array with elements from the input array but without any duplicates.
    static String[]
    removeDuplicates(String[] a, boolean isSorted)
    Returns a new array with elements from the input array but without any duplicates.
    static String[]
    removeDuplicates(String[] a, int fromIndex, int toIndex, boolean isSorted)
    Returns a new array with duplicate elements removed within the specified range.
    static boolean
    Removes duplicate elements from the given collection.
    static boolean
    removeDuplicates(Collection<?> c, boolean isSorted)
    Removes duplicate elements from the given collection.
    static <T> T[]
    Returns a new array with elements from the input array but without any duplicates.
    static <T> T[]
    removeDuplicates(T[] a, boolean isSorted)
    Returns a new array with elements from the input array but without any duplicates.
    static <T> T[]
    removeDuplicates(T[] a, int fromIndex, int toIndex, boolean isSorted)
    Returns a new array with duplicate elements removed within the specified range.
    static <T> List<T>
    repeat(T value, int n)
     
    static <T> List<T>
    Repeats the entire specified Collection n times.
    static <T> List<T>
    repeatCollectionToSize(Collection<? extends T> c, int size)
    Repeats the entire specified Collection till reach the specified size.
    static <T> List<T>
    repeatElements(Collection<? extends T> c, int n)
    Repeats the elements in the specified Collection one by one.
    static <T> List<T>
    Repeats the elements in the specified Collection one by one till reach the specified size.
    static int
    replaceAll(boolean[] a, boolean oldVal, boolean newVal)
    Replaces all occurrences of a specified boolean value in the given boolean array with another specified boolean value.
    static void
    replaceAll(boolean[] a, BooleanUnaryOperator operator)
    Replaces all elements in the given boolean array according to the provided unary operator.
    static int
    replaceAll(byte[] a, byte oldVal, byte newVal)
    Replaces all occurrences of a specified byte value in the given byte array with another specified byte value.
    static void
    replaceAll(byte[] a, ByteUnaryOperator operator)
    Replaces all elements in the given byte array according to the provided unary operator.
    static int
    replaceAll(char[] a, char oldVal, char newVal)
    Replaces all occurrences of a specified char value in the given char array with another specified char value.
    static void
    replaceAll(char[] a, CharUnaryOperator operator)
    Replaces all elements in the given char array according to the provided unary operator.
    static int
    replaceAll(double[] a, double oldVal, double newVal)
    Replaces all occurrences of a specified double value in the given double array with another specified double value.
    static void
    replaceAll(double[] a, DoubleUnaryOperator operator)
    Replaces all elements in the given double array according to the provided unary operator.
    static int
    replaceAll(float[] a, float oldVal, float newVal)
    Replaces all occurrences of a specified float value in the given float array with another specified float value.
    static void
    replaceAll(float[] a, FloatUnaryOperator operator)
    Replaces all elements in the given float array according to the provided unary operator.
    static int
    replaceAll(int[] a, int oldVal, int newVal)
    Replaces all occurrences of a specified int value in the given int array with another specified int value.
    static void
    replaceAll(int[] a, IntUnaryOperator operator)
    Replaces all elements in the given int array according to the provided unary operator.
    static int
    replaceAll(long[] a, long oldVal, long newVal)
    Replaces all occurrences of a specified long value in the given long array with another specified long value.
    static void
    replaceAll(long[] a, LongUnaryOperator operator)
    Replaces all elements in the given long array according to the provided unary operator.
    static int
    replaceAll(short[] a, short oldVal, short newVal)
    Replaces all occurrences of a specified short value in the given short array with another specified short value.
    static void
    replaceAll(short[] a, ShortUnaryOperator operator)
    Replaces all elements in the given short array according to the provided unary operator.
    static <T> int
    replaceAll(List<T> list, Object oldVal, T newVal)
    Replaces all occurrences of a specified value in the given list with another specified value.
    static <T> void
    replaceAll(List<T> list, UnaryOperator<T> operator)
    Replaces all elements in the given list according to the provided unary operator.
    static <T> int
    replaceAll(T[] a, Object oldVal, T newVal)
    Replaces all occurrences of a specified value in the given array with another specified value.
    static <T> void
    replaceAll(T[] a, UnaryOperator<T> operator)
    Replaces all elements in the given array according to the provided unary operator.
    static int
    replaceIf(boolean[] a, BooleanPredicate predicate, boolean newValue)
    Replaces all elements in the given boolean array that satisfy the provided predicate with a specified boolean value.
    static int
    replaceIf(byte[] a, BytePredicate predicate, byte newValue)
    Replaces all elements in the given byte array that satisfy the provided predicate with a specified byte value.
    static int
    replaceIf(char[] a, CharPredicate predicate, char newValue)
    Replaces all elements in the given char array that satisfy the provided predicate with a specified char value.
    static int
    replaceIf(double[] a, DoublePredicate predicate, double newValue)
    Replaces all elements in the given double array that satisfy the provided predicate with a specified double value.
    static int
    replaceIf(float[] a, FloatPredicate predicate, float newValue)
    Replaces all elements in the given float array that satisfy the provided predicate with a specified float value.
    static int
    replaceIf(int[] a, IntPredicate predicate, int newValue)
    Replaces all elements in the given int array that satisfy the provided predicate with a specified int value.
    static int
    replaceIf(long[] a, LongPredicate predicate, long newValue)
    Replaces all elements in the given long array that satisfy the provided predicate with a specified long value.
    static int
    replaceIf(short[] a, ShortPredicate predicate, short newValue)
    Replaces all elements in the given short array that satisfy the provided predicate with a specified short value.
    static <T> int
    replaceIf(List<T> c, Predicate<? super T> predicate, T newValue)
    Replaces all elements in the given list that satisfy the provided predicate with a specified value.
    static <T> int
    replaceIf(T[] a, Predicate<? super T> predicate, T newValue)
    Replaces all elements in the given array that satisfy the provided predicate with a specified value.
    static boolean[]
    replaceRange(boolean[] a, int fromIndex, int toIndex, boolean[] replacement)
    Returns a new array with the specified range replaced with the replacement array.
    static byte[]
    replaceRange(byte[] a, int fromIndex, int toIndex, byte[] replacement)
    Returns a new array with the specified range replaced with the replacement array.
    static char[]
    replaceRange(char[] a, int fromIndex, int toIndex, char[] replacement)
    Returns a new array with the specified range replaced with the replacement array.
    static double[]
    replaceRange(double[] a, int fromIndex, int toIndex, double[] replacement)
    Returns a new array with the specified range replaced with the replacement array.
    static float[]
    replaceRange(float[] a, int fromIndex, int toIndex, float[] replacement)
    Returns a new array with the specified range replaced with the replacement array.
    static int[]
    replaceRange(int[] a, int fromIndex, int toIndex, int[] replacement)
    Returns a new array with the specified range replaced with the replacement array.
    static long[]
    replaceRange(long[] a, int fromIndex, int toIndex, long[] replacement)
    Returns a new array with the specified range replaced with the replacement array.
    static short[]
    replaceRange(short[] a, int fromIndex, int toIndex, short[] replacement)
    Returns a new array with the specified range replaced with the replacement array.
    static String[]
    replaceRange(String[] a, int fromIndex, int toIndex, String[] replacement)
    Returns a new array with the specified range replaced with the replacement array.
    static String
    replaceRange(String str, int fromIndex, int toIndex, String replacement)
    Returns a new String with the specified range replaced with the replacement String.
    static <T> boolean
    replaceRange(List<T> c, int fromIndex, int toIndex, Collection<? extends T> replacement)
    Replaces a range of elements in the given list with the elements from the replacement collection.
    static <T> T[]
    replaceRange(T[] a, int fromIndex, int toIndex, T[] replacement)
    Returns a new array with the specified range replaced with the replacement array.
    static <T> T
    Ensures that the specified object reference is not null.
    static <T> T
    requireNonNull(T obj, String errorMessage)
    Ensures that the specified object reference is not null.
    static <T> T
    requireNonNull(T obj, Supplier<String> errorMessageSupplier)
    Ensures that the specified object reference is not null.
    static <T> boolean
    retainAll(Collection<T> c, Collection<? extends T> objsToKeep)
    Retains only the elements in the specified collection that are present in the specified collection of elements to keep.
    static void
    reverse(boolean[] a)
    Reverses the order of the given array.
    static void
    reverse(boolean[] a, int fromIndex, int toIndex)
    Reverses the order of the given array in the given range.
    static void
    reverse(byte[] a)
    Reverses the order of the given array.
    static void
    reverse(byte[] a, int fromIndex, int toIndex)
    Reverses the order of the given array in the given range.
    static void
    reverse(char[] a)
    Reverses the order of the given array.
    static void
    reverse(char[] a, int fromIndex, int toIndex)
    Reverses the order of the given array in the given range.
    static void
    reverse(double[] a)
    Reverses the order of the given array.
    static void
    reverse(double[] a, int fromIndex, int toIndex)
    Reverses the order of the given array in the given range.
    static void
    reverse(float[] a)
    Reverses the order of the given array.
    static void
    reverse(float[] a, int fromIndex, int toIndex)
    Reverses the order of the given array in the given range.
    static void
    reverse(int[] a)
    Reverses the order of the given array.
    static void
    reverse(int[] a, int fromIndex, int toIndex)
    Reverses the order of the given array in the given range.
    static void
    reverse(long[] a)
    Reverses the order of the given array.
    static void
    reverse(long[] a, int fromIndex, int toIndex)
    Reverses the order of the given array in the given range.
    static void
    reverse(short[] a)
    Reverses the order of the given array.
    static void
    reverse(short[] a, int fromIndex, int toIndex)
    Reverses the order of the given array in the given range.
    static void
    Reverses the order of the given array.
    static void
    reverse(Object[] a, int fromIndex, int toIndex)
    Reverses the order of the given array in the given range.
    static void
     
    static void
    reverse(List<?> list)
     
    static void
    reverse(List<?> list, int fromIndex, int toIndex)
     
    static void
    reverseSort(boolean[] a)
     
    static void
    reverseSort(byte[] a)
     
    static void
    reverseSort(byte[] a, int fromIndex, int toIndex)
     
    static void
    reverseSort(char[] a)
     
    static void
    reverseSort(char[] a, int fromIndex, int toIndex)
     
    static void
    reverseSort(double[] a)
     
    static void
    reverseSort(double[] a, int fromIndex, int toIndex)
     
    static void
    reverseSort(float[] a)
     
    static void
    reverseSort(float[] a, int fromIndex, int toIndex)
     
    static void
    reverseSort(int[] a)
     
    static void
    reverseSort(int[] a, int fromIndex, int toIndex)
     
    static void
    reverseSort(long[] a)
     
    static void
    reverseSort(long[] a, int fromIndex, int toIndex)
     
    static void
    reverseSort(short[] a)
     
    static void
    reverseSort(short[] a, int fromIndex, int toIndex)
     
    static void
     
    static void
    reverseSort(Object[] a, int fromIndex, int toIndex)
     
    static <T extends Comparable<? super T>>
    void
    reverseSort(List<? extends T> list)
     
    static <T extends Comparable<? super T>>
    void
    reverseSort(List<? extends T> list, int fromIndex, int toIndex)
     
    static <T, U extends Comparable<? super U>>
    void
    reverseSortBy(List<? extends T> list, Function<? super T,? extends U> keyMapper)
    Reverse sort by.
    static <T, U extends Comparable<? super U>>
    void
    reverseSortBy(T[] a, Function<? super T,? extends U> keyMapper)
    Reverse sort by.
    static <T> void
    reverseSortByDouble(List<? extends T> list, ToDoubleFunction<? super T> keyMapper)
     
    static <T> void
    reverseSortByDouble(T[] a, ToDoubleFunction<? super T> keyMapper)
     
    static <T> void
    reverseSortByFloat(List<? extends T> list, ToFloatFunction<? super T> keyMapper)
     
    static <T> void
    reverseSortByFloat(T[] a, ToFloatFunction<? super T> keyMapper)
     
    static <T> void
    reverseSortByInt(List<? extends T> list, ToIntFunction<? super T> keyMapper)
     
    static <T> void
    reverseSortByInt(T[] a, ToIntFunction<? super T> keyMapper)
     
    static <T> void
    reverseSortByLong(List<? extends T> list, ToLongFunction<? super T> keyMapper)
     
    static <T> void
    reverseSortByLong(T[] a, ToLongFunction<? super T> keyMapper)
     
    static <T> List<T>
    reverseToList(Collection<? extends T> c)
     
    static void
    rotate(boolean[] a, int distance)
     
    static void
    rotate(byte[] a, int distance)
     
    static void
    rotate(char[] a, int distance)
     
    static void
    rotate(double[] a, int distance)
     
    static void
    rotate(float[] a, int distance)
     
    static void
    rotate(int[] a, int distance)
     
    static void
    rotate(long[] a, int distance)
     
    static void
    rotate(short[] a, int distance)
     
    static void
    rotate(Object[] a, int distance)
     
    static void
    rotate(Collection<?> c, int distance)
     
    static void
    rotate(List<?> list, int distance)
     
    static <T, E extends Exception>
    void
    runByBatch(Iterable<? extends T> iter, int batchSize, Throwables.Consumer<? super List<T>,E> batchAction)
    Executes a given action on batches of elements from the provided iterable.
    static <T, E extends Exception, E2 extends Exception>
    void
    runByBatch(Iterable<? extends T> iter, int batchSize, Throwables.IntObjConsumer<? super T,E> elementConsumer, Throwables.Runnable<E2> batchAction)
    Executes a given action on batches of elements from the provided iterable.
    static <T, E extends Exception>
    void
    runByBatch(Iterator<? extends T> iter, int batchSize, Throwables.Consumer<? super List<T>,E> batchAction)
    Executes a given action on batches of elements from the provided iterator.
    static <T, E extends Exception, E2 extends Exception>
    void
    runByBatch(Iterator<? extends T> iter, int batchSize, Throwables.IntObjConsumer<? super T,E> elementConsumer, Throwables.Runnable<E2> batchAction)
    Executes a given action on batches of elements from the provided iterator.
    static <T, E extends Exception>
    void
    runByBatch(T[] a, int batchSize, Throwables.Consumer<? super List<T>,E> batchAction)
    Executes a given action on batches of elements from the provided array.
    static <T, E extends Exception, E2 extends Exception>
    void
    runByBatch(T[] a, int batchSize, Throwables.IntObjConsumer<? super T,E> elementConsumer, Throwables.Runnable<E2> batchAction)
    Executes a given action on batches of elements from the provided array.
    static void
    runInParallel(Throwables.Runnable<? extends Exception> command, Throwables.Runnable<? extends Exception> command2)
    Executes and complete the input commands in parallel.
    static void
    runInParallel(Throwables.Runnable<? extends Exception> command, Throwables.Runnable<? extends Exception> command2, Throwables.Runnable<? extends Exception> command3)
    Executes and complete the input commands in parallel.
    static void
    runInParallel(Throwables.Runnable<? extends Exception> command, Throwables.Runnable<? extends Exception> command2, Throwables.Runnable<? extends Exception> command3, Throwables.Runnable<? extends Exception> command4)
    Executes and complete the input commands in parallel.
    static void
    runInParallel(Throwables.Runnable<? extends Exception> command, Throwables.Runnable<? extends Exception> command2, Throwables.Runnable<? extends Exception> command3, Throwables.Runnable<? extends Exception> command4, Throwables.Runnable<? extends Exception> command5)
    Executes and complete the input commands in parallel.
    static void
    runInParallel(Collection<? extends Throwables.Runnable<? extends Exception>> commands)
    Executes and complete the input commands in parallel.
    static void
    runInParallel(Collection<? extends Throwables.Runnable<? extends Exception>> commands, Executor executor)
    Executes and complete the input commands in parallel.
    static void
    Note: Copied from Google Guava under Apache License v2.0

    If a thread is interrupted during such a call, the call continues to block until the result is available or the timeout elapses, and only then re-interrupts the thread.
    static void
    Note: Copied from Google Guava under Apache License v2.0

    If a thread is interrupted during such a call, the call continues to block until the result is available or the timeout elapses, and only then re-interrupts the thread.
    static void
    Note: Copied from Google Guava under Apache License v2.0

    If a thread is interrupted during such a call, the call continues to block until the result is available or the timeout elapses, and only then re-interrupts the thread.
    static void
    setAll(boolean[] array, IntToBooleanFunction generator)
    Sets all elements in the given array using the provided generator function.
    static void
    setAll(byte[] array, IntToByteFunction generator)
    Sets all elements in the given array using the provided generator function.
    static void
    setAll(double[] array, IntToDoubleFunction generator)
    Sets all elements in the given array using the provided generator function.
    static void
    setAll(float[] array, IntToFloatFunction generator)
    Sets all elements in the given array using the provided generator function.
    static void
    setAll(int[] array, IntUnaryOperator generator)
    Sets all elements in the given array using the provided generator function.
    static void
    setAll(long[] array, IntToLongFunction generator)
    Sets all elements in the given array using the provided generator function.
    static void
    setAll(short[] array, IntToShortFunction generator)
    Sets all elements in the given array using the provided generator function.
    static <T> void
    setAll(List<T> list, IntFunction<? extends T> generator)
    Sets all elements in the given list using the provided generator function.
    static <T> void
    setAll(T[] array, IntFunction<? extends T> generator)
    Sets all elements in the given array using the provided generator function.
    static void
    setPropValue(Object bean, String propName, Object propValue)
    static void
    shuffle(boolean[] a)
     
    static void
    shuffle(boolean[] a, Random rnd)
     
    static void
    shuffle(byte[] a)
     
    static void
    shuffle(byte[] a, Random rnd)
     
    static void
    shuffle(char[] a)
     
    static void
    shuffle(char[] a, Random rnd)
     
    static void
    shuffle(double[] a)
     
    static void
    shuffle(double[] a, Random rnd)
     
    static void
    shuffle(float[] a)
     
    static void
    shuffle(float[] a, Random rnd)
     
    static void
    shuffle(int[] a)
     
    static void
    shuffle(int[] a, Random rnd)
     
    static void
    shuffle(long[] a)
     
    static void
    shuffle(long[] a, Random rnd)
     
    static void
    shuffle(short[] a)
     
    static void
    shuffle(short[] a, Random rnd)
     
    static void
     
    static void
     
    static void
    shuffle(List<?> list)
     
    static void
    shuffle(List<?> list, Random rnd)
     
    static <T> void
    shuffle(T[] a)
     
    static <T> void
    shuffle(T[] a, Random rnd)
     
    static int
    Returns the length/size of the specified Array/Collection/Map, or 0 if it's empty or null.
    static int
    Returns the length/size of the specified Array/Collection/Map, or 0 if it's empty or null.
    static int
    size(Map<?,?> m)
    Returns the length/size of the specified Array/Collection/Map, or 0 if it's empty or null.
    static <T> List<T>
    skipRange(Collection<? extends T> c, int startInclusive, int endExclusive)
    Returns a new list with the specified range skipped.
    static <T, C extends Collection<T>>
    C
    skipRange(Collection<? extends T> c, int startInclusive, int endExclusive, IntFunction<C> supplier)
    Returns a new collection with the specified range skipped.
    static <T> T[]
    skipRange(T[] a, int startInclusive, int endExclusive)
    Returns a new array with the specified range skipped.
    static <T> List<T>
    skipUntil(Iterable<? extends T> c, Predicate<? super T> filter)
    Returns a list containing the elements of the input iterable starting from the first element that satisfies the provided predicate.
    static <T> List<T>
    skipUntil(T[] a, Predicate<? super T> filter)
    Returns a list containing the elements of the input array starting from the first element that satisfies the provided predicate.
    static void
    sleep(long timeoutInMillis)
    Pauses the execution of the current thread for a specified time.
    static void
    sleep(long timeout, TimeUnit unit)
    Pauses the execution of the current thread for a specified time.
    static void
    sleepUninterruptibly(long timeoutInMillis)
    Note: Copied from Google Guava under Apache License v2.0

    If a thread is interrupted during such a call, the call continues to block until the result is available or the timeout elapses, and only then re-interrupts the thread.
    static void
    sleepUninterruptibly(long timeout, TimeUnit unit)
    Note: Copied from Google Guava under Apache License v2.0

    If a thread is interrupted during such a call, the call continues to block until the result is available or the timeout elapses, and only then re-interrupts the thread.
    static <T> ImmutableCollection<T>
    slice(Collection<? extends T> c, int fromIndex, int toIndex)
    Returns a read-only slice of the input collection from the specified start index to the end index.
    static <T> ObjIterator<T>
    slice(Iterator<? extends T> iter, long fromIndex, long toIndex)
    Returns a read-only slice of the input iterator from the specified start index to the end index.
    static <T> ImmutableList<T>
    slice(List<? extends T> c, int fromIndex, int toIndex)
    Returns a read-only slice of the input list from the specified start index to the end index.
    static <T> ImmutableList<T>
    slice(T[] a, int fromIndex, int toIndex)
    Returns a read-only slice of the input array from the specified start index to the end index.
    static void
    sort(boolean[] a)
     
    static void
    sort(byte[] a)
     
    static void
    sort(byte[] a, int fromIndex, int toIndex)
     
    static void
    sort(char[] a)
     
    static void
    sort(char[] a, int fromIndex, int toIndex)
     
    static void
    sort(double[] a)
     
    static void
    sort(double[] a, int fromIndex, int toIndex)
     
    static void
    sort(float[] a)
     
    static void
    sort(float[] a, int fromIndex, int toIndex)
     
    static void
    sort(int[] a)
     
    static void
    sort(int[] a, int fromIndex, int toIndex)
     
    static void
    sort(long[] a)
     
    static void
    sort(long[] a, int fromIndex, int toIndex)
     
    static void
    sort(short[] a)
     
    static void
    sort(short[] a, int fromIndex, int toIndex)
     
    static void
    sort(Object[] a)
     
    static void
    sort(Object[] a, int fromIndex, int toIndex)
     
    static <T extends Comparable<? super T>>
    void
    sort(List<? extends T> list)
     
    static <T extends Comparable<? super T>>
    void
    sort(List<? extends T> list, int fromIndex, int toIndex)
     
    static <T> void
    sort(List<? extends T> list, int fromIndex, int toIndex, Comparator<? super T> cmp)
     
    static <T> void
    sort(List<? extends T> list, Comparator<? super T> cmp)
     
    static <T> void
    sort(T[] a, int fromIndex, int toIndex, Comparator<? super T> cmp)
     
    static <T> void
    sort(T[] a, Comparator<? super T> cmp)
     
    static <T, U extends Comparable<? super U>>
    void
    sortBy(List<? extends T> list, Function<? super T,? extends U> keyMapper)
     
    static <T, U extends Comparable<? super U>>
    void
    sortBy(T[] a, Function<? super T,? extends U> keyMapper)
     
    static <T> void
    sortByDouble(List<? extends T> list, ToDoubleFunction<? super T> keyMapper)
    Sort by double.
    static <T> void
    sortByDouble(T[] a, ToDoubleFunction<? super T> keyMapper)
    Sort by double.
    static <T> void
    sortByFloat(List<? extends T> list, ToFloatFunction<? super T> keyMapper)
    Sort by float.
    static <T> void
    sortByFloat(T[] a, ToFloatFunction<? super T> keyMapper)
    Sort by float.
    static <T> void
    sortByInt(List<? extends T> list, ToIntFunction<? super T> keyMapper)
    Sort by int.
    static <T> void
    sortByInt(T[] a, ToIntFunction<? super T> keyMapper)
    Sort by int.
    static <T> void
    sortByLong(List<? extends T> list, ToLongFunction<? super T> keyMapper)
    Sort by long.
    static <T> void
    sortByLong(T[] a, ToLongFunction<? super T> keyMapper)
    Sort by long.
    static List<boolean[]>
    split(boolean[] a, int chunkSize)
    Splits the input boolean array into sub-arrays of the specified size.
    static List<boolean[]>
    split(boolean[] a, int fromIndex, int toIndex, int chunkSize)
    Splits the input boolean array into sub-arrays of the specified size.
    static List<byte[]>
    split(byte[] a, int chunkSize)
    Splits the input byte array into sub-arrays of the specified size.
    static List<byte[]>
    split(byte[] a, int fromIndex, int toIndex, int chunkSize)
    Splits the input byte array into sub-arrays of the specified size.
    static List<char[]>
    split(char[] a, int chunkSize)
    Splits the input char array into sub-arrays of the specified size.
    static List<char[]>
    split(char[] a, int fromIndex, int toIndex, int chunkSize)
    Splits the input char array into sub-arrays of the specified size.
    static List<double[]>
    split(double[] a, int chunkSize)
    Splits the input double array into sub-arrays of the specified size.
    static List<double[]>
    split(double[] a, int fromIndex, int toIndex, int chunkSize)
    Splits the input double array into sub-arrays of the specified size.
    static List<float[]>
    split(float[] a, int chunkSize)
    Splits the input float array into sub-arrays of the specified size.
    static List<float[]>
    split(float[] a, int fromIndex, int toIndex, int chunkSize)
    Splits the input float array into sub-arrays of the specified size.
    static List<int[]>
    split(int[] a, int chunkSize)
    Splits the input int array into sub-arrays of the specified size.
    static List<int[]>
    split(int[] a, int fromIndex, int toIndex, int chunkSize)
    Splits the input int array into sub-arrays of the specified size.
    static List<long[]>
    split(long[] a, int chunkSize)
    Splits the input long array into sub-arrays of the specified size.
    static List<long[]>
    split(long[] a, int fromIndex, int toIndex, int chunkSize)
    Splits the input long array into sub-arrays of the specified size.
    static List<short[]>
    split(short[] a, int chunkSize)
    Splits the input short array into sub-arrays of the specified size.
    static List<short[]>
    split(short[] a, int fromIndex, int toIndex, int chunkSize)
    Splits the input short array into sub-arrays of the specified size.
    static List<String>
    split(CharSequence str, int chunkSize)
    Returns consecutive substring of the specified string, each of the same length (the final list may be smaller), or an empty array if the specified string is null or empty.
    static List<String>
    split(CharSequence str, int fromIndex, int toIndex, int chunkSize)
    Returns consecutive substring of the specified string, each of the same length (the final list may be smaller), or an empty array if the specified string is null or empty.
    static <T> List<List<T>>
    split(Iterable<? extends T> c, int chunkSize)
    Splits the input iterable into sub-collections of the specified size.
    static <T> List<List<T>>
    split(Collection<? extends T> c, int chunkSize)
    Splits the input collection into sub-collections of the specified size.
    static <T> List<List<T>>
    split(Collection<? extends T> c, int fromIndex, int toIndex, int chunkSize)
    Splits the input collection into sub-collections of the specified size.
    static <T> ObjIterator<List<T>>
    split(Iterator<? extends T> iter, int chunkSize)
    Splits the input iterator into sub-collections of the specified size.
    static <T> List<T[]>
    split(T[] a, int chunkSize)
    Splits the input array into sub-arrays of the specified size.
    static <T> List<T[]>
    split(T[] a, int fromIndex, int toIndex, int chunkSize)
    Splits the input array into sub-arrays of the specified size.
    static <T> List<T>
    splitByChunkCount(int totalSize, int maxChunkCount, boolean sizeSmallerFirst, IntBiFunction<? extends T> func)
    Splits the total size into chunks based on the specified maximum chunk count.
    static <T> List<T>
    splitByChunkCount(int totalSize, int maxChunkCount, IntBiFunction<? extends T> func)
    Splits the total size into chunks based on the specified maximum chunk count.
    static <T> List<List<T>>
    splitByChunkCount(Collection<? extends T> c, int maxChunkCount)
    Splits the input collection into sub-lists based on the specified maximum chunk count.
    static <T> List<List<T>>
    splitByChunkCount(Collection<? extends T> c, int maxChunkCount, boolean sizeSmallerFirst)
    Splits the input collection into sub-lists based on the specified maximum chunk count.
    static <T> CheckedStream<T,IOException>
    streamJson(File jsonArray, JSONDeserializationConfig config, Class<? extends T> elementClass)
     
    static <T> CheckedStream<T,IOException>
    streamJson(File jsonArray, Class<? extends T> elementClass)
     
    static <T> CheckedStream<T,IOException>
    streamJson(InputStream jsonArray, boolean closeInputStreamWhenStreamIsClosed, Class<? extends T> elementClass)
     
    static <T> CheckedStream<T,IOException>
    streamJson(InputStream jsonArray, JSONDeserializationConfig config, boolean closeInputStreamWhenStreamIsClosed, Class<? extends T> elementClass)
     
    static <T> CheckedStream<T,IOException>
    streamJson(InputStream jsonArray, Class<? extends T> elementClass)
     
    static <T> CheckedStream<T,IOException>
    streamJson(Reader jsonArray, boolean closeReaderWhenStreamIsClosed, Class<? extends T> elementClass)
     
    static <T> CheckedStream<T,IOException>
    streamJson(Reader jsonArray, JSONDeserializationConfig config, boolean closeReaderWhenStreamIsClosed, Class<? extends T> elementClass)
     
    static <T> CheckedStream<T,IOException>
    streamJson(Reader jsonArray, Class<? extends T> elementClass)
     
    static <T> CheckedStream<T,IOException>
    streamJson(String jsonArray, JSONDeserializationConfig config, Class<? extends T> elementClass)
     
    static <T> CheckedStream<T,IOException>
    streamJson(String jsonArray, Class<? extends T> elementClass)
     
    static String
    stringOf(boolean val)
    Converts the given value to its corresponding String representation.
    static String
    stringOf(byte val)
    Converts the given value to its corresponding String representation.
    static String
    stringOf(char val)
    Converts the given value to its corresponding String representation.
    static String
    stringOf(double val)
    Converts the given value to its corresponding String representation.
    static String
    stringOf(float val)
    Converts the given value to its corresponding String representation.
    static String
    stringOf(int val)
    Converts the given value to its corresponding String representation.
    static String
    stringOf(long val)
    Converts the given value to its corresponding String representation.
    static String
    stringOf(short val)
    Converts the given value to its corresponding String representation.
    static String
    Converts the given value to its corresponding String representation.
    static int
    sum(byte... a)
    Calculates the sum of the bytes in the given array.
    static int
    sum(byte[] a, int fromIndex, int toIndex)
    Calculates the sum of the bytes in the given array within the specified range.
    static int
    sum(char... a)
    Calculates the sum of the given array of characters.
    static int
    sum(char[] a, int fromIndex, int toIndex)
    Calculates the sum of the ASCII values of the characters in the given array within the specified range.
    static double
    sum(double... a)
     
    static double
    sum(double[] a, int fromIndex, int toIndex)
     
    static float
    sum(float... a)
     
    static float
    sum(float[] a, int fromIndex, int toIndex)
     
    static int
    sum(int... a)
     
    static int
    sum(int[] a, int fromIndex, int toIndex)
     
    static long
    sum(long... a)
     
    static long
    sum(long[] a, int fromIndex, int toIndex)
     
    static int
    sum(short... a)
     
    static int
    sum(short[] a, int fromIndex, int toIndex)
     
    static BigDecimal
    Sums the BigDecimal values in the provided iterable.
    static <T> BigDecimal
    sumBigDecimal(Iterable<? extends T> c, Function<? super T,BigDecimal> func)
    Returns the sum of the BigDecimal values extracted from the elements in the provided iterable by the input func function.
    static BigInteger
    Sums the BigInteger values in the provided iterable.
    static <T> BigInteger
    sumBigInteger(Iterable<? extends T> c, Function<? super T,BigInteger> func)
    Returns the sum of the BigInteger values extracted from the elements in the provided iterable by the input func function.
    static <T extends Number>
    double
    sumDouble(Iterable<? extends T> c)
     
    static <T> double
    sumDouble(Iterable<? extends T> c, ToDoubleFunction<? super T> func)
     
    static <T extends Number>
    double
    sumDouble(Collection<? extends T> c, int fromIndex, int toIndex)
     
    static <T> double
    sumDouble(Collection<? extends T> c, int fromIndex, int toIndex, ToDoubleFunction<? super T> func)
     
    static <T extends Number>
    double
    sumDouble(T[] a)
     
    static <T extends Number>
    double
    sumDouble(T[] a, int fromIndex, int toIndex)
     
    static <T> double
    sumDouble(T[] a, int fromIndex, int toIndex, ToDoubleFunction<? super T> func)
     
    static <T> double
    sumDouble(T[] a, ToDoubleFunction<? super T> func)
     
    static <T extends Number>
    int
    sumInt(Iterable<? extends T> c)
     
    static <T> int
    sumInt(Iterable<? extends T> c, ToIntFunction<? super T> func)
     
    static <T extends Number>
    int
    sumInt(Collection<? extends T> c, int fromIndex, int toIndex)
     
    static <T> int
    sumInt(Collection<? extends T> c, int fromIndex, int toIndex, ToIntFunction<? super T> func)
     
    static <T extends Number>
    int
    sumInt(T[] a)
     
    static <T extends Number>
    int
    sumInt(T[] a, int fromIndex, int toIndex)
     
    static <T> int
    sumInt(T[] a, int fromIndex, int toIndex, ToIntFunction<? super T> func)
     
    static <T> int
    sumInt(T[] a, ToIntFunction<? super T> func)
     
    static <T extends Number>
    long
    sumIntToLong(Iterable<? extends T> c)
     
    static <T> long
    sumIntToLong(Iterable<? extends T> c, ToIntFunction<? super T> func)
     
    static <T extends Number>
    long
    sumLong(Iterable<? extends T> c)
     
    static <T> long
    sumLong(Iterable<? extends T> c, ToLongFunction<? super T> func)
     
    static <T extends Number>
    long
    sumLong(Collection<? extends T> c, int fromIndex, int toIndex)
     
    static <T> long
    sumLong(Collection<? extends T> c, int fromIndex, int toIndex, ToLongFunction<? super T> func)
     
    static <T extends Number>
    long
    sumLong(T[] a)
     
    static <T extends Number>
    long
    sumLong(T[] a, int fromIndex, int toIndex)
     
    static <T> long
    sumLong(T[] a, int fromIndex, int toIndex, ToLongFunction<? super T> func)
     
    static <T> long
    sumLong(T[] a, ToLongFunction<? super T> func)
     
    static double
    sumToDouble(float... a)
     
    static double
    sumToDouble(float[] a, int fromIndex, int toIndex)
     
    static long
    sumToLong(int... a)
     
    static long
    sumToLong(int[] a, int fromIndex, int toIndex)
     
    static void
    swap(boolean[] a, int i, int j)
     
    static void
    swap(byte[] a, int i, int j)
     
    static void
    swap(char[] a, int i, int j)
     
    static void
    swap(double[] a, int i, int j)
     
    static void
    swap(float[] a, int i, int j)
     
    static void
    swap(int[] a, int i, int j)
     
    static void
    swap(long[] a, int i, int j)
     
    static void
    swap(short[] a, int i, int j)
     
    static <T> void
    swap(Pair<T,T> pair)
     
    static <T, M> void
    swap(Triple<T,M,T> triple)
     
    static void
    swap(Object[] a, int i, int j)
     
    static void
    swap(List<?> list, int i, int j)
     
    static <T> boolean
    swapIf(Pair<T,T> pair, Predicate<? super Pair<T,T>> predicate)
     
    static <T, M> boolean
    swapIf(Triple<T,M,T> triple, Predicate<? super Triple<T,M,T>> predicate)
     
    static boolean[]
    symmetricDifference(boolean[] a, boolean[] b)
    Returns the elements that are in the specified Array/Collection a but not in b and vice versa.
    static byte[]
    symmetricDifference(byte[] a, byte[] b)
    Returns the elements that are in the specified Array/Collection a but not in b and vice versa.
    static char[]
    symmetricDifference(char[] a, char[] b)
    Returns the elements that are in the specified Array/Collection a but not in b and vice versa.
    static double[]
    symmetricDifference(double[] a, double[] b)
    Returns the elements that are in the specified Array/Collection a but not in b and vice versa.
    static float[]
    symmetricDifference(float[] a, float[] b)
    Returns the elements that are in the specified Array/Collection a but not in b and vice versa.
    static int[]
    symmetricDifference(int[] a, int[] b)
    Returns the elements that are in the specified Array/Collection a but not in b and vice versa.
    static long[]
    symmetricDifference(long[] a, long[] b)
    Returns the elements that are in the specified Array/Collection a but not in b and vice versa.
    static short[]
    symmetricDifference(short[] a, short[] b)
    Returns the elements that are in the specified Array/Collection a but not in b and vice versa.
    static <T> List<T>
    symmetricDifference(Collection<? extends T> a, Collection<? extends T> b)
    Returns the elements that are in the specified Array/Collection a but not in b and vice versa.
    static <T> List<T>
    symmetricDifference(T[] a, T[] b)
    Returns the elements that are in the specified Array/Collection a but not in b and vice versa.
    static <T> List<T>
    takeWhile(Iterable<? extends T> c, Predicate<? super T> filter)
    Returns a list containing the elements of the input iterable until the provided predicate returns false.
    static <T> List<T>
    takeWhile(T[] a, Predicate<? super T> filter)
    Returns a list containing the elements of the input array until the provided predicate returns false.
    static <T> List<T>
    takeWhileInclusive(Iterable<? extends T> c, Predicate<? super T> filter)
    Returns a list containing the elements of the input iterable until the provided predicate returns false, including the element that fails the predicate.
    static <T> List<T>
    takeWhileInclusive(T[] a, Predicate<? super T> filter)
    Returns a list containing the elements of the input array until the provided predicate returns false, including the element that fails the predicate.
    static Object[]
    Returns an empty array if the specified collection is null or empty.
    static Object[]
    toArray(Collection<?> c, int fromIndex, int toIndex)
    Converts the specified range in the specified collection into an array.
    static <A, T extends A>
    A[]
    toArray(Collection<? extends T> c, int fromIndex, int toIndex, A[] a)
    Converts the specified range in the specified collection into an array.
    static <A, T extends A>
    A[]
    toArray(Collection<? extends T> c, int fromIndex, int toIndex, Class<A[]> targetType)
    Converts the specified range in the specified collection into an array of a specified type.
    static <A, T extends A>
    A[]
    toArray(Collection<? extends T> c, int fromIndex, int toIndex, IntFunction<A[]> arraySupplier)
    Converts the specified range in the specified collection into an array using a provided array supplier function.
    static <A, T extends A>
    A[]
    toArray(Collection<? extends T> c, A[] a)
    Converts a collection into an array.
    static <A, T extends A>
    A[]
    toArray(Collection<? extends T> c, Class<A[]> targetType)
    Converts a collection into an array of a specified type.
    static <A, T extends A>
    A[]
    toArray(Collection<? extends T> c, IntFunction<A[]> arraySupplier)
    Converts a collection into an array using a provided array supplier function.
    static boolean[]
    toBooleanArray(byte[] a)
    Converts a byte array to a boolean array.
    static boolean[]
    toBooleanArray(int[] a)
    Converts an int array to a boolean array.
    static boolean[]
    To boolean array.
    static boolean[]
    toBooleanArray(Collection<Boolean> c, boolean defaultForNull)
    To boolean array.
    static boolean[]
    toBooleanArray(Collection<Boolean> c, int fromIndex, int toIndex)
    To boolean array.
    static boolean[]
    toBooleanArray(Collection<Boolean> c, int fromIndex, int toIndex, boolean defaultForNull)
    To boolean array.
    static byte[]
    toByteArray(boolean[] a)
    Converts a boolean array to a byte array.
    static byte[]
    To byte array.
    static byte[]
    toByteArray(Collection<? extends Number> c, byte defaultForNull)
    To byte array.
    static byte[]
    toByteArray(Collection<? extends Number> c, int fromIndex, int toIndex)
    To byte array.
    static byte[]
    toByteArray(Collection<? extends Number> c, int fromIndex, int toIndex, byte defaultForNull)
    To byte array.
    static char[]
    To char array.
    static char[]
    toCharArray(Collection<Character> c, char defaultForNull)
    To char array.
    static char[]
    toCharArray(Collection<Character> c, int fromIndex, int toIndex)
    To char array.
    static char[]
    toCharArray(Collection<Character> c, int fromIndex, int toIndex, char defaultForNull)
    To char array.
    static <C extends Collection<Boolean>>
    C
    toCollection(boolean[] a, int fromIndex, int toIndex, IntFunction<? extends C> supplier)
     
    static <C extends Collection<Boolean>>
    C
    toCollection(boolean[] a, IntFunction<? extends C> supplier)
     
    static <C extends Collection<Byte>>
    C
    toCollection(byte[] a, int fromIndex, int toIndex, IntFunction<? extends C> supplier)
     
    static <C extends Collection<Byte>>
    C
    toCollection(byte[] a, IntFunction<? extends C> supplier)
     
    static <C extends Collection<Character>>
    C
    toCollection(char[] a, int fromIndex, int toIndex, IntFunction<? extends C> supplier)
     
    static <C extends Collection<Character>>
    C
    toCollection(char[] a, IntFunction<? extends C> supplier)
     
    static <C extends Collection<Double>>
    C
    toCollection(double[] a, int fromIndex, int toIndex, IntFunction<? extends C> supplier)
     
    static <C extends Collection<Double>>
    C
    toCollection(double[] a, IntFunction<? extends C> supplier)
     
    static <C extends Collection<Float>>
    C
    toCollection(float[] a, int fromIndex, int toIndex, IntFunction<? extends C> supplier)
     
    static <C extends Collection<Float>>
    C
    toCollection(float[] a, IntFunction<? extends C> supplier)
     
    static <C extends Collection<Integer>>
    C
    toCollection(int[] a, int fromIndex, int toIndex, IntFunction<? extends C> supplier)
     
    static <C extends Collection<Integer>>
    C
    toCollection(int[] a, IntFunction<? extends C> supplier)
     
    static <C extends Collection<Long>>
    C
    toCollection(long[] a, int fromIndex, int toIndex, IntFunction<? extends C> supplier)
     
    static <C extends Collection<Long>>
    C
    toCollection(long[] a, IntFunction<? extends C> supplier)
     
    static <C extends Collection<Short>>
    C
    toCollection(short[] a, int fromIndex, int toIndex, IntFunction<? extends C> supplier)
     
    static <C extends Collection<Short>>
    C
    toCollection(short[] a, IntFunction<? extends C> supplier)
     
    static <T, C extends Collection<T>>
    C
    toCollection(Iterable<? extends T> c, IntFunction<? extends C> supplier)
     
    static <T, C extends Collection<T>>
    C
    toCollection(Iterator<? extends T> iter, Supplier<? extends C> supplier)
     
    static <T, C extends Collection<T>>
    C
    toCollection(T[] a, int fromIndex, int toIndex, IntFunction<? extends C> supplier)
     
    static <T, C extends Collection<T>>
    C
    toCollection(T[] a, IntFunction<? extends C> supplier)
     
    static double[]
    To double array.
    static double[]
    toDoubleArray(Collection<? extends Number> c, double defaultForNull)
    To double array.
    static double[]
    toDoubleArray(Collection<? extends Number> c, int fromIndex, int toIndex)
    To double array.
    static double[]
    toDoubleArray(Collection<? extends Number> c, int fromIndex, int toIndex, double defaultForNull)
    To double array.
    static float[]
    To float array.
    static float[]
    toFloatArray(Collection<? extends Number> c, float defaultForNull)
    To float array.
    static float[]
    toFloatArray(Collection<? extends Number> c, int fromIndex, int toIndex)
    To float array.
    static float[]
    toFloatArray(Collection<? extends Number> c, int fromIndex, int toIndex, float defaultForNull)
    To float array.
    static int[]
    toIntArray(boolean[] a)
    Converts a boolean array to an int array.
    static int[]
    toIntArray(char[] a)
    Converts a char array to an int array.
    static int[]
    To int array.
    static int[]
    toIntArray(Collection<? extends Number> c, int defaultForNull)
    To int array.
    static int[]
    toIntArray(Collection<? extends Number> c, int fromIndex, int toIndex)
    To int array.
    static int[]
    toIntArray(Collection<? extends Number> c, int fromIndex, int toIndex, int defaultForNull)
    To int array.
    static String
    Converts the given object into a JSON string.
    static String
    toJson(Object obj, boolean prettyFormat)
    Converts the given object into a JSON string with optional pretty formatting.
    static String
     
    static void
    toJson(Object obj, JSONSerializationConfig config, File output)
     
    static void
     
    static void
     
    static void
    toJson(Object obj, File output)
     
    static void
    toJson(Object obj, OutputStream output)
     
    static void
    toJson(Object obj, Writer output)
     
    static List<Boolean>
    toList(boolean[] a)
     
    static List<Boolean>
    toList(boolean[] a, int fromIndex, int toIndex)
     
    static List<Byte>
    toList(byte[] a)
     
    static List<Byte>
    toList(byte[] a, int fromIndex, int toIndex)
     
    static List<Character>
    toList(char[] a)
     
    static List<Character>
    toList(char[] a, int fromIndex, int toIndex)
     
    static List<Double>
    toList(double[] a)
     
    static List<Double>
    toList(double[] a, int fromIndex, int toIndex)
     
    static List<Float>
    toList(float[] a)
     
    static List<Float>
    toList(float[] a, int fromIndex, int toIndex)
     
    static List<Integer>
    toList(int[] a)
     
    static List<Integer>
    toList(int[] a, int fromIndex, int toIndex)
     
    static List<Long>
    toList(long[] a)
     
    static List<Long>
    toList(long[] a, int fromIndex, int toIndex)
     
    static List<Short>
    toList(short[] a)
     
    static List<Short>
    toList(short[] a, int fromIndex, int toIndex)
     
    static <T> List<T>
    toList(Iterator<? extends T> iter)
     
    static <T> List<T>
    toList(T[] a)
     
    static <T> List<T>
    toList(T[] a, int fromIndex, int toIndex)
     
    static long[]
    To long array.
    static long[]
    toLongArray(Collection<? extends Number> c, int fromIndex, int toIndex)
    To long array.
    static long[]
    toLongArray(Collection<? extends Number> c, int fromIndex, int toIndex, long defaultForNull)
    To long array.
    static long[]
    toLongArray(Collection<? extends Number> c, long defaultForNull)
    To long array.
    static <T, K> Map<K,T>
    toMap(Iterable<? extends T> c, Function<? super T,? extends K> keyMapper)
     
    static <T, K, V> Map<K,V>
    toMap(Iterable<? extends T> c, Function<? super T,? extends K> keyMapper, Function<? super T,? extends V> valueExtractor)
     
    static <T, K, V, M extends Map<K, V>>
    M
    toMap(Iterable<? extends T> c, Function<? super T,? extends K> keyMapper, Function<? super T,? extends V> valueExtractor, BiFunction<? super V,? super V,? extends V> mergeFunction, IntFunction<? extends M> mapSupplier)
     
    static <T, K, V, M extends Map<K, V>>
    M
    toMap(Iterable<? extends T> c, Function<? super T,? extends K> keyMapper, Function<? super T,? extends V> valueExtractor, IntFunction<? extends M> mapSupplier)
     
    static <T, K> Map<K,T>
    toMap(Iterator<? extends T> iter, Function<? super T,K> keyMapper)
     
    static <T, K, V> Map<K,V>
    toMap(Iterator<? extends T> iter, Function<? super T,K> keyMapper, Function<? super T,? extends V> valueExtractor)
     
    static <T, K, V, M extends Map<K, V>>
    M
    toMap(Iterator<? extends T> iter, Function<? super T,K> keyMapper, Function<? super T,? extends V> valueExtractor, BiFunction<? super V,? super V,? extends V> mergeFunction, Supplier<? extends M> mapSupplier)
     
    static <T, K, V, M extends Map<K, V>>
    M
    toMap(Iterator<? extends T> iter, Function<? super T,K> keyMapper, Function<? super T,? extends V> valueExtractor, Supplier<? extends M> mapSupplier)
     
    static double[]
    top(double[] a, int n)
    Returns the top n elements from the provided array.
    static double[]
    top(double[] a, int fromIndex, int toIndex, int n)
    Returns the top n elements from the provided array, based on their natural ordering.
    static double[]
    top(double[] a, int fromIndex, int toIndex, int n, Comparator<? super Double> cmp)
    Returns the top n elements from the provided array, based on the provided comparator.
    static double[]
    top(double[] a, int n, Comparator<? super Double> cmp)
    Returns the top n elements from the provided array.
    static float[]
    top(float[] a, int n)
    Returns the top n elements from the provided array.
    static float[]
    top(float[] a, int fromIndex, int toIndex, int n)
    Returns the top n elements from a specified range of the array.
    static float[]
    top(float[] a, int fromIndex, int toIndex, int n, Comparator<? super Float> cmp)
    Returns the top n elements from a specified range of the array, sorted according to the provided comparator.
    static float[]
    top(float[] a, int n, Comparator<? super Float> cmp)
    Returns the top n elements from the provided array.
    static int[]
    top(int[] a, int n)
    Returns the top n elements from the provided array.
    static int[]
    top(int[] a, int fromIndex, int toIndex, int n)
    Returns the top n elements from a specified range of the array.
    static int[]
    top(int[] a, int fromIndex, int toIndex, int n, Comparator<? super Integer> cmp)
    Returns the top n elements from a specified range of the array, sorted according to the provided comparator.
    static int[]
    top(int[] a, int n, Comparator<? super Integer> cmp)
    Returns the top n elements from the provided array.
    static long[]
    top(long[] a, int n)
    Returns the top n elements from the provided array.
    static long[]
    top(long[] a, int fromIndex, int toIndex, int n)
    Returns the top n elements from a specified range of the array.
    static long[]
    top(long[] a, int fromIndex, int toIndex, int n, Comparator<? super Long> cmp)
    Returns the top n elements from a specified range of the array, sorted according to the provided comparator.
    static long[]
    top(long[] a, int n, Comparator<? super Long> cmp)
    Returns the top n elements from the provided array.
    static short[]
    top(short[] a, int n)
    Returns the top n elements from the provided array.
    static short[]
    top(short[] a, int fromIndex, int toIndex, int n)
    Returns the top n elements from a specified range of the array.
    static short[]
    top(short[] a, int fromIndex, int toIndex, int n, Comparator<? super Short> cmp)
    Returns the top n elements from a specified range of the array, sorted according to the provided comparator.
    static short[]
    top(short[] a, int n, Comparator<? super Short> cmp)
    Returns the top n elements from the provided array.
    static <T extends Comparable<? super T>>
    List<T>
    top(Collection<? extends T> c, int n)
    Returns the top n elements from the provided collection, based on natural ordering of the elements.
    static <T extends Comparable<? super T>>
    List<T>
    top(Collection<? extends T> c, int n, boolean keepEncounterOrder)
    Returns the top n elements from the provided collection, based on the natural ordering of the elements.
    static <T extends Comparable<? super T>>
    List<T>
    top(Collection<? extends T> c, int fromIndex, int toIndex, int n)
    Returns the top n elements from the provided collection, based on natural ordering of the elements.
    static <T extends Comparable<? super T>>
    List<T>
    top(Collection<? extends T> c, int fromIndex, int toIndex, int n, boolean keepEncounterOrder)
    Returns the top n elements from the provided collection, based on the natural ordering of the elements.
    static <T> List<T>
    top(Collection<? extends T> c, int fromIndex, int toIndex, int n, Comparator<? super T> cmp)
    Returns the top n elements from the provided collection, based on the provided comparator.
    static <T> List<T>
    top(Collection<? extends T> c, int fromIndex, int toIndex, int n, Comparator<? super T> cmp, boolean keepEncounterOrder)
    Returns the top n elements from the provided collection, based on the provided comparator.
    static <T> List<T>
    top(Collection<? extends T> c, int n, Comparator<? super T> cmp)
    Returns the top n elements from the provided collection, based on the provided comparator.
    static <T> List<T>
    top(Collection<? extends T> c, int n, Comparator<? super T> cmp, boolean keepEncounterOrder)
    Returns the top n elements from the provided collection, based on the provided comparator.
    static <T extends Comparable<? super T>>
    List<T>
    top(T[] a, int n)
    Returns the top n elements from the provided array.
    static <T extends Comparable<? super T>>
    List<T>
    top(T[] a, int n, boolean keepEncounterOrder)
    Returns the top n elements from the provided array, based on natural ordering of the elements.
    static <T extends Comparable<? super T>>
    List<T>
    top(T[] a, int fromIndex, int toIndex, int n)
    Returns the top n elements from the provided array, based on their natural ordering.
    static <T extends Comparable<? super T>>
    List<T>
    top(T[] a, int fromIndex, int toIndex, int n, boolean keepEncounterOrder)
    Returns the top n elements from the provided array, based on the natural ordering of the elements.
    static <T> List<T>
    top(T[] a, int fromIndex, int toIndex, int n, Comparator<? super T> cmp)
    Returns the top n elements from the provided array, based on the provided comparator.
    static <T> List<T>
    top(T[] a, int fromIndex, int toIndex, int n, Comparator<? super T> cmp, boolean keepEncounterOrder)
    Returns the top n elements from the provided array, based on the provided comparator.
    static <T> List<T>
    top(T[] a, int n, Comparator<? super T> cmp)
    Returns the top n elements from the provided array.
    static <T> List<T>
    top(T[] a, int n, Comparator<? super T> cmp, boolean keepEncounterOrder)
    Returns the top n elements from the provided array, based on the provided comparator.
    Converts the provided exception to a runtime exception.
    Converts the specified Throwable to a RuntimeException if it's a checked exception or an Error, otherwise returns itself.
    toRuntimeException(Throwable e, boolean throwIfItIsError)
    Converts the specified Throwable to a RuntimeException if it's a checked exception, or throw it if it's an Error.
    static Set<Boolean>
    toSet(boolean[] a)
     
    static Set<Boolean>
    toSet(boolean[] a, int fromIndex, int toIndex)
     
    static Set<Byte>
    toSet(byte[] a)
     
    static Set<Byte>
    toSet(byte[] a, int fromIndex, int toIndex)
     
    static Set<Character>
    toSet(char[] a)
     
    static Set<Character>
    toSet(char[] a, int fromIndex, int toIndex)
     
    static Set<Double>
    toSet(double[] a)
     
    static Set<Double>
    toSet(double[] a, int fromIndex, int toIndex)
     
    static Set<Float>
    toSet(float[] a)
     
    static Set<Float>
    toSet(float[] a, int fromIndex, int toIndex)
     
    static Set<Integer>
    toSet(int[] a)
     
    static Set<Integer>
    toSet(int[] a, int fromIndex, int toIndex)
     
    static Set<Long>
    toSet(long[] a)
     
    static Set<Long>
    toSet(long[] a, int fromIndex, int toIndex)
     
    static Set<Short>
    toSet(short[] a)
     
    static Set<Short>
    toSet(short[] a, int fromIndex, int toIndex)
     
    static <T> Set<T>
    toSet(Iterator<? extends T> iter)
     
    static <T> Set<T>
    toSet(T[] a)
     
    static <T> Set<T>
    toSet(T[] a, int fromIndex, int toIndex)
     
    static short[]
    To short array.
    static short[]
    toShortArray(Collection<? extends Number> c, int fromIndex, int toIndex)
    To short array.
    static short[]
    toShortArray(Collection<? extends Number> c, int fromIndex, int toIndex, short defaultForNull)
    To short array.
    static short[]
    toShortArray(Collection<? extends Number> c, short defaultForNull)
    To short array.
    static String
    toString(boolean value)
     
    static String
    toString(boolean[] a)
     
    static String
    toString(boolean[] a, int fromIndex, int toIndex)
     
    static String
    toString(byte value)
     
    static String
    toString(byte[] a)
     
    static String
    toString(byte[] a, int fromIndex, int toIndex)
     
    static String
    toString(char value)
     
    static String
    toString(char[] a)
     
    static String
    toString(char[] a, int fromIndex, int toIndex)
     
    static String
    toString(double value)
     
    static String
    toString(double[] a)
     
    static String
    toString(double[] a, int fromIndex, int toIndex)
     
    static String
    toString(float value)
     
    static String
    toString(float[] a)
     
    static String
    toString(float[] a, int fromIndex, int toIndex)
     
    static String
    toString(int value)
     
    static String
    toString(int[] a)
     
    static String
    toString(int[] a, int fromIndex, int toIndex)
     
    static String
    toString(long value)
     
    static String
    toString(long[] a)
     
    static String
    toString(long[] a, int fromIndex, int toIndex)
     
    static String
    toString(short value)
     
    static String
    toString(short[] a)
     
    static String
    toString(short[] a, int fromIndex, int toIndex)
     
    static String
     
    static String
     
    static String
    toString(Object[] a, int fromIndex, int toIndex)
     
    static String
    toString(Object a, String defaultIfNull)
     
    static String
    Converts the given object into an XML string.
    static String
    toXml(Object obj, boolean prettyFormat)
    Converts the given object into an XML string with optional pretty formatting.
    static String
     
    static void
    toXml(Object obj, XMLSerializationConfig config, File output)
     
    static void
     
    static void
    toXml(Object obj, XMLSerializationConfig config, Writer output)
     
    static void
    toXml(Object obj, File output)
     
    static void
    toXml(Object obj, OutputStream output)
     
    static void
    toXml(Object obj, Writer output)
     
    static <R> R
    tryOrDefaultIfExceptionOccurred(Callable<R> cmd, Supplier<R> supplierForDefaultIfExceptionOccurred)
    Returns the value returned by action or {@code supplierForDefaultIfExceptionOccurred} if exception happens.
    static <R> R
    tryOrDefaultIfExceptionOccurred(Callable<R> cmd, R defaultIfExceptionOccurred)
    Returns the value returned by action or defaultIfExceptionOccurred if exception happens.
    static <T, R> R
    tryOrDefaultIfExceptionOccurred(T init, Throwables.Function<? super T,? extends R,? extends Exception> func, Supplier<R> supplierForDefaultIfExceptionOccurred)
    Returns the value returned by action or defaultIfExceptionOccurred if exception happens.
    static <T, R> R
    tryOrDefaultIfExceptionOccurred(T init, Throwables.Function<? super T,? extends R,? extends Exception> func, R defaultIfExceptionOccurred)
    Returns the value returned by action or defaultIfExceptionOccurred if exception happens.
    static <R> u.Nullable<R>
    Returns a Nullable with the value returned by action or an empty Nullable if exception happens.
    static <T, R> u.Nullable<R>
    tryOrEmptyIfExceptionOccurred(T init, Throwables.Function<? super T,? extends R,? extends Exception> func)
    Returns a Nullable with the value returned by func.apply(init) or an empty Nullable if exception happens.
    static <T> com.landawn.abacus.type.Type<T>
    typeOf(Class<?> cls)
    Gets a Type by the given Class.
    static <T> com.landawn.abacus.type.Type<T>
    typeOf(String typeName)
    Gets a Type by the given type name.
    static <T> Collection<T>
    Returns an unmodifiable view of the specified Collection.
    static <T> List<T>
    unmodifiableList(List<? extends T> list)
    Returns an unmodifiable view of the specified List.
    static <K, V> Map<K,V>
    unmodifiableMap(Map<? extends K,? extends V> m)
    Returns an unmodifiable view of the specified Map.
    static <K, V> NavigableMap<K,V>
    Returns an unmodifiable view of the specified NavigableMap.
    static <T> NavigableSet<T>
    Returns an unmodifiable view of the specified NavigableSet.
    static <T> Set<T>
    unmodifiableSet(Set<? extends T> s)
    Returns an unmodifiable view of the specified Set.
    static <K, V> SortedMap<K,V>
    unmodifiableSortedMap(SortedMap<K,? extends V> m)
    Returns an unmodifiable view of the specified SortedMap.
    static <T> SortedSet<T>
    Returns an unmodifiable view of the specified SortedSet.
    static <T, A, B> Pair<List<A>,List<B>>
    unzip(Iterable<? extends T> c, BiConsumer<? super T,Pair<A,B>> unzip)
     
    static <T, A, B, LC extends Collection<A>, RC extends Collection<B>>
    Pair<LC,RC>
    unzip(Iterable<? extends T> c, BiConsumer<? super T,Pair<A,B>> unzip, IntFunction<? extends Collection<?>> supplier)
     
    static <T, A, B, C>
    Triple<List<A>,List<B>,List<C>>
    unzipp(Iterable<? extends T> c, BiConsumer<? super T,Triple<A,B,C>> unzip)
    static <T, A, B, C, LC extends Collection<A>, MC extends Collection<B>, RC extends Collection<C>>
    Triple<LC,MC,RC>
    unzipp(Iterable<? extends T> c, BiConsumer<? super T,Triple<A,B,C>> unzip, IntFunction<? extends Collection<?>> supplier)
    static void
    Deprecated.
    use replaceAll
    static void
    Deprecated.
    use replaceIf
    static <T> T
    valueOf(String str, Class<? extends T> targetType)
    Converts the given string to its corresponding value of the specified target type.
    static String
    Xml 2 JSO.
    static String
    xml2Json(String xml, Class<?> transferType)
    Xml 2 JSO.
    static <A, B, R> List<R>
    zip(A[] a, B[] b, A valueForNoneA, B valueForNoneB, BiFunction<? super A,? super B,? extends R> zipFunction)
     
    static <A, B, R> R[]
    zip(A[] a, B[] b, A valueForNoneA, B valueForNoneB, BiFunction<? super A,? super B,? extends R> zipFunction, Class<R> targetElementType)
     
    static <A, B, C, R>
    List<R>
    zip(A[] a, B[] b, C[] c, A valueForNoneA, B valueForNoneB, C valueForNoneC, TriFunction<? super A,? super B,? super C,? extends R> zipFunction)
     
    static <A, B, C, R>
    R[]
    zip(A[] a, B[] b, C[] c, A valueForNoneA, B valueForNoneB, C valueForNoneC, TriFunction<? super A,? super B,? super C,? extends R> zipFunction, Class<R> targetElementType)
     
    static <A, B, C, R>
    List<R>
    zip(A[] a, B[] b, C[] c, TriFunction<? super A,? super B,? super C,? extends R> zipFunction)
     
    static <A, B, C, R>
    R[]
    zip(A[] a, B[] b, C[] c, TriFunction<? super A,? super B,? super C,? extends R> zipFunction, Class<R> targetElementType)
     
    static <A, B, R> List<R>
    zip(A[] a, B[] b, BiFunction<? super A,? super B,? extends R> zipFunction)
     
    static <A, B, R> R[]
    zip(A[] a, B[] b, BiFunction<? super A,? super B,? extends R> zipFunction, Class<R> targetElementType)
     
    static <A, B, R> List<R>
    zip(Iterable<A> a, Iterable<B> b, A valueForNoneA, B valueForNoneB, BiFunction<? super A,? super B,? extends R> zipFunction)
     
    static <A, B, C, R>
    List<R>
    zip(Iterable<A> a, Iterable<B> b, Iterable<C> c, A valueForNoneA, B valueForNoneB, C valueForNoneC, TriFunction<? super A,? super B,? super C,? extends R> zipFunction)
     
    static <A, B, C, R>
    List<R>
    zip(Iterable<A> a, Iterable<B> b, Iterable<C> c, TriFunction<? super A,? super B,? super C,? extends R> zipFunction)
     
    static <A, B, R> List<R>
    zip(Iterable<A> a, Iterable<B> b, BiFunction<? super A,? super B,? extends R> zipFunction)
     

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • INDEX_NOT_FOUND

      public static final int INDEX_NOT_FOUND
      The index value when an element is not found in a list or array: -1. This value is returned by methods in this class and can also be used in comparisons with values returned by various method from List .
      See Also:
    • EMPTY_BOOLEAN_ARRAY

      public static final boolean[] EMPTY_BOOLEAN_ARRAY
      An empty immutable/unmodifiable boolean array.
    • EMPTY_CHAR_ARRAY

      public static final char[] EMPTY_CHAR_ARRAY
      An empty immutable/unmodifiable char array.
    • EMPTY_BYTE_ARRAY

      public static final byte[] EMPTY_BYTE_ARRAY
      An empty immutable/unmodifiable byte array.
    • EMPTY_SHORT_ARRAY

      public static final short[] EMPTY_SHORT_ARRAY
      An empty immutable/unmodifiable short array.
    • EMPTY_INT_ARRAY

      public static final int[] EMPTY_INT_ARRAY
      An empty immutable/unmodifiable int array.
    • EMPTY_LONG_ARRAY

      public static final long[] EMPTY_LONG_ARRAY
      An empty immutable/unmodifiable long array.
    • EMPTY_FLOAT_ARRAY

      public static final float[] EMPTY_FLOAT_ARRAY
      An empty immutable/unmodifiable float array.
    • EMPTY_DOUBLE_ARRAY

      public static final double[] EMPTY_DOUBLE_ARRAY
      An empty immutable/unmodifiable double array.
    • EMPTY_BOOLEAN_OBJ_ARRAY

      public static final Boolean[] EMPTY_BOOLEAN_OBJ_ARRAY
      An empty immutable/unmodifiable Boolean array.
    • EMPTY_CHAR_OBJ_ARRAY

      public static final Character[] EMPTY_CHAR_OBJ_ARRAY
      An empty immutable/unmodifiable Character array.
    • EMPTY_BYTE_OBJ_ARRAY

      public static final Byte[] EMPTY_BYTE_OBJ_ARRAY
      An empty immutable/unmodifiable Byte array.
    • EMPTY_SHORT_OBJ_ARRAY

      public static final Short[] EMPTY_SHORT_OBJ_ARRAY
      An empty immutable/unmodifiable Short array.
    • EMPTY_INT_OBJ_ARRAY

      public static final Integer[] EMPTY_INT_OBJ_ARRAY
      An empty immutable/unmodifiable Integer array.
    • EMPTY_LONG_OBJ_ARRAY

      public static final Long[] EMPTY_LONG_OBJ_ARRAY
      An empty immutable/unmodifiable Long array.
    • EMPTY_FLOAT_OBJ_ARRAY

      public static final Float[] EMPTY_FLOAT_OBJ_ARRAY
      An empty immutable/unmodifiable Float array.
    • EMPTY_DOUBLE_OBJ_ARRAY

      public static final Double[] EMPTY_DOUBLE_OBJ_ARRAY
      An empty immutable/unmodifiable Double array.
    • EMPTY_BIG_INTEGER_ARRAY

      public static final BigInteger[] EMPTY_BIG_INTEGER_ARRAY
      An empty immutable/unmodifiable BigInteger array.
    • EMPTY_BIG_DECIMAL_ARRAY

      public static final BigDecimal[] EMPTY_BIG_DECIMAL_ARRAY
      An empty immutable/unmodifiable BigDecimal array.
    • EMPTY_STRING_ARRAY

      public static final String[] EMPTY_STRING_ARRAY
      An empty immutable/unmodifiable String array.
    • EMPTY_JU_DATE_ARRAY

      public static final Date[] EMPTY_JU_DATE_ARRAY
      An empty immutable/unmodifiable java.util.Date array.
    • EMPTY_DATE_ARRAY

      public static final Date[] EMPTY_DATE_ARRAY
      An empty immutable/unmodifiable java.sql.Date array.
    • EMPTY_TIME_ARRAY

      public static final Time[] EMPTY_TIME_ARRAY
      An empty immutable/unmodifiable Time array.
    • EMPTY_TIMESTAMP_ARRAY

      public static final Timestamp[] EMPTY_TIMESTAMP_ARRAY
      An empty immutable/unmodifiable Timestamp array.
    • EMPTY_CALENDAR_ARRAY

      public static final Calendar[] EMPTY_CALENDAR_ARRAY
      /** An empty immutable/unmodifiable Calendar array.
    • EMPTY_LOCAL_DATE_ARRAY

      public static final LocalDate[] EMPTY_LOCAL_DATE_ARRAY
      /** An empty immutable/unmodifiable LocalDate array.
    • EMPTY_LOCAL_TIME_ARRAY

      public static final LocalTime[] EMPTY_LOCAL_TIME_ARRAY
      /** An empty immutable/unmodifiable LocalTime array.
    • EMPTY_LOCAL_DATE_TIME_ARRAY

      public static final LocalDateTime[] EMPTY_LOCAL_DATE_TIME_ARRAY
      /** An empty immutable/unmodifiable LocalDateTime array.
    • EMPTY_OBJECT_ARRAY

      public static final Object[] EMPTY_OBJECT_ARRAY
      An empty immutable/unmodifiable Object array.
  • Method Details

    • occurrencesOf

      public static int occurrencesOf(boolean[] a, boolean valueToFind)
      Counts the occurrences of a specific boolean value in a boolean array.
      Parameters:
      a - The boolean array to be checked for the presence of the valueToFind.
      valueToFind - The boolean value to be checked for its occurrences in the array a.
      Returns:
      The number of occurrences of valueToFind in array a. Returns 0 if the array is null or empty.
    • occurrencesOf

      public static int occurrencesOf(char[] a, char valueToFind)
      Counts the occurrences of a specific char value in a char array.
      Parameters:
      a - The char array to be checked for the presence of the valueToFind.
      valueToFind - The char value to be checked for its occurrences in the array a.
      Returns:
      The number of occurrences of valueToFind in array a. Returns 0 if the array is null or empty.
    • occurrencesOf

      public static int occurrencesOf(byte[] a, byte valueToFind)
      Counts the occurrences of a specific byte value in a byte array.
      Parameters:
      a - The byte array to be checked for the presence of the valueToFind.
      valueToFind - The byte value to be checked for its occurrences in the array a.
      Returns:
      The number of occurrences of valueToFind in array a. Returns 0 if the array is null or empty.
    • occurrencesOf

      public static int occurrencesOf(short[] a, short valueToFind)
      Counts the occurrences of a specific short value in a short array.
      Parameters:
      a - The short array to be checked for the presence of the valueToFind.
      valueToFind - The short value to be checked for its occurrences in the array a.
      Returns:
      The number of occurrences of valueToFind in array a. Returns 0 if the array is null or empty.
    • occurrencesOf

      public static int occurrencesOf(int[] a, int valueToFind)
      Counts the occurrences of a specific int value in a int array.
      Parameters:
      a - The int array to be checked for the presence of the valueToFind.
      valueToFind - The int value to be checked for its occurrences in the array a.
      Returns:
      The number of occurrences of valueToFind in array a. Returns 0 if the array is null or empty.
    • occurrencesOf

      public static int occurrencesOf(long[] a, long valueToFind)
      Counts the occurrences of a specific long value in a long array.
      Parameters:
      a - The long array to be checked for the presence of the valueToFind.
      valueToFind - The long value to be checked for its occurrences in the array a.
      Returns:
      The number of occurrences of valueToFind in array a. Returns 0 if the array is null or empty.
    • occurrencesOf

      public static int occurrencesOf(float[] a, float valueToFind)
      Counts the occurrences of a specific float value in a float array.
      Parameters:
      a - The float array to be checked for the presence of the valueToFind.
      valueToFind - The float value to be checked for its occurrences in the array a.
      Returns:
      The number of occurrences of valueToFind in array a. Returns 0 if the array is null or empty.
    • occurrencesOf

      public static int occurrencesOf(double[] a, double valueToFind)
      Counts the occurrences of a specific double value in a double array.
      Parameters:
      a - The double array to be checked for the presence of the valueToFind.
      valueToFind - The double value to be checked for its occurrences in the array a.
      Returns:
      The number of occurrences of valueToFind in array a. Returns 0 if the array is null or empty.
    • occurrencesOf

      public static int occurrencesOf(Object[] a, Object valueToFind)
      Counts the occurrences of a specific Object value in an Object array.
      Parameters:
      a - The Object array to be checked for the presence of the valueToFind.
      valueToFind - The Object value to be checked for its occurrences in the array a.
      Returns:
      The number of occurrences of valueToFind in array a. Returns 0 if the array is null or empty.
    • occurrencesOf

      public static int occurrencesOf(Iterable<?> c, Object valueToFind)
      Counts the occurrences of a specific Object value in an Iterable.
      Parameters:
      c - The Iterable to be checked for the presence of the valueToFind.
      valueToFind - The Object value to be checked for its occurrences in the Iterable c.
      Returns:
      The number of occurrences of valueToFind in Iterable c. Returns 0 if the Iterable is null.
    • occurrencesOf

      public static int occurrencesOf(Iterator<?> iter, Object valueToFind) throws ArithmeticException
      Counts the occurrences of a specific Object value in an Iterator.
      Parameters:
      iter - The Iterator to be checked for the presence of the valueToFind.
      valueToFind - The Object value to be checked for its occurrences in the Iterator iter.
      Returns:
      The number of occurrences of valueToFind in Iterator iter. Returns 0 if the Iterator is null.
      Throws:
      ArithmeticException - if the number of occurrences exceeds Integer.MAX_VALUE.
      See Also:
    • occurrencesOf

      public static int occurrencesOf(String str, char valueToFind)
      Counts the occurrences of a specific character in a String.
      Parameters:
      str - The String to be checked for the presence of the valueToFind.
      valueToFind - The character to be checked for its occurrences in the String str.
      Returns:
      The number of occurrences of valueToFind in String str. Returns 0 if the String is null or empty.
      See Also:
    • occurrencesOf

      public static int occurrencesOf(String str, String valueToFind)
      Counts the occurrences of a specific String value in another String.
      Parameters:
      str - The String to be checked for the presence of the valueToFind.
      valueToFind - The String value to be checked for its occurrences in the String str.
      Returns:
      The number of occurrences of valueToFind in String str. Returns 0 if the String is null or empty.
      See Also:
    • occurrencesMap

      public static <T> Map<T,Integer> occurrencesMap(T[] a)
      Returns a map with the occurrences of each element in the given array. The map's keys are the distinct elements in the array, and their corresponding values are the number of occurrences of each element. If the input array is null or empty, an empty map is returned.
      Type Parameters:
      T - the type of elements in the array
      Parameters:
      a - the array to count occurrences from
      Returns:
      a Map containing the elements of the array as keys and their occurrences as values
    • occurrencesMap

      public static <T> Map<T,Integer> occurrencesMap(T[] a, Supplier<Map<T,Integer>> mapSupplier)
      Returns a map with the occurrences of each element in the given array. The map's keys are the distinct elements in the array, and their corresponding values are the number of occurrences of each element. If the input array is null or empty, a map provided by the supplied map supplier is returned.
      Type Parameters:
      T - the type of elements in the array
      Parameters:
      a - the array to count occurrences from
      mapSupplier - the supplier of the map to be used for collecting occurrences
      Returns:
      a Map containing the elements of the array as keys and their occurrences as values
    • occurrencesMap

      public static <T> Map<T,Integer> occurrencesMap(Iterable<? extends T> c)
      Returns a map with the occurrences of each element in the given iterable collection. The map's keys are the distinct elements in the collection, and their corresponding values are the number of occurrences of each element. If the input collection is null, an empty map is returned.
      Type Parameters:
      T - the type of elements in the collection
      Parameters:
      c - the collection to count occurrences from
      Returns:
      a Map containing the elements of the collection as keys and their occurrences as values
    • occurrencesMap

      public static <T> Map<T,Integer> occurrencesMap(Iterable<? extends T> c, Supplier<Map<T,Integer>> mapSupplier)
      Returns a map with the occurrences of each element in the given iterable collection. The map's keys are the distinct elements in the collection, and their corresponding values are the number of occurrences of each element. If the input collection is null, a map provided by the supplied map supplier is returned.
      Type Parameters:
      T - the type of elements in the collection
      Parameters:
      c - the collection to count occurrences from
      mapSupplier - the supplier of the map to be used for collecting occurrences
      Returns:
      a Map containing the elements of the collection as keys and their occurrences as values
    • occurrencesMap

      public static <T> Map<T,Integer> occurrencesMap(Iterator<? extends T> iter)
      Returns a map with the occurrences of each element in the given iterator. The map's keys are the distinct elements in the iterator, and their corresponding values are the number of occurrences of each element. If the input iterator is null or empty, an empty map is returned.
      Type Parameters:
      T - the type of elements in the iterator
      Parameters:
      iter - the iterator to count occurrences from
      Returns:
      a Map containing the elements of the iterator as keys and their occurrences as values
    • occurrencesMap

      public static <T> Map<T,Integer> occurrencesMap(Iterator<? extends T> iter, Supplier<Map<T,Integer>> mapSupplier)
      Returns a map with the occurrences of each element in the given iterator. The map's keys are the distinct elements in the iterator, and their corresponding values are the number of occurrences of each element. If the input iterator is null or empty, a map provided by the supplied map supplier is returned.
      Type Parameters:
      T - the type of elements in the iterator
      Parameters:
      iter - the iterator to count occurrences from
      mapSupplier - the supplier of the map to be used for collecting occurrences
      Returns:
      a Map containing the elements of the iterator as keys and their occurrences as values
    • contains

      public static boolean contains(boolean[] a, boolean valueToFind)
      Checks if the specified array contains the specified value.
      Parameters:
      a - The array to be checked for the presence of the value.
      valueToFind - The value to be checked for its presence in the array.
      Returns:
      true if the array contains the specified value, false if a is null or empty or valueToFind is not found.
    • contains

      public static boolean contains(char[] a, char valueToFind)
      Checks if the specified array contains the specified value.
      Parameters:
      a - The array to be checked for the presence of the value.
      valueToFind - The value to be checked for its presence in the array.
      Returns:
      true if the array contains the specified value, false if a is null or empty or valueToFind is not found.
    • contains

      public static boolean contains(byte[] a, byte valueToFind)
      Checks if the specified array contains the specified value.
      Parameters:
      a - The array to be checked for the presence of the value.
      valueToFind - The value to be checked for its presence in the array.
      Returns:
      true if the array contains the specified value, false if a is null or empty or valueToFind is not found.
    • contains

      public static boolean contains(short[] a, short valueToFind)
      Checks if the specified array contains the specified value.
      Parameters:
      a - The array to be checked for the presence of the value.
      valueToFind - The value to be checked for its presence in the array.
      Returns:
      true if the array contains the specified value, false if a is null or empty or valueToFind is not found.
    • contains

      public static boolean contains(int[] a, int valueToFind)
      Checks if the specified array contains the specified value.
      Parameters:
      a - The array to be checked for the presence of the value.
      valueToFind - The value to be checked for its presence in the array.
      Returns:
      true if the array contains the specified value, false if a is null or empty or valueToFind is not found.
    • contains

      public static boolean contains(long[] a, long valueToFind)
      Checks if the specified array contains the specified value.
      Parameters:
      a - The array to be checked for the presence of the value.
      valueToFind - The value to be checked for its presence in the array.
      Returns:
      true if the array contains the specified value, false if a is null or empty or valueToFind is not found.
    • contains

      public static boolean contains(float[] a, float valueToFind)
      Checks if the specified array contains the specified value.
      Parameters:
      a - The array to be checked for the presence of the value.
      valueToFind - The value to be checked for its presence in the array.
      Returns:
      true if the array contains the specified value, false if a is null or empty or valueToFind is not found.
    • contains

      public static boolean contains(double[] a, double valueToFind)
      Checks if the specified array contains the specified value.
      Parameters:
      a - The array to be checked for the presence of the value.
      valueToFind - The value to be checked for its presence in the array.
      Returns:
      true if the array contains the specified value, false if a is null or empty or valueToFind is not found.
    • contains

      public static boolean contains(Object[] a, Object valueToFind)
      Checks if the specified array contains the specified value.
      Parameters:
      a - The array to be checked for the presence of the value.
      valueToFind - The value to be checked for its presence in the array.
      Returns:
      true if the array contains the specified value, false if a is null or empty or valueToFind is not found.
    • contains

      public static boolean contains(Collection<?> c, Object valueToFind)
      Checks if the specified Collection contains the specified value.
      Parameters:
      c - The Collection to be checked for the presence of the Collection.
      valueToFind - The value to be checked for its presence in the array.
      Returns:
      true if the array contains the specified value, false if valueToFind is not found or c is null or empty.
    • contains

      public static boolean contains(Iterable<?> c, Object valueToFind)
      Checks if the specified Iterable contains the specified value.
      Parameters:
      c - The Iterable to be checked for the presence of the value.
      valueToFind - The value to be checked for its presence in the Iterable.
      Returns:
      true if the array contains the specified value, false if valueToFind is not found or c is null or empty.
    • contains

      public static boolean contains(Iterator<?> iter, Object valueToFind)
      Checks if the specified Iterator contains the specified value.
      Parameters:
      valueToFind - The value to be checked for its presence in the Iterator.
      c - The Iterator to be checked for the presence of the value.
      Returns:
      true if the array contains the specified value, false if valueToFind is not found or c is null or empty.
    • containsAll

      public static boolean containsAll(Collection<?> c, Collection<?> valuesToFind)
      Checks if the specified Collection contains all the elements in the specified valuesToFind Collection.
      Parameters:
      c - The Collection to be checked for the presence of the elements in valuesToFind.
      valuesToFind - The Collection of values to be checked for their presence in the Collection c.
      Returns:
      true if the Collection c contains all the elements in valuesToFind or valuesToFind is null or empty, false if any element in valuesToFind is not found in c or if c is null or empty.
    • containsAll

      @SafeVarargs public static boolean containsAll(Collection<?> c, Object... valuesToFind)
      Checks if the specified Collection contains all the elements in the specified valuesToFind array.
      Parameters:
      c - The Collection to be checked for the presence of the elements in valuesToFind.
      valuesToFind - The array of values to be checked for their presence in the Collection c.
      Returns:
      true if the Collection c contains all the elements in valuesToFind or valuesToFind is null or empty, false if any element in valuesToFind is not found in c or if c is null or empty.
    • containsAll

      public static boolean containsAll(Iterable<?> c, Collection<?> valuesToFind)
      Checks if the specified Iterable contains all the elements in the specified valuesToFind Collection.
      Parameters:
      c - The Iterable to be checked for the presence of the elements in valuesToFind.
      valuesToFind - The Collection of values to be checked for their presence in the Iterable c.
      Returns:
      true if the Iterable c contains all the elements in valuesToFind or valuesToFind is null or empty, false if any element in valuesToFind is not found in c or if c is null or empty.
    • containsAll

      public static boolean containsAll(Iterator<?> iter, Collection<?> valuesToFind)
      Checks if the specified Iterator contains all the elements in the specified valuesToFind Collection.
      Parameters:
      valuesToFind - The Collection of values to be checked for their presence in the Iterator c.
      c - The Iterator to be checked for the presence of the elements in valuesToFind.
      Returns:
      true if the Iterator iter contains all the elements in valuesToFind or valuesToFind is null or empty, false if any element in valuesToFind is not found in iter or if iter is null or empty.
    • containsAny

      public static boolean containsAny(Collection<?> c, Collection<?> valuesToFind)
      Checks if the specified Collection contains any elements from the specified valuesToFind Collection.
      Parameters:
      c - The Collection to be checked for the presence of any elements in valuesToFind.
      valuesToFind - The Collection of values to be checked for their presence in the Collection c.
      Returns:
      true if the Collection c contains any elements in valuesToFind or false if c is null or empty, or if valuesToFind is null or empty .
    • containsAny

      @SafeVarargs public static boolean containsAny(Collection<?> c, Object... valuesToFind)
      Checks if the specified Collection contains any elements from the specified valuesToFind array.
      Parameters:
      c - The Collection to be checked for the presence of any elements in valuesToFind.
      valuesToFind - The array of values to be checked for their presence in the Collection c.
      Returns:
      true if the Collection c contains any elements in valuesToFind or false if c is null or empty, or if valuesToFind is null or empty .
    • containsAny

      public static boolean containsAny(Iterable<?> c, Set<?> valuesToFind)
      Checks if the specified Iterable contains any elements from the specified valuesToFind Set.
      Parameters:
      c - The Iterable to be checked for the presence of any elements in valuesToFind.
      valuesToFind - The Set of values to be checked for their presence in the Iterable c.
      Returns:
      true if the Iterable c contains any elements in valuesToFind or false if c is null or empty, or if valuesToFind is null or empty .
    • containsAny

      public static boolean containsAny(Iterator<?> iter, Set<?> valuesToFind)
      Checks if the specified Iterator contains any elements from the specified valuesToFind Set.
      Parameters:
      iter - The Iterator to be checked for the presence of any elements in valuesToFind.
      valuesToFind - The Set of values to be checked for their presence in the Iterator iter.
      Returns:
      true if the Iterator iter contains any elements in valuesToFind or false if iter is null or empty, or if valuesToFind is null or empty .
    • slice

      public static <T> ImmutableList<T> slice(T[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns a read-only slice of the input array from the specified start index to the end index.
      Type Parameters:
      T - The type of the elements in the array.
      Parameters:
      a - The input array to be sliced.
      fromIndex - The start index for the slice, inclusive.
      toIndex - The end index for the slice, exclusive.
      Returns:
      An ImmutableList containing the slice of the input array.
      Throws:
      IndexOutOfBoundsException - if the fromIndex is negative, toIndex is larger than the length of the array, or fromIndex is larger than toIndex.
    • slice

      public static <T> ImmutableList<T> slice(List<? extends T> c, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns a read-only slice of the input list from the specified start index to the end index.
      Type Parameters:
      T - The type of the elements in the list.
      Parameters:
      c - The input list to be sliced.
      fromIndex - The start index for the slice, inclusive.
      toIndex - The end index for the slice, exclusive.
      Returns:
      An ImmutableList containing the slice of the input list.
      Throws:
      IndexOutOfBoundsException - if the fromIndex is negative, toIndex is larger than the length of the list, or fromIndex is larger than toIndex.
    • slice

      public static <T> ImmutableCollection<T> slice(Collection<? extends T> c, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns a read-only slice of the input collection from the specified start index to the end index.
      Type Parameters:
      T - The type of the elements in the collection.
      Parameters:
      c - The input collection to be sliced.
      fromIndex - The start index for the slice, inclusive.
      toIndex - The end index for the slice, exclusive.
      Returns:
      An ImmutableCollection containing the slice of the input collection.
      Throws:
      IndexOutOfBoundsException - if the fromIndex is negative, toIndex is larger than the size of the collection, or fromIndex is larger than toIndex.
    • slice

      public static <T> ObjIterator<T> slice(Iterator<? extends T> iter, long fromIndex, long toIndex)
      Returns a read-only slice of the input iterator from the specified start index to the end index.
      Type Parameters:
      T - The type of the elements in the iterator.
      Parameters:
      iter - The input iterator to be sliced.
      fromIndex - The start index for the slice, inclusive.
      toIndex - The end index for the slice, exclusive.
      Returns:
      An ObjIterator containing the slice of the input iterator.
      Throws:
      IndexOutOfBoundsException - if the fromIndex is negative, or fromIndex is larger than toIndex.
    • split

      public static List<boolean[]> split(boolean[] a, int chunkSize) throws IllegalArgumentException
      Splits the input boolean array into sub-arrays of the specified size. The last sub-array may be smaller if the total array length is not a multiple of chunkSize.
      Parameters:
      a - The input boolean array to be split.
      chunkSize - The desired size of each sub-array.
      Returns:
      A list of boolean sub-arrays, each of size chunkSize (except possibly for the last one).
      Throws:
      IllegalArgumentException - if chunkSize is not a positive integer.
    • split

      public static List<boolean[]> split(boolean[] a, int fromIndex, int toIndex, int chunkSize) throws IllegalArgumentException, IndexOutOfBoundsException
      Splits the input boolean array into sub-arrays of the specified size. The last sub-array may be smaller if the length of specified range is not a multiple of chunkSize. The sub-arrays are created from the specified range in the input array.
      Parameters:
      a - The input boolean array to be split.
      fromIndex - The start index for the slice of the array to be split, inclusive.
      toIndex - The end index for the slice of the array to be split, exclusive.
      chunkSize - The desired size of each sub-array.
      Returns:
      A list of boolean sub-arrays, each of size chunkSize (except possibly for the last one).
      Throws:
      IllegalArgumentException - if chunkSize is not a positive integer.
      IndexOutOfBoundsException - if fromIndex is negative, toIndex is larger than the length of the array, or fromIndex is larger than toIndex.
    • split

      public static List<char[]> split(char[] a, int chunkSize) throws IllegalArgumentException
      Splits the input char array into sub-arrays of the specified size. The last sub-array may be smaller if the total array length is not a multiple of chunkSize.
      Parameters:
      a - The input char array to be split.
      chunkSize - The desired size of each sub-array.
      Returns:
      A list of char sub-arrays, each of size chunkSize (except possibly for the last one).
      Throws:
      IllegalArgumentException - if chunkSize is not a positive integer.
    • split

      public static List<char[]> split(char[] a, int fromIndex, int toIndex, int chunkSize) throws IllegalArgumentException, IndexOutOfBoundsException
      Splits the input char array into sub-arrays of the specified size. The last sub-array may be smaller if the length of specified range is not a multiple of chunkSize. The sub-arrays are created from the specified range in the input array.
      Parameters:
      a - The input char array to be split.
      fromIndex - The start index for the slice of the array to be split, inclusive.
      toIndex - The end index for the slice of the array to be split, exclusive.
      chunkSize - The desired size of each sub-array.
      Returns:
      A list of char sub-arrays, each of size chunkSize (except possibly for the last one).
      Throws:
      IllegalArgumentException - if chunkSize is not a positive integer.
      IndexOutOfBoundsException - if fromIndex is negative, toIndex is larger than the length of the array, or fromIndex is larger than toIndex.
    • split

      public static List<byte[]> split(byte[] a, int chunkSize) throws IllegalArgumentException
      Splits the input byte array into sub-arrays of the specified size. The last sub-array may be smaller if the total array length is not a multiple of chunkSize.
      Parameters:
      a - The input byte array to be split.
      chunkSize - The desired size of each sub-array.
      Returns:
      A list of byte sub-arrays, each of size chunkSize (except possibly for the last one).
      Throws:
      IllegalArgumentException - if chunkSize is not a positive integer.
    • split

      public static List<byte[]> split(byte[] a, int fromIndex, int toIndex, int chunkSize) throws IllegalArgumentException, IndexOutOfBoundsException
      Splits the input byte array into sub-arrays of the specified size. The last sub-array may be smaller if the length of specified range is not a multiple of chunkSize. The sub-arrays are created from the specified range in the input array.
      Parameters:
      a - The input byte array to be split.
      fromIndex - The start index for the slice of the array to be split, inclusive.
      toIndex - The end index for the slice of the array to be split, exclusive.
      chunkSize - The desired size of each sub-array.
      Returns:
      A list of byte sub-arrays, each of size chunkSize (except possibly for the last one).
      Throws:
      IllegalArgumentException - if chunkSize is not a positive integer.
      IndexOutOfBoundsException - if fromIndex is negative, toIndex is larger than the length of the array, or fromIndex is larger than toIndex.
    • split

      public static List<short[]> split(short[] a, int chunkSize) throws IllegalArgumentException
      Splits the input short array into sub-arrays of the specified size. The last sub-array may be smaller if the total array length is not a multiple of chunkSize.
      Parameters:
      a - The input short array to be split.
      chunkSize - The desired size of each sub-array.
      Returns:
      A list of short sub-arrays, each of size chunkSize (except possibly for the last one).
      Throws:
      IllegalArgumentException - if chunkSize is not a positive integer.
    • split

      public static List<short[]> split(short[] a, int fromIndex, int toIndex, int chunkSize) throws IllegalArgumentException, IndexOutOfBoundsException
      Splits the input short array into sub-arrays of the specified size. The last sub-array may be smaller if the length of specified range is not a multiple of chunkSize. The sub-arrays are created from the specified range in the input array.
      Parameters:
      a - The input short array to be split.
      fromIndex - The start index for the slice of the array to be split, inclusive.
      toIndex - The end index for the slice of the array to be split, exclusive.
      chunkSize - The desired size of each sub-array.
      Returns:
      A list of short sub-arrays, each of size chunkSize (except possibly for the last one).
      Throws:
      IllegalArgumentException - if chunkSize is not a positive integer.
      IndexOutOfBoundsException - if fromIndex is negative, toIndex is larger than the length of the array, or fromIndex is larger than toIndex.
    • split

      public static List<int[]> split(int[] a, int chunkSize) throws IllegalArgumentException
      Splits the input int array into sub-arrays of the specified size. The last sub-array may be smaller if the total array length is not a multiple of chunkSize.
      Parameters:
      a - The input int array to be split.
      chunkSize - The desired size of each sub-array.
      Returns:
      A list of int sub-arrays, each of size chunkSize (except possibly for the last one).
      Throws:
      IllegalArgumentException - if chunkSize is not a positive integer.
    • split

      public static List<int[]> split(int[] a, int fromIndex, int toIndex, int chunkSize) throws IllegalArgumentException, IndexOutOfBoundsException
      Splits the input int array into sub-arrays of the specified size. The last sub-array may be smaller if the length of specified range is not a multiple of chunkSize. The sub-arrays are created from the specified range in the input array.
      Parameters:
      a - The input int array to be split.
      fromIndex - The start index for the slice of the array to be split, inclusive.
      toIndex - The end index for the slice of the array to be split, exclusive.
      chunkSize - The desired size of each sub-array.
      Returns:
      A list of int sub-arrays, each of size chunkSize (except possibly for the last one).
      Throws:
      IllegalArgumentException - if chunkSize is not a positive integer.
      IndexOutOfBoundsException - if fromIndex is negative, toIndex is larger than the length of the array, or fromIndex is larger than toIndex.
    • split

      public static List<long[]> split(long[] a, int chunkSize) throws IllegalArgumentException
      Splits the input long array into sub-arrays of the specified size. The last sub-array may be smaller if the total array length is not a multiple of chunkSize.
      Parameters:
      a - The input long array to be split.
      chunkSize - The desired size of each sub-array.
      Returns:
      A list of long sub-arrays, each of size chunkSize (except possibly for the last one).
      Throws:
      IllegalArgumentException - if chunkSize is not a positive integer.
    • split

      public static List<long[]> split(long[] a, int fromIndex, int toIndex, int chunkSize) throws IllegalArgumentException, IndexOutOfBoundsException
      Splits the input long array into sub-arrays of the specified size. The last sub-array may be smaller if the length of specified range is not a multiple of chunkSize. The sub-arrays are created from the specified range in the input array.
      Parameters:
      a - The input long array to be split.
      fromIndex - The start index for the slice of the array to be split, inclusive.
      toIndex - The end index for the slice of the array to be split, exclusive.
      chunkSize - The desired size of each sub-array.
      Returns:
      A list of long sub-arrays, each of size chunkSize (except possibly for the last one).
      Throws:
      IllegalArgumentException - if chunkSize is not a positive integer.
      IndexOutOfBoundsException - if fromIndex is negative, toIndex is larger than the length of the array, or fromIndex is larger than toIndex.
    • split

      public static List<float[]> split(float[] a, int chunkSize) throws IllegalArgumentException
      Splits the input float array into sub-arrays of the specified size. The last sub-array may be smaller if the total array length is not a multiple of chunkSize.
      Parameters:
      a - The input float array to be split.
      chunkSize - The desired size of each sub-array.
      Returns:
      A list of float sub-arrays, each of size chunkSize (except possibly for the last one).
      Throws:
      IllegalArgumentException - if chunkSize is not a positive integer.
    • split

      public static List<float[]> split(float[] a, int fromIndex, int toIndex, int chunkSize) throws IllegalArgumentException, IndexOutOfBoundsException
      Splits the input float array into sub-arrays of the specified size. The last sub-array may be smaller if the length of specified range is not a multiple of chunkSize. The sub-arrays are created from the specified range in the input array.
      Parameters:
      a - The input float array to be split.
      fromIndex - The start index for the slice of the array to be split, inclusive.
      toIndex - The end index for the slice of the array to be split, exclusive.
      chunkSize - The desired size of each sub-array.
      Returns:
      A list of float sub-arrays, each of size chunkSize (except possibly for the last one).
      Throws:
      IllegalArgumentException - if chunkSize is not a positive integer.
      IndexOutOfBoundsException - if fromIndex is negative, toIndex is larger than the length of the array, or fromIndex is larger than toIndex.
    • split

      public static List<double[]> split(double[] a, int chunkSize) throws IllegalArgumentException
      Splits the input double array into sub-arrays of the specified size. The last sub-array may be smaller if the total array length is not a multiple of chunkSize.
      Parameters:
      a - The input double array to be split.
      chunkSize - The desired size of each sub-array.
      Returns:
      A list of double sub-arrays, each of size chunkSize (except possibly for the last one).
      Throws:
      IllegalArgumentException - if chunkSize is not a positive integer.
    • split

      public static List<double[]> split(double[] a, int fromIndex, int toIndex, int chunkSize) throws IllegalArgumentException, IndexOutOfBoundsException
      Splits the input double array into sub-arrays of the specified size. The last sub-array may be smaller if the length of specified range is not a multiple of chunkSize. The sub-arrays are created from the specified range in the input array.
      Parameters:
      a - The input double array to be split.
      fromIndex - The start index for the slice of the array to be split, inclusive.
      toIndex - The end index for the slice of the array to be split, exclusive.
      chunkSize - The desired size of each sub-array.
      Returns:
      A list of double sub-arrays, each of size chunkSize (except possibly for the last one).
      Throws:
      IllegalArgumentException - if chunkSize is not a positive integer.
      IndexOutOfBoundsException - if fromIndex is negative, toIndex is larger than the length of the array, or fromIndex is larger than toIndex.
    • split

      public static <T> List<T[]> split(T[] a, int chunkSize) throws IllegalArgumentException
      Splits the input array into sub-arrays of the specified size. The last sub-array may be smaller if the total array length is not a multiple of chunkSize.
      Type Parameters:
      T - The type of the elements in the array.
      Parameters:
      a - The input array to be split.
      chunkSize - The desired size of each sub-array.
      Returns:
      A list of sub-arrays, each of size chunkSize (except possibly for the last one).
      Throws:
      IllegalArgumentException - if chunkSize is not a positive integer.
    • split

      public static <T> List<T[]> split(T[] a, int fromIndex, int toIndex, int chunkSize) throws IllegalArgumentException, IndexOutOfBoundsException
      Splits the input array into sub-arrays of the specified size. The last sub-array may be smaller if the length of specified range is not a multiple of chunkSize. The sub-arrays are created from the specified range in the input array.
      Parameters:
      a - The input array to be split.
      fromIndex - The start index for the slice of the array to be split, inclusive.
      toIndex - The end index for the slice of the array to be split, exclusive.
      chunkSize - The desired size of each sub-array.
      Returns:
      A list of sub-arrays, each of size chunkSize (except possibly for the last one).
      Throws:
      IllegalArgumentException - if chunkSize is not a positive integer.
      IndexOutOfBoundsException - if fromIndex is negative, toIndex is larger than the length of the array, or fromIndex is larger than toIndex.
    • split

      public static <T> List<List<T>> split(Collection<? extends T> c, int chunkSize) throws IllegalArgumentException
      Splits the input collection into sub-collections of the specified size. The last sub-collection may be smaller if the total collection size is not a multiple of chunkSize.
      Type Parameters:
      T - The type of the elements in the collection.
      Parameters:
      c - The input collection to be split.
      chunkSize - The desired size of each sub-collection.
      Returns:
      A list of sub-collections, each of size chunkSize (except possibly for the last one).
      Throws:
      IllegalArgumentException - if chunkSize is not a positive integer.
    • split

      public static <T> List<List<T>> split(Collection<? extends T> c, int fromIndex, int toIndex, int chunkSize) throws IllegalArgumentException, IndexOutOfBoundsException
      Splits the input collection into sub-collections of the specified size. The last sub-collection may be smaller if the length of specified range is not a multiple of chunkSize. The sub-collections are created from the specified range in the input collection.
      Type Parameters:
      T - The type of the elements in the collection.
      Parameters:
      c - The input collection to be split.
      fromIndex - The start index for the slice of the collection to be split, inclusive.
      toIndex - The end index for the slice of the collection to be split, exclusive.
      chunkSize - The desired size of each sub-collection.
      Returns:
      A list of sub-collections, each of size chunkSize (except possibly for the last one).
      Throws:
      IllegalArgumentException - if chunkSize is not a positive integer.
      IndexOutOfBoundsException - if fromIndex is negative, toIndex is larger than the size of the collection, or fromIndex is larger than toIndex.
    • split

      public static <T> List<List<T>> split(Iterable<? extends T> c, int chunkSize) throws IllegalArgumentException
      Splits the input iterable into sub-collections of the specified size. The last sub-collection may be smaller if the total iterable size is not a multiple of chunkSize.
      Type Parameters:
      T - The type of the elements in the iterable.
      Parameters:
      c - The input iterable to be split.
      chunkSize - The desired size of each sub-collection.
      Returns:
      A list of sub-collections, each of size chunkSize (except possibly for the last one).
      Throws:
      IllegalArgumentException - if chunkSize is not a positive integer.
    • split

      public static <T> ObjIterator<List<T>> split(Iterator<? extends T> iter, int chunkSize) throws IllegalArgumentException
      Splits the input iterator into sub-collections of the specified size. The last sub-collection may be smaller if the total iterator size is not a multiple of chunkSize.
      Type Parameters:
      T - The type of the elements in the iterator.
      Parameters:
      iter - The input iterator to be split.
      chunkSize - The desired size of each sub-collection.
      Returns:
      An iterator of sub-collections, each of size chunkSize (except possibly for the last one).
      Throws:
      IllegalArgumentException - if chunkSize is not a positive integer.
    • split

      public static List<String> split(CharSequence str, int chunkSize) throws IllegalArgumentException
      Returns consecutive substring of the specified string, each of the same length (the final list may be smaller), or an empty array if the specified string is null or empty.
      Parameters:
      str -
      chunkSize - the desired size of each sub String (the last may be smaller).
      Returns:
      Throws:
      IllegalArgumentException
    • split

      public static List<String> split(CharSequence str, int fromIndex, int toIndex, int chunkSize) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns consecutive substring of the specified string, each of the same length (the final list may be smaller), or an empty array if the specified string is null or empty.
      Parameters:
      str -
      fromIndex -
      toIndex -
      chunkSize - the desired size of each sub String (the last may be smaller).
      Returns:
      Throws:
      IllegalArgumentException
      IndexOutOfBoundsException
    • splitByChunkCount

      public static <T> List<T> splitByChunkCount(int totalSize, int maxChunkCount, IntBiFunction<? extends T> func)
      Splits the total size into chunks based on the specified maximum chunk count.
      The size of the chunks is larger first.
      The size of returned List may be less than the specified maxChunkCount if the input totalSize is less than maxChunkCount.
      Type Parameters:
      T - the type of the elements in the resulting stream
      Parameters:
      totalSize - the total size to be split. It could be the size of an array, list, etc.
      maxChunkCount - the maximum number of chunks to split into
      mapper - a function to map the chunk from and to index to an element in the resulting stream
      Returns:
      a Stream of the mapped chunk values
      Throws:
      IllegalArgumentException - if totalSize is negative or maxChunkCount is not positive.
      See Also:
    • splitByChunkCount

      public static <T> List<T> splitByChunkCount(int totalSize, int maxChunkCount, boolean sizeSmallerFirst, IntBiFunction<? extends T> func)
      Splits the total size into chunks based on the specified maximum chunk count.
      The size of the chunks can be either smaller or larger first based on the flag.
      The size of returned List may be less than the specified maxChunkCount if the input totalSize is less than maxChunkCount.
       
       final int[] a = Array.rangeClosed(1, 7);
       splitByChunkCount(7, 5, true, (fromIndex, toIndex) ->  copyOfRange(a, fromIndex, toIndex)); // [[1], [2], [3], [4, 5], [6, 7]]
       splitByChunkCount(7, 5, false, (fromIndex, toIndex) ->  copyOfRange(a, fromIndex, toIndex)); // [[1, 2], [3, 4], [5], [6], [7]]
       
       
      Type Parameters:
      T - the type of the elements in the resulting stream
      Parameters:
      totalSize - the total size to be split. It could be the size of an array, list, etc.
      maxChunkCount - the maximum number of chunks to split into
      sizeSmallerFirst - if true, smaller chunks will be created first; otherwise, larger chunks will be created first
      mapper - a function to map the chunk from and to index to an element in the resulting stream
      Returns:
      a Stream of the mapped chunk values
      Throws:
      IllegalArgumentException - if totalSize is negative or maxChunkCount is not positive.
      See Also:
    • splitByChunkCount

      public static <T> List<List<T>> splitByChunkCount(Collection<? extends T> c, int maxChunkCount)
      Splits the input collection into sub-lists based on the specified maximum chunk count.
      The size of the chunks is larger first.
      The size of returned List may be less than the specified maxChunkCount if the input Collection size is less than maxChunkCount.
      Type Parameters:
      T - the type of elements in the collection
      Parameters:
      c - the input collection to be split
      maxChunkCount - the maximum number of chunks to split into
      Returns:
      a list of sub-lists.
      Throws:
      IllegalArgumentException - if maxChunkCount is not positive.
      See Also:
    • splitByChunkCount

      public static <T> List<List<T>> splitByChunkCount(Collection<? extends T> c, int maxChunkCount, boolean sizeSmallerFirst)
      Splits the input collection into sub-lists based on the specified maximum chunk count.
      The size of the chunks can be either smaller or larger first based on the flag.
      The size of returned List may be less than the specified maxChunkCount if the input Collection size is less than maxChunkCount.
       
       final List c = N.asList(1, 2, 3, 4, 5, 6, 7);
       splitByChunkCount(c, 5, true); // [[1], [2], [3], [4, 5], [6, 7]]
       splitByChunkCount(c, 5, false); // [[1, 2], [3, 4], [5], [6], [7]]
       
       
      Type Parameters:
      T - the type of elements in the collection
      Parameters:
      c - the input collection to be split
      maxChunkCount - the maximum number of chunks to split into
      sizeSmallerFirst - if true, smaller chunks will be created first; otherwise, larger chunks will be created first
      Returns:
      a list of sub-lists.
      Throws:
      IllegalArgumentException - if maxChunkCount is not positive.
      See Also:
    • concat

      public static boolean[] concat(boolean[] a, boolean[] b)
      Concatenates two boolean arrays into a new array.
      Parameters:
      a - The first boolean array.
      b - The second boolean array.
      Returns:
      A new boolean array that contains the elements of a followed by the elements of b. If both a and b are empty or null, an empty array is returned. If a is empty or null, a clone of b is returned. If b is empty or null, a clone of a is returned.
    • concat

      @SafeVarargs public static boolean[] concat(boolean[]... aa)
      Concatenates multiple boolean arrays into a new array.
      Parameters:
      aa - The boolean arrays to be concatenated.
      Returns:
      A new boolean array that contains the elements of each array in 'aa' in the same order. If 'aa' is empty or null, an empty array is returned. If 'aa' contains only one array, a clone of this array is returned.
    • concat

      public static char[] concat(char[] a, char[] b)
      Concatenates two char arrays into a new array.
      Parameters:
      a - The first char array.
      b - The second char array.
      Returns:
      A new char array that contains the elements of a followed by the elements of b. If both a and b are empty or null, an empty array is returned. If a is empty or null, a clone of b is returned. If b is empty or null, a clone of a is returned.
    • concat

      @SafeVarargs public static char[] concat(char[]... aa)
      Concatenates multiple char arrays into a new array.
      Parameters:
      aa - The char arrays to be concatenated.
      Returns:
      A new char array that contains the elements of each array in 'aa' in the same order. If 'aa' is empty or null, an empty array is returned. If 'aa' contains only one array, a clone of this array is returned.
    • concat

      public static byte[] concat(byte[] a, byte[] b)
      Concatenates two byte arrays into a new array.
      Parameters:
      a - The first byte array.
      b - The second byte array.
      Returns:
      A new byte array that contains the elements of a followed by the elements of b. If both a and b are empty or null, an empty array is returned. If a is empty or null, a clone of b is returned. If b is empty or null, a clone of a is returned.
    • concat

      @SafeVarargs public static byte[] concat(byte[]... aa)
      Concatenates multiple byte arrays into a new array.
      Parameters:
      aa - The byte arrays to be concatenated.
      Returns:
      A new byte array that contains the elements of each array in 'aa' in the same order. If 'aa' is empty or null, an empty array is returned. If 'aa' contains only one array, a clone of this array is returned.
    • concat

      public static short[] concat(short[] a, short[] b)
      Concatenates two short arrays into a new array.
      Parameters:
      a - The first short array.
      b - The second short array.
      Returns:
      A new short array that contains the elements of a followed by the elements of b. If both a and b are empty or null, an empty array is returned. If a is empty or null, a clone of b is returned. If b is empty or null, a clone of a is returned.
    • concat

      @SafeVarargs public static short[] concat(short[]... aa)
      Concatenates multiple short arrays into a new array.
      Parameters:
      aa - The short arrays to be concatenated.
      Returns:
      A new short array that contains the elements of each array in 'aa' in the same order. If 'aa' is empty or null, an empty array is returned. If 'aa' contains only one array, a clone of this array is returned.
    • concat

      public static int[] concat(int[] a, int[] b)
      Concatenates two int arrays into a new array.
      Parameters:
      a - The first int array.
      b - The second int array.
      Returns:
      A new int array that contains the elements of a followed by the elements of b. If both a and b are empty or null, an empty array is returned. If a is empty or null, a clone of b is returned. If b is empty or null, a clone of a is returned.
    • concat

      @SafeVarargs public static int[] concat(int[]... aa)
      Concatenates multiple int arrays into a new array.
      Parameters:
      aa - The int arrays to be concatenated.
      Returns:
      A new int array that contains the elements of each array in 'aa' in the same order. If 'aa' is empty or null, an empty array is returned. If 'aa' contains only one array, a clone of this array is returned.
    • concat

      public static long[] concat(long[] a, long[] b)
      Concatenates two long arrays into a new array.
      Parameters:
      a - The first long array.
      b - The second long array.
      Returns:
      A new long array that contains the elements of a followed by the elements of b. If both a and b are empty or null, an empty array is returned. If a is empty or null, a clone of b is returned. If b is empty or null, a clone of a is returned.
    • concat

      @SafeVarargs public static long[] concat(long[]... aa)
      Concatenates multiple long arrays into a new array.
      Parameters:
      aa - The long arrays to be concatenated.
      Returns:
      A new long array that contains the elements of each array in 'aa' in the same order. If 'aa' is empty or null, an empty array is returned. If 'aa' contains only one array, a clone of this array is returned.
    • concat

      public static float[] concat(float[] a, float[] b)
      Concatenates two float arrays into a new array.
      Parameters:
      a - The first float array.
      b - The second float array.
      Returns:
      A new float array that contains the elements of a followed by the elements of b. If both a and b are empty or null, an empty array is returned. If a is empty or null, a clone of b is returned. If b is empty or null, a clone of a is returned.
    • concat

      @SafeVarargs public static float[] concat(float[]... aa)
      Concatenates multiple float arrays into a new array.
      Parameters:
      aa - The float arrays to be concatenated.
      Returns:
      A new float array that contains the elements of each array in 'aa' in the same order. If 'aa' is empty or null, an empty array is returned. If 'aa' contains only one array, a clone of this array is returned.
    • concat

      public static double[] concat(double[] a, double[] b)
      Concatenates two double arrays into a new array.
      Parameters:
      a - The first double array.
      b - The second double array.
      Returns:
      A new double array that contains the elements of a followed by the elements of b. If both a and b are empty or null, an empty array is returned. If a is empty or null, a clone of b is returned. If b is empty or null, a clone of a is returned.
    • concat

      @SafeVarargs public static double[] concat(double[]... aa)
      Concatenates multiple double arrays into a new array.
      Parameters:
      aa - The double arrays to be concatenated.
      Returns:
      A new double array that contains the elements of each array in 'aa' in the same order. If 'aa' is empty or null, an empty array is returned. If 'aa' contains only one array, a clone of this array is returned.
    • concat

      public static <T> T[] concat(T[] a, T[] b)
      Concatenates two arrays into a new array.
      Type Parameters:
      T - The type of the elements in the arrays.
      Parameters:
      a - The first array.
      b - The second array.
      Returns:
      A new array that contains the elements of a followed by the elements of b. If both a and b are empty or null, a is returned. If a is empty or null, a clone of b is returned. If b is empty or null, a clone of a is returned.
    • concat

      @MayReturnNull @SafeVarargs public static <T> T[] concat(T[]... aa)
      Concatenates multiple arrays into a new array.
      Type Parameters:
      T - The type of the elements in the arrays.
      Parameters:
      aa - The arrays to be concatenated.
      Returns:
      A new array that contains the elements of each array in 'aa' in the same order. If all of the specified arrays are null, null is returned.
      See Also:
    • concat

      public static <T> List<T> concat(Iterable<? extends T> a, Iterable<? extends T> b)
      Concatenates two iterables into a new list.
      Type Parameters:
      T - The type of the elements in the iterables.
      Parameters:
      a - The first iterable.
      b - The second iterable.
      Returns:
      A new list that contains the elements of a followed by the elements of b. If both a and b are empty or null, an empty list is returned. If a is empty or null, a list containing the elements of b is returned. If b is empty or null, a list containing the elements of a is returned.
    • concat

      @SafeVarargs public static <T> List<T> concat(Iterable<? extends T>... a)
      Concatenates multiple iterables into a new list.
      Type Parameters:
      T - The type of the elements in the iterables.
      Parameters:
      a - The iterables to be concatenated.
      Returns:
      A new list that contains the elements of each iterable in a in the same order. If a is empty or null, an empty list is returned. If a contains only one iterable, a list containing the elements of this iterable is returned.
    • concat

      public static <T> List<T> concat(Collection<? extends Iterable<? extends T>> c)
      Concatenates multiple iterables into a new list.
      Type Parameters:
      T - The type of the elements in the iterables.
      Parameters:
      c - The collection of iterables to be concatenated.
      Returns:
      A new list that contains the elements of each iterable in c in the same order. If c is empty or null, an empty list is returned. If c contains only one iterable, a list containing the elements of this iterable is returned.
    • concat

      public static <T, C extends Collection<T>> C concat(Collection<? extends Iterable<? extends T>> c, IntFunction<? extends C> supplier)
      Concatenates multiple iterables into a new collection.
      Type Parameters:
      T - The type of the elements in the iterables.
      C - The type of the collection to be returned.
      Parameters:
      c - The collection of iterables to be concatenated.
      supplier - The function that generates a new instance of the return collection.
      Returns:
      A new collection that contains the elements of each iterable in c in the same order. The type of the returned collection is determined by the supplier function. If c is empty or null, an empty collection is returned. If c contains only one iterable, a collection containing the elements of this iterable is returned.
    • concat

      public static <T> ObjIterator<T> concat(Iterator<? extends T> a, Iterator<? extends T> b)
      Concatenates two iterators into a new ObjIterator.
      Type Parameters:
      T - The type of the elements in the iterators.
      Parameters:
      a - The first iterator.
      b - The second iterator.
      Returns:
      A new ObjIterator that contains the elements of a followed by the elements of b.
      See Also:
    • concat

      @SafeVarargs public static <T> ObjIterator<T> concat(Iterator<? extends T>... a)
      Concatenates multiple iterators into a new ObjIterator.
      Type Parameters:
      T - The type of the elements in the iterators.
      Parameters:
      a - The array of iterators to be concatenated.
      Returns:
      A new ObjIterator that contains the elements of each iterator in a in the same order.
      See Also:
    • flatten

      public static boolean[] flatten(boolean[][] a)
      Flattens a two-dimensional boolean array into a one-dimensional boolean array.
      Parameters:
      a - The two-dimensional boolean array to be flattened.
      Returns:
      A one-dimensional boolean array containing all elements in the input array. Returns an empty array if the input array is null or empty.
    • flatten

      public static char[] flatten(char[][] a)
      Flattens a two-dimensional char array into a one-dimensional char array.
      Parameters:
      a - The two-dimensional char array to be flattened.
      Returns:
      A one-dimensional char array containing all elements in the input array. Returns an empty array if the input array is null or empty.
    • flatten

      public static byte[] flatten(byte[][] a)
      Flattens a two-dimensional byte array into a one-dimensional byte array.
      Parameters:
      a - The two-dimensional byte array to be flattened.
      Returns:
      A one-dimensional byte array containing all elements in the input array. Returns an empty array if the input array is null or empty.
    • flatten

      public static short[] flatten(short[][] a)
      Flattens a two-dimensional short array into a one-dimensional short array.
      Parameters:
      a - The two-dimensional short array to be flattened.
      Returns:
      A one-dimensional short array containing all elements in the input array. Returns an empty array if the input array is null or empty.
    • flatten

      public static int[] flatten(int[][] a)
      Flattens a two-dimensional int array into a one-dimensional int array.
      Parameters:
      a - The two-dimensional int array to be flattened.
      Returns:
      A one-dimensional int array containing all elements in the input array. Returns an empty array if the input array is null or empty.
    • flatten

      public static long[] flatten(long[][] a)
      Flattens a two-dimensional long array into a one-dimensional long array.
      Parameters:
      a - The two-dimensional long array to be flattened.
      Returns:
      A one-dimensional long array containing all elements in the input array. Returns an empty array if the input array is null or empty.
    • flatten

      public static float[] flatten(float[][] a)
      Flattens a two-dimensional float array into a one-dimensional float array.
      Parameters:
      a - The two-dimensional float array to be flattened.
      Returns:
      A one-dimensional float array containing all elements in the input array. Returns an empty array if the input array is null or empty.
    • flatten

      public static double[] flatten(double[][] a)
      Flattens a two-dimensional double array into a one-dimensional double array.
      Parameters:
      a - The two-dimensional double array to be flattened.
      Returns:
      A one-dimensional double array containing all elements in the input array. Returns an empty array if the input array is null or empty.
    • flatten

      @MayReturnNull public static <T> T[] flatten(T[][] a)
      Flattens a two-dimensional array into a one-dimensional array.
      Type Parameters:
      T - The type of the elements in the array.
      Parameters:
      a - The two-dimensional array to be flattened.
      Returns:
      A one-dimensional array containing all elements in the input array. Returns null if the input array is null.
    • flatten

      public static <T> T[] flatten(T[][] a, Class<T> componentType)
      Flattens a two-dimensional array into a one-dimensional array.
      Type Parameters:
      T - The type of the elements in the array.
      Parameters:
      a - The two-dimensional array to be flattened.
      componentType - The class object representing the component type of the new array.
      Returns:
      A one-dimensional array containing all elements in the input array. Returns an empty array if the input array is null.
    • flatten

      public static <T> List<T> flatten(Iterable<? extends Iterable<? extends T>> c)
      Flattens an Iterable of Iterable<T> into a one-dimensional List.
      Type Parameters:
      T - The type of the elements in the Iterable.
      Parameters:
      c - The two-dimensional Iterable to be flattened.
      Returns:
      A one-dimensional List containing all elements in the input Iterable. Returns an empty List if the input Iterable is null or empty.
    • flatten

      public static <T, C extends Collection<T>> C flatten(Iterable<? extends Iterable<? extends T>> c, IntFunction<? extends C> supplier)
      Flattens an Iterable of Iterable<T> into a one-dimensional Collection.
      Type Parameters:
      T - The type of the elements in the Iterable.
      C - The type of the Collection to be returned.
      Parameters:
      c - The two-dimensional Iterable to be flattened.
      supplier - The function that generates the Collection instance.
      Returns:
      A one-dimensional Collection containing all elements in the input Iterable. Returns an empty Collection if the input Iterable is null or empty.
    • flatten

      public static <T> ObjIterator<T> flatten(Iterator<? extends Iterator<? extends T>> iters)
      Flattens an Iterator of Iterator<T> into a one-dimensional Iterator.
      Type Parameters:
      T - The type of the elements in the Iterator.
      Parameters:
      iters - The two-dimensional Iterator to be flattened.
      Returns:
      A one-dimensional Iterator containing all elements in the input Iterator. Returns an empty Iterator if the input Iterator is null.
    • flattenEachElement

      @Beta public static List<?> flattenEachElement(Iterable<?> c)
      Flattens each element of the provided Iterable if it's an Iterable itself, otherwise just adds it to the result List. This method is marked as Beta and may be subject to changes or removal in future versions.
      Parameters:
      c - The Iterable to be processed. Each element is checked if it's an Iterable and flattened if so.
      Returns:
      A List containing the flattened elements of the input Iterable. If the input Iterable is null, an empty List is returned.
    • flattenEachElement

      @Beta public static <T, C extends Collection<T>> C flattenEachElement(Iterable<?> c, Supplier<? extends C> supplier)
      Flattens each element of the provided Iterable if it's an Iterable itself, otherwise just adds it to the result Collection. This method is marked as Beta and may be subject to changes or removal in future versions.
      Type Parameters:
      T - The type of the elements in the Iterable.
      C - The type of the Collection to be returned.
      Parameters:
      c - The Iterable to be processed. Each element is checked if it's an Iterable and flattened if so.
      supplier - The function that generates the Collection instance.
      Returns:
      A Collection containing the flattened elements of the input Iterable. If the input Iterable is null, an empty Collection is returned.
    • intersection

      public static boolean[] intersection(boolean[] a, boolean[] b)
      Returns the elements in the specified Array/Collection a and b. Occurrences are considered.
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • intersection

      public static char[] intersection(char[] a, char[] b)
      Returns the elements in the specified Array/Collection a and b. Occurrences are considered.
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • intersection

      public static byte[] intersection(byte[] a, byte[] b)
      Returns the elements in the specified Array/Collection a and b. Occurrences are considered.
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • intersection

      public static short[] intersection(short[] a, short[] b)
      Returns the elements in the specified Array/Collection a and b. Occurrences are considered.
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • intersection

      public static int[] intersection(int[] a, int[] b)
      Returns the elements in the specified Array/Collection a and b. Occurrences are considered.
       int[] a = {0, 1, 2, 2, 3};
       int[] b = {2, 5, 1};
       int[] c = retainAll(a, b); // The elements c in a will b: [1, 2, 2].
      
       int[] a = {0, 1, 2, 2, 3};
       int[] b = {2, 5, 1};
       int[] c = intersection(a, b); // The elements c in a will b: [1, 2].
       
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • intersection

      public static long[] intersection(long[] a, long[] b)
      Returns the elements in the specified Array/Collection a and b. Occurrences are considered.
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • intersection

      public static float[] intersection(float[] a, float[] b)
      Returns the elements in the specified Array/Collection a and b. Occurrences are considered.
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • intersection

      public static double[] intersection(double[] a, double[] b)
      Returns the elements in the specified Array/Collection a and b. Occurrences are considered.
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • intersection

      public static <T> List<T> intersection(T[] a, Object[] b)
      Returns the elements in the specified Array/Collection a and b. Occurrences are considered.
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • intersection

      public static <T> List<T> intersection(Collection<? extends T> a, Collection<?> b)
      Returns the elements in the specified Array/Collection a and b. Occurrences are considered.
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • intersection

      public static <T> List<T> intersection(Collection<? extends Collection<? extends T>> c)
      Returns the elements in all the specified collections. Occurrences are considered.
      Type Parameters:
      T - the type of elements in the collections
      Parameters:
      c - the collections to intersect
      Returns:
      a list containing the intersection of the collections
      See Also:
    • intersection

      @Beta public static <T> List<T> intersection(Collection<? extends T> a, Collection<?> b, boolean ignoreOcurrences)
      Return only the elements in the first collection that are contained in the specified second collection.
      If ignoreOcurrences is true, Occurrences are not considered.
      Duplicated elements in the returned List will not be eliminated.
       List a = N.asList(0, 1, 2, 2, 3);
       List b = N.asList(2, 5, 1);
       List c = N.intersection(a, b, false); // The elements c in a will b: [1, 2]. same as N.intersection(a, b).
       List d = N.intersection(a, b, true); // The elements c in a will b: [1, 2, 2].
       
      Type Parameters:
      T - the type of elements in the collections
      Parameters:
      a - the first collection, elements from this collection will be retained
      b - the second collection, elements in this collection are to be retained in the first collection
      ignoreOcurrences - if true, the method does not consider the number of occurrences of an element.
      Returns:
      a List the elements in the first collection that are contained in the specified second collection.
      See Also:
    • difference

      public static boolean[] difference(boolean[] a, boolean[] b)
      Returns all the elements in the specified Array/Collection a but not in b. Occurrences are considered.
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • difference

      public static char[] difference(char[] a, char[] b)
      Returns all the elements in the specified Array/Collection a but not in b. Occurrences are considered.
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • difference

      public static byte[] difference(byte[] a, byte[] b)
      Returns all the elements in the specified Array/Collection a but not in b. Occurrences are considered.
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • difference

      public static short[] difference(short[] a, short[] b)
      Returns all the elements in the specified Array/Collection a but not in b. Occurrences are considered.
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • difference

      public static int[] difference(int[] a, int[] b)
      Returns all the elements in the specified Array/Collection a but not in b. Occurrences are considered.
       int[] a = {0, 1, 2, 2, 3};
       int[] b = {2, 5, 1};
       int[] c = removeAll(a, b); // The elements c in a will b: [0, 3].
      
       int[] a = {0, 1, 2, 2, 3};
       int[] b = {2, 5, 1};
       int[] c = difference(a, b); // The elements c in a will b: [0, 2, 3].
       
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • difference

      public static long[] difference(long[] a, long[] b)
      Returns all the elements in the specified Array/Collection a but not in b. Occurrences are considered.
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • difference

      public static float[] difference(float[] a, float[] b)
      Returns all the elements in the specified Array/Collection a but not in b. Occurrences are considered.
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • difference

      public static double[] difference(double[] a, double[] b)
      Returns all the elements in the specified Array/Collection a but not in b. Occurrences are considered.
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • difference

      public static <T> List<T> difference(T[] a, Object[] b)
      Returns all the elements in the specified Array/Collection a but not in b. Occurrences are considered.
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • difference

      public static <T> List<T> difference(Collection<? extends T> a, Collection<?> b)
      Returns all the elements in the specified Array/Collection a but not in b. Occurrences are considered.
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • symmetricDifference

      public static boolean[] symmetricDifference(boolean[] a, boolean[] b)
      Returns the elements that are in the specified Array/Collection a but not in b and vice versa. Occurrences are considered
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • symmetricDifference

      public static char[] symmetricDifference(char[] a, char[] b)
      Returns the elements that are in the specified Array/Collection a but not in b and vice versa. Occurrences are considered
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • symmetricDifference

      public static byte[] symmetricDifference(byte[] a, byte[] b)
      Returns the elements that are in the specified Array/Collection a but not in b and vice versa. Occurrences are considered
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • symmetricDifference

      public static short[] symmetricDifference(short[] a, short[] b)
      Returns the elements that are in the specified Array/Collection a but not in b and vice versa. Occurrences are considered
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • symmetricDifference

      public static int[] symmetricDifference(int[] a, int[] b)
      Returns the elements that are in the specified Array/Collection a but not in b and vice versa. Occurrences are considered
       int[] a = {0, 1, 2, 2, 3};
       int[] b = {2, 5, 1};
       int[] c = symmetricDifference(a, b); // The elements c in a will b: [0, 2, 3, 5].
       
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • symmetricDifference

      public static long[] symmetricDifference(long[] a, long[] b)
      Returns the elements that are in the specified Array/Collection a but not in b and vice versa. Occurrences are considered
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • symmetricDifference

      public static float[] symmetricDifference(float[] a, float[] b)
      Returns the elements that are in the specified Array/Collection a but not in b and vice versa. Occurrences are considered
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • symmetricDifference

      public static double[] symmetricDifference(double[] a, double[] b)
      Returns the elements that are in the specified Array/Collection a but not in b and vice versa. Occurrences are considered
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • symmetricDifference

      public static <T> List<T> symmetricDifference(T[] a, T[] b)
      Returns the elements that are in the specified Array/Collection a but not in b and vice versa. Occurrences are considered
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • symmetricDifference

      public static <T> List<T> symmetricDifference(Collection<? extends T> a, Collection<? extends T> b)
      Returns the elements that are in the specified Array/Collection a but not in b and vice versa. Occurrences are considered
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • commonSet

      public static <T> Set<T> commonSet(Collection<? extends T> a, Collection<?> b)
      Returns a Set containing the common elements of two given collections.
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • commonSet

      public static <T> Set<T> commonSet(Collection<? extends Collection<? extends T>> c)
      Returns a Set containing the common elements of the given collections.
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
      See Also:
    • exclude

      public static <T> List<T> exclude(Collection<? extends T> c, Object objToExclude)
      Returns a new List with specified objToExclude excluded. That's to say no more objToExclude will present in the returned List.
      Type Parameters:
      T -
      Parameters:
      c -
      objToExclude -
      Returns:
      a new List
      See Also:
    • excludeToSet

      public static <T> Set<T> excludeToSet(Collection<? extends T> c, Object objToExclude)
      Returns a new Set with specified objToExclude excluded. That's to say no more objToExclude will present in the returned Set.
      Type Parameters:
      T -
      Parameters:
      c -
      objToExclude -
      Returns:
      a new Set
      See Also:
    • excludeAll

      public static <T> List<T> excludeAll(Collection<? extends T> c, Collection<?> objsToExclude)
      Returns a new List with specified objsToExclude excluded. That's to say no more value from objsToExclude will present in the returned List.
      Type Parameters:
      T -
      Parameters:
      c -
      objsToExclude -
      Returns:
      a new List
      See Also:
    • excludeAllToSet

      public static <T> Set<T> excludeAllToSet(Collection<? extends T> c, Collection<?> objsToExclude)
      Returns a new Set with specified objsToExclude excluded. That's to say no more value from objsToExclude will present in the returned Set.
      Type Parameters:
      T -
      Parameters:
      c -
      objsToExclude -
      Returns:
      a new Set
      See Also:
    • isSubCollection

      public static boolean isSubCollection(@NotNull Collection<?> subColl, @NotNull Collection<?> coll) throws IllegalArgumentException
      Returns true if subColl is a sub-collection of coll, that is, if the cardinality of e in subColl is less than or equal to the cardinality of e in coll, for each element e in subColl.
      Parameters:
      subColl - the first (sub?) collection, must not be null
      coll - the second (super?) collection, must not be null
      Returns:
      true if subColl is a sub-collection of coll
      Throws:
      IllegalArgumentException - if subColl or coll is null
      See Also:
    • isProperSubCollection

      public static boolean isProperSubCollection(@NotNull Collection<?> subColl, @NotNull Collection<?> coll) throws IllegalArgumentException
      Returns true if subColl is a proper sub-collection of coll, that is, if the cardinality of e in subColl is less than or equal to the cardinality of e in coll, for each element e in subColl, and there is at least one element f such that the cardinality of f in coll is strictly greater than the cardinality of f in subColl.

      The implementation assumes

      • subColl.size() and coll.size() represent the total cardinality of a and b, resp.
      • subColl.size() < Integer.MAXVALUE
      Parameters:
      subColl - the first (sub?) collection, must not be null
      coll - the second (super?) collection, must not be null
      Returns:
      true if subColl is a proper sub-collection of coll
      Throws:
      IllegalArgumentException - if subColl or coll is null
      See Also:
    • isEqualCollection

      public static boolean isEqualCollection(Collection<?> a, Collection<?> b)
      Returns true if the given Collections contain exactly the same elements with exactly the same cardinalities.

      That is, if the cardinality of e in a is equal to the cardinality of e in b, for each element e in a or b.

      Parameters:
      a - the first collection
      b - the second collection
      Returns:
      true if the collections contain the same elements with the same cardinalities.
    • replaceAll

      public static int replaceAll(boolean[] a, boolean oldVal, boolean newVal)
      Replaces all occurrences of a specified boolean value in the given boolean array with another specified boolean value.
      Parameters:
      a - The boolean array in which replacements are to be made.
      oldVal - The boolean value to be replaced.
      newVal - The boolean value to replace all occurrences of the oldVal.
      Returns:
      The number of replacements made.
    • replaceAll

      public static int replaceAll(char[] a, char oldVal, char newVal)
      Replaces all occurrences of a specified char value in the given char array with another specified char value.
      Parameters:
      a - The char array in which replacements are to be made.
      oldVal - The char value to be replaced.
      newVal - The char value to replace all occurrences of the oldVal.
      Returns:
      The number of replacements made.
    • replaceAll

      public static int replaceAll(byte[] a, byte oldVal, byte newVal)
      Replaces all occurrences of a specified byte value in the given byte array with another specified byte value.
      Parameters:
      a - The byte array in which replacements are to be made.
      oldVal - The byte value to be replaced.
      newVal - The byte value to replace all occurrences of the oldVal.
      Returns:
      The number of replacements made.
    • replaceAll

      public static int replaceAll(short[] a, short oldVal, short newVal)
      Replaces all occurrences of a specified short value in the given short array with another specified short value.
      Parameters:
      a - The short array in which replacements are to be made.
      oldVal - The short value to be replaced.
      newVal - The short value to replace all occurrences of the oldVal.
      Returns:
      The number of replacements made.
    • replaceAll

      public static int replaceAll(int[] a, int oldVal, int newVal)
      Replaces all occurrences of a specified int value in the given int array with another specified int value.
      Parameters:
      a - The int array in which replacements are to be made.
      oldVal - The int value to be replaced.
      newVal - The int value to replace all occurrences of the oldVal.
      Returns:
      The number of replacements made.
    • replaceAll

      public static int replaceAll(long[] a, long oldVal, long newVal)
      Replaces all occurrences of a specified long value in the given long array with another specified long value.
      Parameters:
      a - The long array in which replacements are to be made.
      oldVal - The long value to be replaced.
      newVal - The long value to replace all occurrences of the oldVal.
      Returns:
      The number of replacements made.
    • replaceAll

      public static int replaceAll(float[] a, float oldVal, float newVal)
      Replaces all occurrences of a specified float value in the given float array with another specified float value.
      Parameters:
      a - The float array in which replacements are to be made.
      oldVal - The float value to be replaced.
      newVal - The float value to replace all occurrences of the oldVal.
      Returns:
      The number of replacements made.
    • replaceAll

      public static int replaceAll(double[] a, double oldVal, double newVal)
      Replaces all occurrences of a specified double value in the given double array with another specified double value.
      Parameters:
      a - The double array in which replacements are to be made.
      oldVal - The double value to be replaced.
      newVal - The double value to replace all occurrences of the oldVal.
      Returns:
      The number of replacements made.
    • replaceAll

      public static <T> int replaceAll(T[] a, Object oldVal, T newVal)
      Replaces all occurrences of a specified value in the given array with another specified value.
      Type Parameters:
      T - The type of elements in the array.
      Parameters:
      a - The array in which replacements are to be made.
      oldVal - The value to be replaced.
      newVal - The value to replace all occurrences of the oldVal.
      Returns:
      The number of replacements made.
    • replaceAll

      public static <T> int replaceAll(List<T> list, Object oldVal, T newVal)
      Replaces all occurrences of a specified value in the given list with another specified value.
      Type Parameters:
      T - The type of elements in the list.
      Parameters:
      list - The list in which replacements are to be made.
      oldVal - The value to be replaced.
      newVal - The value to replace all occurrences of the oldVal.
      Returns:
      The number of replacements made.
    • replaceAll

      public static void replaceAll(boolean[] a, BooleanUnaryOperator operator)
      Replaces all elements in the given boolean array according to the provided unary operator.
      Parameters:
      a - The boolean array to be modified.
      operator - The operator used to determine the new values.
    • replaceAll

      public static void replaceAll(char[] a, CharUnaryOperator operator)
      Replaces all elements in the given char array according to the provided unary operator.
      Parameters:
      a - The char array to be modified.
      operator - The operator used to determine the new values.
    • replaceAll

      public static void replaceAll(byte[] a, ByteUnaryOperator operator)
      Replaces all elements in the given byte array according to the provided unary operator.
      Parameters:
      a - The byte array to be modified.
      operator - The operator used to determine the new values.
    • replaceAll

      public static void replaceAll(short[] a, ShortUnaryOperator operator)
      Replaces all elements in the given short array according to the provided unary operator.
      Parameters:
      a - The short array to be modified.
      operator - The operator used to determine the new values.
    • replaceAll

      public static void replaceAll(int[] a, IntUnaryOperator operator)
      Replaces all elements in the given int array according to the provided unary operator.
      Parameters:
      a - The int array to be modified.
      operator - The operator used to determine the new values.
    • replaceAll

      public static void replaceAll(long[] a, LongUnaryOperator operator)
      Replaces all elements in the given long array according to the provided unary operator.
      Parameters:
      a - The long array to be modified.
      operator - The operator used to determine the new values.
    • replaceAll

      public static void replaceAll(float[] a, FloatUnaryOperator operator)
      Replaces all elements in the given float array according to the provided unary operator.
      Parameters:
      a - The float array to be modified.
      operator - The operator used to determine the new values.
    • replaceAll

      public static void replaceAll(double[] a, DoubleUnaryOperator operator)
      Replaces all elements in the given double array according to the provided unary operator.
      Parameters:
      a - The double array to be modified.
      operator - The operator used to determine the new values.
    • replaceAll

      public static <T> void replaceAll(T[] a, UnaryOperator<T> operator)
      Replaces all elements in the given array according to the provided unary operator.
      Type Parameters:
      T - The type of elements in the array.
      Parameters:
      a - The array to be modified.
      operator - The operator used to determine the new values.
    • replaceAll

      public static <T> void replaceAll(List<T> list, UnaryOperator<T> operator)
      Replaces all elements in the given list according to the provided unary operator.
      Type Parameters:
      T - The type of elements in the list.
      Parameters:
      list - The list to be modified.
      operator - The operator used to determine the new values.
    • replaceIf

      public static int replaceIf(boolean[] a, BooleanPredicate predicate, boolean newValue)
      Replaces all elements in the given boolean array that satisfy the provided predicate with a specified boolean value.
      Parameters:
      a - The boolean array to be modified.
      predicate - The predicate used to determine which elements should be replaced.
      newValue - The boolean value to replace all elements that satisfy the predicate.
      Returns:
      The number of replacements made.
    • replaceIf

      public static int replaceIf(char[] a, CharPredicate predicate, char newValue)
      Replaces all elements in the given char array that satisfy the provided predicate with a specified char value.
      Parameters:
      a - The char array to be modified.
      predicate - The predicate used to determine which elements should be replaced.
      newValue - The char value to replace all elements that satisfy the predicate.
      Returns:
      The number of replacements made.
    • replaceIf

      public static int replaceIf(byte[] a, BytePredicate predicate, byte newValue)
      Replaces all elements in the given byte array that satisfy the provided predicate with a specified byte value.
      Parameters:
      a - The byte array to be modified.
      predicate - The predicate used to determine which elements should be replaced.
      newValue - The byte value to replace all elements that satisfy the predicate.
      Returns:
      The number of replacements made.
    • replaceIf

      public static int replaceIf(short[] a, ShortPredicate predicate, short newValue)
      Replaces all elements in the given short array that satisfy the provided predicate with a specified short value.
      Parameters:
      a - The short array to be modified.
      predicate - The predicate used to determine which elements should be replaced.
      newValue - The short value to replace all elements that satisfy the predicate.
      Returns:
      The number of replacements made.
    • replaceIf

      public static int replaceIf(int[] a, IntPredicate predicate, int newValue)
      Replaces all elements in the given int array that satisfy the provided predicate with a specified int value.
      Parameters:
      a - The int array to be modified.
      predicate - The predicate used to determine which elements should be replaced.
      newValue - The int value to replace all elements that satisfy the predicate.
      Returns:
      The number of replacements made.
    • replaceIf

      public static int replaceIf(long[] a, LongPredicate predicate, long newValue)
      Replaces all elements in the given long array that satisfy the provided predicate with a specified long value.
      Parameters:
      a - The long array to be modified.
      predicate - The predicate used to determine which elements should be replaced.
      newValue - The long value to replace all elements that satisfy the predicate.
      Returns:
      The number of replacements made.
    • replaceIf

      public static int replaceIf(float[] a, FloatPredicate predicate, float newValue)
      Replaces all elements in the given float array that satisfy the provided predicate with a specified float value.
      Parameters:
      a - The float array to be modified.
      predicate - The predicate used to determine which elements should be replaced.
      newValue - The float value to replace all elements that satisfy the predicate.
      Returns:
      The number of replacements made.
    • replaceIf

      public static int replaceIf(double[] a, DoublePredicate predicate, double newValue)
      Replaces all elements in the given double array that satisfy the provided predicate with a specified double value.
      Parameters:
      a - The double array to be modified.
      predicate - The predicate used to determine which elements should be replaced.
      newValue - The double value to replace all elements that satisfy the predicate.
      Returns:
      The number of replacements made.
    • replaceIf

      public static <T> int replaceIf(T[] a, Predicate<? super T> predicate, T newValue)
      Replaces all elements in the given array that satisfy the provided predicate with a specified value.
      Type Parameters:
      T - The type of elements in the array.
      Parameters:
      a - The array to be modified.
      predicate - The predicate used to determine which elements should be replaced.
      newValue - The value to replace all elements that satisfy the predicate.
      Returns:
      The number of replacements made.
    • replaceIf

      public static <T> int replaceIf(List<T> c, Predicate<? super T> predicate, T newValue)
      Replaces all elements in the given list that satisfy the provided predicate with a specified value.
      Type Parameters:
      T - The type of elements in the list.
      Parameters:
      c - The list to be modified.
      predicate - The predicate used to determine which elements should be replaced.
      newValue - The value to replace all elements that satisfy the predicate.
      Returns:
      The number of replacements made.
    • updateAllUsingReplaceAllInstead

      @Deprecated public static void updateAllUsingReplaceAllInstead() throws UnsupportedOperationException
      Deprecated.
      use replaceAll
      A fake/unsupported method defined to remind user to use replaceAll when update/updateAll/updateIf is searched.
      Throws:
      UnsupportedOperationException
      See Also:
    • updateIfUsingReplaceIfInstead

      @Deprecated public static void updateIfUsingReplaceIfInstead() throws UnsupportedOperationException
      Deprecated.
      use replaceIf
      A fake/unsupported method defined to remind user to use replaceIf when update/updateAll/updateIf is searched.
      Throws:
      UnsupportedOperationException
      See Also:
    • setAll

      public static void setAll(boolean[] array, IntToBooleanFunction generator)
      Sets all elements in the given array using the provided generator function. If the specified array is null or empty, does nothing.
      Parameters:
      array - the array to be modified
      generator - the function used to generate new values for the array elements
      See Also:
    • setAll

      public static void setAll(byte[] array, IntToByteFunction generator)
      Sets all elements in the given array using the provided generator function. If the specified array is null or empty, does nothing.
      Parameters:
      array - the array to be modified
      generator - the function used to generate new values for the array elements
      See Also:
    • setAll

      public static void setAll(short[] array, IntToShortFunction generator)
      Sets all elements in the given array using the provided generator function. If the specified array is null or empty, does nothing.
      Parameters:
      array - the array to be modified
      generator - the function used to generate new values for the array elements
      See Also:
    • setAll

      public static void setAll(int[] array, IntUnaryOperator generator)
      Sets all elements in the given array using the provided generator function. If the specified array is null or empty, does nothing.
      Parameters:
      array - the array to be modified
      generator - the function used to generate new values for the array elements
      See Also:
    • setAll

      public static void setAll(long[] array, IntToLongFunction generator)
      Sets all elements in the given array using the provided generator function. If the specified array is null or empty, does nothing.
      Parameters:
      array - the array to be modified
      generator - the function used to generate new values for the array elements
      See Also:
    • setAll

      public static void setAll(float[] array, IntToFloatFunction generator)
      Sets all elements in the given array using the provided generator function. If the specified array is null or empty, does nothing.
      Parameters:
      array - the array to be modified
      generator - the function used to generate new values for the array elements
      See Also:
    • setAll

      public static void setAll(double[] array, IntToDoubleFunction generator)
      Sets all elements in the given array using the provided generator function. If the specified array is null or empty, does nothing.
      Parameters:
      array - the array to be modified
      generator - the function used to generate new values for the array elements
      See Also:
    • setAll

      public static <T> void setAll(T[] array, IntFunction<? extends T> generator)
      Sets all elements in the given array using the provided generator function. If the specified array is null or empty, does nothing.
      Type Parameters:
      T - the type of elements in the array
      Parameters:
      array - the array to be modified
      generator - the function used to generate new values for the array elements
      See Also:
    • setAll

      public static <T> void setAll(List<T> list, IntFunction<? extends T> generator)
      Sets all elements in the given list using the provided generator function. If the specified list is null or empty, does nothing.
      Type Parameters:
      T - the type of elements in the list
      Parameters:
      list - the list to be modified
      generator - the function used to generate new values for the list elements
    • add

      public static boolean[] add(boolean[] a, boolean elementToAdd)
      Returns a new array with elements copied from the specified array and the specified element added at the end.
      The original array remains unchanged.
      Parameters:
      a - The original boolean array.
      elementToAdd - The boolean element to be added to the array.
      Returns:
      A new boolean array containing the original elements and the added element.
    • add

      public static char[] add(char[] a, char elementToAdd)
      Returns a new array with elements copied from the specified array and the specified element added at the end.
      The original array remains unchanged.
      Parameters:
      a - The original char array.
      elementToAdd - The char element to be added to the array.
      Returns:
      A new char array containing the original elements and the added element.
    • add

      public static byte[] add(byte[] a, byte elementToAdd)
      Returns a new array with elements copied from the specified array and the specified element added at the end.
      The original array remains unchanged.
      Parameters:
      a - The original byte array.
      elementToAdd - The byte element to be added to the array.
      Returns:
      A new byte array containing the original elements and the added element.
    • add

      public static short[] add(short[] a, short elementToAdd)
      Returns a new array with elements copied from the specified array and the specified element added at the end.
      The original array remains unchanged.
      Parameters:
      a - The original short array.
      elementToAdd - The short element to be added to the array.
      Returns:
      A new short array containing the original elements and the added element.
    • add

      public static int[] add(int[] a, int elementToAdd)
      Returns a new array with elements copied from the specified array and the specified element added at the end.
      The original array remains unchanged.
      Parameters:
      a - The original int array.
      elementToAdd - The int element to be added to the array.
      Returns:
      A new int array containing the original elements and the added element.
    • add

      public static long[] add(long[] a, long elementToAdd)
      Returns a new array with elements copied from the specified array and the specified element added at the end.
      The original array remains unchanged.
      Parameters:
      a - The original long array.
      elementToAdd - The long element to be added to the array.
      Returns:
      A new long array containing the original elements and the added element.
    • add

      public static float[] add(float[] a, float elementToAdd)
      Returns a new array with elements copied from the specified array and the specified element added at the end.
      The original array remains unchanged.
      Parameters:
      a - The original float array.
      elementToAdd - The float element to be added to the array.
      Returns:
      A new float array containing the original elements and the added element.
    • add

      public static double[] add(double[] a, double elementToAdd)
      Returns a new array with elements copied from the specified array and the specified element added at the end.
      The original array remains unchanged.
      Parameters:
      a - The original double array.
      elementToAdd - The double element to be added to the array.
      Returns:
      A new double array containing the original elements and the added element.
    • add

      public static String[] add(String[] a, String elementToAdd)
      Returns a new array with elements copied from the specified array and the specified element added at the end.
      The original array remains unchanged.
      Parameters:
      a - The original String array.
      elementToAdd - The String element to be added to the array.
      Returns:
      A new String array containing the original elements and the added element.
    • add

      public static <T> T[] add(@NotNull T[] a, T elementToAdd) throws IllegalArgumentException
      Returns a new array with elements copied from the specified array and the specified element added at the end.
      The original array remains unchanged.
      Type Parameters:
      T - The type of elements in the array.
      Parameters:
      a - The original array.
      elementToAdd - The element to be added to the array.
      Returns:
      A new array containing the original elements and the added element.
      Throws:
      IllegalArgumentException - if the original array is null.
    • addAll

      @SafeVarargs public static boolean[] addAll(boolean[] a, boolean... elementsToAdd)
      Returns a new array with elements copied from the specified array and the specified element added at the end.
      The original array remains unchanged.
      Parameters:
      a - The first array whose elements are added to the new array.
      elementsToAdd - The additional elements to be added to the new array.
      Returns:
      A new boolean array containing the elements from a and elementsToAdd.
    • addAll

      @SafeVarargs public static char[] addAll(char[] a, char... elementsToAdd)
      Returns a new array with elements copied from the specified array and the specified element added at the end.
      The original array remains unchanged.
      Parameters:
      a - The first array whose elements are added to the new array.
      elementsToAdd - The additional elements to be added to the new array.
      Returns:
      A new char array containing the elements from a and elementsToAdd.
    • addAll

      @SafeVarargs public static byte[] addAll(byte[] a, byte... elementsToAdd)
      Returns a new array with elements copied from the specified array and the specified elements added at the end.
      The original array remains unchanged.
      Parameters:
      a - The first array whose elements are added to the new array.
      elementsToAdd - The additional elements to be added to the new array.
      Returns:
      A new byte array containing the elements from a and elementsToAdd.
    • addAll

      @SafeVarargs public static short[] addAll(short[] a, short... elementsToAdd)
      Returns a new array with elements copied from the specified array and the specified elements added at the end.
      The original array remains unchanged.
      Parameters:
      a - The first array whose elements are added to the new array.
      elementsToAdd - The additional elements to be added to the new array.
      Returns:
      A new short array containing the elements from a and elementsToAdd.
    • addAll

      @SafeVarargs public static int[] addAll(int[] a, int... elementsToAdd)
      Returns a new array with elements copied from the specified array and the specified elements added at the end.
      The original array remains unchanged.
      Parameters:
      a - The first array whose elements are added to the new array.
      elementsToAdd - The additional elements to be added to the new array.
      Returns:
      A new int array containing the elements from a and elementsToAdd.
    • addAll

      @SafeVarargs public static long[] addAll(long[] a, long... elementsToAdd)
      Returns a new array with elements copied from the specified array and the specified elements added at the end.
      The original array remains unchanged.
      Parameters:
      a - The first array whose elements are added to the new array.
      elementsToAdd - The additional elements to be added to the new array.
      Returns:
      A new long array containing the elements from a and elementsToAdd.
    • addAll

      @SafeVarargs public static float[] addAll(float[] a, float... elementsToAdd)
      Returns a new array with elements copied from the specified array and the specified elements added at the end.
      The original array remains unchanged.
      Parameters:
      a - The first array whose elements are added to the new array.
      elementsToAdd - The additional elements to be added to the new array.
      Returns:
      A new float array containing the elements from a and elementsToAdd.
    • addAll

      @SafeVarargs public static double[] addAll(double[] a, double... elementsToAdd)
      Returns a new array with elements copied from the specified array and the specified elements added at the end.
      The original array remains unchanged.
      Parameters:
      a - The first array whose elements are added to the new array.
      elementsToAdd - The additional elements to be added to the new array.
      Returns:
      A new double array containing the elements from a and elementsToAdd.
    • addAll

      @SafeVarargs public static String[] addAll(String[] a, String... elementsToAdd)
      Returns a new array with elements copied from the specified array and the specified elements added at the end.
      The original array remains unchanged.
      Parameters:
      a - The first array whose elements are added to the new array.
      elementsToAdd - The additional elements to be added to the new array.
      Returns:
      A new String array containing the elements from a and elementsToAdd.
    • addAll

      @SafeVarargs public static <T> T[] addAll(@NotNull T[] a, T... elementsToAdd) throws IllegalArgumentException
      Returns a new array with elements copied from the specified array and the specified elements added at the end.
      The original array remains unchanged.
      Type Parameters:
      T - The type of elements in the array.
      Parameters:
      a - The original array.
      elementsToAdd - The elements to be added to the array.
      Returns:
      A new array containing the original elements and the added elements.
      Throws:
      IllegalArgumentException - if the input array a and elementsToAdd both are null.
    • addAll

      public static <T> boolean addAll(@NotNull Collection<T> c, T... elementsToAdd) throws IllegalArgumentException
      Adds all the elements in elementsToAdd to a given collection.
      Type Parameters:
      T - The type of elements in the collection.
      Parameters:
      c - The original collection.
      elementsToAdd - The elements to be added to the collection.
      Returns:
      A boolean indicating if the collection changed as a result of the call.
      Throws:
      IllegalArgumentException - if the original collection is null.
    • addAll

      public static <T> boolean addAll(@NotNull Collection<T> c, Iterable<? extends T> elementsToAdd) throws IllegalArgumentException
      Adds all the elements in elementsToAdd to a given collection.
      Type Parameters:
      T - The type of elements in the collection.
      Parameters:
      c - The original collection where elements are to be added.
      elementsToAdd - The collection of elements to be added to the original collection.
      Returns:
      A boolean indicating if the original collection changed as a result of the call.
      Throws:
      IllegalArgumentException - if the original collection is null.
    • addAll

      public static <T> boolean addAll(@NotNull Collection<T> c, Iterator<? extends T> elementsToAdd) throws IllegalArgumentException
      Adds all the elements in elementsToAdd to a given collection.
      Type Parameters:
      T - The type of elements in the collection.
      Parameters:
      c - The original collection where elements are to be added.
      elementsToAdd - The iterator of elements to be added to the original collection.
      Returns:
      A boolean indicating if the original collection changed as a result of the call.
      Throws:
      IllegalArgumentException - if the original collection is null.
    • insert

      public static boolean[] insert(boolean[] a, int index, boolean elementToInsert) throws IndexOutOfBoundsException
      Inserts a boolean value into a given boolean array at a specified index. The method creates a new array, copies the original array into it, then adds the new element at the specified index. The original array remains unchanged.
      Parameters:
      a - the original boolean array
      index - the position in the array where the new element should be inserted
      elementToInsert - the char value to be inserted into the array
      Returns:
      a new char array with the original elements and the inserted element
      Throws:
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index > a.length)
    • insert

      public static char[] insert(char[] a, int index, char elementToInsert) throws IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array and the specified element inserted at the specified index.
      The original array remains unchanged.
      Parameters:
      a - the original char array
      index - the position in the array where the new element should be inserted
      elementToInsert - the boolean value to be inserted into the array
      Returns:
      a new boolean array with the original elements and the inserted element
      Throws:
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index > a.length)
    • insert

      public static byte[] insert(byte[] a, int index, byte elementToInsert) throws IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array and the specified element inserted at the specified index.
      The original array remains unchanged.
      Parameters:
      a - the original byte array
      index - the position in the array where the new element should be inserted
      elementToInsert - the byte value to be inserted into the array
      Returns:
      a new byte array with the original elements and the inserted element
      Throws:
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index > a.length)
    • insert

      public static short[] insert(short[] a, int index, short elementToInsert) throws IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array and the specified element inserted at the specified index.
      The original array remains unchanged.
      Parameters:
      a - the original short array
      index - the position in the array where the new element should be inserted
      elementToInsert - the short value to be inserted into the array
      Returns:
      a new short array with the original elements and the inserted element
      Throws:
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index > a.length)
    • insert

      public static int[] insert(int[] a, int index, int elementToInsert) throws IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array and the specified element inserted at the specified index.
      The original array remains unchanged.
      Parameters:
      a - the original int array
      index - the position in the array where the new element should be inserted
      elementToInsert - the int value to be inserted into the array
      Returns:
      a new int array with the original elements and the inserted element
      Throws:
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index > a.length)
    • insert

      public static long[] insert(long[] a, int index, long elementToInsert) throws IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array and the specified element inserted at the specified index.
      The original array remains unchanged.
      Parameters:
      a - the original long array
      index - the position in the array where the new element should be inserted
      elementToInsert - the long value to be inserted into the array
      Returns:
      a new long array with the original elements and the inserted element
      Throws:
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index > a.length)
    • insert

      public static float[] insert(float[] a, int index, float elementToInsert) throws IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array and the specified element inserted at the specified index.
      The original array remains unchanged.
      Parameters:
      a - the original float array
      index - the position in the array where the new element should be inserted
      elementToInsert - the float value to be inserted into the array
      Returns:
      a new float array with the original elements and the inserted element
      Throws:
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index > a.length)
    • insert

      public static double[] insert(double[] a, int index, double elementToInsert) throws IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array and the specified element inserted at the specified index.
      The original array remains unchanged.
      Parameters:
      a - the original double array
      index - the position in the array where the new element should be inserted
      elementToInsert - the double value to be inserted into the array
      Returns:
      a new double array with the original elements and the inserted element
      Throws:
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index > a.length)
    • insert

      public static String[] insert(String[] a, int index, String elementToInsert) throws IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array and the specified element inserted at the specified index.
      The original array remains unchanged.
      Parameters:
      a - the original String array
      index - the position in the array where the new element should be inserted
      elementToInsert - the String value to be inserted into the array
      Returns:
      a new String array with the original elements and the inserted element
      Throws:
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index > a.length)
    • insert

      public static <T> T[] insert(@NotNull T[] a, int index, T elementToInsert) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array and the specified element inserted at the specified index.
      The original array remains unchanged.
      Type Parameters:
      T - the type of the elements in the array
      Parameters:
      a - the original array
      index - the position in the array where the new element should be inserted
      elementToInsert - the element to be inserted into the array
      Returns:
      a new array with the original elements and the inserted element
      Throws:
      IllegalArgumentException - if the original array is null
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index > a.length)
    • insert

      public static String insert(String str, int index, String strToInsert) throws IndexOutOfBoundsException
      Returns a new String with chars copied from the specified String and the specified String inserted at the specified index.
      The original String remains unchanged.
      Parameters:
      str - the original string
      index - the position in the string where the new string should be inserted
      strToInsert - the string to be inserted into the original string
      Returns:
      a new string with the original characters and the inserted string
      Throws:
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index > str.length())
    • insertAll

      @SafeVarargs public static boolean[] insertAll(boolean[] a, int index, boolean... elementsToInsert) throws IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array and the specified elements inserted at the specified index.
      The original array remains unchanged.
      Parameters:
      a - the original array
      index - the position in the array where the new elements should be inserted
      elementsToInsert - the elements to be inserted into the array
      Returns:
      a new array with the original elements and the inserted elements
      Throws:
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index > a.length)
    • insertAll

      @SafeVarargs public static char[] insertAll(char[] a, int index, char... elementsToInsert) throws IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array and the specified elements inserted at the specified index.
      The original array remains unchanged.
      Parameters:
      a - the original array
      index - the position in the array where the new elements should be inserted
      elementsToInsert - the elements to be inserted into the array
      Returns:
      a new array with the original elements and the inserted elements
      Throws:
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index > a.length)
    • insertAll

      @SafeVarargs public static byte[] insertAll(byte[] a, int index, byte... elementsToInsert) throws IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array and the specified elements inserted at the specified index.
      The original array remains unchanged.
      Parameters:
      a - the original array
      index - the position in the array where the new elements should be inserted
      elementsToInsert - the elements to be inserted into the array
      Returns:
      a new array with the original elements and the inserted elements
      Throws:
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index > a.length)
    • insertAll

      @SafeVarargs public static short[] insertAll(short[] a, int index, short... elementsToInsert) throws IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array and the specified elements inserted at the specified index.
      The original array remains unchanged.
      Parameters:
      a - the original array
      index - the position in the array where the new elements should be inserted
      elementsToInsert - the elements to be inserted into the array
      Returns:
      a new array with the original elements and the inserted elements
      Throws:
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index > a.length)
    • insertAll

      @SafeVarargs public static int[] insertAll(int[] a, int index, int... elementsToInsert) throws IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array and the specified elements inserted at the specified index.
      The original array remains unchanged.
      Parameters:
      a - the original array
      index - the position in the array where the new elements should be inserted
      elementsToInsert - the elements to be inserted into the array
      Returns:
      a new array with the original elements and the inserted elements
      Throws:
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index > a.length)
    • insertAll

      @SafeVarargs public static long[] insertAll(long[] a, int index, long... elementsToInsert) throws IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array and the specified elements inserted at the specified index.
      The original array remains unchanged.
      Parameters:
      a - the original array
      index - the position in the array where the new elements should be inserted
      elementsToInsert - the elements to be inserted into the array
      Returns:
      a new array with the original elements and the inserted elements
      Throws:
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index > a.length)
    • insertAll

      @SafeVarargs public static float[] insertAll(float[] a, int index, float... elementsToInsert) throws IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array and the specified elements inserted at the specified index.
      The original array remains unchanged.
      Parameters:
      a - the original array
      index - the position in the array where the new elements should be inserted
      elementsToInsert - the elements to be inserted into the array
      Returns:
      a new array with the original elements and the inserted elements
      Throws:
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index > a.length)
    • insertAll

      @SafeVarargs public static double[] insertAll(double[] a, int index, double... elementsToInsert) throws IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array and the specified elements inserted at the specified index.
      The original array remains unchanged.
      Parameters:
      a - the original array
      index - the position in the array where the new elements should be inserted
      elementsToInsert - the elements to be inserted into the array
      Returns:
      a new array with the original elements and the inserted elements
      Throws:
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index > a.length)
    • insertAll

      @SafeVarargs public static String[] insertAll(String[] a, int index, String... elementsToInsert) throws IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array and the specified elements inserted at the specified index.
      The original array remains unchanged.
      Parameters:
      a - the original array
      index - the position in the array where the new elements should be inserted
      elementsToInsert - the elements to be inserted into the array
      Returns:
      a new array with the original elements and the inserted elements
      Throws:
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index > a.length)
    • insertAll

      @SafeVarargs public static <T> T[] insertAll(@NotNull T[] a, int index, T... elementsToInsert) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array and the specified elements inserted at the specified index.
      The original array remains unchanged.
      Parameters:
      a - the original array
      index - the position in the array where the new elements should be inserted
      elementsToInsert - the elements to be inserted into the array
      Returns:
      a new array with the original elements and the inserted elements
      Throws:
      IllegalArgumentException - if the specified Array is null.
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index > a.length)
    • insertAll

      @SafeVarargs public static <T> boolean insertAll(@NotNull List<T> list, int index, T... elementsToInsert) throws IllegalArgumentException, IndexOutOfBoundsException
      Inserts the specified elements at the specified position in the list. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
      Type Parameters:
      T - the type of elements in the list
      Parameters:
      list - the list to insert into
      index - the position in the list where the new elements should be inserted
      elementsToInsert - the elements to be inserted into the list
      Returns:
      true if the list changed as a result of the call
      Throws:
      IllegalArgumentException - if the list is null
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index > list.size())
    • insertAll

      public static <T> boolean insertAll(@NotNull List<T> list, int index, Collection<? extends T> elementsToInsert) throws IllegalArgumentException, IndexOutOfBoundsException
      Inserts the specified elements at the specified position in the list. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
      Type Parameters:
      T - the type of elements in the list
      Parameters:
      list - the list to insert into
      index - the position in the list where the new elements should be inserted
      elementsToInsert - the elements to be inserted into the list
      Returns:
      true if the list changed as a result of the call
      Throws:
      IllegalArgumentException - if the list is null
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index > list.size())
    • deleteByIndex

      public static boolean[] deleteByIndex(@NotNull boolean[] a, int index) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array except the element at the specified position.
      The original array remains unchanged.
      Parameters:
      a - the original boolean array
      index - the position of the element to be removed
      Returns:
      a new boolean array containing the existing elements except the element at the specified index
      Throws:
      IllegalArgumentException - if the input array is null
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index >= a.length)
    • deleteByIndex

      public static char[] deleteByIndex(@NotNull char[] a, int index) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array except the element at the specified position.
      The original array remains unchanged.
      Parameters:
      a - the original char array
      index - the position of the element to be removed
      Returns:
      a new char array containing the existing elements except the element at the specified index
      Throws:
      IllegalArgumentException - if the input array is null
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index >= a.length)
    • deleteByIndex

      public static byte[] deleteByIndex(@NotNull byte[] a, int index) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array except the element at the specified position.
      The original array remains unchanged.
      Parameters:
      a - the original byte array
      index - the position of the element to be removed
      Returns:
      a new byte array containing the existing elements except the element at the specified index
      Throws:
      IllegalArgumentException - if the input array is null
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index >= a.length)
    • deleteByIndex

      public static short[] deleteByIndex(@NotNull short[] a, int index) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array except the element at the specified position.
      The original array remains unchanged.
      Parameters:
      a - the original short array
      index - the position of the element to be removed
      Returns:
      a new short array containing the existing elements except the element at the specified index
      Throws:
      IllegalArgumentException - if the input array is null
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index >= a.length)
    • deleteByIndex

      public static int[] deleteByIndex(@NotNull int[] a, int index) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array except the element at the specified position.
      The original array remains unchanged.
      Parameters:
      a - the original int array
      index - the position of the element to be removed
      Returns:
      a new int array containing the existing elements except the element at the specified index
      Throws:
      IllegalArgumentException - if the input array is null
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index >= a.length)
    • deleteByIndex

      public static long[] deleteByIndex(@NotNull long[] a, int index) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array except the element at the specified position.
      The original array remains unchanged.
      Parameters:
      a - the original long array
      index - the position of the element to be removed
      Returns:
      a new long array containing the existing elements except the element at the specified index
      Throws:
      IllegalArgumentException - if the input array is null
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index >= a.length)
    • deleteByIndex

      public static float[] deleteByIndex(@NotNull float[] a, int index) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array except the element at the specified position.
      The original array remains unchanged.
      Parameters:
      a - the original float array
      index - the position of the element to be removed
      Returns:
      a new float array containing the existing elements except the element at the specified index
      Throws:
      IllegalArgumentException - if the input array is null
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index >= a.length)
    • deleteByIndex

      public static double[] deleteByIndex(@NotNull double[] a, int index) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array except the element at the specified position.
      The original array remains unchanged.
      Parameters:
      a - the original double array
      index - the position of the element to be removed
      Returns:
      a new double array containing the existing elements except the element at the specified index
      Throws:
      IllegalArgumentException - if the input array is null
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index >= a.length)
    • deleteByIndex

      public static <T> T[] deleteByIndex(@NotNull T[] a, int index) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array except the element at the specified position.
      The original array remains unchanged.
      Parameters:
      a - the original array
      index - the position of the element to be removed
      Returns:
      a new array containing the existing elements except the element at the specified index
      Throws:
      IllegalArgumentException - if the input array is null
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index >= a.length)
    • deleteAllByIndices

      @SafeVarargs public static boolean[] deleteAllByIndices(boolean[] a, int... indices) throws IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array except the element at the specified positions.
      The original array remains unchanged.
      Parameters:
      a - the input boolean array from which elements are to be removed
      indices - the indices of the elements to be removed
      Returns:
      a new boolean array containing the remaining elements after removal
      Throws:
      IndexOutOfBoundsException - if any index is out of the array's range
    • deleteAllByIndices

      @SafeVarargs public static char[] deleteAllByIndices(char[] a, int... indices) throws IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array except the element at the specified positions.
      The original array remains unchanged.
      Parameters:
      a - the input char array from which elements are to be removed
      indices - the indices of the elements to be removed
      Returns:
      a new char array containing the remaining elements after removal
      Throws:
      IndexOutOfBoundsException - if any index is out of the array's range
    • deleteAllByIndices

      @SafeVarargs public static byte[] deleteAllByIndices(byte[] a, int... indices) throws IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array except the element at the specified positions.
      The original array remains unchanged.
      Parameters:
      a - the input byte array from which elements are to be removed
      indices - the indices of the elements to be removed
      Returns:
      a new byte array containing the remaining elements after removal
      Throws:
      IndexOutOfBoundsException - if any index is out of the array's range
    • deleteAllByIndices

      @SafeVarargs public static short[] deleteAllByIndices(short[] a, int... indices) throws IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array except the element at the specified positions.
      The original array remains unchanged.
      Parameters:
      a - the input short array from which elements are to be removed
      indices - the indices of the elements to be removed
      Returns:
      a new short array containing the remaining elements after removal
      Throws:
      IndexOutOfBoundsException - if any index is out of the array's range
    • deleteAllByIndices

      @SafeVarargs public static int[] deleteAllByIndices(int[] a, int... indices) throws IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array except the element at the specified positions.
      The original array remains unchanged.
      Parameters:
      a - the input int array from which elements are to be removed
      indices - the indices of the elements to be removed
      Returns:
      a new int array containing the remaining elements after removal
      Throws:
      IndexOutOfBoundsException - if any index is out of the array's range
    • deleteAllByIndices

      @SafeVarargs public static long[] deleteAllByIndices(long[] a, int... indices) throws IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array except the element at the specified positions.
      The original array remains unchanged.
      Parameters:
      a - the input long array from which elements are to be removed
      indices - the indices of the elements to be removed
      Returns:
      a new long array containing the remaining elements after removal
      Throws:
      IndexOutOfBoundsException - if any index is out of the array's range
    • deleteAllByIndices

      @SafeVarargs public static float[] deleteAllByIndices(float[] a, int... indices) throws IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array except the element at the specified positions.
      The original array remains unchanged.
      Parameters:
      a - the input float array from which elements are to be removed
      indices - the indices of the elements to be removed
      Returns:
      a new float array containing the remaining elements after removal
      Throws:
      IndexOutOfBoundsException - if any index is out of the array's range
    • deleteAllByIndices

      @SafeVarargs public static double[] deleteAllByIndices(double[] a, int... indices) throws IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array except the element at the specified positions.
      The original array remains unchanged.
      Parameters:
      a - the input double array from which elements are to be removed
      indices - the indices of the elements to be removed
      Returns:
      a new double array containing the remaining elements after removal
      Throws:
      IndexOutOfBoundsException - if any index is out of the array's range
    • deleteAllByIndices

      @SafeVarargs public static String[] deleteAllByIndices(String[] a, int... indices) throws IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array except the element at the specified positions.
      The original array remains unchanged.
      Parameters:
      a - the input String array from which elements are to be removed
      indices - the indices of the elements to be removed
      Returns:
      a new String array containing the remaining elements after removal
      Throws:
      IndexOutOfBoundsException - if any index is out of the array's range
    • deleteAllByIndices

      @SafeVarargs public static <T> T[] deleteAllByIndices(@NotNull T[] a, int... indices) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns a new array with elements copied from the specified array except the element at the specified positions.
      The original array remains unchanged.
      Type Parameters:
      T - the type of elements in the array
      Parameters:
      a - the input array from which elements are to be removed
      indices - the indices of the elements to be removed
      Returns:
      a new array containing the remaining elements after removal
      Throws:
      IllegalArgumentException - if the input array is null
      IndexOutOfBoundsException - if any index is out of the array's range
    • deleteAllByIndices

      @SafeVarargs public static boolean deleteAllByIndices(@NotNull List<?> list, int... indices) throws IllegalArgumentException
      Removes the elements at the specified positions from the specified List.
      Parameters:
      list -
      indices -
      Returns:
      Throws:
      IllegalArgumentException
    • remove

      public static boolean[] remove(boolean[] a, boolean valueToRemove)
      Returns a new array with elements copied from the specified array except the first occurrence of the specified value.
      The original array remains unchanged.
      Parameters:
      a - The array from which the value should be removed.
      valueToRemove - The value to be removed from the array.
      Returns:
      A new array with the first occurrence of the specified value removed. An empty array is returned if the specified array is null or empty.
    • remove

      public static char[] remove(char[] a, char valueToRemove)
      Returns a new array with elements copied from the specified array except the first occurrence of the specified value.
      The original array remains unchanged.
      Parameters:
      a - The array from which the value should be removed.
      valueToRemove - The value to be removed from the array.
      Returns:
      A new array with the first occurrence of the specified value removed. An empty array is returned if the specified array is null or empty.
    • remove

      public static byte[] remove(byte[] a, byte valueToRemove)
      Returns a new array with elements copied from the specified array except the first occurrence of the specified value.
      The original array remains unchanged.
      Parameters:
      a - The array from which the value should be removed.
      valueToRemove - The value to be removed from the array.
      Returns:
      A new array with the first occurrence of the specified value removed. An empty array is returned if the specified array is null or empty.
    • remove

      public static short[] remove(short[] a, short valueToRemove)
      Returns a new array with elements copied from the specified array except the first occurrence of the specified value.
      The original array remains unchanged.
      Parameters:
      a - The array from which the value should be removed.
      valueToRemove - The value to be removed from the array.
      Returns:
      A new array with the first occurrence of the specified value removed. An empty array is returned if the specified array is null or empty.
    • remove

      public static int[] remove(int[] a, int valueToRemove)
      Returns a new array with elements copied from the specified array except the first occurrence of the specified value.
      The original array remains unchanged.
      Parameters:
      a - The array from which the value should be removed.
      valueToRemove - The value to be removed from the array.
      Returns:
      A new array with the first occurrence of the specified value removed. An empty array is returned if the specified array is null or empty.
    • remove

      public static long[] remove(long[] a, long valueToRemove)
      Returns a new array with elements copied from the specified array except the first occurrence of the specified value.
      The original array remains unchanged.
      Parameters:
      a - The array from which the value should be removed.
      valueToRemove - The value to be removed from the array.
      Returns:
      A new array with the first occurrence of the specified value removed. An empty array is returned if the specified array is null or empty.
    • remove

      public static float[] remove(float[] a, float valueToRemove)
      Returns a new array with elements copied from the specified array except the first occurrence of the specified value.
      The original array remains unchanged.
      Parameters:
      a - The array from which the value should be removed.
      valueToRemove - The value to be removed from the array.
      Returns:
      A new array with the first occurrence of the specified value removed. An empty array is returned if the specified array is null or empty.
    • remove

      public static double[] remove(double[] a, double valueToRemove)
      Returns a new array with elements copied from the specified array except the first occurrence of the specified value.
      The original array remains unchanged.
      Parameters:
      a - The array from which the value should be removed.
      valueToRemove - The value to be removed from the array.
      Returns:
      A new array with the first occurrence of the specified value removed. An empty array is returned if the specified array is null or empty.
    • remove

      public static String[] remove(String[] a, String valueToRemove)
      Returns a new array with elements copied from the specified array except the first occurrence of the specified value.
      The original array remains unchanged.
      Parameters:
      a - The array from which the value should be removed.
      valueToRemove - The value to be removed from the array.
      Returns:
      A new array with the first occurrence of the specified value removed. An empty array is returned if the specified array is null or empty.
    • remove

      public static <T> T[] remove(T[] a, T valueToRemove) throws IllegalArgumentException
      Returns a new array with elements copied from the specified array except the first occurrence of the specified value.
      The original array remains unchanged.
      Parameters:
      a - The array from which the value should be removed.
      valueToRemove - The value to be removed from the array.
      Returns:
      A new array with the first occurrence of the specified value removed. The input array itself is returned if the specified array is null or empty.
      Throws:
      IllegalArgumentException
    • remove

      public static <T> boolean remove(Collection<T> c, T valueToRemove)
      Removes the first occurrence of the specified value from the given collection.
      Parameters:
      c - The collection from which the value should be removed.
      valueToRemove - The value to be removed from the collection.
      Returns:
      true if the collection changed as a result of this call, false otherwise.
    • removeAll

      @SafeVarargs public static boolean[] removeAll(boolean[] a, boolean... valuesToRemove)
      Returns a new array with elements copied from the specified array except all occurrences of the specified values.
      The original array remains unchanged.
      Parameters:
      a - The array from which the values should be removed.
      valuesToRemove - The values to be removed from the array.
      Returns:
      A new array with all occurrences of the specified values removed. An empty array is returned if the specified array is null or empty.
      See Also:
    • removeAll

      @SafeVarargs public static char[] removeAll(char[] a, char... valuesToRemove)
      Returns a new array with elements copied from the specified array except all occurrences of the specified values.
      The original array remains unchanged.
      Parameters:
      a - The array from which the values should be removed.
      valuesToRemove - The values to be removed from the array.
      Returns:
      A new array with all occurrences of the specified values removed. An empty array is returned if the specified array is null or empty.
      See Also:
    • removeAll

      @SafeVarargs public static byte[] removeAll(byte[] a, byte... valuesToRemove)
      Returns a new array with elements copied from the specified array except all occurrences of the specified values.
      The original array remains unchanged.
      Parameters:
      a - The array from which the values should be removed.
      valuesToRemove - The values to be removed from the array.
      Returns:
      A new array with all occurrences of the specified values removed. An empty array is returned if the specified array is null or empty.
      See Also:
    • removeAll

      @SafeVarargs public static short[] removeAll(short[] a, short... valuesToRemove)
      Returns a new array with elements copied from the specified array except all occurrences of the specified values.
      The original array remains unchanged.
      Parameters:
      a - The array from which the values should be removed.
      valuesToRemove - The values to be removed from the array.
      Returns:
      A new array with all occurrences of the specified values removed. An empty array is returned if the specified array is null or empty.
      See Also:
    • removeAll

      @SafeVarargs public static int[] removeAll(int[] a, int... valuesToRemove)
      Returns a new array with elements copied from the specified array except all occurrences of the specified values.
      The original array remains unchanged.
      Parameters:
      a - The array from which the values should be removed.
      valuesToRemove - The values to be removed from the array.
      Returns:
      A new array with all occurrences of the specified values removed. An empty array is returned if the specified array is null or empty.
      See Also:
    • removeAll

      @SafeVarargs public static long[] removeAll(long[] a, long... valuesToRemove)
      Returns a new array with elements copied from the specified array except all occurrences of the specified values.
      The original array remains unchanged.
      Parameters:
      a - The array from which the values should be removed.
      valuesToRemove - The values to be removed from the array.
      Returns:
      A new array with all occurrences of the specified values removed. An empty array is returned if the specified array is null or empty.
      See Also:
    • removeAll

      @SafeVarargs public static float[] removeAll(float[] a, float... valuesToRemove)
      Returns a new array with elements copied from the specified array except all occurrences of the specified values.
      The original array remains unchanged.
      Parameters:
      a - The array from which the values should be removed.
      valuesToRemove - The values to be removed from the array.
      Returns:
      A new array with all occurrences of the specified values removed. An empty array is returned if the specified array is null or empty.
      See Also:
    • removeAll

      @SafeVarargs public static double[] removeAll(double[] a, double... valuesToRemove)
      Returns a new array with elements copied from the specified array except all occurrences of the specified values.
      The original array remains unchanged.
      Parameters:
      a - The array from which the values should be removed.
      valuesToRemove - The values to be removed from the array.
      Returns:
      A new array with all occurrences of the specified values removed. An empty array is returned if the specified array is null or empty.
      See Also:
    • removeAll

      @SafeVarargs public static String[] removeAll(String[] a, String... valuesToRemove)
      Returns a new array with elements copied from the specified array except all occurrences of the specified values.
      The original array remains unchanged.
      Parameters:
      a - The array from which the values should be removed.
      valuesToRemove - The values to be removed from the array.
      Returns:
      A new array with all occurrences of the specified values removed. An empty array is returned if the specified array is null or empty.
      See Also:
    • removeAll

      @SafeVarargs public static <T> T[] removeAll(T[] a, T... valuesToRemove)
      Returns a new array with elements copied from the specified array except all occurrences of the specified values.
      The original array remains unchanged.
      Parameters:
      a - The array from which the values should be removed.
      valuesToRemove - The values to be removed from the array.
      Returns:
      A new array with the first occurrence of the specified value removed. The input array itself is returned if the specified array is null or empty.
      See Also:
    • removeAll

      @SafeVarargs public static <T> boolean removeAll(Collection<T> c, T... valuesToRemove)
      Removes all occurrences of the specified values from the given collection.
      Type Parameters:
      T - The type of elements in the collection.
      Parameters:
      c - The collection from which the values should be removed.
      valuesToRemove - The values to be removed from the collection.
      Returns:
      true if the collection changed as a result of this call, false otherwise.
    • removeAll

      public static <T> boolean removeAll(Collection<T> c, Iterable<?> valuesToRemove)
      Removes all occurrences of the specified values from the given collection.
      Type Parameters:
      T - The type of elements in the collection.
      Parameters:
      c - The collection from which the values should be removed.
      valuesToRemove - The collection of values to be removed from the collection.
      Returns:
      true if the collection changed as a result of this call, false otherwise.
    • removeAll

      public static <T> boolean removeAll(Collection<T> c, Iterator<?> valuesToRemove)
      Removes all occurrences of the specified values from the given collection.
      Type Parameters:
      T - The type of elements in the collection.
      Parameters:
      c - The collection from which the elements should be removed.
      valuesToRemove - The iterator of values to be removed from the collection.
      Returns:
      true if the collection changed as a result of this call, false otherwise.
    • removeAllOccurrences

      public static boolean[] removeAllOccurrences(boolean[] a, boolean valueToRemove)
      Returns a new array with elements copied from the specified array except all occurrence of the specified value.
      The original array remains unchanged.
      Parameters:
      a - The array from which the value should be removed.
      valueToRemove - The value to be removed from the array.
      Returns:
      a new array with all occurrences of the specified value removed. An empty array is returned if the specified array is null or empty.
    • removeAllOccurrences

      public static char[] removeAllOccurrences(char[] a, char valueToRemove)
      Returns a new array with elements copied from the specified array except all occurrence of the specified value.
      The original array remains unchanged.
      Parameters:
      a - The array from which the value should be removed.
      valueToRemove - The value to be removed from the array.
      Returns:
      a new array with all occurrences of the specified value removed. An empty array is returned if the specified array is null or empty.
    • removeAllOccurrences

      public static byte[] removeAllOccurrences(byte[] a, byte valueToRemove)
      Returns a new array with elements copied from the specified array except all occurrence of the specified value.
      The original array remains unchanged.
      Parameters:
      a - The array from which the value should be removed.
      valueToRemove - The value to be removed from the array.
      Returns:
      a new array with all occurrences of the specified value removed. An empty array is returned if the specified array is null or empty.
    • removeAllOccurrences

      public static short[] removeAllOccurrences(short[] a, short valueToRemove)
      Returns a new array with elements copied from the specified array except all occurrence of the specified value.
      The original array remains unchanged.
      Parameters:
      a - The array from which the value should be removed.
      valueToRemove - The value to be removed from the array.
      Returns:
      a new array with all occurrences of the specified value removed. An empty array is returned if the specified array is null or empty.
    • removeAllOccurrences

      public static int[] removeAllOccurrences(int[] a, int valueToRemove)
      Returns a new array with elements copied from the specified array except all occurrence of the specified value.
      The original array remains unchanged.
      Parameters:
      a - The array from which the value should be removed.
      valueToRemove - The value to be removed from the array.
      Returns:
      a new array with all occurrences of the specified value removed. An empty array is returned if the specified array is null or empty.
    • removeAllOccurrences

      public static long[] removeAllOccurrences(long[] a, long valueToRemove)
      Returns a new array with elements copied from the specified array except all occurrence of the specified value.
      The original array remains unchanged.
      Parameters:
      a - The array from which the value should be removed.
      valueToRemove - The value to be removed from the array.
      Returns:
      a new array with all occurrences of the specified value removed. An empty array is returned if the specified array is null or empty.
    • removeAllOccurrences

      public static float[] removeAllOccurrences(float[] a, float valueToRemove)
      Returns a new array with elements copied from the specified array except all occurrence of the specified value.
      The original array remains unchanged.
      Parameters:
      a - The array from which the value should be removed.
      valueToRemove - The value to be removed from the array.
      Returns:
      a new array with all occurrences of the specified value removed. An empty array is returned if the specified array is null or empty.
    • removeAllOccurrences

      public static double[] removeAllOccurrences(double[] a, double valueToRemove)
      Returns a new array with elements copied from the specified array except all occurrence of the specified value.
      The original array remains unchanged.
      Parameters:
      a - The array from which the value should be removed.
      valueToRemove - The value to be removed from the array.
      Returns:
      a new array with all occurrences of the specified value removed. An empty array is returned if the specified array is null or empty.
    • removeAllOccurrences

      public static String[] removeAllOccurrences(String[] a, String valueToRemove)
      Returns a new array with elements copied from the specified array except all occurrence of the specified value.
      The original array remains unchanged.
      Parameters:
      a - The array from which the value should be removed.
      valueToRemove - The value to be removed from the array.
      Returns:
      a new array with all occurrences of the specified value removed. An empty array is returned if the specified array is null or empty.
    • removeAllOccurrences

      public static <T> T[] removeAllOccurrences(T[] a, T valueToRemove)
      Returns a new array with elements copied from the specified array except all occurrence of the specified value.
      The original array remains unchanged.
      Parameters:
      a - The array from which the value should be removed.
      valueToRemove - The value to be removed from the array.
      Returns:
      a new array with all occurrences of the specified value removed. The input array itself is returned if the specified array is null or empty.
    • removeAllOccurrences

      public static <T> boolean removeAllOccurrences(Collection<T> c, T valueToRemove)
      Removes all occurrences of the specified value from the given collection.
      Type Parameters:
      T - The type of elements in the collection.
      Parameters:
      c - The collection from which the value should be removed.
      valueToRemove - The value to be removed from the collection.
      Returns:
      true if the collection changed as a result of this call, false otherwise.
    • removeDuplicates

      public static boolean[] removeDuplicates(boolean[] a)
      Returns a new array with elements from the input array but without any duplicates.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      Returns:
      a new array with all duplicates removed. An empty array is returned if the specified array is null or empty.
    • removeDuplicates

      public static boolean[] removeDuplicates(boolean[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns a new array with duplicate elements removed within the specified range.
      The original array remains unchanged.
      Parameters:
      a - The boolean array from which duplicates should be removed.
      fromIndex - The initial index of the range to be considered for duplicate removal.
      toIndex - The final index of the range to be considered for duplicate removal.
      Returns:
      a new array with duplicate elements from the given array within the specified range
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds.
    • removeDuplicates

      public static char[] removeDuplicates(char[] a)
      Returns a new array with elements from the input array but without any duplicates.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      Returns:
      a new array with all duplicates removed. An empty array is returned if the specified array is null or empty.
    • removeDuplicates

      public static char[] removeDuplicates(char[] a, boolean isSorted)
      Returns a new array with elements from the input array but without any duplicates.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      isSorted - A boolean flag indicating whether the input array is sorted. If true, the algorithm will be faster
      Returns:
      a new array with all duplicates removed. An empty array is returned if the specified array is null or empty.
    • removeDuplicates

      public static char[] removeDuplicates(char[] a, int fromIndex, int toIndex, boolean isSorted) throws IndexOutOfBoundsException
      Returns a new array with duplicate elements removed within the specified range.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      fromIndex - The initial index of the range to be considered for duplicate removal.
      toIndex - The final index of the range to be considered for duplicate removal.
      isSorted - A boolean flag indicating whether the input array within the specified range is sorted. If true, the algorithm will be faster.
      Returns:
      A new array with duplicates removed within the specified range.
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds.
    • removeDuplicates

      public static byte[] removeDuplicates(byte[] a)
      Returns a new array with elements from the input array but without any duplicates.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      Returns:
      a new array with all duplicates removed. An empty array is returned if the specified array is null or empty.
    • removeDuplicates

      public static byte[] removeDuplicates(byte[] a, boolean isSorted)
      Returns a new array with elements from the input array but without any duplicates.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      isSorted - A boolean flag indicating whether the input array is sorted. If true, the algorithm will be faster
      Returns:
      a new array with all duplicates removed. An empty array is returned if the specified array is null or empty.
    • removeDuplicates

      public static byte[] removeDuplicates(byte[] a, int fromIndex, int toIndex, boolean isSorted) throws IndexOutOfBoundsException
      Returns a new array with duplicate elements removed within the specified range.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      fromIndex - The initial index of the range to be considered for duplicate removal.
      toIndex - The final index of the range to be considered for duplicate removal.
      isSorted - A boolean flag indicating whether the input array within the specified range is sorted. If true, the algorithm will be faster.
      Returns:
      A new array with duplicates removed within the specified range.
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds.
    • removeDuplicates

      public static short[] removeDuplicates(short[] a)
      Returns a new array with elements from the input array but without any duplicates.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      Returns:
      a new array with all duplicates removed. An empty array is returned if the specified array is null or empty.
    • removeDuplicates

      public static short[] removeDuplicates(short[] a, boolean isSorted)
      Returns a new array with elements from the input array but without any duplicates.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      isSorted - A boolean flag indicating whether the input array is sorted. If true, the algorithm will be faster
      Returns:
      a new array with all duplicates removed. An empty array is returned if the specified array is null or empty.
    • removeDuplicates

      public static short[] removeDuplicates(short[] a, int fromIndex, int toIndex, boolean isSorted) throws IndexOutOfBoundsException
      Returns a new array with duplicate elements removed within the specified range.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      fromIndex - The initial index of the range to be considered for duplicate removal.
      toIndex - The final index of the range to be considered for duplicate removal.
      isSorted - A boolean flag indicating whether the input array within the specified range is sorted. If true, the algorithm will be faster.
      Returns:
      A new array with duplicates removed within the specified range.
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds.
    • removeDuplicates

      public static int[] removeDuplicates(int[] a)
      Returns a new array with elements from the input array but without any duplicates.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      Returns:
      a new array with all duplicates removed. An empty array is returned if the specified array is null or empty.
    • removeDuplicates

      public static int[] removeDuplicates(int[] a, boolean isSorted)
      Returns a new array with elements from the input array but without any duplicates.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      isSorted - A boolean flag indicating whether the input array is sorted. If true, the algorithm will be faster
      Returns:
      a new array with all duplicates removed. An empty array is returned if the specified array is null or empty.
    • removeDuplicates

      public static int[] removeDuplicates(int[] a, int fromIndex, int toIndex, boolean isSorted) throws IndexOutOfBoundsException
      Returns a new array with duplicate elements removed within the specified range.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      fromIndex - The initial index of the range to be considered for duplicate removal.
      toIndex - The final index of the range to be considered for duplicate removal.
      isSorted - A boolean flag indicating whether the input array within the specified range is sorted. If true, the algorithm will be faster.
      Returns:
      A new array with duplicates removed within the specified range.
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds.
    • removeDuplicates

      public static long[] removeDuplicates(long[] a)
      Returns a new array with elements from the input array but without any duplicates.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      Returns:
      a new array with all duplicates removed. An empty array is returned if the specified array is null or empty.
    • removeDuplicates

      public static long[] removeDuplicates(long[] a, boolean isSorted)
      Returns a new array with elements from the input array but without any duplicates.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      isSorted - A boolean flag indicating whether the input array is sorted. If true, the algorithm will be faster
      Returns:
      a new array with all duplicates removed. An empty array is returned if the specified array is null or empty.
    • removeDuplicates

      public static long[] removeDuplicates(long[] a, int fromIndex, int toIndex, boolean isSorted) throws IndexOutOfBoundsException
      Returns a new array with duplicate elements removed within the specified range.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      fromIndex - The initial index of the range to be considered for duplicate removal.
      toIndex - The final index of the range to be considered for duplicate removal.
      isSorted - A boolean flag indicating whether the input array within the specified range is sorted. If true, the algorithm will be faster.
      Returns:
      A new array with duplicates removed within the specified range.
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds.
    • removeDuplicates

      public static float[] removeDuplicates(float[] a)
      Returns a new array with elements from the input array but without any duplicates.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      Returns:
      a new array with all duplicates removed. An empty array is returned if the specified array is null or empty.
    • removeDuplicates

      public static float[] removeDuplicates(float[] a, boolean isSorted)
      Returns a new array with elements from the input array but without any duplicates.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      isSorted - A boolean flag indicating whether the input array is sorted. If true, the algorithm will be faster
      Returns:
      a new array with all duplicates removed. An empty array is returned if the specified array is null or empty.
    • removeDuplicates

      public static float[] removeDuplicates(float[] a, int fromIndex, int toIndex, boolean isSorted) throws IndexOutOfBoundsException
      Returns a new array with duplicate elements removed within the specified range.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      fromIndex - The initial index of the range to be considered for duplicate removal.
      toIndex - The final index of the range to be considered for duplicate removal.
      isSorted - A boolean flag indicating whether the input array within the specified range is sorted. If true, the algorithm will be faster.
      Returns:
      A new array with duplicates removed within the specified range.
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds.
    • removeDuplicates

      public static double[] removeDuplicates(double[] a)
      Returns a new array with elements from the input array but without any duplicates.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      Returns:
      a new array with all duplicates removed. An empty array is returned if the specified array is null or empty.
    • removeDuplicates

      public static double[] removeDuplicates(double[] a, boolean isSorted)
      Returns a new array with elements from the input array but without any duplicates.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      isSorted - A boolean flag indicating whether the input array is sorted. If true, the algorithm will be faster
      Returns:
      a new array with all duplicates removed. An empty array is returned if the specified array is null or empty.
    • removeDuplicates

      public static double[] removeDuplicates(double[] a, int fromIndex, int toIndex, boolean isSorted) throws IndexOutOfBoundsException
      Returns a new array with duplicate elements removed within the specified range.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      fromIndex - The initial index of the range to be considered for duplicate removal.
      toIndex - The final index of the range to be considered for duplicate removal.
      isSorted - A boolean flag indicating whether the input array within the specified range is sorted. If true, the algorithm will be faster.
      Returns:
      A new array with duplicates removed within the specified range.
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds.
    • removeDuplicates

      public static String[] removeDuplicates(String[] a)
      Returns a new array with elements from the input array but without any duplicates.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      Returns:
      a new array with all duplicates removed. An empty array is returned if the specified array is null or empty.
    • removeDuplicates

      public static String[] removeDuplicates(String[] a, boolean isSorted)
      Returns a new array with elements from the input array but without any duplicates.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      isSorted - A boolean flag indicating whether the input array is sorted. If true, the algorithm will be faster
      Returns:
      a new array with all duplicates removed. An empty array is returned if the specified array is null or empty.
    • removeDuplicates

      public static String[] removeDuplicates(String[] a, int fromIndex, int toIndex, boolean isSorted) throws IndexOutOfBoundsException
      Returns a new array with duplicate elements removed within the specified range.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      fromIndex - The initial index of the range to be considered for duplicate removal.
      toIndex - The final index of the range to be considered for duplicate removal.
      isSorted - A boolean flag indicating whether the input array within the specified range is sorted. If true, the algorithm will be faster.
      Returns:
      A new array with duplicates removed within the specified range.
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds.
    • removeDuplicates

      public static <T> T[] removeDuplicates(T[] a)
      Returns a new array with elements from the input array but without any duplicates.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      Returns:
      a new array with all duplicates removed. The input array itself is returned if the specified array is null or empty.
    • removeDuplicates

      public static <T> T[] removeDuplicates(T[] a, boolean isSorted)
      Returns a new array with elements from the input array but without any duplicates.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      isSorted - A boolean flag indicating whether the input array is sorted. If true, the algorithm will be faster
      Returns:
      a new array with all duplicates removed. The input array itself is returned if the specified array is null or empty.
    • removeDuplicates

      public static <T> T[] removeDuplicates(T[] a, int fromIndex, int toIndex, boolean isSorted) throws IndexOutOfBoundsException
      Returns a new array with duplicate elements removed within the specified range.
      The original array remains unchanged.
      Parameters:
      a - The array from which duplicates should be removed.
      fromIndex - The initial index of the range to be considered for duplicate removal.
      toIndex - The final index of the range to be considered for duplicate removal.
      isSorted - A boolean flag indicating whether the input array within the specified range is sorted. If true, the algorithm will be faster.
      Returns:
      A new array with duplicates removed within the specified range.
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds.
    • removeDuplicates

      public static boolean removeDuplicates(Collection<?> c)
      Removes duplicate elements from the given collection.
      Parameters:
      c - The collection from which duplicates should be removed.
      Returns:
      true if the collection changed as a result of this call, false otherwise.
    • removeDuplicates

      public static boolean removeDuplicates(Collection<?> c, boolean isSorted)
      Removes duplicate elements from the given collection.
      Parameters:
      c - The collection from which duplicates should be removed.
      isSorted - A boolean flag indicating whether the input array is sorted. If true, the algorithm will be faster
      Returns:
      true if the collection changed as a result of this call, false otherwise.
    • deleteRange

      public static boolean[] deleteRange(boolean[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns a new array with the specified range of elements removed
      The original array remains unchanged.
      Parameters:
      a - the input array from which a range of elements are to be deleted
      fromIndex - the initial index of the range to be deleted, inclusive
      toIndex - the final index of the range to be deleted, exclusive
      Returns:
      a new array with the specified range of elements removed. An empty array is returned if the specified array is null or empty.
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds
    • deleteRange

      public static char[] deleteRange(char[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns a new array with the specified range of elements removed
      The original array remains unchanged.
      Parameters:
      a - the input array from which a range of elements are to be deleted
      fromIndex - the initial index of the range to be deleted, inclusive
      toIndex - the final index of the range to be deleted, exclusive
      Returns:
      a new array with the specified range of elements removed. An empty array is returned if the specified array is null or empty.
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds
    • deleteRange

      public static byte[] deleteRange(byte[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns a new array with the specified range of elements removed
      The original array remains unchanged.
      Parameters:
      a - the input array from which a range of elements are to be deleted
      fromIndex - the initial index of the range to be deleted, inclusive
      toIndex - the final index of the range to be deleted, exclusive
      Returns:
      a new array with the specified range of elements removed. An empty array is returned if the specified array is null or empty.
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds
    • deleteRange

      public static short[] deleteRange(short[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns a new array with the specified range of elements removed
      The original array remains unchanged.
      Parameters:
      a - the input array from which a range of elements are to be deleted
      fromIndex - the initial index of the range to be deleted, inclusive
      toIndex - the final index of the range to be deleted, exclusive
      Returns:
      a new array with the specified range of elements removed. An empty array is returned if the specified array is null or empty.
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds
    • deleteRange

      public static int[] deleteRange(int[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns a new array with the specified range of elements removed
      The original array remains unchanged.
      Parameters:
      a - the input array from which a range of elements are to be deleted
      fromIndex - the initial index of the range to be deleted, inclusive
      toIndex - the final index of the range to be deleted, exclusive
      Returns:
      a new array with the specified range of elements removed. An empty array is returned if the specified array is null or empty.
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds
    • deleteRange

      public static long[] deleteRange(long[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns a new array with the specified range of elements removed
      The original array remains unchanged.
      Parameters:
      a - the input array from which a range of elements are to be deleted
      fromIndex - the initial index of the range to be deleted, inclusive
      toIndex - the final index of the range to be deleted, exclusive
      Returns:
      a new array with the specified range of elements removed. An empty array is returned if the specified array is null or empty.
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds
    • deleteRange

      public static float[] deleteRange(float[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns a new array with the specified range of elements removed
      The original array remains unchanged.
      Parameters:
      a - the input array from which a range of elements are to be deleted
      fromIndex - the initial index of the range to be deleted, inclusive
      toIndex - the final index of the range to be deleted, exclusive
      Returns:
      a new array with the specified range of elements removed. An empty array is returned if the specified array is null or empty.
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds
    • deleteRange

      public static double[] deleteRange(double[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns a new array with the specified range of elements removed
      The original array remains unchanged.
      Parameters:
      a - the input array from which a range of elements are to be deleted
      fromIndex - the initial index of the range to be deleted, inclusive
      toIndex - the final index of the range to be deleted, exclusive
      Returns:
      a new array with the specified range of elements removed. An empty array is returned if the specified array is null or empty.
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds
    • deleteRange

      public static String[] deleteRange(String[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException, IllegalArgumentException
      Returns a new array with the specified range of elements removed
      The original array remains unchanged.
      Parameters:
      a - the input array from which a range of elements are to be deleted
      fromIndex - the initial index of the range to be deleted, inclusive
      toIndex - the final index of the range to be deleted, exclusive
      Returns:
      a new array with the specified range of elements removed. An empty array is returned if the specified array is null or empty.
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds
      IllegalArgumentException
    • deleteRange

      public static <T> T[] deleteRange(@NotNull T[] a, int fromIndex, int toIndex) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns a new array with the specified range of elements removed
      The original array remains unchanged.
      Parameters:
      a - the input array from which a range of elements are to be deleted
      fromIndex - the initial index of the range to be deleted, inclusive
      toIndex - the final index of the range to be deleted, exclusive
      Returns:
      a new array with the specified range of elements removed
      Throws:
      IllegalArgumentException - if the specified original Array is null.
      IndexOutOfBoundsException - if the range is out of the array bounds
    • deleteRange

      public static <T> boolean deleteRange(List<T> c, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Deletes a range of elements from the given list.
      Type Parameters:
      T - the type of elements in the list
      Parameters:
      c - the input list from which a range of elements are to be deleted
      fromIndex - the initial index of the range to be deleted, inclusive
      toIndex - the final index of the range to be deleted, exclusive
      Returns:
      true if the list is updated; false otherwise
      Throws:
      IndexOutOfBoundsException - if the range is out of the list bounds
    • deleteRange

      public static String deleteRange(String str, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns a new String with the specified range of chars removed
      The original String remains unchanged.
      Parameters:
      str - the input string from which a range of characters are to be deleted
      fromIndex - the initial index of the range to be deleted, inclusive
      toIndex - the final index of the range to be deleted, exclusive
      Returns:
      a new string with the specified range of characters deleted. An empty String is returned if the specified String is null or empty.
      Throws:
      IndexOutOfBoundsException - if the range is out of the string bounds
      See Also:
    • replaceRange

      public static boolean[] replaceRange(boolean[] a, int fromIndex, int toIndex, boolean[] replacement) throws IndexOutOfBoundsException
      Returns a new array with the specified range replaced with the replacement array.
      The original array remains unchanged.
      Parameters:
      a - the original array
      fromIndex - the initial index of the range to be replaced, inclusive
      toIndex - the final index of the range to be replaced, exclusive
      replacement - the array to replace the specified range in the original array
      Returns:
      a new array with the specified range replaced by the replacement array
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds
    • replaceRange

      public static char[] replaceRange(char[] a, int fromIndex, int toIndex, char[] replacement) throws IndexOutOfBoundsException
      Returns a new array with the specified range replaced with the replacement array.
      The original array remains unchanged.
      Parameters:
      a - the original array
      fromIndex - the initial index of the range to be replaced, inclusive
      toIndex - the final index of the range to be replaced, exclusive
      replacement - the array to replace the specified range in the original array
      Returns:
      a new array with the specified range replaced by the replacement array
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds
    • replaceRange

      public static byte[] replaceRange(byte[] a, int fromIndex, int toIndex, byte[] replacement) throws IndexOutOfBoundsException
      Returns a new array with the specified range replaced with the replacement array.
      The original array remains unchanged.
      Parameters:
      a - the original array
      fromIndex - the initial index of the range to be replaced, inclusive
      toIndex - the final index of the range to be replaced, exclusive
      replacement - the array to replace the specified range in the original array
      Returns:
      a new array with the specified range replaced by the replacement array
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds
    • replaceRange

      public static short[] replaceRange(short[] a, int fromIndex, int toIndex, short[] replacement) throws IndexOutOfBoundsException
      Returns a new array with the specified range replaced with the replacement array.
      The original array remains unchanged.
      Parameters:
      a - the original array
      fromIndex - the initial index of the range to be replaced, inclusive
      toIndex - the final index of the range to be replaced, exclusive
      replacement - the array to replace the specified range in the original array
      Returns:
      a new array with the specified range replaced by the replacement array
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds
    • replaceRange

      public static int[] replaceRange(int[] a, int fromIndex, int toIndex, int[] replacement) throws IndexOutOfBoundsException
      Returns a new array with the specified range replaced with the replacement array.
      The original array remains unchanged.
      Parameters:
      a - the original array
      fromIndex - the initial index of the range to be replaced, inclusive
      toIndex - the final index of the range to be replaced, exclusive
      replacement - the array to replace the specified range in the original array
      Returns:
      a new array with the specified range replaced by the replacement array
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds
    • replaceRange

      public static long[] replaceRange(long[] a, int fromIndex, int toIndex, long[] replacement) throws IndexOutOfBoundsException
      Returns a new array with the specified range replaced with the replacement array.
      The original array remains unchanged.
      Parameters:
      a - the original array
      fromIndex - the initial index of the range to be replaced, inclusive
      toIndex - the final index of the range to be replaced, exclusive
      replacement - the array to replace the specified range in the original array
      Returns:
      a new array with the specified range replaced by the replacement array
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds
    • replaceRange

      public static float[] replaceRange(float[] a, int fromIndex, int toIndex, float[] replacement) throws IndexOutOfBoundsException
      Returns a new array with the specified range replaced with the replacement array.
      The original array remains unchanged.
      Parameters:
      a - the original array
      fromIndex - the initial index of the range to be replaced, inclusive
      toIndex - the final index of the range to be replaced, exclusive
      replacement - the array to replace the specified range in the original array
      Returns:
      a new array with the specified range replaced by the replacement array
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds
    • replaceRange

      public static double[] replaceRange(double[] a, int fromIndex, int toIndex, double[] replacement) throws IndexOutOfBoundsException
      Returns a new array with the specified range replaced with the replacement array.
      The original array remains unchanged.
      Parameters:
      a - the original array
      fromIndex - the initial index of the range to be replaced, inclusive
      toIndex - the final index of the range to be replaced, exclusive
      replacement - the array to replace the specified range in the original array
      Returns:
      a new array with the specified range replaced by the replacement array
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds
    • replaceRange

      public static String[] replaceRange(String[] a, int fromIndex, int toIndex, String[] replacement) throws IndexOutOfBoundsException
      Returns a new array with the specified range replaced with the replacement array.
      The original array remains unchanged.
      Parameters:
      a - the original array
      fromIndex - the initial index of the range to be replaced, inclusive
      toIndex - the final index of the range to be replaced, exclusive
      replacement - the array to replace the specified range in the original array
      Returns:
      a new array with the specified range replaced by the replacement array
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds
    • replaceRange

      public static <T> T[] replaceRange(@NotNull T[] a, int fromIndex, int toIndex, T[] replacement) throws IllegalArgumentException, IndexOutOfBoundsException
      Returns a new array with the specified range replaced with the replacement array.
      The original array remains unchanged.
      Parameters:
      a - the original array
      fromIndex - the initial index of the range to be replaced, inclusive
      toIndex - the final index of the range to be replaced, exclusive
      replacement - the array to replace the specified range in the original array
      Returns:
      a new array with the specified range replaced by the replacement array
      Throws:
      IllegalArgumentException - if the specified original Array is null.
      IndexOutOfBoundsException - if the range is out of the array bounds
    • replaceRange

      public static <T> boolean replaceRange(@NotNull List<T> c, int fromIndex, int toIndex, Collection<? extends T> replacement) throws IllegalArgumentException
      Replaces a range of elements in the given list with the elements from the replacement collection.
      Type Parameters:
      T - the type of elements in the list and replacement collection
      Parameters:
      c - the original list to be modified
      fromIndex - the initial index of the range to be replaced, inclusive
      toIndex - the final index of the range to be replaced, exclusive
      replacement - the collection to replace the specified range in the original list
      Returns:
      a boolean indicating whether the list was modified
      Throws:
      IllegalArgumentException - if the specified list is null
      IndexOutOfBoundsException - if the range is out of the list bounds
    • replaceRange

      public static String replaceRange(String str, int fromIndex, int toIndex, String replacement) throws IndexOutOfBoundsException
      Returns a new String with the specified range replaced with the replacement String.
      The original String remains unchanged.
      Parameters:
      str - the original string
      fromIndex - the initial index of the range to be replaced, inclusive
      toIndex - the final index of the range to be replaced, exclusive
      replacement - the string to replace the specified range in the original string
      Returns:
      a new string with the specified range replaced by the replacement string
      Throws:
      IndexOutOfBoundsException - if the range is out of the string bounds
      See Also:
    • moveRange

      public static void moveRange(boolean[] a, int fromIndex, int toIndex, int newPositionStartIndex) throws IndexOutOfBoundsException
      Moves a range of elements in the given array to a new position within the array.
      No elements are deleted in the process, the original array maintains its size.
      Parameters:
      a - the original array to be modified
      fromIndex - the initial index of the range to be moved, inclusive
      toIndex - the final index of the range to be moved, exclusive
      newPositionStartIndex - must in the range: [0, array.length - (toIndex - fromIndex)]
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds or newPositionStartIndex is invalid
    • moveRange

      public static void moveRange(char[] a, int fromIndex, int toIndex, int newPositionStartIndex) throws IndexOutOfBoundsException
      Moves a range of elements in the given array to a new position within the array.
      No elements are deleted in the process, the original array maintains its size.
      Parameters:
      a - the original array to be modified
      fromIndex - the initial index of the range to be moved, inclusive
      toIndex - the final index of the range to be moved, exclusive
      newPositionStartIndex - must in the range: [0, array.length - (toIndex - fromIndex)]
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds or newPositionStartIndex is invalid
    • moveRange

      public static void moveRange(byte[] a, int fromIndex, int toIndex, int newPositionStartIndex) throws IndexOutOfBoundsException
      Moves a range of elements in the given array to a new position within the array.
      No elements are deleted in the process, the original array maintains its size.
      Parameters:
      a - the original array to be modified
      fromIndex - the initial index of the range to be moved, inclusive
      toIndex - the final index of the range to be moved, exclusive
      newPositionStartIndex - must in the range: [0, array.length - (toIndex - fromIndex)]
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds or newPositionStartIndex is invalid
    • moveRange

      public static void moveRange(short[] a, int fromIndex, int toIndex, int newPositionStartIndex) throws IndexOutOfBoundsException
      Moves a range of elements in the given array to a new position within the array.
      No elements are deleted in the process, the original array maintains its size.
      Parameters:
      a - the original array to be modified
      fromIndex - the initial index of the range to be moved, inclusive
      toIndex - the final index of the range to be moved, exclusive
      newPositionStartIndex - must in the range: [0, array.length - (toIndex - fromIndex)]
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds or newPositionStartIndex is invalid
    • moveRange

      public static void moveRange(int[] a, int fromIndex, int toIndex, int newPositionStartIndex) throws IndexOutOfBoundsException
      Moves a range of elements in the given array to a new position within the array.
      No elements are deleted in the process, the original array maintains its size.
      Parameters:
      a - the original array to be modified
      fromIndex - the initial index of the range to be moved, inclusive
      toIndex - the final index of the range to be moved, exclusive
      newPositionStartIndex - must in the range: [0, array.length - (toIndex - fromIndex)]
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds or newPositionStartIndex is invalid
    • moveRange

      public static void moveRange(long[] a, int fromIndex, int toIndex, int newPositionStartIndex) throws IndexOutOfBoundsException
      Moves a range of elements in the given array to a new position within the array.
      No elements are deleted in the process, the original array maintains its size.
      Parameters:
      a - the original array to be modified
      fromIndex - the initial index of the range to be moved, inclusive
      toIndex - the final index of the range to be moved, exclusive
      newPositionStartIndex - must in the range: [0, array.length - (toIndex - fromIndex)]
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds or newPositionStartIndex is invalid
    • moveRange

      public static void moveRange(float[] a, int fromIndex, int toIndex, int newPositionStartIndex) throws IndexOutOfBoundsException
      Moves a range of elements in the given array to a new position within the array.
      No elements are deleted in the process, the original array maintains its size.
      Parameters:
      a - the original array to be modified
      fromIndex - the initial index of the range to be moved, inclusive
      toIndex - the final index of the range to be moved, exclusive
      newPositionStartIndex - must in the range: [0, array.length - (toIndex - fromIndex)]
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds or newPositionStartIndex is invalid
    • moveRange

      public static void moveRange(double[] a, int fromIndex, int toIndex, int newPositionStartIndex) throws IndexOutOfBoundsException
      Moves a range of elements in the given array to a new position within the array.
      No elements are deleted in the process, the original array maintains its size.
      Parameters:
      a - the original array to be modified
      fromIndex - the initial index of the range to be moved, inclusive
      toIndex - the final index of the range to be moved, exclusive
      newPositionStartIndex - must in the range: [0, array.length - (toIndex - fromIndex)]
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds or newPositionStartIndex is invalid
    • moveRange

      public static <T> void moveRange(T[] a, int fromIndex, int toIndex, int newPositionStartIndex) throws IndexOutOfBoundsException
      Moves a range of elements in the given array to a new position within the array.
      No elements are deleted in the process, the original array maintains its size.
      Parameters:
      a - the original array to be modified
      fromIndex - the initial index of the range to be moved, inclusive
      toIndex - the final index of the range to be moved, exclusive
      newPositionStartIndex - must in the range: [0, array.length - (toIndex - fromIndex)]
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds or newPositionStartIndex is invalid
    • moveRange

      public static <T> boolean moveRange(List<T> c, int fromIndex, int toIndex, int newPositionStartIndex) throws IndexOutOfBoundsException
      Moves a range of elements in the given list to a new position within the list.
      No elements are deleted in the process, the original list maintains its size.
      Type Parameters:
      T - the type of elements in the list
      Parameters:
      c - the original list to be modified
      fromIndex - the initial index of the range to be moved, inclusive
      toIndex - the final index of the range to be moved, exclusive
      newPositionStartIndex - must in the range: [0, list.size() - (toIndex - fromIndex)]
      Returns:
      true if the list was modified as a result of this operation
      Throws:
      IndexOutOfBoundsException - if the range is out of the list bounds or newPositionStartIndex is invalid
    • moveRange

      public static String moveRange(String str, int fromIndex, int toIndex, int newPositionStartIndex) throws IndexOutOfBoundsException
      Returns a new string with the specified range moved to the new position.
      The original String remains unchanged.
      Parameters:
      str - the original string to be modified
      fromIndex - the initial index of the range to be moved, inclusive
      toIndex - the final index of the range to be moved, exclusive
      newPositionStartIndex - must in the range: [0, String.length - (toIndex - fromIndex)]
      Returns:
      a new string with the specified range moved to the new position
      Throws:
      IndexOutOfBoundsException - if the range is out of the string bounds or newPositionStartIndex is invalid
      See Also:
    • skipRange

      public static <T> T[] skipRange(T[] a, int startInclusive, int endExclusive) throws IndexOutOfBoundsException
      Returns a new array with the specified range skipped.
      The original array remains unchanged.
      Type Parameters:
      T - the type of elements in the array
      Parameters:
      a - the original array to be modified
      startInclusive - the initial index of the range to be skipped, inclusive
      endExclusive - the final index of the range to be skipped, exclusive
      Returns:
      a new array with the specified range skipped
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds
    • skipRange

      public static <T> List<T> skipRange(Collection<? extends T> c, int startInclusive, int endExclusive) throws IndexOutOfBoundsException
      Returns a new list with the specified range skipped.
      The original collection remains unchanged.
      Type Parameters:
      T - the type of elements in the collection
      Parameters:
      c - the original collection to be modified
      startInclusive - the initial index of the range to be skipped, inclusive
      endExclusive - the final index of the range to be skipped, exclusive
      Returns:
      a new list with the specified range skipped
      Throws:
      IndexOutOfBoundsException - if the range is out of the collection bounds
    • skipRange

      public static <T, C extends Collection<T>> C skipRange(Collection<? extends T> c, int startInclusive, int endExclusive, IntFunction<C> supplier) throws IndexOutOfBoundsException
      Returns a new collection with the specified range skipped.
      The original collection remains unchanged.
      Type Parameters:
      T - the type of elements in the collection
      C - the type of the collection to be returned
      Parameters:
      c - the original collection to be modified
      startInclusive - the initial index of the range to be skipped, inclusive
      endExclusive - the final index of the range to be skipped, exclusive
      supplier - a function that creates a new instance of the desired collection type
      Returns:
      a new collection with the specified range skipped
      Throws:
      IndexOutOfBoundsException - if the range is out of the collection bounds
    • hasDuplicates

      public static boolean hasDuplicates(boolean[] a)
      Checks if the given array has duplicate elements.
      Parameters:
      a - the array to be checked for duplicates
      Returns:
      true if the array has duplicates, false otherwise
    • hasDuplicates

      public static boolean hasDuplicates(char[] a)
      Checks if the given array has duplicate elements.
      Parameters:
      a - the array to be checked for duplicates
      Returns:
      true if the array has duplicates, false otherwise
    • hasDuplicates

      public static boolean hasDuplicates(char[] a, boolean isSorted)
      Checks if the given array has duplicate elements.
      Parameters:
      a - the array to be checked for duplicates
      isSorted - a boolean that indicates if the array is sorted. If true, the algorithm will be faster.
      Returns:
      true if the array has duplicates, false otherwise
    • hasDuplicates

      public static boolean hasDuplicates(byte[] a)
      Checks if the given array has duplicate elements.
      Parameters:
      a - the array to be checked for duplicates
      Returns:
      true if the array has duplicates, false otherwise
    • hasDuplicates

      public static boolean hasDuplicates(byte[] a, boolean isSorted)
      Checks if the given array has duplicate elements.
      Parameters:
      a - the array to be checked for duplicates
      isSorted - a boolean that indicates if the array is sorted. If true, the algorithm will be faster.
      Returns:
      true if the array has duplicates, false otherwise
    • hasDuplicates

      public static boolean hasDuplicates(short[] a)
      Checks if the given array has duplicate elements.
      Parameters:
      a - the array to be checked for duplicates
      Returns:
      true if the array has duplicates, false otherwise
    • hasDuplicates

      public static boolean hasDuplicates(short[] a, boolean isSorted)
      Checks if the given array has duplicate elements.
      Parameters:
      a - the array to be checked for duplicates
      isSorted - a boolean that indicates if the array is sorted. If true, the algorithm will be faster.
      Returns:
      true if the array has duplicates, false otherwise
    • hasDuplicates

      public static boolean hasDuplicates(int[] a)
      Checks if the given array has duplicate elements.
      Parameters:
      a - the array to be checked for duplicates
      Returns:
      true if the array has duplicates, false otherwise
    • hasDuplicates

      public static boolean hasDuplicates(int[] a, boolean isSorted)
      Checks if the given array has duplicate elements.
      Parameters:
      a - the array to be checked for duplicates
      isSorted - a boolean that indicates if the array is sorted. If true, the algorithm will be faster.
      Returns:
      true if the array has duplicates, false otherwise
    • hasDuplicates

      public static boolean hasDuplicates(long[] a)
      Checks if the given array has duplicate elements.
      Parameters:
      a - the array to be checked for duplicates
      Returns:
      true if the array has duplicates, false otherwise
    • hasDuplicates

      public static boolean hasDuplicates(long[] a, boolean isSorted)
      Checks if the given array has duplicate elements.
      Parameters:
      a - the array to be checked for duplicates
      isSorted - a boolean that indicates if the array is sorted. If true, the algorithm will be faster.
      Returns:
      true if the array has duplicates, false otherwise
    • hasDuplicates

      public static boolean hasDuplicates(float[] a)
      Checks if the given array has duplicate elements.
      Parameters:
      a - the array to be checked for duplicates
      Returns:
      true if the array has duplicates, false otherwise
    • hasDuplicates

      public static boolean hasDuplicates(float[] a, boolean isSorted)
      Checks if the given array has duplicate elements.
      Parameters:
      a - the array to be checked for duplicates
      isSorted - a boolean that indicates if the array is sorted. If true, the algorithm will be faster.
      Returns:
      true if the array has duplicates, false otherwise
    • hasDuplicates

      public static boolean hasDuplicates(double[] a)
      Checks if the given array has duplicate elements.
      Parameters:
      a - the array to be checked for duplicates
      Returns:
      true if the array has duplicates, false otherwise
    • hasDuplicates

      public static boolean hasDuplicates(double[] a, boolean isSorted)
      Checks if the given array has duplicate elements.
      Parameters:
      a - the array to be checked for duplicates
      isSorted - a boolean that indicates if the array is sorted. If true, the algorithm will be faster.
      Returns:
      true if the array has duplicates, false otherwise
    • hasDuplicates

      public static <T> boolean hasDuplicates(T[] a)
      Checks if the given array has duplicate elements.
      Type Parameters:
      T -
      Parameters:
      a - the array to be checked for duplicates
      Returns:
      true if the array has duplicates, false otherwise
    • hasDuplicates

      public static <T> boolean hasDuplicates(T[] a, boolean isSorted)
      Checks if the given array has duplicate elements.
      Type Parameters:
      T -
      Parameters:
      a - the array to be checked for duplicates
      isSorted - a boolean that indicates if the array is sorted. If true, the algorithm will be faster.
      Returns:
      true if the array has duplicates, false otherwise
    • hasDuplicates

      public static boolean hasDuplicates(Collection<?> c)
      Checks if the given collection has duplicate elements.
      Parameters:
      c - the collection to be checked for duplicates
      Returns:
      true if the collection has duplicates, false otherwise
    • hasDuplicates

      public static boolean hasDuplicates(Collection<?> c, boolean isSorted)
      Checks if the given collection has duplicate elements.
      Parameters:
      c - the collection to be checked for duplicates
      isSorted - a boolean that indicates if the collection is sorted. If true, the algorithm will be faster
      Returns:
      true if the collection has duplicates, false otherwise
    • retainAll

      public static <T> boolean retainAll(Collection<T> c, Collection<? extends T> objsToKeep)
      Retains only the elements in the specified collection that are present in the specified collection of elements to keep. In other words, removes from the first collection all of its elements that are not contained in the second collection.
      Type Parameters:
      T - the type of elements in the collections
      Parameters:
      c - the collection to be modified.
      objsToKeep - the collection containing elements to be retained in the first collection.
      Returns:
      true if the first collection changed as a result of the call
    • sum

      @SafeVarargs public static int sum(char... a)
      Calculates the sum of the given array of characters. The sum is calculated by adding up the ASCII values of the characters.
      Parameters:
      a - the array of characters to sum. If the array is null or empty, the method returns 0.
      Returns:
      the sum of the ASCII values of the characters in the array.
    • sum

      public static int sum(char[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Calculates the sum of the ASCII values of the characters in the given array within the specified range.
      Parameters:
      a - the array of characters to sum. If the array is null or empty, the method returns 0.
      fromIndex - the start index, inclusive.
      toIndex - the end index, exclusive.
      Returns:
      the sum of the ASCII values of the characters in the specified range of the array.
      Throws:
      IndexOutOfBoundsException - if the range is out of bounds for the given array.
    • sum

      @SafeVarargs public static int sum(byte... a)
      Calculates the sum of the bytes in the given array.
      Parameters:
      a - the array of bytes to sum. If the array is null or empty, the method returns 0.
      Returns:
      the sum of the bytes in the array.
    • sum

      public static int sum(byte[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Calculates the sum of the bytes in the given array within the specified range.
      Parameters:
      a - the array of bytes to sum. If the array is null or empty, the method returns 0.
      fromIndex - the start index, inclusive.
      toIndex - the end index, exclusive.
      Returns:
      the sum of the bytes in the specified range of the array.
      Throws:
      IndexOutOfBoundsException - if the range is out of bounds for the given array.
    • sum

      @SafeVarargs public static int sum(short... a)
      Parameters:
      a -
      Returns:
      a long number
    • sum

      public static int sum(short[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • sum

      @SafeVarargs public static int sum(int... a)
      Parameters:
      a -
      Returns:
      a long number
    • sum

      public static int sum(int[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
    • sumToLong

      @SafeVarargs public static long sumToLong(int... a)
      Parameters:
      a -
      Returns:
      a long number
    • sumToLong

      public static long sumToLong(int[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • sum

      @SafeVarargs public static long sum(long... a)
      Parameters:
      a -
      Returns:
      a long number
    • sum

      public static long sum(long[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • sum

      @SafeVarargs public static float sum(float... a)
      Parameters:
      a -
      Returns:
    • sum

      public static float sum(float[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • sumToDouble

      @SafeVarargs public static double sumToDouble(float... a)
      Parameters:
      a -
      Returns:
    • sumToDouble

      public static double sumToDouble(float[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • sum

      @SafeVarargs public static double sum(double... a)
      Parameters:
      a -
      Returns:
      a double number
    • sum

      public static double sum(double[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • average

      @SafeVarargs public static double average(char... a)
      Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      Parameters:
      a -
      Returns:
      a double number
    • average

      public static double average(char[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • average

      @SafeVarargs public static double average(byte... a)
      Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      Parameters:
      a -
      Returns:
      a double number
    • average

      public static double average(byte[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • average

      @SafeVarargs public static double average(short... a)
      Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      Parameters:
      a -
      Returns:
      a double number
    • average

      public static double average(short[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • average

      @SafeVarargs public static double average(int... a)
      Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      Parameters:
      a -
      Returns:
      a double number
    • average

      public static double average(int[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • average

      @SafeVarargs public static double average(long... a)
      Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      Parameters:
      a -
      Returns:
      a double number
    • average

      public static double average(long[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • average

      @SafeVarargs public static double average(float... a)
      Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      Parameters:
      a -
      Returns:
      a double number
    • average

      public static double average(float[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • average

      @SafeVarargs public static double average(double... a)
      Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      Parameters:
      a -
      Returns:
      a double number
    • average

      public static double average(double[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • sumInt

      public static <T extends Number> int sumInt(T[] a)
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
      See Also:
    • sumInt

      public static <T extends Number> int sumInt(T[] a, int fromIndex, int toIndex)
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      See Also:
    • sumInt

      public static <T> int sumInt(T[] a, ToIntFunction<? super T> func) throws IndexOutOfBoundsException
      Type Parameters:
      T -
      Parameters:
      a -
      func -
      Returns:
      Throws:
      IndexOutOfBoundsException
      See Also:
    • sumInt

      public static <T> int sumInt(T[] a, int fromIndex, int toIndex, ToIntFunction<? super T> func) throws IndexOutOfBoundsException
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      func -
      Returns:
      Throws:
      IndexOutOfBoundsException
      See Also:
    • sumInt

      public static <T extends Number> int sumInt(Collection<? extends T> c, int fromIndex, int toIndex)
      Type Parameters:
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      Returns:
      See Also:
    • sumInt

      public static <T> int sumInt(Collection<? extends T> c, int fromIndex, int toIndex, ToIntFunction<? super T> func) throws IndexOutOfBoundsException
      Type Parameters:
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      func -
      Returns:
      Throws:
      IndexOutOfBoundsException
      See Also:
    • sumInt

      public static <T extends Number> int sumInt(Iterable<? extends T> c)
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
      See Also:
    • sumInt

      public static <T> int sumInt(Iterable<? extends T> c, ToIntFunction<? super T> func)
      Type Parameters:
      T -
      Parameters:
      c -
      func -
      Returns:
      See Also:
    • sumIntToLong

      public static <T extends Number> long sumIntToLong(Iterable<? extends T> c)
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
      See Also:
    • sumIntToLong

      public static <T> long sumIntToLong(Iterable<? extends T> c, ToIntFunction<? super T> func)
      Type Parameters:
      T -
      Parameters:
      c -
      func -
      Returns:
      See Also:
    • sumLong

      public static <T extends Number> long sumLong(T[] a)
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
      See Also:
    • sumLong

      public static <T extends Number> long sumLong(T[] a, int fromIndex, int toIndex)
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      See Also:
    • sumLong

      public static <T> long sumLong(T[] a, ToLongFunction<? super T> func) throws IndexOutOfBoundsException
      Type Parameters:
      T -
      Parameters:
      a -
      func -
      Returns:
      Throws:
      IndexOutOfBoundsException
      See Also:
    • sumLong

      public static <T> long sumLong(T[] a, int fromIndex, int toIndex, ToLongFunction<? super T> func) throws IndexOutOfBoundsException
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      func -
      Returns:
      Throws:
      IndexOutOfBoundsException
      See Also:
    • sumLong

      public static <T extends Number> long sumLong(Collection<? extends T> c, int fromIndex, int toIndex)
      Type Parameters:
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      Returns:
      See Also:
    • sumLong

      public static <T> long sumLong(Collection<? extends T> c, int fromIndex, int toIndex, ToLongFunction<? super T> func) throws IndexOutOfBoundsException
      Type Parameters:
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      func -
      Returns:
      Throws:
      IndexOutOfBoundsException
      See Also:
    • sumLong

      public static <T extends Number> long sumLong(Iterable<? extends T> c)
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
      See Also:
    • sumLong

      public static <T> long sumLong(Iterable<? extends T> c, ToLongFunction<? super T> func)
      Type Parameters:
      T -
      Parameters:
      c -
      func -
      Returns:
      See Also:
    • sumDouble

      public static <T extends Number> double sumDouble(T[] a)
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
      See Also:
    • sumDouble

      public static <T extends Number> double sumDouble(T[] a, int fromIndex, int toIndex)
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      See Also:
    • sumDouble

      public static <T> double sumDouble(T[] a, ToDoubleFunction<? super T> func)
      Type Parameters:
      T -
      Parameters:
      a -
      func -
      Returns:
      See Also:
    • sumDouble

      public static <T> double sumDouble(T[] a, int fromIndex, int toIndex, ToDoubleFunction<? super T> func) throws IndexOutOfBoundsException
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      func -
      Returns:
      Throws:
      IndexOutOfBoundsException
      See Also:
    • sumDouble

      public static <T extends Number> double sumDouble(Collection<? extends T> c, int fromIndex, int toIndex)
      Type Parameters:
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      Returns:
      See Also:
    • sumDouble

      public static <T> double sumDouble(Collection<? extends T> c, int fromIndex, int toIndex, ToDoubleFunction<? super T> func) throws IndexOutOfBoundsException
      Type Parameters:
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      func -
      Returns:
      Throws:
      IndexOutOfBoundsException
      See Also:
    • sumDouble

      public static <T extends Number> double sumDouble(Iterable<? extends T> c)
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
      See Also:
    • sumDouble

      public static <T> double sumDouble(Iterable<? extends T> c, ToDoubleFunction<? super T> func)
      Type Parameters:
      T -
      Parameters:
      c -
      func -
      Returns:
      See Also:
    • sumBigInteger

      public static BigInteger sumBigInteger(Iterable<? extends BigInteger> c)
      Sums the BigInteger values in the provided iterable. If the iterable is null, BigInteger.ZERO is returned.
      Parameters:
      c - The iterable of BigInteger values to be summed. This can be any iterable of BigInteger.
      Returns:
      The sum of the BigInteger values in the iterable.
      See Also:
    • sumBigInteger

      public static <T> BigInteger sumBigInteger(Iterable<? extends T> c, Function<? super T,BigInteger> func)
      Returns the sum of the BigInteger values extracted from the elements in the provided iterable by the input func function. If the iterable is null, BigInteger.ZERO is returned.
      Type Parameters:
      T - The type of elements in the iterable.
      Parameters:
      c - The iterable of elements to be processed. This can be any iterable of type T.
      func - The function to be applied to each element in the iterable. This function should take an instance of type T and return a BigInteger.
      Returns:
      The sum of the BigInteger values extracted from the elements in the iterable by the input function.
      See Also:
    • sumBigDecimal

      public static BigDecimal sumBigDecimal(Iterable<? extends BigDecimal> c)
      Sums the BigDecimal values in the provided iterable. If the iterable is null, BigDecimal.ZERO is returned.
      Parameters:
      c - The iterable of BigDecimal values to be summed. This can be any iterable of BigDecimal.
      Returns:
      The sum of the BigDecimal values in the iterable.
      See Also:
    • sumBigDecimal

      public static <T> BigDecimal sumBigDecimal(Iterable<? extends T> c, Function<? super T,BigDecimal> func)
      Returns the sum of the BigDecimal values extracted from the elements in the provided iterable by the input func function. If the iterable is null, BigDecimal.ZERO is returned.
      Type Parameters:
      T - The type of elements in the iterable.
      Parameters:
      c - The iterable of elements to be processed. This can be any iterable of type T.
      func - The function to be applied to each element in the iterable. This function should take an instance of type T and return a BigDecimal.
      Returns:
      The sum of the BigDecimal values extracted from the elements in the iterable by the input function.
      See Also:
    • averageInt

      public static <T extends Number> double averageInt(T[] a)
      Calculates the average of an Array/Collection.
      Returns 0 if the specified Array/Collection is null or empty.
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
      See Also:
    • averageInt

      public static <T extends Number> double averageInt(T[] a, int fromIndex, int toIndex)
      Calculates the average of an Array/Collection within the specified range.
      Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      See Also:
    • averageInt

      public static <T> double averageInt(T[] a, ToIntFunction<? super T> func)
      Calculates the average of an Array/Collection.
      Returns 0 if the specified Array/Collection is null or empty.
      Type Parameters:
      T -
      Parameters:
      a -
      func -
      Returns:
      See Also:
    • averageInt

      public static <T> double averageInt(T[] a, int fromIndex, int toIndex, ToIntFunction<? super T> func) throws IndexOutOfBoundsException
      Calculates the average of an Array/Collection within the specified range.
      Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      func -
      Returns:
      Throws:
      IndexOutOfBoundsException
      See Also:
    • averageInt

      public static <T extends Number> double averageInt(Collection<? extends T> c, int fromIndex, int toIndex)
      Calculates the average of an Array/Collection within the specified range.
      Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      Type Parameters:
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      Returns:
      See Also:
    • averageInt

      public static <T> double averageInt(Collection<? extends T> c, int fromIndex, int toIndex, ToIntFunction<? super T> func) throws IndexOutOfBoundsException
      Calculates the average of an Array/Collection within the specified range.
      Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      Type Parameters:
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      func -
      Returns:
      Throws:
      IndexOutOfBoundsException
      See Also:
    • averageInt

      public static <T extends Number> double averageInt(Iterable<? extends T> c)
      Calculates the average of an Array/Collection.
      Returns 0 if the specified Array/Collection is null or empty.
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
      See Also:
    • averageInt

      public static <T> double averageInt(Iterable<? extends T> c, ToIntFunction<? super T> func)
      Calculates the average of an Array/Collection.
      Returns 0 if the specified Array/Collection is null or empty.
      Type Parameters:
      T -
      Parameters:
      c -
      func -
      Returns:
      See Also:
    • averageLong

      public static <T extends Number> double averageLong(T[] a)
      Calculates the average of an Array/Collection.
      Returns 0 if the specified Array/Collection is null or empty.
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
      See Also:
    • averageLong

      public static <T extends Number> double averageLong(T[] a, int fromIndex, int toIndex)
      Calculates the average of an Array/Collection within the specified range.
      Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      See Also:
    • averageLong

      public static <T> double averageLong(T[] a, ToLongFunction<? super T> func)
      Calculates the average of an Array/Collection.
      Returns 0 if the specified Array/Collection is null or empty.
      Type Parameters:
      T -
      Parameters:
      a -
      func -
      Returns:
      See Also:
    • averageLong

      public static <T> double averageLong(T[] a, int fromIndex, int toIndex, ToLongFunction<? super T> func) throws IndexOutOfBoundsException
      Calculates the average of an Array/Collection within the specified range.
      Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      func -
      Returns:
      Throws:
      IndexOutOfBoundsException
      See Also:
    • averageLong

      public static <T extends Number> double averageLong(Collection<? extends T> c, int fromIndex, int toIndex)
      Calculates the average of an Array/Collection within the specified range.
      Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      Type Parameters:
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      Returns:
      See Also:
    • averageLong

      public static <T> double averageLong(Collection<? extends T> c, int fromIndex, int toIndex, ToLongFunction<? super T> func) throws IndexOutOfBoundsException
      Calculates the average of an Array/Collection within the specified range.
      Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      Type Parameters:
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      func -
      Returns:
      Throws:
      IndexOutOfBoundsException
      See Also:
    • averageLong

      public static <T extends Number> double averageLong(Iterable<? extends T> c)
      Calculates the average of an Array/Collection.
      Returns 0 if the specified Array/Collection is null or empty.
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
      See Also:
    • averageLong

      public static <T> double averageLong(Iterable<? extends T> c, ToLongFunction<? super T> func)
      Calculates the average of an Array/Collection.
      Returns 0 if the specified Array/Collection is null or empty.
      Type Parameters:
      T -
      Parameters:
      c -
      func -
      Returns:
      See Also:
    • averageDouble

      public static <T extends Number> double averageDouble(T[] a)
      Calculates the average of an Array/Collection.
      Returns 0 if the specified Array/Collection is null or empty.
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
      See Also:
    • averageDouble

      public static <T extends Number> double averageDouble(T[] a, int fromIndex, int toIndex)
      Calculates the average of an Array/Collection within the specified range.
      Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      See Also:
    • averageDouble

      public static <T> double averageDouble(T[] a, ToDoubleFunction<? super T> func)
      Calculates the average of an Array/Collection.
      Returns 0 if the specified Array/Collection is null or empty.
      Type Parameters:
      T -
      Parameters:
      a -
      func -
      Returns:
      See Also:
    • averageDouble

      public static <T> double averageDouble(T[] a, int fromIndex, int toIndex, ToDoubleFunction<? super T> func) throws IndexOutOfBoundsException
      Calculates the average of an Array/Collection within the specified range.
      Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      func -
      Returns:
      Throws:
      IndexOutOfBoundsException
      See Also:
    • averageDouble

      public static <T extends Number> double averageDouble(Collection<? extends T> c, int fromIndex, int toIndex)
      Calculates the average of an Array/Collection within the specified range.
      Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      Type Parameters:
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      Returns:
      See Also:
    • averageDouble

      public static <T> double averageDouble(Collection<? extends T> c, int fromIndex, int toIndex, ToDoubleFunction<? super T> func) throws IndexOutOfBoundsException
      Calculates the average of an Array/Collection within the specified range.
      Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      Type Parameters:
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      func -
      Returns:
      Throws:
      IndexOutOfBoundsException
      See Also:
    • averageDouble

      public static <T extends Number> double averageDouble(Iterable<? extends T> c)
      Calculates the average of an Array/Collection.
      Returns 0 if the specified Array/Collection is null or empty.
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
      See Also:
    • averageDouble

      public static <T> double averageDouble(Iterable<? extends T> c, ToDoubleFunction<? super T> func)
      Calculates the average of an Array/Collection.
      Returns 0 if the specified Array/Collection is null or empty.
      Type Parameters:
      T -
      Parameters:
      c -
      func -
      Returns:
      See Also:
    • averageBigInteger

      public static BigDecimal averageBigInteger(Iterable<? extends BigInteger> c)
      Calculates the average of an Array/Collection.
      Returns 0 if the specified Array/Collection is null or empty.
      Parameters:
      c -
      Returns:
      See Also:
    • averageBigInteger

      public static <T> BigDecimal averageBigInteger(Iterable<? extends T> c, Function<? super T,BigInteger> func)
      Calculates the average of an Array/Collection.
      Returns 0 if the specified Array/Collection is null or empty.
      Type Parameters:
      T -
      Parameters:
      c -
      func -
      Returns:
      See Also:
    • averageBigDecimal

      public static BigDecimal averageBigDecimal(Iterable<? extends BigDecimal> c)
      Calculates the average of an Array/Collection.
      Returns 0 if the specified Array/Collection is null or empty.
      Parameters:
      c -
      Returns:
      See Also:
    • averageBigDecimal

      public static <T> BigDecimal averageBigDecimal(Iterable<? extends T> c, Function<? super T,BigDecimal> func)
      Calculates the average of an Array/Collection.
      Returns 0 if the specified Array/Collection is null or empty.
      Type Parameters:
      T -
      Parameters:
      c -
      func -
      Returns:
      See Also:
    • min

      public static char min(char a, char b)
      Returns the minimum value among the provided values.
      Parameters:
      a -
      b -
      Returns:
    • min

      public static byte min(byte a, byte b)
      Returns the minimum value among the provided values.
      Parameters:
      a -
      b -
      Returns:
    • min

      public static short min(short a, short b)
      Returns the minimum value among the provided values.
      Parameters:
      a -
      b -
      Returns:
    • min

      public static int min(int a, int b)
      Returns the minimum value among the provided values.
      Parameters:
      a -
      b -
      Returns:
    • min

      public static long min(long a, long b)
      Returns the minimum value among the provided values.
      Parameters:
      a -
      b -
      Returns:
    • min

      public static float min(float a, float b)
      Returns the minimum value among the provided values.
      Parameters:
      a -
      b -
      Returns:
    • min

      public static double min(double a, double b)
      Returns the minimum value among the provided values.
      Parameters:
      a -
      b -
      Returns:
    • min

      public static <T extends Comparable<? super T>> T min(T a, T b)
      Returns the minimum value among the provided values based on their natural ordering. Null values are considered to be maximum.
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      Returns:
    • min

      public static <T> T min(T a, T b, Comparator<? super T> cmp)
      Returns the minimum value among the provided values according to the provided comparator.
      Type Parameters:
      T - the type of the objects to be compared
      Parameters:
      a - the first object to be compared
      b - the second object to be compared
      cmp - the comparator to compare the objects
      Returns:
      the minimum of a and b according to the provided comparator
    • min

      public static char min(char a, char b, char c)
      Returns the minimum value among the provided values.
      Parameters:
      a -
      b -
      c -
      Returns:
    • min

      public static byte min(byte a, byte b, byte c)
      Returns the minimum value among the provided values.
      Parameters:
      a -
      b -
      c -
      Returns:
    • min

      public static short min(short a, short b, short c)
      Returns the minimum value among the provided values.
      Parameters:
      a -
      b -
      c -
      Returns:
    • min

      public static int min(int a, int b, int c)
      Returns the minimum value among the provided values.
      Parameters:
      a -
      b -
      c -
      Returns:
    • min

      public static long min(long a, long b, long c)
      Returns the minimum value among the provided values.
      Parameters:
      a -
      b -
      c -
      Returns:
    • min

      public static float min(float a, float b, float c)
      Returns the minimum value among the provided values.
      Parameters:
      a -
      b -
      c -
      Returns:
    • min

      public static double min(double a, double b, double c)
      Returns the minimum value among the provided values.
      Parameters:
      a -
      b -
      c -
      Returns:
    • min

      public static <T extends Comparable<? super T>> T min(T a, T b, T c)
      Returns the minimum value among the three provided values based on their natural ordering. Null values are considered to be maximum.
      Type Parameters:
      T - the type of the values, which must be a subtype of Comparable
      Parameters:
      a - the first value to compare
      b - the second value to compare
      c - the third value to compare
      Returns:
      the minimum value among a, b, and c based on their natural ordering
    • min

      public static <T> T min(T a, T b, T c, Comparator<? super T> cmp)
      Returns the minimum value among the provided values according to the provided comparator.
      Type Parameters:
      T - the type of the values
      Parameters:
      a - the first value to compare
      b - the second value to compare
      c - the third value to compare
      cmp - the Comparator to compare the values
      Returns:
      the minimum value among a, b, and c based on the provided Comparator
    • min

      @SafeVarargs public static char min(char... a) throws IllegalArgumentException
      Returns the minimum value among the provided values.
      Parameters:
      a -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
    • min

      public static char min(char[] a, int fromIndex, int toIndex) throws IllegalArgumentException
      Returns the minimum value among the given range in the specified Array/Collection.
      Parameters:
      a - the char array to find the minimum value from.
      fromIndex - the start index (inclusive) of the subarray.
      toIndex - the end index (exclusive) of the subarray.
      Returns:
      the minimum value in the specified subarray of the char array.
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
    • min

      @SafeVarargs public static byte min(byte... a) throws IllegalArgumentException
      Returns the minimum value among the provided values.
      Parameters:
      a -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
    • min

      public static byte min(byte[] a, int fromIndex, int toIndex) throws IllegalArgumentException
      Returns the minimum value among the given range in the specified Array/Collection.
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
    • min

      @SafeVarargs public static short min(short... a) throws IllegalArgumentException
      Returns the minimum value among the provided values.
      Parameters:
      a -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
    • min

      public static short min(short[] a, int fromIndex, int toIndex) throws IllegalArgumentException
      Returns the minimum value among the given range in the specified Array/Collection.
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
    • min

      @SafeVarargs public static int min(int... a) throws IllegalArgumentException
      Returns the minimum value among the provided values.
      Parameters:
      a -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
    • min

      public static int min(int[] a, int fromIndex, int toIndex) throws IllegalArgumentException
      Returns the minimum value among the given range in the specified Array/Collection.
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
    • min

      @SafeVarargs public static long min(long... a) throws IllegalArgumentException
      Returns the minimum value among the provided values.
      Parameters:
      a -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
    • min

      public static long min(long[] a, int fromIndex, int toIndex) throws IllegalArgumentException
      Returns the minimum value among the given range in the specified Array/Collection.
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
    • min

      @SafeVarargs public static float min(float... a) throws IllegalArgumentException
      Returns the minimum value among the provided values.
      Parameters:
      a -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      See Also:
    • min

      public static float min(float[] a, int fromIndex, int toIndex) throws IllegalArgumentException
      Returns the minimum value among the given range in the specified Array/Collection.
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
    • min

      @SafeVarargs public static double min(double... a) throws IllegalArgumentException
      Returns the minimum value among the provided values.
      Parameters:
      a -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      See Also:
    • min

      public static double min(double[] a, int fromIndex, int toIndex) throws IllegalArgumentException
      Returns the minimum value among the given range in the specified Array/Collection.
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
    • min

      public static <T extends Comparable<? super T>> T min(T[] a) throws IllegalArgumentException
      Returns the minimum value among the provided values based on their natural ordering. Null values are considered to be maximum.
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      See Also:
    • min

      public static <T extends Comparable<? super T>> T min(T[] a, int fromIndex, int toIndex) throws IllegalArgumentException
      Returns the minimum value among the given range in the specified Array/Collection based on their natural ordering. Null values are considered to be maximum.
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
    • min

      public static <T> T min(T[] a, Comparator<? super T> cmp) throws IllegalArgumentException
      Returns the minimum value among the provided values according to the provided comparator.
      Type Parameters:
      T -
      Parameters:
      a - an Array which must not be null or empty
      cmp -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      See Also:
    • min

      public static <T> T min(T[] a, int fromIndex, int toIndex, Comparator<? super T> cmp) throws IndexOutOfBoundsException, IllegalArgumentException
      Returns the minimum value among the given range in the specified Array/Collection according to the provided comparator.
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      cmp -
      Returns:
      Throws:
      IndexOutOfBoundsException
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
    • min

      public static <T extends Comparable<? super T>> T min(Collection<? extends T> c, int fromIndex, int toIndex) throws IllegalArgumentException
      Returns the minimum value among the given range in the specified Array/Collection based on their natural ordering. Null values are considered to be maximum.
      Type Parameters:
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      See Also:
    • min

      public static <T> T min(Collection<? extends T> c, int fromIndex, int toIndex, Comparator<? super T> cmp) throws IllegalArgumentException
      Returns the minimum value among the given range in the specified Array/Collection according to the provided comparator.
      Type Parameters:
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      cmp -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
    • min

      public static <T extends Comparable<? super T>> T min(Iterable<? extends T> c) throws IllegalArgumentException
      Returns the minimum value among the provided values based on their natural ordering. Null values are considered to be maximum.
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      See Also:
    • min

      public static <T> T min(Iterable<? extends T> c, Comparator<? super T> cmp) throws IllegalArgumentException
      Returns the minimum value among the provided values according to the provided comparator.
      Type Parameters:
      T -
      Parameters:
      c -
      cmp -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      See Also:
    • min

      public static <T extends Comparable<? super T>> T min(Iterator<? extends T> iter) throws IllegalArgumentException
      Returns the minimum value among the provided values based on their natural ordering. Null values are considered to be maximum.
      Type Parameters:
      T -
      Parameters:
      iter -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      See Also:
    • min

      public static <T> T min(Iterator<? extends T> iter, Comparator<? super T> cmp) throws IllegalArgumentException
      Returns the minimum value among the provided values according to the provided comparator.
      Type Parameters:
      T -
      Parameters:
      iter -
      cmp -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      See Also:
    • minAll

      public static <T extends Comparable<? super T>> List<T> minAll(T[] a)
      Returns a list of all the minimum values in the provided values, based on their natural ordering. Null values are considered to be maximum.
      Type Parameters:
      T - the type of the values, which must be a subtype of Comparable
      Parameters:
      a - the array to find the minimum values from
      Returns:
      a list of the minimum values in the provided array
    • minAll

      public static <T> List<T> minAll(T[] a, Comparator<? super T> cmp)
      Returns a list of all the minimum values in the provided array, based on the provided comparator.
      Type Parameters:
      T - the type of the values
      Parameters:
      a - the array to find the minimum values from
      cmp - the comparator to compare the elements
      Returns:
      a list of the minimum values in the provided array
    • minAll

      public static <T extends Comparable<? super T>> List<T> minAll(Iterable<? extends T> c)
      Returns a list of all the minimum values in the provided values, based on their natural ordering. Null values are considered to be maximum.
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
    • minAll

      public static <T> List<T> minAll(Iterable<? extends T> c, Comparator<? super T> cmp)
      Returns a list of all the minimum values in the provided array, based on the provided comparator.
      Type Parameters:
      T -
      Parameters:
      c -
      cmp -
      Returns:
    • minAll

      public static <T extends Comparable<? super T>> List<T> minAll(Iterator<? extends T> iter)
      Returns a list of all the minimum values in the provided values, based on their natural ordering. Null values are considered to be maximum.
      Type Parameters:
      T -
      Parameters:
      iter -
      Returns:
      See Also:
    • minAll

      public static <T> List<T> minAll(Iterator<? extends T> iter, Comparator<? super T> cmp)
      Returns a list of all the minimum values in the provided array, based on the provided comparator.
      Type Parameters:
      T -
      Parameters:
      iter -
      cmp -
      Returns:
      See Also:
    • minOrDefaultIfEmpty

      @Beta public static <T, R extends Comparable<? super R>> R minOrDefaultIfEmpty(T[] a, Function<? super T,? extends R> valueExtractor, R defaultValue)
      Returns the minimum value extracted from the specified array a by valueExtractor, or defaultValue if a is null or empty. Null values are considered to be maximum.
      Type Parameters:
      T -
      R -
      Parameters:
      a -
      valueExtractor -
      defaultValue -
      Returns:
    • minOrDefaultIfEmpty

      public static <T, R extends Comparable<? super R>> R minOrDefaultIfEmpty(Iterable<? extends T> c, Function<? super T,? extends R> valueExtractor, R defaultValue)
      Returns the minimum value extracted from the specified collection c by valueExtractor, or defaultValue if c is null or empty. Null values are considered to be maximum.
      Type Parameters:
      T -
      R -
      Parameters:
      c -
      valueExtractor -
      defaultValue -
      Returns:
    • minOrDefaultIfEmpty

      public static <T, R extends Comparable<? super R>> R minOrDefaultIfEmpty(Iterator<? extends T> iter, Function<? super T,? extends R> valueExtractor, R defaultValue)
      Returns the minimum value extracted from the specified iterator iter by valueExtractor, or defaultValue if iter is null or empty. Null values are considered to be maximum.
      Type Parameters:
      T -
      R -
      Parameters:
      iter -
      valueExtractor -
      defaultValue -
      Returns:
    • minIntOrDefaultIfEmpty

      @Beta public static <T> int minIntOrDefaultIfEmpty(T[] a, ToIntFunction<? super T> valueExtractor, int defaultValue)
      Returns the minimum int value extracted from the specified array a by valueExtractor, or defaultValue if a is null or empty.
      Type Parameters:
      T -
      Parameters:
      a -
      valueExtractor -
      defaultValue -
      Returns:
    • minIntOrDefaultIfEmpty

      @Beta public static <T> int minIntOrDefaultIfEmpty(Iterable<? extends T> c, ToIntFunction<? super T> valueExtractor, int defaultValue)
      Returns the minimum int value extracted from the specified iterable c by valueExtractor, or defaultValue if a is null or empty.
      Type Parameters:
      T -
      Parameters:
      c -
      valueExtractor -
      defaultValue -
      Returns:
    • minIntOrDefaultIfEmpty

      @Beta public static <T> int minIntOrDefaultIfEmpty(Iterator<? extends T> iter, ToIntFunction<? super T> valueExtractor, int defaultValue)
      Returns the minimum int value extracted from the specified iterator iter by valueExtractor, or defaultValue if a is null or empty.
      Type Parameters:
      T -
      Parameters:
      iter -
      valueExtractor -
      defaultValue -
      Returns:
    • minLongOrDefaultIfEmpty

      @Beta public static <T> long minLongOrDefaultIfEmpty(T[] a, ToLongFunction<? super T> valueExtractor, long defaultValue)
      Returns the minimum long value extracted from the specified array a by valueExtractor, or defaultValue if a is null or empty.
      Type Parameters:
      T -
      Parameters:
      a -
      valueExtractor -
      defaultValue -
      Returns:
    • minLongOrDefaultIfEmpty

      @Beta public static <T> long minLongOrDefaultIfEmpty(Iterable<? extends T> c, ToLongFunction<? super T> valueExtractor, long defaultValue)
      Returns the minimum long value extracted from the specified iterable c by valueExtractor, or defaultValue if a is null or empty.
      Type Parameters:
      T -
      Parameters:
      c -
      valueExtractor -
      defaultValue -
      Returns:
    • minLongOrDefaultIfEmpty

      @Beta public static <T> long minLongOrDefaultIfEmpty(Iterator<? extends T> iter, ToLongFunction<? super T> valueExtractor, long defaultValue)
      Returns the minimum long value extracted from the specified iterator iter by valueExtractor, or defaultValue if a is null or empty.
      Type Parameters:
      T -
      Parameters:
      iter -
      valueExtractor -
      defaultValue -
      Returns:
    • minDoubleOrDefaultIfEmpty

      @Beta public static <T> double minDoubleOrDefaultIfEmpty(T[] a, ToDoubleFunction<? super T> valueExtractor, double defaultValue)
      Returns the minimum double value extracted from the specified array a by valueExtractor, or defaultValue if a is null or empty.
      Type Parameters:
      T -
      Parameters:
      a -
      valueExtractor -
      defaultValue -
      Returns:
    • minDoubleOrDefaultIfEmpty

      @Beta public static <T> double minDoubleOrDefaultIfEmpty(Iterable<? extends T> c, ToDoubleFunction<? super T> valueExtractor, double defaultValue)
      Returns the minimum double value extracted from the specified iterable c by valueExtractor, or defaultValue if a is null or empty.
      Type Parameters:
      T -
      Parameters:
      c -
      valueExtractor -
      defaultValue -
      Returns:
    • minDoubleOrDefaultIfEmpty

      @Beta public static <T> double minDoubleOrDefaultIfEmpty(Iterator<? extends T> iter, ToDoubleFunction<? super T> valueExtractor, double defaultValue)
      Returns the minimum double value extracted from the specified iterator iter by valueExtractor, or defaultValue if a is null or empty.
      Type Parameters:
      T -
      Parameters:
      iter -
      valueExtractor -
      defaultValue -
      Returns:
    • minMax

      public static <T extends Comparable<? super T>> Pair<T,T> minMax(T[] a) throws IllegalArgumentException
      Returns a pair of the minimum and maximum values in the specified array.
      Type Parameters:
      T - the type of the values, which must be a subtype of Comparable
      Parameters:
      a - the array to find the minimum and maximum values from
      Returns:
      a Pair object where the first element is the minimum value and the second element is the maximum value in the specified array
      Throws:
      IllegalArgumentException - if the specified array is null or
      See Also:
    • minMax

      public static <T> Pair<T,T> minMax(T[] a, Comparator<? super T> cmp) throws IllegalArgumentException
      Returns a pair of the minimum and maximum values in the specified array, based on the provided comparator.
      Type Parameters:
      T - the type of the values
      Parameters:
      a - the array to find the minimum and maximum values from
      cmp - the comparator to compare the elements
      Returns:
      a Pair object where the first element is the minimum value and the second element is the maximum value in the specified array
      Throws:
      IllegalArgumentException - if the specified array is null or empty
      See Also:
    • minMax

      public static <T extends Comparable<? super T>> Pair<T,T> minMax(Iterable<? extends T> c) throws IllegalArgumentException
      Returns a pair of the minimum and maximum values in the specified Iterable.
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
      Throws:
      IllegalArgumentException - if c is null or empty.
      See Also:
    • minMax

      public static <T> Pair<T,T> minMax(@NotNull Iterable<? extends T> c, Comparator<? super T> cmp) throws IllegalArgumentException
      Returns a pair of the minimum and maximum values in the specified Iterable, based on the provided comparator.
      Type Parameters:
      T -
      Parameters:
      c -
      cmp -
      Returns:
      Throws:
      IllegalArgumentException - if c is null or empty.
      See Also:
    • minMax

      public static <T extends Comparable<? super T>> Pair<T,T> minMax(Iterator<? extends T> iter) throws IllegalArgumentException
      Returns a pair of the minimum and maximum values in the specified Iterator.
      Type Parameters:
      T -
      Parameters:
      iter -
      Returns:
      Throws:
      IllegalArgumentException - if iter is null or empty.
      See Also:
    • minMax

      public static <T> Pair<T,T> minMax(Iterator<? extends T> iter, Comparator<? super T> cmp) throws IllegalArgumentException
      Returns a pair of the minimum and maximum values in the specified Iterator, based on the provided comparator.
      Type Parameters:
      T -
      Parameters:
      iter -
      cmp -
      Returns:
      Throws:
      IllegalArgumentException - if iter is null or empty.
      See Also:
    • max

      public static char max(char a, char b)
      Returns the maximum value among the provided values.
      Parameters:
      a -
      b -
      Returns:
    • max

      public static byte max(byte a, byte b)
      Returns the maximum value among the provided values.
      Parameters:
      a -
      b -
      Returns:
    • max

      public static short max(short a, short b)
      Returns the maximum value among the provided values.
      Parameters:
      a -
      b -
      Returns:
    • max

      public static int max(int a, int b)
      Returns the maximum value among the provided values.
      Parameters:
      a -
      b -
      Returns:
    • max

      public static long max(long a, long b)
      Returns the maximum value among the provided values.
      Parameters:
      a -
      b -
      Returns:
    • max

      public static float max(float a, float b)
      Returns the maximum value among the provided values.
      Parameters:
      a -
      b -
      Returns:
    • max

      public static double max(double a, double b)
      Returns the maximum value among the provided values.
      Parameters:
      a -
      b -
      Returns:
    • max

      public static <T extends Comparable<? super T>> T max(T a, T b)
      Returns the maximum value among the provided values based on their natural ordering. Null values are considered to be minimum.
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      Returns:
    • max

      public static <T> T max(T a, T b, Comparator<? super T> cmp)
      Returns the maximum value among the provided values according to the provided comparator.
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      cmp -
      Returns:
    • max

      public static char max(char a, char b, char c)
      Returns the maximum value among the provided values.
      Parameters:
      a -
      b -
      c -
      Returns:
    • max

      public static byte max(byte a, byte b, byte c)
      Returns the maximum value among the provided values.
      Parameters:
      a -
      b -
      c -
      Returns:
    • max

      public static short max(short a, short b, short c)
      Returns the maximum value among the provided values.
      Parameters:
      a -
      b -
      c -
      Returns:
    • max

      public static int max(int a, int b, int c)
      Returns the maximum value among the provided values.
      Parameters:
      a -
      b -
      c -
      Returns:
    • max

      public static long max(long a, long b, long c)
      Returns the maximum value among the provided values.
      Parameters:
      a -
      b -
      c -
      Returns:
    • max

      public static float max(float a, float b, float c)
      Returns the maximum value among the provided values.
      Parameters:
      a -
      b -
      c -
      Returns:
    • max

      public static double max(double a, double b, double c)
      Returns the maximum value among the provided values.
      Parameters:
      a -
      b -
      c -
      Returns:
    • max

      public static <T extends Comparable<? super T>> T max(T a, T b, T c)
      Returns the maximum value among the provided values based on their natural ordering. Null values are considered to be minimum.
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      c -
      Returns:
    • max

      public static <T> T max(T a, T b, T c, Comparator<? super T> cmp)
      Returns the maximum value among the provided values according to the provided comparator.
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      c -
      cmp -
      Returns:
    • max

      @SafeVarargs public static char max(char... a) throws IllegalArgumentException
      Returns the maximum value among the provided values.
      Parameters:
      a - an Array which must not be null or empty
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
    • max

      public static char max(char[] a, int fromIndex, int toIndex) throws IllegalArgumentException
      Returns the maximum value among the given range in the specified Array/Collection.
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
    • max

      @SafeVarargs public static byte max(byte... a) throws IllegalArgumentException
      Returns the maximum value among the provided values.
      Parameters:
      a - an Array which must not be null or empty
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
    • max

      public static byte max(byte[] a, int fromIndex, int toIndex) throws IllegalArgumentException
      Returns the maximum value among the given range in the specified Array/Collection.
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
    • max

      @SafeVarargs public static short max(short... a) throws IllegalArgumentException
      Returns the maximum value among the provided values.
      Parameters:
      a - an Array which must not be null or empty
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
    • max

      public static short max(short[] a, int fromIndex, int toIndex) throws IllegalArgumentException
      Returns the maximum value among the given range in the specified Array/Collection.
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
    • max

      @SafeVarargs public static int max(int... a) throws IllegalArgumentException
      Returns the maximum value among the provided values.
      Parameters:
      a - an Array which must not be null or empty
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
    • max

      public static int max(int[] a, int fromIndex, int toIndex) throws IllegalArgumentException
      Returns the maximum value among the given range in the specified Array/Collection.
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
    • max

      @SafeVarargs public static long max(long... a) throws IllegalArgumentException
      Returns the maximum value among the provided values.
      Parameters:
      a - an Array which must not be null or empty
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
    • max

      public static long max(long[] a, int fromIndex, int toIndex) throws IllegalArgumentException
      Returns the maximum value among the given range in the specified Array/Collection.
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
    • max

      @SafeVarargs public static float max(float... a) throws IllegalArgumentException
      Returns the maximum value among the provided values.
      Parameters:
      a - an Array which must not be null or empty
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      See Also:
    • max

      public static float max(float[] a, int fromIndex, int toIndex) throws IllegalArgumentException
      Returns the maximum value among the given range in the specified Array/Collection.
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
    • max

      @SafeVarargs public static double max(double... a) throws IllegalArgumentException
      Returns the maximum value among the provided values.
      Parameters:
      a - an Array which must not be null or empty
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      See Also:
    • max

      public static double max(double[] a, int fromIndex, int toIndex) throws IllegalArgumentException
      Returns the maximum value among the given range in the specified Array/Collection.
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
    • max

      public static <T extends Comparable<? super T>> T max(T[] a) throws IllegalArgumentException
      Returns the maximum value among the provided values based on their natural ordering. Null values are considered to be minimum.
      Type Parameters:
      T -
      Parameters:
      a - an Array which must not be null or empty
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      See Also:
    • max

      public static <T extends Comparable<? super T>> T max(T[] a, int fromIndex, int toIndex) throws IllegalArgumentException
      Returns the minimum value among the given range in the specified Array/Collection based on their natural ordering. Null values are considered to be minimum.
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      See Also:
    • max

      public static <T> T max(T[] a, Comparator<? super T> cmp) throws IllegalArgumentException
      Returns the maximum value among the provided values according to the provided comparator.
      Type Parameters:
      T -
      Parameters:
      a - an Array which must not be null or empty
      cmp -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      See Also:
    • max

      public static <T> T max(T[] a, int fromIndex, int toIndex, Comparator<? super T> cmp) throws IndexOutOfBoundsException, IllegalArgumentException
      Returns the maximum value among the given range in the specified Array/Collection according to the provided comparator.
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      cmp -
      Returns:
      Throws:
      IndexOutOfBoundsException
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      See Also:
    • max

      public static <T extends Comparable<? super T>> T max(Collection<? extends T> c, int fromIndex, int toIndex) throws IllegalArgumentException
      Returns the minimum value among the given range in the specified Array/Collection based on their natural ordering. Null values are considered to be minimum.
      Type Parameters:
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      See Also:
    • max

      public static <T> T max(Collection<? extends T> c, int fromIndex, int toIndex, Comparator<? super T> cmp) throws IllegalArgumentException
      Returns the maximum value among the given range in the specified Array/Collection according to the provided comparator.
      Type Parameters:
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      cmp -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      See Also:
    • max

      public static <T extends Comparable<? super T>> T max(Iterable<? extends T> c) throws IllegalArgumentException
      Returns the maximum value among the provided values based on their natural ordering. Null values are considered to be minimum.
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      See Also:
    • max

      public static <T> T max(Iterable<? extends T> c, Comparator<? super T> cmp) throws IllegalArgumentException
      Returns the maximum value among the provided values according to the provided comparator.
      Type Parameters:
      T -
      Parameters:
      c -
      cmp -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      See Also:
    • max

      public static <T extends Comparable<? super T>> T max(Iterator<? extends T> iter) throws IllegalArgumentException
      Returns the maximum value among the provided values based on their natural ordering. Null values are considered to be minimum.
      Type Parameters:
      T -
      Parameters:
      iter -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      See Also:
    • max

      public static <T> T max(Iterator<? extends T> iter, Comparator<? super T> cmp) throws IllegalArgumentException
      Returns the maximum value among the provided values according to the provided comparator.
      Type Parameters:
      T -
      Parameters:
      iter -
      cmp -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      See Also:
    • maxAll

      public static <T extends Comparable<? super T>> List<T> maxAll(T[] a)
      Returns a list of all the maximum values in the provided values, based on their natural ordering. Null values are considered to be minimum.
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • maxAll

      public static <T> List<T> maxAll(T[] a, Comparator<? super T> cmp)
      Returns a list of all the maximum values in the provided values, based on the provided comparator.
      Type Parameters:
      T -
      Parameters:
      a -
      cmp -
      Returns:
    • maxAll

      public static <T extends Comparable<? super T>> List<T> maxAll(Iterable<? extends T> c)
      Returns a list of all the maximum values in the provided values, based on their natural ordering. Null values are considered to be minimum.
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
    • maxAll

      public static <T> List<T> maxAll(Iterable<? extends T> c, Comparator<? super T> cmp)
      Returns a list of all the maximum values in the provided values, based on the provided comparator.
      Type Parameters:
      T -
      Parameters:
      c -
      cmp -
      Returns:
    • maxAll

      public static <T extends Comparable<? super T>> List<T> maxAll(Iterator<? extends T> iter)
      Returns a list of all the maximum values in the provided values, based on their natural ordering. Null values are considered to be minimum.
      Type Parameters:
      T -
      Parameters:
      iter -
      Returns:
    • maxAll

      public static <T> List<T> maxAll(Iterator<? extends T> iter, Comparator<? super T> cmp)
      Returns a list of all the maximum values in the provided values, based on the provided comparator.
      Type Parameters:
      T -
      Parameters:
      iter -
      cmp -
      Returns:
    • maxOrDefaultIfEmpty

      @Beta public static <T, R extends Comparable<? super R>> R maxOrDefaultIfEmpty(T[] a, Function<? super T,? extends R> valueExtractor, R defaultValue)
      Returns the maximum value extracted from the specified array a by valueExtractor, or defaultValue if a is null or empty. Null values are considered to be minimum.
      Type Parameters:
      T -
      R -
      Parameters:
      a -
      valueExtractor -
      defaultValue -
      Returns:
    • maxOrDefaultIfEmpty

      public static <T, R extends Comparable<? super R>> R maxOrDefaultIfEmpty(Iterable<? extends T> c, Function<? super T,? extends R> valueExtractor, R defaultValue)
      Returns the maximum value extracted from the specified collection c by valueExtractor, or defaultValue if c is null or empty. Null values are considered to be minimum.
      Type Parameters:
      T -
      R -
      Parameters:
      c -
      valueExtractor -
      defaultValue -
      Returns:
    • maxOrDefaultIfEmpty

      public static <T, R extends Comparable<? super R>> R maxOrDefaultIfEmpty(Iterator<? extends T> iter, Function<? super T,? extends R> valueExtractor, R defaultValue)
      Returns the maximum value extracted from the specified iterator iter by valueExtractor, or defaultValue if iter is null or empty. Null values are considered to be minimum.
      Type Parameters:
      T -
      R -
      Parameters:
      iter -
      valueExtractor -
      defaultValue -
      Returns:
    • maxIntOrDefaultIfEmpty

      @Beta public static <T> int maxIntOrDefaultIfEmpty(T[] a, ToIntFunction<? super T> valueExtractor, int defaultValue)
      Returns the maximum int value extracted from the specified array a by valueExtractor, or defaultValue if a is null or empty.
      Type Parameters:
      T -
      Parameters:
      a -
      valueExtractor -
      defaultValue -
      Returns:
    • maxIntOrDefaultIfEmpty

      @Beta public static <T> int maxIntOrDefaultIfEmpty(Iterable<? extends T> c, ToIntFunction<? super T> valueExtractor, int defaultValue)
      Returns the maximum int value extracted from the specified iterable c by valueExtractor, or defaultValue if a is null or empty.
      Type Parameters:
      T -
      Parameters:
      c -
      valueExtractor -
      defaultValue -
      Returns:
    • maxIntOrDefaultIfEmpty

      @Beta public static <T> int maxIntOrDefaultIfEmpty(Iterator<? extends T> iter, ToIntFunction<? super T> valueExtractor, int defaultValue)
      Returns the maximum int value extracted from the specified iterator iter by valueExtractor, or defaultValue if a is null or empty.
      Type Parameters:
      T -
      Parameters:
      iter -
      valueExtractor -
      defaultValue -
      Returns:
    • maxLongOrDefaultIfEmpty

      @Beta public static <T> long maxLongOrDefaultIfEmpty(T[] a, ToLongFunction<? super T> valueExtractor, long defaultValue)
      Returns the maximum long value extracted from the specified array a by valueExtractor, or defaultValue if a is null or empty.
      Type Parameters:
      T -
      Parameters:
      a -
      valueExtractor -
      defaultValue -
      Returns:
    • maxLongOrDefaultIfEmpty

      @Beta public static <T> long maxLongOrDefaultIfEmpty(Iterable<? extends T> c, ToLongFunction<? super T> valueExtractor, long defaultValue)
      Returns the maximum long value extracted from the specified iterable c by valueExtractor, or defaultValue if a is null or empty.
      Type Parameters:
      T -
      Parameters:
      c -
      valueExtractor -
      defaultValue -
      Returns:
    • maxLongOrDefaultIfEmpty

      @Beta public static <T> long maxLongOrDefaultIfEmpty(Iterator<? extends T> iter, ToLongFunction<? super T> valueExtractor, long defaultValue)
      Returns the maximum long value extracted from the specified iterator iter by valueExtractor, or defaultValue if a is null or empty.
      Type Parameters:
      T -
      Parameters:
      iter -
      valueExtractor -
      defaultValue -
      Returns:
    • maxDoubleOrDefaultIfEmpty

      @Beta public static <T> double maxDoubleOrDefaultIfEmpty(T[] a, ToDoubleFunction<? super T> valueExtractor, double defaultValue)
      Returns the maximum double value extracted from the specified array a by valueExtractor, or defaultValue if a is null or empty.
      Type Parameters:
      T -
      Parameters:
      a -
      valueExtractor -
      defaultValue -
      Returns:
    • maxDoubleOrDefaultIfEmpty

      @Beta public static <T> double maxDoubleOrDefaultIfEmpty(Iterable<? extends T> c, ToDoubleFunction<? super T> valueExtractor, double defaultValue)
      Returns the maximum double value extracted from the specified iterable c by valueExtractor, or defaultValue if a is null or empty.
      Type Parameters:
      T -
      Parameters:
      c -
      valueExtractor -
      defaultValue -
      Returns:
    • maxDoubleOrDefaultIfEmpty

      @Beta public static <T> double maxDoubleOrDefaultIfEmpty(Iterator<? extends T> iter, ToDoubleFunction<? super T> valueExtractor, double defaultValue)
      Returns the maximum double value extracted from the specified iterator iter by valueExtractor, or defaultValue if a is null or empty.
      Type Parameters:
      T -
      Parameters:
      iter -
      valueExtractor -
      defaultValue -
      Returns:
    • median

      public static char median(char a, char b, char c)
      Returns the median of provided values.
      Parameters:
      a -
      b -
      c -
      Returns:
      See Also:
    • median

      public static byte median(byte a, byte b, byte c)
      Returns the median of provided values.
      Parameters:
      a -
      b -
      c -
      Returns:
      See Also:
    • median

      public static short median(short a, short b, short c)
      Returns the median of provided values.
      Parameters:
      a -
      b -
      c -
      Returns:
      See Also:
    • median

      public static int median(int a, int b, int c)
      Returns the median of provided values.
      Parameters:
      a -
      b -
      c -
      Returns:
      See Also:
    • median

      public static long median(long a, long b, long c)
      Returns the median of provided values.
      Parameters:
      a -
      b -
      c -
      Returns:
      See Also:
    • median

      public static float median(float a, float b, float c)
      Returns the median of provided values.
      Parameters:
      a -
      b -
      c -
      Returns:
      See Also:
    • median

      public static double median(double a, double b, double c)
      Returns the median of provided values.
      Parameters:
      a -
      b -
      c -
      Returns:
      See Also:
    • median

      public static <T extends Comparable<? super T>> T median(T a, T b, T c)
      Returns the median of provided values.
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      c -
      Returns:
      See Also:
    • median

      public static <T> T median(T a, T b, T c, Comparator<? super T> cmp)
      Returns the median of the provided values based on the provided comparator.
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      c -
      cmp -
      Returns:
      See Also:
    • median

      @SafeVarargs public static char median(char... a) throws IllegalArgumentException
      Returns the length / 2 + 1 largest value in the specified array.
      Parameters:
      a - an Array which must not be null or empty
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      See Also:
    • median

      public static char median(char[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException, IllegalArgumentException
      Returns the median of the specified values within the given range
      Parameters:
      a - the array of char values
      fromIndex - the start index (inclusive) of the range to consider in the array
      toIndex - the end index (exclusive) of the range to consider in the array
      Returns:
      the median of the char values in the specified range of the array
      Throws:
      IndexOutOfBoundsException - if the range is out of the array bounds
      IllegalArgumentException - if the specified array is null or empty, or if fromIndex equals toIndex
    • median

      @SafeVarargs public static byte median(byte... a) throws IllegalArgumentException
      Returns the length / 2 + 1 largest value in the specified array.
      Parameters:
      a - an Array which must not be null or empty
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      See Also:
    • median

      public static byte median(byte[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException, IllegalArgumentException
      Returns the median of the specified values within the given range
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
    • median

      @SafeVarargs public static short median(short... a) throws IllegalArgumentException
      Returns the length / 2 + 1 largest value in the specified array.
      Parameters:
      a - an Array which must not be null or empty
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      See Also:
    • median

      public static short median(short[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException, IllegalArgumentException
      Returns the median of the specified values within the given range
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
    • median

      @SafeVarargs public static int median(int... a) throws IllegalArgumentException
      Returns the length / 2 + 1 largest value in the specified array.
      Parameters:
      a - an Array which must not be null or empty
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      See Also:
    • median

      public static int median(int[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException, IllegalArgumentException
      Returns the median of the specified values within the given range
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
    • median

      @SafeVarargs public static long median(long... a) throws IllegalArgumentException
      Returns the length / 2 + 1 largest value in the specified array.
      Parameters:
      a - an Array which must not be null or empty
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      See Also:
    • median

      public static long median(long[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException, IllegalArgumentException
      Returns the median of the specified values within the given range
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
    • median

      @SafeVarargs public static float median(float... a) throws IllegalArgumentException
      Returns the length / 2 + 1 largest value in the specified array.
      Parameters:
      a - an Array which must not be null or empty
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      See Also:
    • median

      public static float median(float[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException, IllegalArgumentException
      Returns the median of the specified values within the given range
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
    • median

      @SafeVarargs public static double median(double... a) throws IllegalArgumentException
      Returns the length / 2 + 1 largest value in the specified array.
      Parameters:
      a - an Array which must not be null or empty
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      See Also:
    • median

      public static double median(double[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException, IllegalArgumentException
      Returns the median of the specified values within the given range
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
    • median

      public static <T extends Comparable<? super T>> T median(T[] a) throws IllegalArgumentException
      Returns the length / 2 + 1 largest value in the specified array.
      Type Parameters:
      T -
      Parameters:
      a - an Array which must not be null or empty
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      See Also:
    • median

      public static <T extends Comparable<? super T>> T median(T[] a, int fromIndex, int toIndex) throws IllegalArgumentException
      Returns the median of the specified values within the given range
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      See Also:
    • median

      public static <T> T median(T[] a, Comparator<? super T> cmp) throws IllegalArgumentException
      Returns the length / 2 + 1 largest value in the provided values based on the provided comparator.
      Type Parameters:
      T -
      Parameters:
      a - an Array which must not be null or empty
      cmp -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      See Also:
    • median

      public static <T> T median(T[] a, int fromIndex, int toIndex, Comparator<? super T> cmp) throws IndexOutOfBoundsException, IllegalArgumentException
      Returns the median of the specified values within the given range based on the provided comparator.
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      cmp -
      Returns:
      Throws:
      IndexOutOfBoundsException
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      See Also:
    • median

      public static <T extends Comparable<? super T>> T median(Collection<? extends T> c) throws IllegalArgumentException
      Returns the length / 2 + 1 largest value in the provided values based on the provided comparator.
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      See Also:
    • median

      public static <T extends Comparable<? super T>> T median(Collection<? extends T> c, int fromIndex, int toIndex) throws IllegalArgumentException
      Returns the median of the specified values within the given range
      Type Parameters:
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      See Also:
    • median

      public static <T> T median(Collection<? extends T> c, Comparator<? super T> cmp) throws IndexOutOfBoundsException, IllegalArgumentException
      Returns the length / 2 + 1 largest value in the provided values based on the provided comparator.
      Type Parameters:
      T -
      Parameters:
      c -
      cmp -
      Returns:
      Throws:
      IndexOutOfBoundsException
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      See Also:
    • median

      public static <T> T median(Collection<? extends T> c, int fromIndex, int toIndex, Comparator<? super T> cmp) throws IllegalArgumentException
      Returns the median of the specified values within the given range based on the provided comparator.
      Type Parameters:
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      cmp -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      See Also:
    • kthLargest

      public static char kthLargest(char[] a, int k) throws IllegalArgumentException
      Returns the kth largest element in the specified array/collection.
      Parameters:
      a -
      k -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or its length/size is less than k, or toIndex - fromIndex < k.
    • kthLargest

      public static char kthLargest(char[] a, int fromIndex, int toIndex, int k) throws IndexOutOfBoundsException, IllegalArgumentException
      Returns the kth largest element in the specified array/collection within the given range.
      Parameters:
      a -
      fromIndex -
      toIndex -
      k -
      Returns:
      Throws:
      IndexOutOfBoundsException
      IllegalArgumentException - if the specified Array/Collection is null or empty, or its length/size is less than k, or toIndex - fromIndex < k.
    • kthLargest

      public static byte kthLargest(byte[] a, int k) throws IllegalArgumentException
      Returns the kth largest element in the specified array/collection.
      Parameters:
      a -
      k -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or its length/size is less than k, or toIndex - fromIndex < k.
    • kthLargest

      public static byte kthLargest(byte[] a, int fromIndex, int toIndex, int k) throws IndexOutOfBoundsException, IllegalArgumentException
      Returns the kth largest element in the specified array/collection within the given range.
      Parameters:
      a -
      fromIndex -
      toIndex -
      k -
      Returns:
      Throws:
      IndexOutOfBoundsException
      IllegalArgumentException - if the specified Array/Collection is null or empty, or its length/size is less than k, or toIndex - fromIndex < k.
    • kthLargest

      public static short kthLargest(short[] a, int k) throws IllegalArgumentException
      Returns the kth largest element in the specified array/collection.
      Parameters:
      a -
      k -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or its length/size is less than k, or toIndex - fromIndex < k.
    • kthLargest

      public static short kthLargest(short[] a, int fromIndex, int toIndex, int k) throws IndexOutOfBoundsException, IllegalArgumentException
      Returns the kth largest element in the specified array/collection within the given range.
      Parameters:
      a -
      fromIndex -
      toIndex -
      k -
      Returns:
      Throws:
      IndexOutOfBoundsException
      IllegalArgumentException - if the specified Array/Collection is null or empty, or its length/size is less than k, or toIndex - fromIndex < k.
    • kthLargest

      public static int kthLargest(int[] a, int k) throws IllegalArgumentException
      Returns the kth largest element in the specified array/collection.
      Parameters:
      a -
      k -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or its length/size is less than k, or toIndex - fromIndex < k.
    • kthLargest

      public static int kthLargest(int[] a, int fromIndex, int toIndex, int k) throws IndexOutOfBoundsException, IllegalArgumentException
      Returns the kth largest element in the specified array/collection within the given range.
      Parameters:
      a -
      fromIndex -
      toIndex -
      k -
      Returns:
      Throws:
      IndexOutOfBoundsException
      IllegalArgumentException - if the specified Array/Collection is null or empty, or its length/size is less than k, or toIndex - fromIndex < k.
    • kthLargest

      public static long kthLargest(long[] a, int k) throws IllegalArgumentException
      Returns the kth largest element in the specified array/collection.
      Parameters:
      a -
      k -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or its length/size is less than k, or toIndex - fromIndex < k.
    • kthLargest

      public static long kthLargest(long[] a, int fromIndex, int toIndex, int k) throws IndexOutOfBoundsException, IllegalArgumentException
      Returns the kth largest element in the specified array/collection within the given range.
      Parameters:
      a -
      fromIndex -
      toIndex -
      k -
      Returns:
      Throws:
      IndexOutOfBoundsException
      IllegalArgumentException - if the specified Array/Collection is null or empty, or its length/size is less than k, or toIndex - fromIndex < k.
    • kthLargest

      public static float kthLargest(float[] a, int k) throws IllegalArgumentException
      Returns the kth largest element in the specified array/collection.
      Parameters:
      a -
      k -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or its length/size is less than k, or toIndex - fromIndex < k.
    • kthLargest

      public static float kthLargest(float[] a, int fromIndex, int toIndex, int k) throws IndexOutOfBoundsException, IllegalArgumentException
      Returns the kth largest element in the specified array/collection within the given range.
      Parameters:
      a -
      fromIndex -
      toIndex -
      k -
      Returns:
      Throws:
      IndexOutOfBoundsException
      IllegalArgumentException - if the specified Array/Collection is null or empty, or its length/size is less than k, or toIndex - fromIndex < k.
    • kthLargest

      public static double kthLargest(double[] a, int k) throws IllegalArgumentException
      Returns the kth largest element in the specified array/collection.
      Parameters:
      a -
      k -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or its length/size is less than k, or toIndex - fromIndex < k.
    • kthLargest

      public static double kthLargest(double[] a, int fromIndex, int toIndex, int k) throws IndexOutOfBoundsException, IllegalArgumentException
      Returns the kth largest element in the specified array/collection within the given range.
      Parameters:
      a -
      fromIndex -
      toIndex -
      k -
      Returns:
      Throws:
      IndexOutOfBoundsException
      IllegalArgumentException - if the specified Array/Collection is null or empty, or its length/size is less than k, or toIndex - fromIndex < k.
    • kthLargest

      public static <T extends Comparable<? super T>> T kthLargest(T[] a, int k) throws IllegalArgumentException
      Returns the kth largest element in the specified array/collection.
      Type Parameters:
      T - The type of the elements in the array. It must be a type that implements Comparable.
      Parameters:
      a - The array from which to find the kth largest element.
      k - The position from the largest element to return.
      Returns:
      The kth largest element from the array.
      Throws:
      IllegalArgumentException - if the provided array is null or its length is less than k.
      See Also:
    • kthLargest

      public static <T extends Comparable<? super T>> T kthLargest(T[] a, int fromIndex, int toIndex, int k) throws IllegalArgumentException
      Returns the kth largest element in the specified array/collection within the given range.
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      k -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or its length/size is less than k, or toIndex - fromIndex < k.
      See Also:
    • kthLargest

      public static <T> T kthLargest(T[] a, int k, Comparator<? super T> cmp) throws IndexOutOfBoundsException, IllegalArgumentException
      Returns the kth largest element in the specified array/collection.
      Type Parameters:
      T -
      Parameters:
      a -
      k -
      cmp -
      Returns:
      Throws:
      IndexOutOfBoundsException
      IllegalArgumentException - if the specified Array/Collection is null or empty, or its length/size is less than k, or toIndex - fromIndex < k.
      See Also:
    • kthLargest

      public static <T> T kthLargest(T[] a, int fromIndex, int toIndex, int k, Comparator<? super T> cmp) throws IllegalArgumentException
      Returns the kth largest element in the specified array/collection within the given range.
      Type Parameters:
      T - The type of the elements in the array.
      Parameters:
      a - The array from which to find the kth largest element.
      fromIndex - The start index for the range to be searched.
      toIndex - The end index for the range to be searched.
      k - The position from the largest element to return.
      cmp - The comparator to determine the order of the array.
      Returns:
      The kth largest element from the array.
      Throws:
      IllegalArgumentException - if the provided array is null, its length is less than k, or the range fromIndex to toIndex is less than k.
      See Also:
    • kthLargest

      public static <T extends Comparable<? super T>> T kthLargest(Collection<? extends T> c, int k) throws IllegalArgumentException
      Returns the kth largest element in the specified array/collection.
      Type Parameters:
      T - The type of the elements in the collection. It must be a type that implements Comparable.
      Parameters:
      c - The collection from which to find the kth largest element.
      k - The position from the largest element to return.
      Returns:
      The kth largest element from the collection.
      Throws:
      IllegalArgumentException - if the provided collection is null or its size is less than k.
      See Also:
    • kthLargest

      public static <T extends Comparable<? super T>> T kthLargest(Collection<? extends T> c, int fromIndex, int toIndex, int k) throws IllegalArgumentException
      Returns the kth largest element in the specified array/collection within the given range.
      Type Parameters:
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      k -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or its length/size is less than k, or toIndex - fromIndex < k.
      See Also:
    • kthLargest

      public static <T> T kthLargest(Collection<? extends T> c, int k, Comparator<? super T> cmp) throws IndexOutOfBoundsException, IllegalArgumentException
      Returns the kth largest element in the specified array/collection.
      Type Parameters:
      T -
      Parameters:
      c -
      k -
      cmp -
      Returns:
      Throws:
      IndexOutOfBoundsException
      IllegalArgumentException - if the specified Array/Collection is null or empty, or its length/size is less than k, or toIndex - fromIndex < k.
      See Also:
    • kthLargest

      public static <T> T kthLargest(Collection<? extends T> c, int fromIndex, int toIndex, int k, Comparator<? super T> cmp) throws IllegalArgumentException
      Returns the kth largest element in the specified array/collection within the given range.
      Type Parameters:
      T - The type of the elements in the collection.
      Parameters:
      c - The collection from which to find the kth largest element.
      fromIndex - The start index for the range to be searched.
      toIndex - The end index for the range to be searched.
      k - The position from the largest element to return.
      cmp - The comparator to determine the order of the collection.
      Returns:
      The kth largest element from the collection.
      Throws:
      IllegalArgumentException - if the provided collection is null, its size is less than k, or the range fromIndex to toIndex is less than k.
      See Also:
    • top

      public static short[] top(short[] a, int n)
      Returns the top n elements from the provided array. If there are less than n elements in the array, a copy of the input array is returned.
      Parameters:
      a - The array from which to find the top n elements.
      n - The number of top elements to return.
      Returns:
      A short array containing the top n elements from the array.
      Throws:
      IllegalArgumentException - if the specified n is negative.
    • top

      public static short[] top(short[] a, int n, Comparator<? super Short> cmp)
      Returns the top n elements from the provided array. If there are less than n elements in the array, a copy of the input array is returned.
      Parameters:
      a -
      n -
      cmp -
      Returns:
    • top

      public static short[] top(short[] a, int fromIndex, int toIndex, int n)
      Returns the top n elements from a specified range of the array.
      Parameters:
      a - the array to select the top elements from.
      fromIndex - the start index (inclusive) of the range.
      toIndex - the end index (exclusive) of the range.
      n - the number of top elements to select.
      Returns:
      a array containing the top n elements from the specified range of the input array.
      Throws:
      IllegalArgumentException - if n is negative.
    • top

      public static short[] top(short[] a, int fromIndex, int toIndex, int n, Comparator<? super Short> cmp) throws IllegalArgumentException
      Returns the top n elements from a specified range of the array, sorted according to the provided comparator.
      Parameters:
      a - the array to select the top elements from.
      fromIndex - the start index (inclusive) of the range.
      toIndex - the end index (exclusive) of the range.
      n - the number of top elements to select.
      cmp - the comparator to determine the order of the array.
      Returns:
      a array containing the top n elements from the specified range of the input array.
      Throws:
      IllegalArgumentException - if n is negative or if 'fromIndex' or 'toIndex' are out of the array's bounds.
    • top

      public static int[] top(int[] a, int n)
      Returns the top n elements from the provided array. If there are less than n elements in the array, a copy of the input array is returned.
      Parameters:
      a -
      n -
      Returns:
    • top

      public static int[] top(int[] a, int n, Comparator<? super Integer> cmp)
      Returns the top n elements from the provided array. If there are less than n elements in the array, a copy of the input array is returned.
      Parameters:
      a -
      n -
      cmp -
      Returns:
    • top

      public static int[] top(int[] a, int fromIndex, int toIndex, int n)
      Returns the top n elements from a specified range of the array.
      Parameters:
      a - the array to select the top elements from.
      fromIndex - the start index (inclusive) of the range.
      toIndex - the end index (exclusive) of the range.
      n - the number of top elements to select.
      Returns:
      a array containing the top n elements from the specified range of the input array.
      Throws:
      IllegalArgumentException - if n is negative.
    • top

      public static int[] top(int[] a, int fromIndex, int toIndex, int n, Comparator<? super Integer> cmp) throws IllegalArgumentException
      Returns the top n elements from a specified range of the array, sorted according to the provided comparator.
      Parameters:
      a - the array to select the top elements from.
      fromIndex - the start index (inclusive) of the range.
      toIndex - the end index (exclusive) of the range.
      n - the number of top elements to select.
      cmp - the comparator to determine the order of the array.
      Returns:
      a array containing the top n elements from the specified range of the input array.
      Throws:
      IllegalArgumentException - if n is negative or if 'fromIndex' or 'toIndex' are out of the array's bounds.
    • top

      public static long[] top(long[] a, int n)
      Returns the top n elements from the provided array. If there are less than n elements in the array, a copy of the input array is returned.
      Parameters:
      a -
      n -
      Returns:
    • top

      public static long[] top(long[] a, int n, Comparator<? super Long> cmp)
      Returns the top n elements from the provided array. If there are less than n elements in the array, a copy of the input array is returned.
      Parameters:
      a -
      n -
      cmp -
      Returns:
    • top

      public static long[] top(long[] a, int fromIndex, int toIndex, int n)
      Returns the top n elements from a specified range of the array.
      Parameters:
      a - the array to select the top elements from.
      fromIndex - the start index (inclusive) of the range.
      toIndex - the end index (exclusive) of the range.
      n - the number of top elements to select.
      Returns:
      a array containing the top n elements from the specified range of the input array.
      Throws:
      IllegalArgumentException - if n is negative.
    • top

      public static long[] top(long[] a, int fromIndex, int toIndex, int n, Comparator<? super Long> cmp) throws IllegalArgumentException
      Returns the top n elements from a specified range of the array, sorted according to the provided comparator.
      Parameters:
      a - the array to select the top elements from.
      fromIndex - the start index (inclusive) of the range.
      toIndex - the end index (exclusive) of the range.
      n - the number of top elements to select.
      cmp - the comparator to determine the order of the array.
      Returns:
      a array containing the top n elements from the specified range of the input array.
      Throws:
      IllegalArgumentException - if n is negative or if 'fromIndex' or 'toIndex' are out of the array's bounds.
    • top

      public static float[] top(float[] a, int n)
      Returns the top n elements from the provided array. If there are less than n elements in the array, a copy of the input array is returned.
      Parameters:
      a -
      n -
      Returns:
    • top

      public static float[] top(float[] a, int n, Comparator<? super Float> cmp)
      Returns the top n elements from the provided array. If there are less than n elements in the array, a copy of the input array is returned.
      Parameters:
      a -
      n -
      cmp -
      Returns:
    • top

      public static float[] top(float[] a, int fromIndex, int toIndex, int n)
      Returns the top n elements from a specified range of the array.
      Parameters:
      a - the array to select the top elements from.
      fromIndex - the start index (inclusive) of the range.
      toIndex - the end index (exclusive) of the range.
      n - the number of top elements to select.
      Returns:
      a array containing the top n elements from the specified range of the input array.
      Throws:
      IllegalArgumentException - if n is negative.
    • top

      public static float[] top(float[] a, int fromIndex, int toIndex, int n, Comparator<? super Float> cmp) throws IllegalArgumentException
      Returns the top n elements from a specified range of the array, sorted according to the provided comparator.
      Parameters:
      a - the array to select the top elements from.
      fromIndex - the start index (inclusive) of the range.
      toIndex - the end index (exclusive) of the range.
      n - the number of top elements to select.
      cmp - the comparator to determine the order of the array.
      Returns:
      a array containing the top n elements from the specified range of the input array.
      Throws:
      IllegalArgumentException - if n is negative or if 'fromIndex' or 'toIndex' are out of the array's bounds.
    • top

      public static double[] top(double[] a, int n)
      Returns the top n elements from the provided array. If there are less than n elements in the array, a copy of the input array is returned.
      Parameters:
      a - The array from which to find the top n elements.
      n - The number of top elements to return.
      Returns:
      An array containing the top n elements from the original array.
      Throws:
      IllegalArgumentException - if the specified n is negative.
    • top

      public static double[] top(double[] a, int n, Comparator<? super Double> cmp)
      Returns the top n elements from the provided array. If there are less than n elements in the array, a copy of the input array is returned.
      Parameters:
      a - The array from which to find the top n elements.
      n - The number of top elements to return.
      cmp - The comparator to determine the order of the elements. If null, the natural ordering of the elements will be used.
      Returns:
      An array containing the top n elements from the original array.
      Throws:
      IllegalArgumentException - if the specified n is negative.
    • top

      public static double[] top(double[] a, int fromIndex, int toIndex, int n)
      Returns the top n elements from the provided array, based on their natural ordering. The elements are selected from the specified range (fromIndex, toIndex) in the array. If there are less than n elements in the specified range, all the elements from the range will be included in the returned array.
      Parameters:
      a - The array from which to find the top n elements.
      fromIndex - The start index in the array from which to select the top n elements.
      toIndex - The end index in the array to which to select the top n elements.
      n - The number of top elements to return.
      Returns:
      An array containing the top n elements from the original array.
      Throws:
      IllegalArgumentException - if the specified n is negative.
    • top

      public static double[] top(double[] a, int fromIndex, int toIndex, int n, Comparator<? super Double> cmp) throws IllegalArgumentException
      Returns the top n elements from the provided array, based on the provided comparator. The elements are selected from the specified range (fromIndex, toIndex) in the array. If there are less than n elements in the specified range, all the elements from the range will be included in the returned array.
      Parameters:
      a - The array from which to find the top n elements.
      fromIndex - The start index in the array from which to select the top n elements.
      toIndex - The end index in the array to which to select the top n elements.
      n - The number of top elements to return.
      cmp - The comparator to determine the order of the elements.
      Returns:
      An array containing the top n elements from the original array.
      Throws:
      IllegalArgumentException - if the specified n is negative.
    • top

      public static <T extends Comparable<? super T>> List<T> top(T[] a, int n)
      Returns the top n elements from the provided array. If there are less than n elements in the array, all the elements will be included to returned list.
      Type Parameters:
      T - The type of the elements in the array. It must be a type that implements Comparable.
      Parameters:
      a - The array from which to find the top n elements.
      n - The number of top elements to return.
      Returns:
      A list containing the top n elements from the array.
      Throws:
      IllegalArgumentException - if the specified n is negative.
    • top

      public static <T> List<T> top(T[] a, int n, Comparator<? super T> cmp)
      Returns the top n elements from the provided array. If there are less than n elements in the array, all the elements will be included to returned list.
      Type Parameters:
      T - The type of the elements in the array.
      Parameters:
      a - The array from which to find the top n elements.
      n - The number of top elements to return.
      cmp - The Comparator to determine the order of the elements.
      Returns:
      A list containing the top n elements from the array.
      Throws:
      IllegalArgumentException - if the specified n is negative.
    • top

      public static <T extends Comparable<? super T>> List<T> top(T[] a, int fromIndex, int toIndex, int n)
      Returns the top n elements from the provided array, based on their natural ordering. If there are less than n elements in the range specified by fromIndex and toIndex, all the elements from that range will be included to returned list.
      Type Parameters:
      T - The type of the elements in the array. It must be a type that implements Comparable.
      Parameters:
      a - The array from which to find the top n elements.
      fromIndex - The start index for the range to be searched.
      toIndex - The end index for the range to be searched.
      n - The number of top elements to return.
      Returns:
      A list containing the top n elements from the array.
      Throws:
      IllegalArgumentException - if the specified n is negative.
    • top

      public static <T> List<T> top(T[] a, int fromIndex, int toIndex, int n, Comparator<? super T> cmp) throws IllegalArgumentException
      Returns the top n elements from the provided array, based on the provided comparator. The elements are selected from the range specified by fromIndex and toIndex. If there are less than n elements in the range, all the elements from that range will be included in the returned list.
      Type Parameters:
      T - The type of the elements in the array.
      Parameters:
      a - The array from which to find the top n elements.
      fromIndex - The start index for the range to be searched.
      toIndex - The end index for the range to be searched.
      n - The number of top elements to return.
      cmp - The comparator to determine the order of the elements.
      Returns:
      A list containing the top n elements from the array.
      Throws:
      IllegalArgumentException - if the specified n is negative.
    • top

      public static <T extends Comparable<? super T>> List<T> top(Collection<? extends T> c, int n)
      Returns the top n elements from the provided collection, based on natural ordering of the elements. The elements are selected based on their natural ordering (from smallest to largest). If there are less than n elements in the collection, all the elements from the collection will be included in the returned list.
      Type Parameters:
      T - The type of the elements in the collection. The type must be a subclass of Comparable.
      Parameters:
      c - The collection from which to find the top n elements.
      n - The number of top elements to return.
      Returns:
      A list containing the top n elements from the collection.
      Throws:
      IllegalArgumentException - if the specified n is negative.
    • top

      public static <T> List<T> top(Collection<? extends T> c, int n, Comparator<? super T> cmp)
      Returns the top n elements from the provided collection, based on the provided comparator. The elements are selected based on the order determined by the comparator. If there are less than n elements in the collection, all the elements from the collection will be included in the returned list.
      Type Parameters:
      T - The type of the elements in the collection.
      Parameters:
      c - The collection from which to find the top n elements.
      n - The number of top elements to return.
      cmp - The comparator to determine the order of the elements.
      Returns:
      A list containing the top n elements from the collection.
      Throws:
      IllegalArgumentException - if the specified n is negative.
    • top

      public static <T extends Comparable<? super T>> List<T> top(Collection<? extends T> c, int fromIndex, int toIndex, int n)
      Returns the top n elements from the provided collection, based on natural ordering of the elements. The elements are selected based on their natural ordering (from smallest to largest). If there are less than n elements in the collection, all the elements from the collection will be included in the returned list.
      Type Parameters:
      T - The type of the elements in the collection. The type must be a subclass of Comparable.
      Parameters:
      c - The collection from which to find the top n elements.
      fromIndex - The start index in the collection from which to select the top n elements.
      toIndex - The end index in the collection to which to select the top n elements.
      n - The number of top elements to return.
      Returns:
      A list containing the top n elements from the collection.
      Throws:
      IllegalArgumentException - if the specified n is negative.
    • top

      public static <T> List<T> top(Collection<? extends T> c, int fromIndex, int toIndex, int n, Comparator<? super T> cmp) throws IllegalArgumentException
      Returns the top n elements from the provided collection, based on the provided comparator. The elements are selected based on the order determined by the comparator. If there are less than n elements in the collection, all the elements from the collection will be included in the returned list.
      Type Parameters:
      T - The type of the elements in the collection.
      Parameters:
      c - The collection from which to find the top n elements.
      fromIndex - The start index in the collection from which to select the top n elements.
      toIndex - The end index in the collection to which to select the top n elements.
      n - The number of top elements to return.
      cmp - The comparator to determine the order of the elements.
      Returns:
      A list containing the top n elements from the collection.
      Throws:
      IllegalArgumentException - if the specified n is negative.
    • top

      public static <T extends Comparable<? super T>> List<T> top(T[] a, int n, boolean keepEncounterOrder)
      Returns the top n elements from the provided array, based on natural ordering of the elements. The elements are selected based on their natural ordering (from smallest to largest). If there are less than n elements in the array, all the elements from the array will be included in the returned list. The order of the elements in the returned list is based on their encounter order in the array if 'keepEncounterOrder' is true.
      Type Parameters:
      T - The type of the elements in the array. The type must be a subclass of Comparable.
      Parameters:
      a - The array from which to find the top n elements.
      n - The number of top elements to return.
      keepEncounterOrder - If true, the encounter order of the elements in the array is preserved in the returned list.
      Returns:
      A list containing the top n elements from the array.
      Throws:
      IllegalArgumentException - if the specified n is negative.
    • top

      public static <T> List<T> top(T[] a, int n, Comparator<? super T> cmp, boolean keepEncounterOrder)
      Returns the top n elements from the provided array, based on the provided comparator. The elements are selected based on the order determined by the comparator. If there are less than n elements in the array, all the elements from the array will be included in the returned list. The order of the elements in the returned list is based on their encounter order in the array if 'keepEncounterOrder' is true.
      Type Parameters:
      T - The type of the elements in the array.
      Parameters:
      a - The array from which to find the top n elements.
      n - The number of top elements to return.
      cmp - The comparator to determine the order of the elements.
      keepEncounterOrder - If true, the encounter order of the elements in the array is preserved in the returned list.
      Returns:
      A list containing the top n elements from the array.
      Throws:
      IllegalArgumentException - if the specified n is negative.
    • top

      public static <T extends Comparable<? super T>> List<T> top(T[] a, int fromIndex, int toIndex, int n, boolean keepEncounterOrder)
      Returns the top n elements from the provided array, based on the natural ordering of the elements. The elements are selected from the specified range in the array (from 'fromIndex' inclusive to 'toIndex' exclusive). If there are less than n elements in the specified range, all the elements from the range will be included in the returned list. The order of the elements in the returned list is based on their encounter order in the array if 'keepEncounterOrder' is true.
      Type Parameters:
      T - The type of the elements in the array. The type must be a subclass of Comparable.
      Parameters:
      a - The array from which to find the top n elements.
      fromIndex - The start index (inclusive) in the array to consider for the operation.
      toIndex - The end index (exclusive) in the array to consider for the operation.
      n - The number of top elements to return.
      keepEncounterOrder - If true, the encounter order of the elements in the array is preserved in the returned list.
      Returns:
      A list containing the top n elements from the specified range in the array.
      Throws:
      IllegalArgumentException - if the specified n is negative.
    • top

      public static <T> List<T> top(T[] a, int fromIndex, int toIndex, int n, Comparator<? super T> cmp, boolean keepEncounterOrder) throws IllegalArgumentException
      Returns the top n elements from the provided array, based on the provided comparator. The elements are selected from the specified range in the array (from 'fromIndex' inclusive to 'toIndex' exclusive). If there are less than n elements in the specified range, all the elements from the range will be included in the returned list. The order of the elements in the returned list is based on their encounter order in the array if 'keepEncounterOrder' is true.
      Type Parameters:
      T - The type of the elements in the array.
      Parameters:
      a - The array from which to find the top n elements.
      fromIndex - The start index (inclusive) in the array to consider for the operation.
      toIndex - The end index (exclusive) in the array to consider for the operation.
      n - The number of top elements to return.
      cmp - The comparator to determine the order of the elements.
      keepEncounterOrder - If true, the encounter order of the elements in the array is preserved in the returned list.
      Returns:
      A list containing the top n elements from the specified range in the array.
      Throws:
      IllegalArgumentException - if the specified n is negative.
    • top

      public static <T extends Comparable<? super T>> List<T> top(Collection<? extends T> c, int n, boolean keepEncounterOrder)
      Returns the top n elements from the provided collection, based on the natural ordering of the elements. The elements are selected based on their natural ordering (from smallest to largest). If there are less than n elements in the Collection, all the elements from the array will be included in the returned list. The order of the elements in the returned list is based on their encounter order in the collection if 'keepEncounterOrder' is true.
      Type Parameters:
      T - The type of the elements in the collection. The type must be a subclass of Comparable.
      Parameters:
      c - The collection from which to find the top n elements.
      n - The number of top elements to return.
      keepEncounterOrder - If true, the encounter order of the elements in the collection is preserved in the returned list.
      Returns:
      A list containing the top n elements from the collection.
      Throws:
      IllegalArgumentException - if the specified n is negative.
    • top

      public static <T> List<T> top(Collection<? extends T> c, int n, Comparator<? super T> cmp, boolean keepEncounterOrder)
      Returns the top n elements from the provided collection, based on the provided comparator. The elements are selected based on their ordering defined by the comparator (from smallest to largest). If there are less than n elements in the Collection, all the elements from the collection will be included in the returned list. The order of the elements in the returned list is based on their encounter order in the collection if 'keepEncounterOrder' is true.
      Type Parameters:
      T - The type of the elements in the collection.
      Parameters:
      c - The collection from which to find the top n elements.
      n - The number of top elements to return.
      cmp - The comparator to determine the order of the elements.
      keepEncounterOrder - If true, the encounter order of the elements in the collection is preserved in the returned list.
      Returns:
      A list containing the top n elements from the collection.
      Throws:
      IllegalArgumentException - if the specified n is negative.
    • top

      public static <T extends Comparable<? super T>> List<T> top(Collection<? extends T> c, int fromIndex, int toIndex, int n, boolean keepEncounterOrder)
      Returns the top n elements from the provided collection, based on the natural ordering of the elements. The elements are selected from the specified range (fromIndex, toIndex) in the collection. If there are less than n elements in the specified range, all the elements from the range will be included in the returned list. The order of the elements in the returned list is based on their encounter order in the collection if 'keepEncounterOrder' is true.
      Type Parameters:
      T - The type of the elements in the collection. The type must be a subclass of Comparable.
      Parameters:
      c - The collection from which to find the top n elements.
      fromIndex - The start index in the collection from which to select the top n elements.
      toIndex - The end index in the collection to which to select the top n elements.
      n - The number of top elements to return.
      keepEncounterOrder - If true, the encounter order of the elements in the collection is preserved in the returned list.
      Returns:
      A list containing the top n elements from the collection.
      Throws:
      IllegalArgumentException - if the specified n is negative.
    • top

      public static <T> List<T> top(Collection<? extends T> c, int fromIndex, int toIndex, int n, Comparator<? super T> cmp, boolean keepEncounterOrder) throws IllegalArgumentException
      Returns the top n elements from the provided collection, based on the provided comparator. The elements are selected from the specified range (fromIndex, toIndex) in the collection. If there are less than n elements in the specified range, all the elements from the range will be included in the returned list. The order of the elements in the returned list is based on their encounter order in the collection if 'keepEncounterOrder' is true.
      Type Parameters:
      T - The type of the elements in the collection.
      Parameters:
      c - The collection from which to find the top n elements.
      fromIndex - The start index in the collection from which to select the top n elements.
      toIndex - The end index in the collection to which to select the top n elements.
      n - The number of top elements to return.
      cmp - The comparator to determine the order of the elements.
      keepEncounterOrder - If true, the encounter order of the elements in the collection is preserved in the returned list.
      Returns:
      A list containing the top n elements from the collection.
      Throws:
      IllegalArgumentException - if the specified n is negative.
    • percentiles

      public static Map<Percentage,Character> percentiles(char[] sortedArray) throws IllegalArgumentException
      Calculates the percentiles of the provided sorted array of characters.
      Parameters:
      sortedArray - The sorted array of characters for which to calculate the percentiles.
      Returns:
      A map where the keys are the percentiles and the values are the corresponding characters from the array.
      Throws:
      IllegalArgumentException - if the provided array is empty.
    • percentiles

      public static Map<Percentage,Byte> percentiles(byte[] sortedArray) throws IllegalArgumentException
      Calculates the percentiles of the provided sorted array of bytes.
      Parameters:
      sortedArray - The sorted array of bytes for which to calculate the percentiles.
      Returns:
      A map where the keys are the percentiles and the values are the corresponding bytes from the array.
      Throws:
      IllegalArgumentException - if the provided array is empty.
    • percentiles

      public static Map<Percentage,Short> percentiles(short[] sortedArray) throws IllegalArgumentException
      Calculates the percentiles of the provided sorted array of shorts.
      Parameters:
      sortedArray - The sorted array of shorts for which to calculate the percentiles.
      Returns:
      A map where the keys are the percentiles and the values are the corresponding shorts from the array.
      Throws:
      IllegalArgumentException - if the provided array is empty.
    • percentiles

      public static Map<Percentage,Integer> percentiles(int[] sortedArray) throws IllegalArgumentException
      Calculates the percentiles of the provided sorted array of integers.
      Parameters:
      sortedArray - The sorted array of integers for which to calculate the percentiles.
      Returns:
      A map where the keys are the percentiles and the values are the corresponding integers from the array.
      Throws:
      IllegalArgumentException - if the provided array is empty.
    • percentiles

      public static Map<Percentage,Long> percentiles(long[] sortedArray) throws IllegalArgumentException
      Calculates the percentiles of the provided sorted array of longs.
      Parameters:
      sortedArray - The sorted array of longs for which to calculate the percentiles.
      Returns:
      A map where the keys are the percentiles and the values are the corresponding longs from the array.
      Throws:
      IllegalArgumentException - if the provided array is empty.
    • percentiles

      public static Map<Percentage,Float> percentiles(float[] sortedArray) throws IllegalArgumentException
      Calculates the percentiles of the provided sorted array of floats.
      Parameters:
      sortedArray - The sorted array of floats for which to calculate the percentiles.
      Returns:
      A map where the keys are the percentiles and the values are the corresponding floats from the array.
      Throws:
      IllegalArgumentException - if the provided array is empty.
    • percentiles

      public static Map<Percentage,Double> percentiles(double[] sortedArray) throws IllegalArgumentException
      Calculates the percentiles of the provided sorted array of doubles.
      Parameters:
      sortedArray - The sorted array of doubles for which to calculate the percentiles.
      Returns:
      A map where the keys are the percentiles and the values are the corresponding doubles from the array.
      Throws:
      IllegalArgumentException - if the provided array is empty.
    • percentiles

      public static <T> Map<Percentage,T> percentiles(T[] sortedArray) throws IllegalArgumentException
      Calculates the percentiles of the provided sorted array.
      Type Parameters:
      T - The type of elements in the array.
      Parameters:
      sortedArray - The array for which to calculate the percentiles.
      Returns:
      A map where the keys are the percentiles and the values are the corresponding elements from the array.
      Throws:
      IllegalArgumentException - if the provided array is null or empty.
    • percentiles

      public static <T> Map<Percentage,T> percentiles(List<T> sortedList) throws IllegalArgumentException
      Calculates the percentiles of the provided sorted list.
      Type Parameters:
      T - The type of elements in the list.
      Parameters:
      sortedList - The sorted list for which to calculate the percentiles.
      Returns:
      A map where the keys are the percentiles and the values are the corresponding elements from the list.
      Throws:
      IllegalArgumentException - if the provided list is null or empty.
    • filter

      public static boolean[] filter(boolean[] a, BooleanPredicate filter)
      Parameters:
      a -
      filter -
      Returns:
    • filter

      public static boolean[] filter(boolean[] a, int max, BooleanPredicate filter)
      Parameters:
      a -
      max -
      filter -
      Returns:
    • filter

      public static boolean[] filter(boolean[] a, int fromIndex, int toIndex, BooleanPredicate filter)
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      Returns:
    • filter

      public static boolean[] filter(boolean[] a, int fromIndex, int toIndex, BooleanPredicate filter, int max) throws IndexOutOfBoundsException
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      max - maximum return result.
      Returns:
      Throws:
      IndexOutOfBoundsException
    • filter

      public static char[] filter(char[] a, CharPredicate filter)
      Parameters:
      a -
      filter -
      Returns:
    • filter

      public static char[] filter(char[] a, CharPredicate filter, int max) throws IllegalArgumentException
      Parameters:
      a -
      filter -
      max -
      Returns:
      Throws:
      IllegalArgumentException
    • filter

      public static char[] filter(char[] a, int fromIndex, int toIndex, CharPredicate filter)
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      Returns:
    • filter

      public static char[] filter(char[] a, int fromIndex, int toIndex, CharPredicate filter, int max) throws IllegalArgumentException, IndexOutOfBoundsException
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      max - maximum return result.
      Returns:
      Throws:
      IllegalArgumentException
      IndexOutOfBoundsException
    • filter

      public static byte[] filter(byte[] a, BytePredicate filter)
      Parameters:
      a -
      filter -
      Returns:
    • filter

      public static byte[] filter(byte[] a, BytePredicate filter, int max) throws IllegalArgumentException
      Parameters:
      a -
      filter -
      max -
      Returns:
      Throws:
      IllegalArgumentException
    • filter

      public static byte[] filter(byte[] a, int fromIndex, int toIndex, BytePredicate filter)
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      Returns:
    • filter

      public static byte[] filter(byte[] a, int fromIndex, int toIndex, BytePredicate filter, int max) throws IllegalArgumentException, IndexOutOfBoundsException
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      max - maximum return result.
      Returns:
      Throws:
      IllegalArgumentException
      IndexOutOfBoundsException
    • filter

      public static short[] filter(short[] a, ShortPredicate filter)
      Parameters:
      a -
      filter -
      Returns:
    • filter

      public static short[] filter(short[] a, ShortPredicate filter, int max) throws IllegalArgumentException
      Parameters:
      a -
      filter -
      max -
      Returns:
      Throws:
      IllegalArgumentException
    • filter

      public static short[] filter(short[] a, int fromIndex, int toIndex, ShortPredicate filter)
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      Returns:
    • filter

      public static short[] filter(short[] a, int fromIndex, int toIndex, ShortPredicate filter, int max) throws IllegalArgumentException, IndexOutOfBoundsException
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      max - maximum return result.
      Returns:
      Throws:
      IllegalArgumentException
      IndexOutOfBoundsException
    • filter

      public static int[] filter(int[] a, IntPredicate filter)
      Parameters:
      a -
      filter -
      Returns:
    • filter

      public static int[] filter(int[] a, IntPredicate filter, int max) throws IllegalArgumentException
      Parameters:
      a -
      filter -
      max -
      Returns:
      Throws:
      IllegalArgumentException
    • filter

      public static int[] filter(int[] a, int fromIndex, int toIndex, IntPredicate filter)
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      Returns:
    • filter

      public static int[] filter(int[] a, int fromIndex, int toIndex, IntPredicate filter, int max) throws IllegalArgumentException, IndexOutOfBoundsException
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      max - maximum return result.
      Returns:
      Throws:
      IllegalArgumentException
      IndexOutOfBoundsException
    • filter

      public static long[] filter(long[] a, LongPredicate filter)
      Parameters:
      a -
      filter -
      Returns:
    • filter

      public static long[] filter(long[] a, LongPredicate filter, int max) throws IllegalArgumentException
      Parameters:
      a -
      filter -
      max -
      Returns:
      Throws:
      IllegalArgumentException
    • filter

      public static long[] filter(long[] a, int fromIndex, int toIndex, LongPredicate filter)
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      Returns:
    • filter

      public static long[] filter(long[] a, int fromIndex, int toIndex, LongPredicate filter, int max) throws IllegalArgumentException, IndexOutOfBoundsException
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      max - maximum return result.
      Returns:
      Throws:
      IllegalArgumentException
      IndexOutOfBoundsException
    • filter

      public static float[] filter(float[] a, FloatPredicate filter)
      Parameters:
      a -
      filter -
      Returns:
    • filter

      public static float[] filter(float[] a, FloatPredicate filter, int max) throws IllegalArgumentException
      Parameters:
      a -
      filter -
      max -
      Returns:
      Throws:
      IllegalArgumentException
    • filter

      public static float[] filter(float[] a, int fromIndex, int toIndex, FloatPredicate filter)
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      Returns:
    • filter

      public static float[] filter(float[] a, int fromIndex, int toIndex, FloatPredicate filter, int max) throws IllegalArgumentException, IndexOutOfBoundsException
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      max - maximum return result.
      Returns:
      Throws:
      IllegalArgumentException
      IndexOutOfBoundsException
    • filter

      public static double[] filter(double[] a, DoublePredicate filter)
      Parameters:
      a -
      filter -
      Returns:
    • filter

      public static double[] filter(double[] a, DoublePredicate filter, int max) throws IllegalArgumentException
      Parameters:
      a -
      filter -
      max -
      Returns:
      Throws:
      IllegalArgumentException
    • filter

      public static double[] filter(double[] a, int fromIndex, int toIndex, DoublePredicate filter)
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      Returns:
    • filter

      public static double[] filter(double[] a, int fromIndex, int toIndex, DoublePredicate filter, int max) throws IllegalArgumentException, IndexOutOfBoundsException
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      max - maximum return result.
      Returns:
      Throws:
      IllegalArgumentException
      IndexOutOfBoundsException
    • filter

      public static <T> List<T> filter(T[] a, Predicate<? super T> filter)
      Returns a list of values filtered by the specified predicate.
      Type Parameters:
      T - the type of the elements in the array
      Parameters:
      a - the array to filter
      filter - the predicate to apply to each element in the array
      Returns:
      a list containing the elements of the array that match the predicate
    • filter

      public static <T, C extends Collection<T>> C filter(T[] a, Predicate<? super T> filter, IntFunction<C> supplier)
      Returns a list of values filtered by the specified predicate.
      Type Parameters:
      T -
      C -
      Parameters:
      a -
      filter -
      supplier -
      Returns:
    • filter

      public static <T> List<T> filter(T[] a, Predicate<? super T> filter, int max)
      Returns a list of values filtered by the specified predicate.
      Type Parameters:
      T -
      Parameters:
      a -
      filter -
      max -
      Returns:
    • filter

      public static <T, C extends Collection<T>> C filter(T[] a, Predicate<? super T> filter, int max, IntFunction<C> supplier)
      Returns a list of values filtered by the specified predicate.
      Type Parameters:
      T -
      C -
      Parameters:
      a -
      filter -
      max -
      supplier -
      Returns:
    • filter

      public static <T> List<T> filter(T[] a, int fromIndex, int toIndex, Predicate<? super T> filter)
      Returns a list of values filtered by the specified predicate.
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      Returns:
    • filter

      public static <T, C extends Collection<T>> C filter(T[] a, int fromIndex, int toIndex, Predicate<? super T> filter, IntFunction<C> supplier)
      Returns a list of values filtered by the specified predicate.
      Type Parameters:
      T -
      C -
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      supplier -
      Returns:
    • filter

      public static <T> List<T> filter(T[] a, int fromIndex, int toIndex, Predicate<? super T> filter, int max)
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      max -
      Returns:
    • filter

      public static <T, C extends Collection<T>> C filter(T[] a, int fromIndex, int toIndex, Predicate<? super T> filter, int max, IntFunction<C> supplier) throws IllegalArgumentException, IndexOutOfBoundsException
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Type Parameters:
      T -
      C -
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      max -
      supplier -
      Returns:
      Throws:
      IllegalArgumentException
      IndexOutOfBoundsException
    • filter

      public static <T> List<T> filter(Iterable<? extends T> c, Predicate<? super T> filter)
      Type Parameters:
      T -
      Parameters:
      c -
      filter -
      Returns:
    • filter

      public static <T, C extends Collection<T>> C filter(Iterable<? extends T> c, Predicate<? super T> filter, IntFunction<C> supplier)
      Type Parameters:
      T -
      C -
      Parameters:
      c -
      filter -
      supplier -
      Returns:
    • filter

      public static <T> List<T> filter(Iterable<? extends T> c, Predicate<? super T> filter, int max)
      Type Parameters:
      T -
      Parameters:
      c -
      filter -
      max -
      Returns:
    • filter

      public static <T, C extends Collection<T>> C filter(Iterable<? extends T> c, Predicate<? super T> filter, int max, IntFunction<C> supplier) throws IllegalArgumentException
      Type Parameters:
      T -
      C -
      Parameters:
      c -
      filter -
      max -
      supplier -
      Returns:
      Throws:
      IllegalArgumentException
    • filter

      public static <T> List<T> filter(Collection<? extends T> c, int fromIndex, int toIndex, Predicate<? super T> filter)
      Type Parameters:
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      filter -
      Returns:
    • filter

      public static <T, C extends Collection<T>> C filter(Collection<? extends T> c, int fromIndex, int toIndex, Predicate<? super T> filter, IntFunction<C> supplier)
      Type Parameters:
      T -
      C -
      Parameters:
      c -
      fromIndex -
      toIndex -
      filter -
      supplier -
      Returns:
    • filter

      public static <T> List<T> filter(Collection<? extends T> c, int fromIndex, int toIndex, Predicate<? super T> filter, int max)
      Type Parameters:
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      filter -
      max -
      Returns:
    • filter

      public static <T, C extends Collection<T>> C filter(Collection<? extends T> c, int fromIndex, int toIndex, Predicate<? super T> filter, int max, IntFunction<C> supplier) throws IllegalArgumentException, IndexOutOfBoundsException
      Type Parameters:
      T -
      C -
      Parameters:
      c -
      fromIndex -
      toIndex -
      filter -
      max -
      supplier -
      Returns:
      Throws:
      IllegalArgumentException
      IndexOutOfBoundsException
    • mapToBoolean

      public static <T> boolean[] mapToBoolean(T[] a, ToBooleanFunction<? super T> mapper)
      Map to boolean.
      Type Parameters:
      T -
      Parameters:
      a -
      mapper -
      Returns:
    • mapToBoolean

      public static <T> boolean[] mapToBoolean(T[] a, int fromIndex, int toIndex, ToBooleanFunction<? super T> mapper) throws IndexOutOfBoundsException
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      mapper -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • mapToBoolean

      public static <T> boolean[] mapToBoolean(Collection<? extends T> c, ToBooleanFunction<? super T> mapper)
      Map to boolean.
      Type Parameters:
      T -
      Parameters:
      c -
      mapper -
      Returns:
    • mapToBoolean

      public static <T> boolean[] mapToBoolean(Collection<? extends T> c, int fromIndex, int toIndex, ToBooleanFunction<? super T> mapper) throws IndexOutOfBoundsException
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Type Parameters:
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      mapper -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • mapToChar

      public static <T> char[] mapToChar(T[] a, ToCharFunction<? super T> mapper)
      Map to char.
      Type Parameters:
      T -
      Parameters:
      a -
      mapper -
      Returns:
    • mapToChar

      public static <T> char[] mapToChar(T[] a, int fromIndex, int toIndex, ToCharFunction<? super T> mapper) throws IndexOutOfBoundsException
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      mapper -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • mapToChar

      public static <T> char[] mapToChar(Collection<? extends T> c, ToCharFunction<? super T> mapper)
      Map to char.
      Type Parameters:
      T -
      Parameters:
      c -
      mapper -
      Returns:
    • mapToChar

      public static <T> char[] mapToChar(Collection<? extends T> c, int fromIndex, int toIndex, ToCharFunction<? super T> mapper) throws IndexOutOfBoundsException
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Type Parameters:
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      mapper -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • mapToByte

      public static <T> byte[] mapToByte(T[] a, ToByteFunction<? super T> mapper)
      Map to byte.
      Type Parameters:
      T -
      Parameters:
      a -
      mapper -
      Returns:
    • mapToByte

      public static <T> byte[] mapToByte(T[] a, int fromIndex, int toIndex, ToByteFunction<? super T> mapper) throws IndexOutOfBoundsException
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      mapper -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • mapToByte

      public static <T> byte[] mapToByte(Collection<? extends T> c, ToByteFunction<? super T> mapper)
      Map to byte.
      Type Parameters:
      T -
      Parameters:
      c -
      mapper -
      Returns:
    • mapToByte

      public static <T> byte[] mapToByte(Collection<? extends T> c, int fromIndex, int toIndex, ToByteFunction<? super T> mapper) throws IndexOutOfBoundsException
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Type Parameters:
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      mapper -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • mapToShort

      public static <T> short[] mapToShort(T[] a, ToShortFunction<? super T> mapper)
      Map to short.
      Type Parameters:
      T -
      Parameters:
      a -
      mapper -
      Returns:
    • mapToShort

      public static <T> short[] mapToShort(T[] a, int fromIndex, int toIndex, ToShortFunction<? super T> mapper) throws IndexOutOfBoundsException
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      mapper -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • mapToShort

      public static <T> short[] mapToShort(Collection<? extends T> c, ToShortFunction<? super T> mapper)
      Map to short.
      Type Parameters:
      T -
      Parameters:
      c -
      mapper -
      Returns:
    • mapToShort

      public static <T> short[] mapToShort(Collection<? extends T> c, int fromIndex, int toIndex, ToShortFunction<? super T> mapper) throws IndexOutOfBoundsException
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Type Parameters:
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      mapper -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • mapToInt

      public static <T> int[] mapToInt(T[] a, ToIntFunction<? super T> mapper)
      Map to int.
      Type Parameters:
      T -
      Parameters:
      a -
      mapper -
      Returns:
    • mapToInt

      public static <T> int[] mapToInt(T[] a, int fromIndex, int toIndex, ToIntFunction<? super T> mapper) throws IndexOutOfBoundsException
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      mapper -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • mapToInt

      public static <T> int[] mapToInt(Collection<? extends T> c, ToIntFunction<? super T> mapper)
      Map to int.
      Type Parameters:
      T -
      Parameters:
      c -
      mapper -
      Returns:
    • mapToInt

      public static <T> int[] mapToInt(Collection<? extends T> c, int fromIndex, int toIndex, ToIntFunction<? super T> mapper) throws IndexOutOfBoundsException
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Type Parameters:
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      mapper -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • mapToInt

      @Beta public static int[] mapToInt(long[] a, LongToIntFunction mapper)
      Parameters:
      a -
      mapper -
      Returns:
    • mapToInt

      @Beta public static int[] mapToInt(double[] a, DoubleToIntFunction mapper)
      Parameters:
      a -
      mapper -
      Returns:
    • mapToLong

      public static <T> long[] mapToLong(T[] a, ToLongFunction<? super T> mapper)
      Map to long.
      Type Parameters:
      T -
      Parameters:
      a -
      mapper -
      Returns:
    • mapToLong

      public static <T> long[] mapToLong(T[] a, int fromIndex, int toIndex, ToLongFunction<? super T> mapper) throws IndexOutOfBoundsException
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      mapper -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • mapToLong

      public static <T> long[] mapToLong(Collection<? extends T> c, ToLongFunction<? super T> mapper)
      Map to long.
      Type Parameters:
      T -
      Parameters:
      c -
      mapper -
      Returns:
    • mapToLong

      public static <T> long[] mapToLong(Collection<? extends T> c, int fromIndex, int toIndex, ToLongFunction<? super T> mapper) throws IndexOutOfBoundsException
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Type Parameters:
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      mapper -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • mapToLong

      @Beta public static long[] mapToLong(int[] a, IntToLongFunction mapper)
      Parameters:
      a -
      mapper -
      Returns:
    • mapToLong

      @Beta public static long[] mapToLong(double[] a, DoubleToLongFunction mapper)
      Parameters:
      a -
      mapper -
      Returns:
    • mapToFloat

      public static <T> float[] mapToFloat(T[] a, ToFloatFunction<? super T> mapper)
      Map to float.
      Type Parameters:
      T -
      Parameters:
      a -
      mapper -
      Returns:
    • mapToFloat

      public static <T> float[] mapToFloat(T[] a, int fromIndex, int toIndex, ToFloatFunction<? super T> mapper) throws IndexOutOfBoundsException
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      mapper -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • mapToFloat

      public static <T> float[] mapToFloat(Collection<? extends T> c, ToFloatFunction<? super T> mapper)
      Map to float.
      Type Parameters:
      T -
      Parameters:
      c -
      mapper -
      Returns:
    • mapToFloat

      public static <T> float[] mapToFloat(Collection<? extends T> c, int fromIndex, int toIndex, ToFloatFunction<? super T> mapper) throws IndexOutOfBoundsException
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Type Parameters:
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      mapper -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • mapToDouble

      public static <T> double[] mapToDouble(T[] a, ToDoubleFunction<? super T> mapper)
      Map to double.
      Type Parameters:
      T -
      Parameters:
      a -
      mapper -
      Returns:
    • mapToDouble

      public static <T> double[] mapToDouble(T[] a, int fromIndex, int toIndex, ToDoubleFunction<? super T> mapper) throws IndexOutOfBoundsException
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      mapper -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • mapToDouble

      public static <T> double[] mapToDouble(Collection<? extends T> c, ToDoubleFunction<? super T> mapper)
      Map to double.
      Type Parameters:
      T -
      Parameters:
      c -
      mapper -
      Returns:
    • mapToDouble

      public static <T> double[] mapToDouble(Collection<? extends T> c, int fromIndex, int toIndex, ToDoubleFunction<? super T> mapper) throws IndexOutOfBoundsException
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Type Parameters:
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      mapper -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • mapToDouble

      @Beta public static double[] mapToDouble(int[] a, IntToDoubleFunction mapper)
      Parameters:
      a -
      mapper -
      Returns:
    • mapToDouble

      @Beta public static double[] mapToDouble(long[] a, LongToDoubleFunction mapper)
      Parameters:
      a -
      mapper -
      Returns:
    • map

      public static <T, R> List<R> map(T[] a, Function<? super T,? extends R> mapper)
      Transforms an array of elements into a list by applying a given function to each element.
      Type Parameters:
      T - The type of the elements in the input array.
      R - The type of the elements in the resulting list.
      Parameters:
      a - The input array to be transformed. Must not be null.
      mapper - The function to apply to each element in the input array. Must not be null.
      Returns:
      A list containing the transformed elements.
    • map

      public static <T, R, C extends Collection<R>> C map(T[] a, Function<? super T,? extends R> mapper, IntFunction<? extends C> supplier)
      Type Parameters:
      T -
      R -
      C -
      Parameters:
      a -
      mapper -
      supplier -
      Returns:
    • map

      public static <T, R> List<R> map(T[] a, int fromIndex, int toIndex, Function<? super T,? extends R> mapper)
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Type Parameters:
      T -
      R -
      Parameters:
      a -
      fromIndex -
      toIndex -
      mapper -
      Returns:
    • map

      public static <T, R, C extends Collection<R>> C map(T[] a, int fromIndex, int toIndex, Function<? super T,? extends R> mapper, IntFunction<? extends C> supplier) throws IndexOutOfBoundsException
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Type Parameters:
      T -
      R -
      C -
      Parameters:
      a -
      fromIndex -
      toIndex -
      mapper -
      supplier -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • map

      public static <T, R> List<R> map(Collection<? extends T> c, int fromIndex, int toIndex, Function<? super T,? extends R> mapper)
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Type Parameters:
      T -
      R -
      Parameters:
      c -
      fromIndex -
      toIndex -
      mapper -
      Returns:
    • map

      public static <T, R, C extends Collection<R>> C map(Collection<? extends T> c, int fromIndex, int toIndex, Function<? super T,? extends R> mapper, IntFunction<? extends C> supplier) throws IndexOutOfBoundsException
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Type Parameters:
      T -
      R -
      C -
      Parameters:
      c -
      fromIndex -
      toIndex -
      mapper -
      supplier -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • map

      public static <T, R> List<R> map(Iterable<? extends T> c, Function<? super T,? extends R> mapper)
      Type Parameters:
      T -
      R -
      Parameters:
      c -
      mapper -
      Returns:
    • map

      public static <T, R, C extends Collection<R>> C map(Iterable<? extends T> c, Function<? super T,? extends R> mapper, IntFunction<? extends C> supplier)
      Type Parameters:
      T -
      R -
      C -
      Parameters:
      c -
      mapper -
      supplier -
      Returns:
    • flatMap

      public static <T, R> List<R> flatMap(T[] a, Function<? super T,? extends Collection<? extends R>> mapper)
      Transforms an array of elements into a list by applying a given function to each element and flattening the result.
      Type Parameters:
      T - The type of the elements in the input array.
      R - The type of the elements in the resulting list.
      Parameters:
      a - The input array to be transformed. Must not be null.
      mapper - The function to apply to each element in the input array. Must not be null.
      Returns:
      A list containing the transformed elements.
    • flatMap

      public static <T, R, C extends Collection<R>> C flatMap(T[] a, Function<? super T,? extends Collection<? extends R>> mapper, IntFunction<? extends C> supplier)
      Type Parameters:
      T -
      R -
      C -
      Parameters:
      a -
      mapper -
      supplier -
      Returns:
    • flatMap

      public static <T, R> List<R> flatMap(T[] a, int fromIndex, int toIndex, Function<? super T,? extends Collection<? extends R>> mapper)
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Type Parameters:
      T -
      R -
      Parameters:
      a -
      fromIndex -
      toIndex -
      mapper -
      Returns:
    • flatMap

      public static <T, R, C extends Collection<R>> C flatMap(T[] a, int fromIndex, int toIndex, Function<? super T,? extends Collection<? extends R>> mapper, IntFunction<? extends C> supplier) throws IndexOutOfBoundsException
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Type Parameters:
      T -
      R -
      C -
      Parameters:
      a -
      fromIndex -
      toIndex -
      mapper -
      supplier -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • flatMap

      public static <T, R> List<R> flatMap(Collection<? extends T> c, int fromIndex, int toIndex, Function<? super T,? extends Collection<? extends R>> mapper)
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Type Parameters:
      T -
      R -
      Parameters:
      c -
      fromIndex -
      toIndex -
      mapper -
      Returns:
    • flatMap

      public static <T, R, C extends Collection<R>> C flatMap(Collection<? extends T> c, int fromIndex, int toIndex, Function<? super T,? extends Collection<? extends R>> mapper, IntFunction<? extends C> supplier) throws IndexOutOfBoundsException
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Type Parameters:
      T -
      R -
      C -
      Parameters:
      c -
      fromIndex -
      toIndex -
      mapper -
      supplier -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • flatMap

      public static <T, R> List<R> flatMap(Iterable<? extends T> c, Function<? super T,? extends Collection<? extends R>> mapper)
      Type Parameters:
      T -
      R -
      Parameters:
      c -
      mapper -
      Returns:
    • flatMap

      public static <T, R, C extends Collection<R>> C flatMap(Iterable<? extends T> c, Function<? super T,? extends Collection<? extends R>> mapper, IntFunction<? extends C> supplier) throws IndexOutOfBoundsException
      Type Parameters:
      T -
      R -
      C -
      Parameters:
      c -
      mapper -
      supplier -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • flatMap

      public static <T, U, R> List<R> flatMap(T[] a, Function<? super T,? extends Collection<? extends U>> mapper, Function<? super U,? extends Collection<? extends R>> mapper2)
      Type Parameters:
      T -
      U -
      R -
      Parameters:
      a -
      mapper -
      mapper2 -
      Returns:
    • flatMap

      public static <T, U, R, C extends Collection<R>> C flatMap(T[] a, Function<? super T,? extends Collection<? extends U>> mapper, Function<? super U,? extends Collection<? extends R>> mapper2, IntFunction<? extends C> supplier)
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Type Parameters:
      T -
      U -
      R -
      C -
      Parameters:
      a -
      mapper -
      mapper2 -
      supplier -
      Returns:
    • flatMap

      public static <T, U, R> List<R> flatMap(Iterable<? extends T> c, Function<? super T,? extends Collection<? extends U>> mapper, Function<? super U,? extends Collection<? extends R>> mapper2)
      Type Parameters:
      T -
      U -
      R -
      Parameters:
      c -
      mapper -
      mapper2 -
      Returns:
    • flatMap

      public static <T, U, R, C extends Collection<R>> C flatMap(Iterable<? extends T> c, Function<? super T,? extends Collection<? extends U>> mapper, Function<? super U,? extends Collection<? extends R>> mapper2, IntFunction<? extends C> supplier)
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Type Parameters:
      T -
      U -
      R -
      C -
      Parameters:
      c -
      mapper -
      mapper2 -
      supplier -
      Returns:
    • flatmap

      public static <T, R> List<R> flatmap(T[] a, Function<? super T,? extends R[]> mapper)
      Type Parameters:
      T -
      R -
      Parameters:
      a -
      mapper -
      Returns:
    • flatmap

      public static <T, R, C extends Collection<R>> C flatmap(T[] a, Function<? super T,? extends R[]> mapper, IntFunction<? extends C> supplier)
      Type Parameters:
      T -
      R -
      C -
      Parameters:
      a -
      mapper -
      supplier -
      Returns:
    • flatmap

      public static <T, R> List<R> flatmap(T[] a, int fromIndex, int toIndex, Function<? super T,? extends R[]> mapper)
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Type Parameters:
      T -
      R -
      Parameters:
      a -
      fromIndex -
      toIndex -
      mapper -
      Returns:
    • flatmap

      public static <T, R, C extends Collection<R>> C flatmap(T[] a, int fromIndex, int toIndex, Function<? super T,? extends R[]> mapper, IntFunction<? extends C> supplier) throws IndexOutOfBoundsException
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Type Parameters:
      T -
      R -
      C -
      Parameters:
      a -
      fromIndex -
      toIndex -
      mapper -
      supplier -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • flatmap

      public static <T, R> List<R> flatmap(Collection<? extends T> c, int fromIndex, int toIndex, Function<? super T,? extends R[]> mapper)
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Type Parameters:
      T -
      R -
      Parameters:
      c -
      fromIndex -
      toIndex -
      mapper -
      Returns:
    • flatmap

      public static <T, R, C extends Collection<R>> C flatmap(Collection<? extends T> c, int fromIndex, int toIndex, Function<? super T,? extends R[]> mapper, IntFunction<? extends C> supplier) throws IndexOutOfBoundsException
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Type Parameters:
      T -
      R -
      C -
      Parameters:
      c -
      fromIndex -
      toIndex -
      mapper -
      supplier -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • flatmap

      public static <T, R> List<R> flatmap(Iterable<? extends T> c, Function<? super T,? extends R[]> mapper)
      Type Parameters:
      T -
      R -
      Parameters:
      c -
      mapper -
      Returns:
    • flatmap

      public static <T, R, C extends Collection<R>> C flatmap(Iterable<? extends T> c, Function<? super T,? extends R[]> mapper, IntFunction<? extends C> supplier)
      Type Parameters:
      T -
      R -
      C -
      Parameters:
      c -
      mapper -
      supplier -
      Returns:
    • takeWhile

      public static <T> List<T> takeWhile(T[] a, Predicate<? super T> filter)
      Returns a list containing the elements of the input array until the provided predicate returns false.
      Type Parameters:
      T -
      Parameters:
      a - the array to process.
      filter - the predicate to apply to elements of the array.
      Returns:
      a list of elements from the input array starting from the first element until the predicate returns false.
    • takeWhile

      public static <T> List<T> takeWhile(Iterable<? extends T> c, Predicate<? super T> filter)
      Returns a list containing the elements of the input iterable until the provided predicate returns false.
      Type Parameters:
      T -
      Parameters:
      c - the iterable to process.
      filter - the predicate to apply to elements of the iterable.
      Returns:
      a list of elements from the input iterable starting from the first element until the predicate returns false.
    • takeWhileInclusive

      public static <T> List<T> takeWhileInclusive(T[] a, Predicate<? super T> filter)
      Returns a list containing the elements of the input array until the provided predicate returns false, including the element that fails the predicate.
      Parameters:
      a - the array to process.
      filter - the predicate to apply to elements of the array.
      Returns:
      a list of elements from the input array starting from the first element until the predicate returns false, including the element that fails the predicate.
    • takeWhileInclusive

      public static <T> List<T> takeWhileInclusive(Iterable<? extends T> c, Predicate<? super T> filter)
      Returns a list containing the elements of the input iterable until the provided predicate returns false, including the element that fails the predicate.
      Parameters:
      c - the iterable to process.
      filter - the predicate to apply to elements of the iterable.
      Returns:
      a list of elements from the input iterable starting from the first element until the predicate returns false, including the element that fails the predicate.
    • dropWhile

      public static <T> List<T> dropWhile(T[] a, Predicate<? super T> filter)
      Returns a list containing the elements of the input array after dropping the elements that satisfy the provided predicate.
      Parameters:
      a - the array to process.
      filter - the predicate to apply to elements of the array.
      Returns:
      a list of elements from the input array starting from the first element that fails the predicate.
    • dropWhile

      public static <T> List<T> dropWhile(Iterable<? extends T> c, Predicate<? super T> filter)
      Returns a list containing the elements of the input iterable after dropping the elements that satisfy the provided predicate.
      Parameters:
      c - the iterable to process.
      filter - the predicate to apply to elements of the iterable.
      Returns:
      a list of elements from the input iterable starting from the first element that fails the predicate.
    • skipUntil

      public static <T> List<T> skipUntil(T[] a, Predicate<? super T> filter)
      Returns a list containing the elements of the input array starting from the first element that satisfies the provided predicate.
      Parameters:
      a - the array to process.
      filter - the predicate to apply to elements of the array.
      Returns:
      a list of elements from the input array starting from the first element that satisfies the predicate.
    • skipUntil

      public static <T> List<T> skipUntil(Iterable<? extends T> c, Predicate<? super T> filter)
      Returns a list containing the elements of the input iterable starting from the first element that satisfies the provided predicate.
      Parameters:
      c - the iterable to process.
      filter - the predicate to apply to elements of the iterable.
      Returns:
      a list of elements from the input iterable starting from the first element that satisfies the predicate.
    • distinct

      public static boolean[] distinct(boolean[] a)
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Parameters:
      a -
      Returns:
    • distinct

      public static boolean[] distinct(boolean[] a, int fromIndex, int toIndex)
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
    • distinct

      public static char[] distinct(char[] a)
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Parameters:
      a -
      Returns:
    • distinct

      public static char[] distinct(char[] a, int fromIndex, int toIndex)
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
    • distinct

      public static byte[] distinct(byte[] a)
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Parameters:
      a -
      Returns:
    • distinct

      public static byte[] distinct(byte[] a, int fromIndex, int toIndex)
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
    • distinct

      public static short[] distinct(short[] a)
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Parameters:
      a -
      Returns:
    • distinct

      public static short[] distinct(short[] a, int fromIndex, int toIndex)
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
    • distinct

      public static int[] distinct(int[] a)
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Parameters:
      a -
      Returns:
    • distinct

      public static int[] distinct(int[] a, int fromIndex, int toIndex)
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
    • distinct

      public static long[] distinct(long[] a)
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Parameters:
      a -
      Returns:
    • distinct

      public static long[] distinct(long[] a, int fromIndex, int toIndex)
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
    • distinct

      public static float[] distinct(float[] a)
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Parameters:
      a -
      Returns:
    • distinct

      public static float[] distinct(float[] a, int fromIndex, int toIndex)
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
    • distinct

      public static double[] distinct(double[] a)
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Parameters:
      a -
      Returns:
    • distinct

      public static double[] distinct(double[] a, int fromIndex, int toIndex)
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
    • distinct

      public static <T> List<T> distinct(T[] a)
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • distinct

      public static <T> List<T> distinct(T[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • distinct

      public static <T> List<T> distinct(Iterable<? extends T> c)
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
    • distinct

      public static <T> List<T> distinct(Iterator<? extends T> iter)
      Type Parameters:
      T -
      Parameters:
      iter -
      Returns:
      See Also:
    • distinct

      public static <T> List<T> distinct(Collection<? extends T> c, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Type Parameters:
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • distinctBy

      public static <T> List<T> distinctBy(T[] a, Function<? super T,?> keyMapper)
      Distinct by the value mapped from keyMapper. Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Type Parameters:
      T -
      Parameters:
      a -
      keyMapper - don't change value of the input parameter.
      Returns:
    • distinctBy

      public static <T> List<T> distinctBy(T[] a, int fromIndex, int toIndex, Function<? super T,?> keyMapper) throws IndexOutOfBoundsException
      Distinct by the value mapped from keyMapper. Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      keyMapper - don't change value of the input parameter.
      Returns:
      Throws:
      IndexOutOfBoundsException
    • distinctBy

      public static <T, C extends Collection<T>> C distinctBy(T[] a, Function<? super T,?> keyMapper, Supplier<C> supplier)
      Distinct by the value mapped from keyMapper. Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Type Parameters:
      T -
      C -
      Parameters:
      a -
      keyMapper - don't change value of the input parameter.
      supplier -
      Returns:
    • distinctBy

      public static <T> List<T> distinctBy(Collection<? extends T> c, int fromIndex, int toIndex, Function<? super T,?> keyMapper) throws IndexOutOfBoundsException
      Distinct by the value mapped from keyMapper. Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Type Parameters:
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      keyMapper - don't change value of the input parameter.
      Returns:
      Throws:
      IndexOutOfBoundsException
    • distinctBy

      public static <T> List<T> distinctBy(Iterable<? extends T> c, Function<? super T,?> keyMapper)
      Distinct by the value mapped from keyMapper. Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Type Parameters:
      T -
      Parameters:
      c -
      keyMapper - don't change value of the input parameter.
      Returns:
    • distinctBy

      public static <T, C extends Collection<T>> C distinctBy(Iterable<? extends T> c, Function<? super T,?> keyMapper, Supplier<C> supplier)
      Distinct by the value mapped from keyMapper. Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Type Parameters:
      T -
      C -
      Parameters:
      c -
      keyMapper - don't change value of the input parameter.
      supplier -
      Returns:
    • distinctBy

      public static <T> List<T> distinctBy(Iterator<? extends T> iter, Function<? super T,?> keyMapper)
      Distinct by the value mapped from keyMapper. Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Type Parameters:
      T -
      Parameters:
      iter -
      keyMapper - don't change value of the input parameter.
      Returns:
      See Also:
    • distinctBy

      public static <T, C extends Collection<T>> C distinctBy(Iterator<? extends T> iter, Function<? super T,?> keyMapper, Supplier<C> supplier)
      Distinct by the value mapped from keyMapper. Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Type Parameters:
      T -
      C -
      Parameters:
      iter -
      keyMapper - don't change value of the input parameter.
      supplier -
      Returns:
      See Also:
    • allMatch

      public static <T> boolean allMatch(T[] a, Predicate<? super T> filter)
      Type Parameters:
      T -
      Parameters:
      a -
      filter -
      Returns:
    • allMatch

      public static <T> boolean allMatch(Iterable<? extends T> c, Predicate<? super T> filter)
      Type Parameters:
      T -
      Parameters:
      c -
      filter -
      Returns:
    • allMatch

      public static <T> boolean allMatch(Iterator<? extends T> iter, Predicate<? super T> filter)
      Type Parameters:
      T -
      Parameters:
      iter -
      filter -
      Returns:
    • anyMatch

      public static <T> boolean anyMatch(T[] a, Predicate<? super T> filter)
      Type Parameters:
      T -
      Parameters:
      a -
      filter -
      Returns:
    • anyMatch

      public static <T> boolean anyMatch(Iterable<? extends T> c, Predicate<? super T> filter)
      Type Parameters:
      T -
      Parameters:
      c -
      filter -
      Returns:
    • anyMatch

      public static <T> boolean anyMatch(Iterator<? extends T> iter, Predicate<? super T> filter)
      Type Parameters:
      T -
      Parameters:
      iter -
      filter -
      Returns:
    • noneMatch

      public static <T> boolean noneMatch(T[] a, Predicate<? super T> filter)
      Type Parameters:
      T -
      Parameters:
      a -
      filter -
      Returns:
    • noneMatch

      public static <T> boolean noneMatch(Iterable<? extends T> c, Predicate<? super T> filter)
      Type Parameters:
      T -
      Parameters:
      c -
      filter -
      Returns:
    • noneMatch

      public static <T> boolean noneMatch(Iterator<? extends T> iter, Predicate<? super T> filter)
      Type Parameters:
      T -
      Parameters:
      iter -
      filter -
      Returns:
    • nMatch

      public static <T> boolean nMatch(T[] a, int atLeast, int atMost, Predicate<? super T> filter)
      Checks if a certain number of elements in the array match the provided predicate.
      Type Parameters:
      T - the type of elements in the array
      Parameters:
      a - the array to be checked
      atLeast - the minimum number of elements that should match the predicate
      atMost - the maximum number of elements that should match the predicate
      filter - the predicate to apply to elements in the array
      Returns:
      true if the number of matching elements is within the specified range (inclusive), false otherwise
    • nMatch

      public static <T> boolean nMatch(Iterable<? extends T> c, int atLeast, int atMost, Predicate<? super T> filter)
      Checks if a certain number of elements in the iterable match the provided predicate.
      Type Parameters:
      T - the type of elements in the iterable
      Parameters:
      c - the iterable to be checked
      atLeast - the minimum number of elements that should match the predicate
      atMost - the maximum number of elements that should match the predicate
      filter - the predicate to apply to elements in the iterable
      Returns:
      true if the number of matching elements is within the specified range (inclusive), false otherwise
    • nMatch

      public static <T> boolean nMatch(Iterator<? extends T> iter, int atLeast, int atMost, Predicate<? super T> filter)
      Checks if a certain number of elements in the iterator match the provided predicate.
      Type Parameters:
      T - the type of elements in the iterator
      Parameters:
      iter - the iterator to be checked
      atLeast - the minimum number of elements that should match the predicate
      atMost - the maximum number of elements that should match the predicate
      filter - the predicate to apply to elements in the iterator
      Returns:
      true if the number of matching elements is within the specified range (inclusive), false otherwise
    • allTrue

      public static boolean allTrue(boolean[] a)
      Parameters:
      a -
      Returns:
    • allFalse

      public static boolean allFalse(boolean[] a)
      Parameters:
      a -
      Returns:
    • anyTrue

      public static boolean anyTrue(boolean[] a)
      Parameters:
      a -
      Returns:
    • anyFalse

      public static boolean anyFalse(boolean[] a)
      Parameters:
      a -
      Returns:
    • count

      public static int count(boolean[] a, BooleanPredicate filter) throws IndexOutOfBoundsException
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Parameters:
      a -
      filter -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • count

      public static int count(boolean[] a, int fromIndex, int toIndex, BooleanPredicate filter) throws IndexOutOfBoundsException
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • count

      public static int count(char[] a, CharPredicate filter)
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Parameters:
      a -
      filter -
      Returns:
    • count

      public static int count(char[] a, int fromIndex, int toIndex, CharPredicate filter) throws IndexOutOfBoundsException
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • count

      public static int count(byte[] a, BytePredicate filter)
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Parameters:
      a -
      filter -
      Returns:
    • count

      public static int count(byte[] a, int fromIndex, int toIndex, BytePredicate filter) throws IndexOutOfBoundsException
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • count

      public static int count(short[] a, ShortPredicate filter)
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Parameters:
      a -
      filter -
      Returns:
    • count

      public static int count(short[] a, int fromIndex, int toIndex, ShortPredicate filter) throws IndexOutOfBoundsException
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • count

      public static int count(int[] a, IntPredicate filter)
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Parameters:
      a -
      filter -
      Returns:
    • count

      public static int count(int[] a, int fromIndex, int toIndex, IntPredicate filter) throws IndexOutOfBoundsException
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • count

      public static int count(long[] a, LongPredicate filter)
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Parameters:
      a -
      filter -
      Returns:
    • count

      public static int count(long[] a, int fromIndex, int toIndex, LongPredicate filter) throws IndexOutOfBoundsException
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • count

      public static int count(float[] a, FloatPredicate filter)
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Parameters:
      a -
      filter -
      Returns:
    • count

      public static int count(float[] a, int fromIndex, int toIndex, FloatPredicate filter) throws IndexOutOfBoundsException
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • count

      public static int count(double[] a, DoublePredicate filter) throws IndexOutOfBoundsException
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Parameters:
      a -
      filter -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • count

      public static int count(double[] a, int fromIndex, int toIndex, DoublePredicate filter) throws IndexOutOfBoundsException
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • count

      public static <T> int count(T[] a, Predicate<? super T> filter) throws IndexOutOfBoundsException
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Type Parameters:
      T -
      Parameters:
      a -
      filter -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • count

      public static <T> int count(T[] a, int fromIndex, int toIndex, Predicate<? super T> filter) throws IndexOutOfBoundsException
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • count

      public static <T> int count(Collection<? extends T> c, int fromIndex, int toIndex, Predicate<? super T> filter) throws IndexOutOfBoundsException
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Type Parameters:
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      filter -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • count

      public static <T> int count(Iterable<? extends T> c, Predicate<? super T> filter)
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation.
      Type Parameters:
      T -
      Parameters:
      c -
      filter -
      Returns:
    • count

      public static int count(Iterator<?> iter) throws ArithmeticException
      Counts the number of elements in the given iterator.
      Parameters:
      iter -
      Returns:
      Throws:
      ArithmeticException - if the total count overflows an int.
      See Also:
    • count

      public static <T> int count(Iterator<? extends T> iter, Predicate<? super T> filter) throws ArithmeticException
      Counts the number of elements in the given iterator that match the provided predicate.
      Type Parameters:
      T - The type of the elements in the iterator.
      Parameters:
      iter - The iterator to be counted.
      filter - The predicate to apply to each element.
      Returns:
      The number of elements that match the predicate.
      Throws:
      ArithmeticException - if the total matched count overflows an int.
      See Also:
    • merge

      public static <T> List<T> merge(T[] a, T[] b, BiFunction<? super T,? super T,MergeResult> nextSelector)
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      nextSelector -
      Returns:
    • merge

      public static <T> List<T> merge(Iterable<? extends T> a, Iterable<? extends T> b, BiFunction<? super T,? super T,MergeResult> nextSelector)
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      nextSelector -
      Returns:
    • merge

      public static <T> List<T> merge(Collection<? extends Iterable<? extends T>> c, BiFunction<? super T,? super T,MergeResult> nextSelector)
      Type Parameters:
      T -
      Parameters:
      c -
      nextSelector -
      Returns:
    • merge

      public static <T, C extends Collection<T>> C merge(Collection<? extends Iterable<? extends T>> c, BiFunction<? super T,? super T,MergeResult> nextSelector, IntFunction<? extends C> supplier)
      Type Parameters:
      T -
      C -
      Parameters:
      c -
      nextSelector -
      supplier -
      Returns:
    • zip

      public static <A, B, R> List<R> zip(A[] a, B[] b, BiFunction<? super A,? super B,? extends R> zipFunction)
      Type Parameters:
      A -
      B -
      R -
      Parameters:
      a -
      b -
      zipFunction -
      Returns:
    • zip

      public static <A, B, R> List<R> zip(Iterable<A> a, Iterable<B> b, BiFunction<? super A,? super B,? extends R> zipFunction)
      Type Parameters:
      A -
      B -
      R -
      Parameters:
      a -
      b -
      zipFunction -
      Returns:
    • zip

      public static <A, B, C, R> List<R> zip(A[] a, B[] b, C[] c, TriFunction<? super A,? super B,? super C,? extends R> zipFunction)
      Type Parameters:
      A -
      B -
      C -
      R -
      Parameters:
      a -
      b -
      c -
      zipFunction -
      Returns:
    • zip

      public static <A, B, C, R> List<R> zip(Iterable<A> a, Iterable<B> b, Iterable<C> c, TriFunction<? super A,? super B,? super C,? extends R> zipFunction)
      Type Parameters:
      A -
      B -
      C -
      R -
      Parameters:
      a -
      b -
      c -
      zipFunction -
      Returns:
    • zip

      public static <A, B, R> List<R> zip(A[] a, B[] b, A valueForNoneA, B valueForNoneB, BiFunction<? super A,? super B,? extends R> zipFunction)
      Type Parameters:
      A -
      B -
      R -
      Parameters:
      a -
      b -
      valueForNoneA -
      valueForNoneB -
      zipFunction -
      Returns:
    • zip

      public static <A, B, R> List<R> zip(Iterable<A> a, Iterable<B> b, A valueForNoneA, B valueForNoneB, BiFunction<? super A,? super B,? extends R> zipFunction)
      Type Parameters:
      A -
      B -
      R -
      Parameters:
      a -
      b -
      valueForNoneA -
      valueForNoneB -
      zipFunction -
      Returns:
    • zip

      public static <A, B, C, R> List<R> zip(A[] a, B[] b, C[] c, A valueForNoneA, B valueForNoneB, C valueForNoneC, TriFunction<? super A,? super B,? super C,? extends R> zipFunction)
      Type Parameters:
      A -
      B -
      C -
      R -
      Parameters:
      a -
      b -
      c -
      valueForNoneA -
      valueForNoneB -
      valueForNoneC -
      zipFunction -
      Returns:
    • zip

      public static <A, B, C, R> List<R> zip(Iterable<A> a, Iterable<B> b, Iterable<C> c, A valueForNoneA, B valueForNoneB, C valueForNoneC, TriFunction<? super A,? super B,? super C,? extends R> zipFunction)
      Type Parameters:
      A -
      B -
      C -
      R -
      Parameters:
      a -
      b -
      c -
      valueForNoneA -
      valueForNoneB -
      valueForNoneC -
      zipFunction -
      Returns:
    • zip

      public static <A, B, R> R[] zip(A[] a, B[] b, BiFunction<? super A,? super B,? extends R> zipFunction, Class<R> targetElementType)
      Type Parameters:
      A -
      B -
      R -
      Parameters:
      a -
      b -
      zipFunction -
      targetElementType -
      Returns:
    • zip

      public static <A, B, R> R[] zip(A[] a, B[] b, A valueForNoneA, B valueForNoneB, BiFunction<? super A,? super B,? extends R> zipFunction, Class<R> targetElementType)
      Type Parameters:
      A -
      B -
      R -
      Parameters:
      a -
      b -
      valueForNoneA -
      valueForNoneB -
      zipFunction -
      targetElementType -
      Returns:
    • zip

      public static <A, B, C, R> R[] zip(A[] a, B[] b, C[] c, TriFunction<? super A,? super B,? super C,? extends R> zipFunction, Class<R> targetElementType)
      Type Parameters:
      A -
      B -
      C -
      R -
      Parameters:
      a -
      b -
      c -
      zipFunction -
      targetElementType -
      Returns:
    • zip

      public static <A, B, C, R> R[] zip(A[] a, B[] b, C[] c, A valueForNoneA, B valueForNoneB, C valueForNoneC, TriFunction<? super A,? super B,? super C,? extends R> zipFunction, Class<R> targetElementType)
      Type Parameters:
      A -
      B -
      C -
      R -
      Parameters:
      a -
      b -
      c -
      valueForNoneA -
      valueForNoneB -
      valueForNoneC -
      zipFunction -
      targetElementType -
      Returns:
    • unzip

      public static <T, A, B> Pair<List<A>,List<B>> unzip(Iterable<? extends T> c, BiConsumer<? super T,Pair<A,B>> unzip)
      Type Parameters:
      T -
      A -
      B -
      Parameters:
      c -
      unzip - the second parameter is an output parameter.
      Returns:
    • unzip

      public static <T, A, B, LC extends Collection<A>, RC extends Collection<B>> Pair<LC,RC> unzip(Iterable<? extends T> c, BiConsumer<? super T,Pair<A,B>> unzip, IntFunction<? extends Collection<?>> supplier)
      Type Parameters:
      T -
      A -
      B -
      LC -
      RC -
      Parameters:
      c -
      unzip - the second parameter is an output parameter.
      supplier -
      Returns:
    • unzipp

      @Deprecated public static <T, A, B, C> Triple<List<A>,List<B>,List<C>> unzipp(Iterable<? extends T> c, BiConsumer<? super T,Triple<A,B,C>> unzip)
      Type Parameters:
      T -
      A -
      B -
      C -
      Parameters:
      c -
      unzip - the second parameter is an output parameter.
      Returns:
      See Also:
    • unzipp

      @Deprecated public static <T, A, B, C, LC extends Collection<A>, MC extends Collection<B>, RC extends Collection<C>> Triple<LC,MC,RC> unzipp(Iterable<? extends T> c, BiConsumer<? super T,Triple<A,B,C>> unzip, IntFunction<? extends Collection<?>> supplier)
      Type Parameters:
      T -
      A -
      B -
      C -
      LC -
      MC -
      RC -
      Parameters:
      c -
      unzip - the second parameter is an output parameter.
      supplier -
      Returns:
      See Also:
    • groupBy

      @Beta public static <T, K> Map<K,List<T>> groupBy(T[] a, Function<? super T,? extends K> keyExtractor)
      Type Parameters:
      T -
      K -
      Parameters:
      a -
      keyExtractor -
      Returns:
    • groupBy

      @Beta public static <T, K, M extends Map<K, List<T>>> M groupBy(T[] a, Function<? super T,? extends K> keyExtractor, Supplier<M> mapSupplier)
      Type Parameters:
      T -
      K -
      M -
      Parameters:
      a -
      keyExtractor -
      mapSupplier -
      Returns:
    • groupBy

      @Beta public static <T, K> Map<K,List<T>> groupBy(T[] a, int fromIndex, int toIndex, Function<? super T,? extends K> keyExtractor)
      Type Parameters:
      T -
      K -
      Parameters:
      a -
      fromIndex -
      toIndex -
      keyExtractor -
      Returns:
    • groupBy

      @Beta public static <T, K, M extends Map<K, List<T>>> M groupBy(T[] a, int fromIndex, int toIndex, Function<? super T,? extends K> keyExtractor, Supplier<M> mapSupplier) throws IndexOutOfBoundsException
      Type Parameters:
      T -
      K -
      M -
      Parameters:
      a -
      fromIndex -
      toIndex -
      keyExtractor -
      mapSupplier -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • groupBy

      @Beta public static <T, K> Map<K,List<T>> groupBy(Iterable<? extends T> c, Function<? super T,? extends K> keyExtractor)
      Type Parameters:
      T -
      K -
      Parameters:
      c -
      keyExtractor -
      Returns:
    • groupBy

      @Beta public static <T, K, M extends Map<K, List<T>>> M groupBy(Iterable<? extends T> c, Function<? super T,? extends K> keyExtractor, Supplier<M> mapSupplier)
      Type Parameters:
      T -
      K -
      M -
      Parameters:
      c -
      keyExtractor -
      mapSupplier -
      Returns:
    • groupBy

      @Beta public static <T, K> Map<K,List<T>> groupBy(Iterator<? extends T> iter, Function<? super T,? extends K> keyExtractor)
      Type Parameters:
      T -
      K -
      Parameters:
      iter -
      keyExtractor -
      Returns:
    • groupBy

      @Beta public static <T, K, M extends Map<K, List<T>>> M groupBy(Iterator<? extends T> iter, Function<? super T,? extends K> keyExtractor, Supplier<M> mapSupplier)
      Type Parameters:
      T -
      K -
      M -
      Parameters:
      iter -
      keyExtractor -
      mapSupplier -
      Returns:
    • groupBy

      @Beta public static <T, K, V> Map<K,List<V>> groupBy(Iterable<? extends T> c, Function<? super T,? extends K> keyExtractor, Function<? super T,? extends V> valueExtractor)
      Type Parameters:
      T -
      K -
      V -
      Parameters:
      c -
      keyExtractor -
      valueExtractor -
      Returns:
    • groupBy

      @Beta public static <T, K, V, M extends Map<K, List<V>>> M groupBy(Iterable<? extends T> c, Function<? super T,? extends K> keyExtractor, Function<? super T,? extends V> valueExtractor, Supplier<M> mapSupplier)
      Type Parameters:
      T -
      K -
      V -
      M -
      Parameters:
      c -
      keyExtractor -
      valueExtractor -
      mapSupplier -
      Returns:
    • groupBy

      @Beta public static <T, K, V> Map<K,List<V>> groupBy(Iterator<? extends T> iter, Function<? super T,? extends K> keyExtractor, Function<? super T,? extends V> valueExtractor)
      Type Parameters:
      T -
      K -
      V -
      Parameters:
      iter -
      keyExtractor -
      valueExtractor -
      Returns:
    • groupBy

      @Beta public static <T, K, V, M extends Map<K, List<V>>> M groupBy(Iterator<? extends T> iter, Function<? super T,? extends K> keyExtractor, Function<? super T,? extends V> valueExtractor, Supplier<M> mapSupplier)
      Type Parameters:
      T -
      K -
      V -
      M -
      Parameters:
      iter -
      keyExtractor -
      valueExtractor -
      mapSupplier -
      Returns:
    • groupBy

      @Beta public static <T, K, R> Map<K,R> groupBy(Iterable<? extends T> c, Function<? super T,? extends K> keyExtractor, Collector<? super T,?,R> collector)
      Type Parameters:
      T -
      K -
      R -
      Parameters:
      c -
      keyExtractor -
      collector -
      Returns:
    • groupBy

      @Beta public static <T, K, R, M extends Map<K, R>> M groupBy(Iterable<? extends T> c, Function<? super T,? extends K> keyExtractor, Collector<? super T,?,R> collector, Supplier<M> mapSupplier)
      Type Parameters:
      T -
      K -
      R -
      M -
      Parameters:
      c -
      keyExtractor -
      collector -
      mapSupplier -
      Returns:
    • groupBy

      @Beta public static <K, T, R> Map<K,R> groupBy(Iterator<? extends T> iter, Function<? super T,? extends K> keyExtractor, Collector<? super T,?,R> collector)
      Type Parameters:
      K -
      T -
      R -
      Parameters:
      iter -
      keyExtractor -
      collector -
      Returns:
    • groupBy

      @Beta public static <K, T, R, M extends Map<K, R>> M groupBy(Iterator<? extends T> iter, Function<? super T,? extends K> keyExtractor, Collector<? super T,?,R> collector, Supplier<M> mapSupplier)
      Type Parameters:
      K -
      T -
      R -
      M -
      Parameters:
      iter -
      keyExtractor -
      collector -
      mapSupplier -
      Returns:
    • countBy

      @Beta public static <T, K> Map<K,Integer> countBy(Iterable<? extends T> c, Function<? super T,? extends K> keyExtractor)
      Type Parameters:
      T -
      K -
      Parameters:
      c -
      keyExtractor -
      Returns:
    • countBy

      @Beta public static <T, K, M extends Map<K, Integer>> M countBy(Iterable<? extends T> c, Function<? super T,? extends K> keyExtractor, Supplier<M> mapSupplier)
      Type Parameters:
      T -
      K -
      M -
      Parameters:
      c -
      keyExtractor -
      mapSupplier -
      Returns:
    • countBy

      @Beta public static <T, K> Map<K,Integer> countBy(Iterator<? extends T> iter, Function<? super T,? extends K> keyExtractor)
      Type Parameters:
      T -
      K -
      Parameters:
      iter -
      keyExtractor -
      Returns:
    • countBy

      @Beta public static <T, K, M extends Map<K, Integer>> M countBy(Iterator<? extends T> iter, Function<? super T,? extends K> keyExtractor, Supplier<M> mapSupplier)
      Type Parameters:
      T -
      K -
      M -
      Parameters:
      iter -
      keyExtractor -
      mapSupplier -
      Returns:
    • iterate

      @Beta public static <T> ObjIterator<T> iterate(T[] a)
      Returns an iterator over the elements in the specified array.
      Parameters:
      a - the array to iterate over.
      Returns:
      an iterator over the elements in the specified array. If the array is null, an empty iterator is returned.
      See Also:
    • iterate

      @Beta public static <T> ObjIterator<T> iterate(T[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Returns an iterator over the elements in the specified array, starting from the 'fromIndex' and ending before the 'toIndex'.
      Parameters:
      a - the array to iterate over.
      fromIndex - the index of the first element to be returned from the iterator.
      toIndex - the index after the last element to be returned from the iterator.
      Returns:
      an iterator over the elements in the specified range of the array.
      Throws:
      IndexOutOfBoundsException - if the indices are out of range.
      See Also:
    • iterate

      @Beta public static <T> Iterator<T> iterate(Iterable<? extends T> iterable)
      Returns an iterator over the elements in the specified iterable.
      Parameters:
      iterable - the iterable to iterate over.
      Returns:
      an iterator over the elements in the specified iterable. If the iterable is null, an empty iterator is returned.
    • disjoint

      public static boolean disjoint(Object[] a, Object[] b)
      Returns true if the two specified arrays/collections have no elements in common.
      Parameters:
      a -
      b -
      Returns:
    • disjoint

      public static boolean disjoint(Collection<?> c1, Collection<?> c2)
      Returns true if the two specified arrays/collections have no elements in common.
      Parameters:
      c1 -
      c2 -
      Returns:
      true if the two specified arrays have no elements in common.
      See Also:
    • toJson

      public static String toJson(Object obj)
      Converts the given object into a JSON string.
      Parameters:
      obj - the object to be converted into a JSON string.
      Returns:
      a JSON string representation of the given object.
    • toJson

      public static String toJson(Object obj, boolean prettyFormat)
      Converts the given object into a JSON string with optional pretty formatting.
      Parameters:
      obj - the object to be converted into a JSON string.
      prettyFormat - a boolean flag that indicates whether the JSON string should be pretty formatted or not.
      Returns:
      a JSON string representation of the given object. If prettyFormat is true, the JSON string is formatted with indents and line breaks for easier reading.
    • toJson

      public static String toJson(Object obj, JSONSerializationConfig config)
      Parameters:
      obj -
      config -
      Returns:
    • toJson

      public static void toJson(Object obj, File output)
      Parameters:
      obj -
      output -
    • toJson

      public static void toJson(Object obj, JSONSerializationConfig config, File output)
      Parameters:
      obj -
      config -
      output -
    • toJson

      public static void toJson(Object obj, OutputStream output)
      Parameters:
      obj -
      output -
    • toJson

      public static void toJson(Object obj, JSONSerializationConfig config, OutputStream output)
      Parameters:
      obj -
      config -
      output -
    • toJson

      public static void toJson(Object obj, Writer output)
      Parameters:
      obj -
      output -
    • toJson

      public static void toJson(Object obj, JSONSerializationConfig config, Writer output)
      Parameters:
      obj -
      config -
      output -
    • fromJson

      public static <T> T fromJson(String json, Class<? extends T> targetType)
      Type Parameters:
      T -
      Parameters:
      json -
      targetType -
      Returns:
      See Also:
    • fromJson

      public static <T> T fromJson(String json, T defaultIfNull, Class<? extends T> targetType)
      Type Parameters:
      T -
      Parameters:
      json -
      defaultIfNull -
      targetType -
      Returns:
      See Also:
    • fromJson

      public static <T> T fromJson(String json, JSONDeserializationConfig config, Class<? extends T> targetType)
      Type Parameters:
      T -
      Parameters:
      json -
      config -
      targetType -
      Returns:
      See Also:
    • fromJson

      public static <T> T fromJson(File json, Class<? extends T> targetType)
      Type Parameters:
      T -
      Parameters:
      json -
      targetType -
      Returns:
      See Also:
    • fromJson

      public static <T> T fromJson(File json, JSONDeserializationConfig config, Class<? extends T> targetType)
      Type Parameters:
      T -
      Parameters:
      json -
      config -
      targetType -
      Returns:
      See Also:
    • fromJson

      public static <T> T fromJson(InputStream json, Class<? extends T> targetType)
      Type Parameters:
      T -
      Parameters:
      json -
      targetType -
      Returns:
      See Also:
    • fromJson

      public static <T> T fromJson(InputStream json, JSONDeserializationConfig config, Class<? extends T> targetType)
      Type Parameters:
      T -
      Parameters:
      json -
      config -
      targetType -
      Returns:
      See Also:
    • fromJson

      public static <T> T fromJson(Reader json, Class<? extends T> targetType)
      Type Parameters:
      T -
      Parameters:
      json -
      targetType -
      Returns:
      See Also:
    • fromJson

      public static <T> T fromJson(Reader json, JSONDeserializationConfig config, Class<? extends T> targetType)
      Type Parameters:
      T -
      Parameters:
      json -
      config -
      targetType -
      Returns:
      See Also:
    • fromJson

      public static <T> T fromJson(String json, int fromIndex, int toIndex, Class<? extends T> targetType)
      Type Parameters:
      T -
      Parameters:
      json -
      fromIndex -
      toIndex -
      targetType -
      Returns:
      See Also:
    • fromJson

      public static <T> T fromJson(String json, int fromIndex, int toIndex, JSONDeserializationConfig config, Class<? extends T> targetType)
      Type Parameters:
      T -
      Parameters:
      json -
      fromIndex -
      toIndex -
      config -
      targetType -
      Returns:
      See Also:
    • fromJson

      public static <T> T fromJson(String json, com.landawn.abacus.type.Type<? extends T> targetType)
      Type Parameters:
      T -
      Parameters:
      json -
      targetType - can be the Type of Bean/Array/Collection/Map.
      Returns:
      See Also:
    • fromJson

      public static <T> T fromJson(String json, T defaultIfNull, com.landawn.abacus.type.Type<? extends T> targetType)
      Type Parameters:
      T -
      Parameters:
      json -
      defaultIfNull -
      targetType -
      Returns:
      See Also:
    • fromJson

      public static <T> T fromJson(String json, JSONDeserializationConfig config, com.landawn.abacus.type.Type<? extends T> targetType)
      Type Parameters:
      T -
      Parameters:
      json -
      config -
      targetType - can be the Type of Bean/Array/Collection/Map.
      Returns:
      See Also:
    • fromJson

      public static <T> T fromJson(File json, com.landawn.abacus.type.Type<? extends T> targetType)
      Type Parameters:
      T -
      Parameters:
      json -
      targetType - can be the Type of Bean/Array/Collection/Map.
      Returns:
      See Also:
    • fromJson

      public static <T> T fromJson(File json, JSONDeserializationConfig config, com.landawn.abacus.type.Type<? extends T> targetType)
      Type Parameters:
      T -
      Parameters:
      json -
      config -
      targetType - can be the Type of Bean/Array/Collection/Map.
      Returns:
      See Also:
    • fromJson

      public static <T> T fromJson(InputStream json, com.landawn.abacus.type.Type<? extends T> targetType)
      Type Parameters:
      T -
      Parameters:
      json -
      targetType - can be the Type of Bean/Array/Collection/Map.
      Returns:
      See Also:
    • fromJson

      public static <T> T fromJson(InputStream json, JSONDeserializationConfig config, com.landawn.abacus.type.Type<? extends T> targetType)
      Type Parameters:
      T -
      Parameters:
      json -
      config -
      targetType - can be the Type of Bean/Array/Collection/Map.
      Returns:
      See Also:
    • fromJson

      public static <T> T fromJson(Reader json, com.landawn.abacus.type.Type<? extends T> targetType)
      Type Parameters:
      T -
      Parameters:
      json -
      targetType - can be the Type of Bean/Array/Collection/Map.
      Returns:
      See Also:
    • fromJson

      public static <T> T fromJson(Reader json, JSONDeserializationConfig config, com.landawn.abacus.type.Type<? extends T> targetType)
      Type Parameters:
      T -
      Parameters:
      json -
      config -
      targetType - can be the Type of Bean/Array/Collection/Map.
      Returns:
      See Also:
    • fromJson

      public static <T> T fromJson(String json, int fromIndex, int toIndex, com.landawn.abacus.type.Type<? extends T> targetType)
      Type Parameters:
      T -
      Parameters:
      json -
      fromIndex -
      toIndex -
      targetType - can be the Type of Bean/Array/Collection/Map.
      Returns:
      See Also:
    • fromJson

      public static <T> T fromJson(String json, int fromIndex, int toIndex, JSONDeserializationConfig config, com.landawn.abacus.type.Type<? extends T> targetType)
      Type Parameters:
      T -
      Parameters:
      json -
      fromIndex -
      toIndex -
      config -
      targetType - can be the Type of Bean/Array/Collection/Map.
      Returns:
      See Also:
    • streamJson

      public static <T> CheckedStream<T,IOException> streamJson(String jsonArray, Class<? extends T> elementClass)
      Type Parameters:
      T -
      Parameters:
      jsonArray - must be a json array/list.
      elementClass - Only Bean/Map/Collection/Array/DataSet element types are supported at present.
      Returns:
    • streamJson

      public static <T> CheckedStream<T,IOException> streamJson(String jsonArray, JSONDeserializationConfig config, Class<? extends T> elementClass)
      Type Parameters:
      T -
      Parameters:
      jsonArray - must be a json array/list.
      config -
      elementClass - Only Bean/Map/Collection/Array/DataSet element types are supported at present.
      Returns:
    • streamJson

      public static <T> CheckedStream<T,IOException> streamJson(File jsonArray, Class<? extends T> elementClass)
      Type Parameters:
      T -
      Parameters:
      jsonArray - must be a json array/list.
      elementClass - Only Bean/Map/Collection/Array/DataSet element types are supported at present.
      Returns:
    • streamJson

      public static <T> CheckedStream<T,IOException> streamJson(File jsonArray, JSONDeserializationConfig config, Class<? extends T> elementClass)
      Type Parameters:
      T -
      Parameters:
      jsonArray - must be a json array/list.
      config -
      elementClass - Only Bean/Map/Collection/Array/DataSet element types are supported at present.
      Returns:
    • streamJson

      public static <T> CheckedStream<T,IOException> streamJson(InputStream jsonArray, Class<? extends T> elementClass)
      Type Parameters:
      T -
      Parameters:
      jsonArray - must be a json array/list.
      elementClass - Only Bean/Map/Collection/Array/DataSet element types are supported at present.
      Returns:
    • streamJson

      public static <T> CheckedStream<T,IOException> streamJson(InputStream jsonArray, boolean closeInputStreamWhenStreamIsClosed, Class<? extends T> elementClass)
      Type Parameters:
      T -
      Parameters:
      jsonArray - must be a json array/list.
      closeInputStreamWhenStreamIsClosed -
      elementClass - Only Bean/Map/Collection/Array/DataSet element types are supported at present.
      Returns:
    • streamJson

      public static <T> CheckedStream<T,IOException> streamJson(InputStream jsonArray, JSONDeserializationConfig config, boolean closeInputStreamWhenStreamIsClosed, Class<? extends T> elementClass)
      Type Parameters:
      T -
      Parameters:
      jsonArray - must be a json array/list.
      config -
      closeInputStreamWhenStreamIsClosed -
      elementClass - Only Bean/Map/Collection/Array/DataSet element types are supported at present.
      Returns:
    • streamJson

      public static <T> CheckedStream<T,IOException> streamJson(Reader jsonArray, Class<? extends T> elementClass)
      Type Parameters:
      T -
      Parameters:
      jsonArray - must be a json array/list.
      elementClass - Only Bean/Map/Collection/Array/DataSet element types are supported at present.
      Returns:
    • streamJson

      public static <T> CheckedStream<T,IOException> streamJson(Reader jsonArray, boolean closeReaderWhenStreamIsClosed, Class<? extends T> elementClass)
      Type Parameters:
      T -
      Parameters:
      jsonArray - must be a json array/list.
      closeReaderWhenStreamIsClosed -
      elementClass - Only Bean/Map/Collection/Array/DataSet element types are supported at present.
      Returns:
    • streamJson

      public static <T> CheckedStream<T,IOException> streamJson(Reader jsonArray, JSONDeserializationConfig config, boolean closeReaderWhenStreamIsClosed, Class<? extends T> elementClass)
      Type Parameters:
      T -
      Parameters:
      jsonArray - must be a json array/list.
      config -
      closeReaderWhenStreamIsClosed -
      elementClass - Only Bean/Map/Collection/Array/DataSet element types are supported at present.
      Returns:
    • formatJson

      public static String formatJson(String json)
      Parameters:
      json -
      Returns:
      See Also:
    • formatJson

      public static String formatJson(String json, JSONSerializationConfig config)
      Parameters:
      json -
      config -
      Returns:
      See Also:
    • formatJson

      public static String formatJson(String json, Class<?> transferType)
      Parameters:
      json -
      transferType -
      Returns:
      See Also:
    • formatJson

      public static String formatJson(String json, JSONSerializationConfig config, Class<?> transferType)
      Parameters:
      json -
      config -
      transferType -
      Returns:
      See Also:
    • formatJson

      public static String formatJson(String json, com.landawn.abacus.type.Type<?> transferType)
      Parameters:
      json -
      transferType -
      Returns:
      See Also:
    • formatJson

      public static String formatJson(String json, JSONSerializationConfig config, com.landawn.abacus.type.Type<?> transferType)
      Parameters:
      json -
      config -
      transferType -
      Returns:
      See Also:
    • toXml

      public static String toXml(Object obj)
      Converts the given object into an XML string.
      Parameters:
      obj - the object to be converted into an XML string.
      Returns:
      an XML string representation of the given object.
    • toXml

      public static String toXml(Object obj, boolean prettyFormat)
      Converts the given object into an XML string with optional pretty formatting.
      Parameters:
      obj - the object to be converted into an XML string.
      prettyFormat - a boolean flag that indicates whether the XML string should be pretty formatted or not.
      Returns:
      an XML string representation of the given object. If prettyFormat is true, the XML string is formatted with indents and line breaks for easier reading.
    • toXml

      public static String toXml(Object obj, XMLSerializationConfig config)
      Parameters:
      obj -
      config -
      Returns:
    • toXml

      public static void toXml(Object obj, File output)
      Parameters:
      obj -
      output -
    • toXml

      public static void toXml(Object obj, XMLSerializationConfig config, File output)
      Parameters:
      obj -
      config -
      output -
    • toXml

      public static void toXml(Object obj, OutputStream output)
      Parameters:
      obj -
      output -
    • toXml

      public static void toXml(Object obj, XMLSerializationConfig config, OutputStream output)
      Parameters:
      obj -
      config -
      output -
    • toXml

      public static void toXml(Object obj, Writer output)
      Parameters:
      obj -
      output -
    • toXml

      public static void toXml(Object obj, XMLSerializationConfig config, Writer output)
      Parameters:
      obj -
      config -
      output -
    • fromXml

      public static <T> T fromXml(String xml, Class<? extends T> targetType)
      Type Parameters:
      T -
      Parameters:
      xml -
      targetType -
      Returns:
      See Also:
    • fromXml

      public static <T> T fromXml(String xml, XMLDeserializationConfig config, Class<? extends T> targetType)
      Type Parameters:
      T -
      Parameters:
      xml -
      config -
      targetType -
      Returns:
      See Also:
    • fromXml

      public static <T> T fromXml(File xml, Class<? extends T> targetType)
      Type Parameters:
      T -
      Parameters:
      xml -
      targetType -
      Returns:
      See Also:
    • fromXml

      public static <T> T fromXml(File xml, XMLDeserializationConfig config, Class<? extends T> targetType)
      Type Parameters:
      T -
      Parameters:
      xml -
      config -
      targetType -
      Returns:
      See Also:
    • fromXml

      public static <T> T fromXml(InputStream xml, Class<? extends T> targetType)
      Type Parameters:
      T -
      Parameters:
      xml -
      targetType -
      Returns:
      See Also:
    • fromXml

      public static <T> T fromXml(InputStream xml, XMLDeserializationConfig config, Class<? extends T> targetType)
      Type Parameters:
      T -
      Parameters:
      xml -
      config -
      targetType -
      Returns:
      See Also:
    • fromXml

      public static <T> T fromXml(Reader xml, Class<? extends T> targetType)
      Type Parameters:
      T -
      Parameters:
      xml -
      targetType -
      Returns:
      See Also:
    • fromXml

      public static <T> T fromXml(Reader xml, XMLDeserializationConfig config, Class<? extends T> targetType)
      Type Parameters:
      T -
      Parameters:
      xml -
      config -
      targetType -
      Returns:
      See Also:
    • fromXml

      public static <T> T fromXml(String xml, com.landawn.abacus.type.Type<? extends T> targetType)
      Type Parameters:
      T -
      Parameters:
      xml -
      targetType - can be the Type of Bean/Array/Collection/Map.
      Returns:
      See Also:
    • fromXml

      public static <T> T fromXml(String xml, XMLDeserializationConfig config, com.landawn.abacus.type.Type<? extends T> targetType)
      Type Parameters:
      T -
      Parameters:
      xml -
      config -
      targetType - can be the Type of Bean/Array/Collection/Map.
      Returns:
      See Also:
    • fromXml

      public static <T> T fromXml(File xml, com.landawn.abacus.type.Type<? extends T> targetType)
      Type Parameters:
      T -
      Parameters:
      xml -
      targetType - can be the Type of Bean/Array/Collection/Map.
      Returns:
      See Also:
    • fromXml

      public static <T> T fromXml(File xml, XMLDeserializationConfig config, com.landawn.abacus.type.Type<? extends T> targetType)
      Type Parameters:
      T -
      Parameters:
      xml -
      config -
      targetType - can be the Type of Bean/Array/Collection/Map.
      Returns:
      See Also:
    • fromXml

      public static <T> T fromXml(InputStream xml, com.landawn.abacus.type.Type<? extends T> targetType)
      Type Parameters:
      T -
      Parameters:
      xml -
      targetType - can be the Type of Bean/Array/Collection/Map.
      Returns:
      See Also:
    • fromXml

      public static <T> T fromXml(InputStream xml, XMLDeserializationConfig config, com.landawn.abacus.type.Type<? extends T> targetType)
      Type Parameters:
      T -
      Parameters:
      xml -
      config -
      targetType - can be the Type of Bean/Array/Collection/Map.
      Returns:
      See Also:
    • fromXml

      public static <T> T fromXml(Reader xml, com.landawn.abacus.type.Type<? extends T> targetType)
      Type Parameters:
      T -
      Parameters:
      xml -
      targetType - can be the Type of Bean/Array/Collection/Map.
      Returns:
      See Also:
    • fromXml

      public static <T> T fromXml(Reader xml, XMLDeserializationConfig config, com.landawn.abacus.type.Type<? extends T> targetType)
      Type Parameters:
      T -
      Parameters:
      xml -
      config -
      targetType - can be the Type of Bean/Array/Collection/Map.
      Returns:
      See Also:
    • formatXml

      public static String formatXml(String xml)
      Parameters:
      xml -
      Returns:
      See Also:
    • formatXml

      public static String formatXml(String xml, XMLSerializationConfig config)
      Parameters:
      xml -
      config -
      Returns:
      See Also:
    • formatXml

      public static String formatXml(String xml, Class<?> transferType)
      Parameters:
      xml -
      transferType -
      Returns:
      See Also:
    • formatXml

      public static String formatXml(String xml, XMLSerializationConfig config, Class<?> transferType)
      Parameters:
      xml -
      config -
      transferType -
      Returns:
      See Also:
    • formatXml

      public static String formatXml(String xml, com.landawn.abacus.type.Type<?> transferType)
      Parameters:
      xml -
      transferType -
      Returns:
      See Also:
    • formatXml

      public static String formatXml(String xml, XMLSerializationConfig config, com.landawn.abacus.type.Type<?> transferType)
      Parameters:
      xml -
      config -
      transferType -
      Returns:
      See Also:
    • xml2Json

      public static String xml2Json(String xml)
      Xml 2 JSO.
      Parameters:
      xml -
      Returns:
      See Also:
    • xml2Json

      public static String xml2Json(String xml, Class<?> transferType)
      Xml 2 JSO.
      Parameters:
      xml -
      transferType -
      Returns:
      See Also:
    • json2Xml

      public static String json2Xml(String json)
      Json 2 XML.
      Parameters:
      json -
      Returns:
      See Also:
    • json2Xml

      public static String json2Xml(String json, Class<?> transferType)
      Json 2 XML.
      Parameters:
      json -
      transferType -
      Returns:
      See Also:
    • forEach

      public static <E extends Exception> void forEach(int startInclusive, int endExclusive, Throwables.Runnable<E> action) throws E
      Executes the provided action for each value in the range defined by startInclusive and endExclusive.
      Type Parameters:
      E - the type of the exception that the action may throw
      Parameters:
      startInclusive - the start value of the range (inclusive)
      endExclusive - the end value of the range (exclusive)
      action - the action to be performed for each value in the range
      Throws:
      E - if the action throws an exception
    • forEach

      public static <E extends Exception> void forEach(int startInclusive, int endExclusive, int step, Throwables.Runnable<E> action) throws IllegalArgumentException, E
      Executes the provided action for each value in the range defined by startInclusive, endExclusive and step.
      Type Parameters:
      E - the type of the exception that the action may throw
      Parameters:
      startInclusive - the start value of the range (inclusive)
      endExclusive - the end value of the range (exclusive)
      step - the increment value for each iteration in the range
      action - the action to be performed for each value in the range
      Throws:
      IllegalArgumentException - if the step is less than 1
      E - if the action throws an exception
    • forEach

      public static <E extends Exception> void forEach(int startInclusive, int endExclusive, Throwables.IntConsumer<E> action) throws E
      Type Parameters:
      E -
      Parameters:
      startInclusive -
      endExclusive -
      action -
      Throws:
      E - the e
    • forEach

      public static <E extends Exception> void forEach(int startInclusive, int endExclusive, int step, Throwables.IntConsumer<E> action) throws E
      Type Parameters:
      E -
      Parameters:
      startInclusive -
      endExclusive -
      step -
      action -
      Throws:
      E - the e
    • forEach

      public static <T, E extends Exception> void forEach(int startInclusive, int endExclusive, T a, Throwables.IntObjConsumer<? super T,E> action) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      startInclusive -
      endExclusive -
      a -
      action -
      Throws:
      E - the e
    • forEach

      public static <T, E extends Exception> void forEach(int startInclusive, int endExclusive, int step, T a, Throwables.IntObjConsumer<? super T,E> action) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      startInclusive -
      endExclusive -
      step -
      a -
      action -
      Throws:
      E - the e
    • forEach

      public static <T, E extends Exception> void forEach(T[] a, Throwables.Consumer<? super T,E> action) throws IndexOutOfBoundsException, E
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      action -
      Throws:
      IndexOutOfBoundsException
      E - the e
    • forEach

      public static <T, E extends Exception> void forEach(T[] a, int fromIndex, int toIndex, Throwables.Consumer<? super T,E> action) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      fromIndex -
      toIndex -
      action -
      Throws:
      E - the e
    • forEach

      public static <T, E extends Exception> void forEach(Iterable<? extends T> c, Throwables.Consumer<? super T,E> action) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      action -
      Throws:
      E - the e
    • forEach

      public static <T, E extends Exception> void forEach(Iterator<? extends T> iter, Throwables.Consumer<? super T,E> action) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      iter -
      action -
      Throws:
      E - the e
    • forEach

      public static <T, E extends Exception> void forEach(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.Consumer<? super T,E> action) throws IndexOutOfBoundsException, E
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation. Note: This is NOT a replacement of traditional for loop statement. The traditional for loop is still recommended in regular programming.
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      fromIndex -
      toIndex -
      action -
      Throws:
      IndexOutOfBoundsException
      E - the e
    • forEach

      public static <K, V, E extends Exception> void forEach(Map<K,V> map, Throwables.Consumer<? super Map.Entry<K,V>,E> action) throws E
      Type Parameters:
      K -
      V -
      E -
      Parameters:
      map -
      action -
      Throws:
      E - the e
    • forEach

      public static <K, V, E extends Exception> void forEach(Map<K,V> map, Throwables.BiConsumer<? super K,? super V,E> action) throws E
      Type Parameters:
      K -
      V -
      E -
      Parameters:
      map -
      action -
      Throws:
      E - the e
    • forEach

      public static <T, E extends Exception> void forEach(Iterable<? extends T> c, Throwables.Consumer<? super T,E> elementConsumer, int processThreadNum)
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      elementConsumer -
      processThreadNum -
    • forEach

      public static <T, E extends Exception> void forEach(Iterable<? extends T> c, Throwables.Consumer<? super T,E> elementConsumer, int processThreadNum, Executor executor)
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      elementConsumer -
      processThreadNum -
      executor -
    • forEach

      public static <T, E extends Exception> void forEach(Iterator<? extends T> iter, Throwables.Consumer<? super T,E> elementConsumer, int processThreadNum)
      Type Parameters:
      T -
      E -
      Parameters:
      iter -
      elementConsumer -
      processThreadNum -
    • forEach

      public static <T, E extends Exception> void forEach(Iterator<? extends T> iter, Throwables.Consumer<? super T,E> elementConsumer, int processThreadNum, Executor executor)
      Type Parameters:
      T -
      E -
      Parameters:
      iter -
      elementConsumer -
      processThreadNum -
      executor -
    • forEach

      public static <T, U, E extends Exception, E2 extends Exception> void forEach(T[] a, Throwables.Function<? super T,? extends Iterable<U>,E> flatMapper, Throwables.BiConsumer<? super T,? super U,E2> action) throws E, E2
      Type Parameters:
      T -
      U -
      E -
      E2 -
      Parameters:
      a -
      flatMapper -
      action -
      Throws:
      E - the e
      E2 - the e2
    • forEach

      public static <T, U, E extends Exception, E2 extends Exception> void forEach(Iterable<? extends T> c, Throwables.Function<? super T,? extends Iterable<U>,E> flatMapper, Throwables.BiConsumer<? super T,? super U,E2> action) throws E, E2
      Type Parameters:
      T -
      U -
      E -
      E2 -
      Parameters:
      c -
      flatMapper -
      action -
      Throws:
      E - the e
      E2 - the e2
    • forEach

      public static <T, U, E extends Exception, E2 extends Exception> void forEach(Iterator<? extends T> iter, Throwables.Function<? super T,? extends Iterable<U>,E> flatMapper, Throwables.BiConsumer<? super T,? super U,E2> action) throws E, E2
      Type Parameters:
      T -
      U -
      E -
      E2 -
      Parameters:
      iter -
      flatMapper -
      action -
      Throws:
      E - the e
      E2 - the e2
    • forEach

      public static <T, T2, T3, E extends Exception, E2 extends Exception, E3 extends Exception> void forEach(T[] a, Throwables.Function<? super T,? extends Iterable<T2>,E> flatMapper, Throwables.Function<? super T2,? extends Iterable<T3>,E2> flatMapper2, Throwables.TriConsumer<? super T,? super T2,? super T3,E3> action) throws E, E2, E3
      Type Parameters:
      T -
      T2 -
      T3 -
      E -
      E2 -
      E3 -
      Parameters:
      a -
      flatMapper -
      flatMapper2 -
      action -
      Throws:
      E - the e
      E2 - the e2
      E3 - the e3
    • forEach

      public static <T, T2, T3, E extends Exception, E2 extends Exception, E3 extends Exception> void forEach(Iterable<? extends T> c, Throwables.Function<? super T,? extends Iterable<T2>,E> flatMapper, Throwables.Function<? super T2,? extends Iterable<T3>,E2> flatMapper2, Throwables.TriConsumer<? super T,? super T2,? super T3,E3> action) throws E, E2, E3
      Type Parameters:
      T -
      T2 -
      T3 -
      E -
      E2 -
      E3 -
      Parameters:
      c -
      flatMapper -
      flatMapper2 -
      action -
      Throws:
      E - the e
      E2 - the e2
      E3 - the e3
    • forEach

      public static <T, T2, T3, E extends Exception, E2 extends Exception, E3 extends Exception> void forEach(Iterator<? extends T> iter, Throwables.Function<? super T,? extends Iterable<T2>,E> flatMapper, Throwables.Function<? super T2,? extends Iterable<T3>,E2> flatMapper2, Throwables.TriConsumer<? super T,? super T2,? super T3,E3> action) throws E, E2, E3
      Type Parameters:
      T -
      T2 -
      T3 -
      E -
      E2 -
      E3 -
      Parameters:
      iter -
      flatMapper -
      flatMapper2 -
      action -
      Throws:
      E - the e
      E2 - the e2
      E3 - the e3
    • forEach

      public static <A, B, E extends Exception> void forEach(A[] a, B[] b, Throwables.BiConsumer<? super A,? super B,E> action) throws E
      Type Parameters:
      A -
      B -
      E -
      Parameters:
      a -
      b -
      action -
      Throws:
      E - the e
    • forEach

      public static <A, B, E extends Exception> void forEach(Iterable<A> a, Iterable<B> b, Throwables.BiConsumer<? super A,? super B,E> action) throws E
      Type Parameters:
      A -
      B -
      E -
      Parameters:
      a -
      b -
      action -
      Throws:
      E - the e
    • forEach

      public static <A, B, E extends Exception> void forEach(Iterator<A> a, Iterator<B> b, Throwables.BiConsumer<? super A,? super B,E> action) throws E
      Type Parameters:
      A -
      B -
      E -
      Parameters:
      a -
      b -
      action -
      Throws:
      E - the e
    • forEach

      public static <A, B, C, E extends Exception> void forEach(A[] a, B[] b, C[] c, Throwables.TriConsumer<? super A,? super B,? super C,E> action) throws E
      Type Parameters:
      A -
      B -
      C -
      E -
      Parameters:
      a -
      b -
      c -
      action -
      Throws:
      E - the e
    • forEach

      public static <A, B, C, E extends Exception> void forEach(Iterable<A> a, Iterable<B> b, Iterable<C> c, Throwables.TriConsumer<? super A,? super B,? super C,E> action) throws E
      Type Parameters:
      A -
      B -
      C -
      E -
      Parameters:
      a -
      b -
      c -
      action -
      Throws:
      E - the e
    • forEach

      public static <A, B, C, E extends Exception> void forEach(Iterator<A> a, Iterator<B> b, Iterator<C> c, Throwables.TriConsumer<? super A,? super B,? super C,E> action) throws E
      Type Parameters:
      A -
      B -
      C -
      E -
      Parameters:
      a -
      b -
      c -
      action -
      Throws:
      E - the e
    • forEach

      public static <A, B, E extends Exception> void forEach(A[] a, B[] b, A valueForNoneA, B valueForNoneB, Throwables.BiConsumer<? super A,? super B,E> action) throws E
      Type Parameters:
      A -
      B -
      E -
      Parameters:
      a -
      b -
      valueForNoneA -
      valueForNoneB -
      action -
      Throws:
      E - the e
    • forEach

      public static <A, B, E extends Exception> void forEach(Iterable<A> a, Iterable<B> b, A valueForNoneA, B valueForNoneB, Throwables.BiConsumer<? super A,? super B,E> action) throws E
      Type Parameters:
      A -
      B -
      E -
      Parameters:
      a -
      b -
      valueForNoneA -
      valueForNoneB -
      action -
      Throws:
      E - the e
    • forEach

      public static <A, B, E extends Exception> void forEach(Iterator<A> a, Iterator<B> b, A valueForNoneA, B valueForNoneB, Throwables.BiConsumer<? super A,? super B,E> action) throws E
      Type Parameters:
      A -
      B -
      E -
      Parameters:
      a -
      b -
      valueForNoneA -
      valueForNoneB -
      action -
      Throws:
      E - the e
    • forEach

      public static <A, B, C, E extends Exception> void forEach(A[] a, B[] b, C[] c, A valueForNoneA, B valueForNoneB, C valueForNoneC, Throwables.TriConsumer<? super A,? super B,? super C,E> action) throws E
      Type Parameters:
      A -
      B -
      C -
      E -
      Parameters:
      a -
      b -
      c -
      valueForNoneA -
      valueForNoneB -
      valueForNoneC -
      action -
      Throws:
      E - the e
    • forEach

      public static <A, B, C, E extends Exception> void forEach(Iterable<A> a, Iterable<B> b, Iterable<C> c, A valueForNoneA, B valueForNoneB, C valueForNoneC, Throwables.TriConsumer<? super A,? super B,? super C,E> action) throws E
      Type Parameters:
      A -
      B -
      C -
      E -
      Parameters:
      a -
      b -
      c -
      valueForNoneA -
      valueForNoneB -
      valueForNoneC -
      action -
      Throws:
      E - the e
    • forEach

      public static <A, B, C, E extends Exception> void forEach(Iterator<A> a, Iterator<B> b, Iterator<C> c, A valueForNoneA, B valueForNoneB, C valueForNoneC, Throwables.TriConsumer<? super A,? super B,? super C,E> action) throws E
      Type Parameters:
      A -
      B -
      C -
      E -
      Parameters:
      a -
      b -
      c -
      valueForNoneA -
      valueForNoneB -
      valueForNoneC -
      action -
      Throws:
      E - the e
    • forEachNonNull

      public static <T, E extends Exception> void forEachNonNull(T[] a, Throwables.Consumer<? super T,E> action) throws E
      For each non null.
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      action -
      Throws:
      E - the e
    • forEachNonNull

      public static <T, E extends Exception> void forEachNonNull(Iterable<? extends T> c, Throwables.Consumer<? super T,E> action) throws E
      For each non null.
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      action -
      Throws:
      E - the e
    • forEachNonNull

      public static <T, U, E extends Exception, E2 extends Exception> void forEachNonNull(T[] a, Throwables.Function<? super T,? extends Iterable<U>,E> flatMapper, Throwables.BiConsumer<? super T,? super U,E2> action) throws E, E2
      For each non null.
      Type Parameters:
      T -
      U -
      E -
      E2 -
      Parameters:
      a -
      flatMapper -
      action -
      Throws:
      E - the e
      E2 - the e2
    • forEachNonNull

      public static <T, U, E extends Exception, E2 extends Exception> void forEachNonNull(Iterable<? extends T> c, Throwables.Function<? super T,? extends Iterable<U>,E> flatMapper, Throwables.BiConsumer<? super T,? super U,E2> action) throws E, E2
      For each non null.
      Type Parameters:
      T -
      U -
      E -
      E2 -
      Parameters:
      c -
      flatMapper -
      action -
      Throws:
      E - the e
      E2 - the e2
    • forEachNonNull

      public static <T, U, E extends Exception, E2 extends Exception> void forEachNonNull(Iterator<? extends T> iter, Throwables.Function<? super T,? extends Iterable<U>,E> flatMapper, Throwables.BiConsumer<? super T,? super U,E2> action) throws E, E2
      For each non null.
      Type Parameters:
      T -
      U -
      E -
      E2 -
      Parameters:
      iter -
      flatMapper -
      action -
      Throws:
      E - the e
      E2 - the e2
    • forEachNonNull

      public static <T, T2, T3, E extends Exception, E2 extends Exception, E3 extends Exception> void forEachNonNull(T[] a, Throwables.Function<? super T,? extends Iterable<T2>,E> flatMapper, Throwables.Function<? super T2,? extends Iterable<T3>,E2> flatMapper2, Throwables.TriConsumer<? super T,? super T2,? super T3,E3> action) throws E, E2, E3
      For each non null.
      Type Parameters:
      T -
      T2 -
      T3 -
      E -
      E2 -
      E3 -
      Parameters:
      a -
      flatMapper -
      flatMapper2 -
      action -
      Throws:
      E - the e
      E2 - the e2
      E3 - the e3
    • forEachNonNull

      public static <T, T2, T3, E extends Exception, E2 extends Exception, E3 extends Exception> void forEachNonNull(Iterable<? extends T> c, Throwables.Function<? super T,? extends Iterable<T2>,E> flatMapper, Throwables.Function<? super T2,? extends Iterable<T3>,E2> flatMapper2, Throwables.TriConsumer<? super T,? super T2,? super T3,E3> action) throws E, E2, E3
      For each non null.
      Type Parameters:
      T -
      T2 -
      T3 -
      E -
      E2 -
      E3 -
      Parameters:
      c -
      flatMapper -
      flatMapper2 -
      action -
      Throws:
      E - the e
      E2 - the e2
      E3 - the e3
    • forEachNonNull

      public static <T, T2, T3, E extends Exception, E2 extends Exception, E3 extends Exception> void forEachNonNull(Iterator<? extends T> iter, Throwables.Function<? super T,? extends Iterable<T2>,E> flatMapper, Throwables.Function<? super T2,? extends Iterable<T3>,E2> flatMapper2, Throwables.TriConsumer<? super T,? super T2,? super T3,E3> action) throws E, E2, E3
      For each non null.
      Type Parameters:
      T -
      T2 -
      T3 -
      E -
      E2 -
      E3 -
      Parameters:
      iter -
      flatMapper -
      flatMapper2 -
      action -
      Throws:
      E - the e
      E2 - the e2
      E3 - the e3
    • forEachIndexed

      public static <T, E extends Exception> void forEachIndexed(T[] a, Throwables.IntObjConsumer<? super T,E> action) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      action -
      Throws:
      E - the e
    • forEachIndexed

      public static <T, E extends Exception> void forEachIndexed(T[] a, int fromIndex, int toIndex, Throwables.IntObjConsumer<? super T,E> action) throws IndexOutOfBoundsException, E
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      fromIndex -
      toIndex -
      action -
      Throws:
      IndexOutOfBoundsException
      E - the e
    • forEachIndexed

      public static <T, E extends Exception> void forEachIndexed(Iterable<? extends T> c, Throwables.IntObjConsumer<? super T,E> action) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      action -
      Throws:
      E - the e
    • forEachIndexed

      public static <T, E extends Exception> void forEachIndexed(Iterator<? extends T> iter, Throwables.IntObjConsumer<? super T,E> action) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      iter -
      action -
      Throws:
      E - the e
    • forEachIndexed

      public static <T, E extends Exception> void forEachIndexed(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.IntObjConsumer<? super T,E> action) throws IndexOutOfBoundsException, E
      Mostly it's designed for one-step operation to complete the operation in one step. java.util.stream.Stream is preferred for multiple phases operation. Note: This is NOT a replacement of traditional for loop statement. The traditional for loop is still recommended in regular programming.
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      fromIndex -
      toIndex -
      action -
      Throws:
      IndexOutOfBoundsException
      E - the e
    • forEachIndexed

      public static <K, V, E extends Exception> void forEachIndexed(Map<K,V> map, Throwables.IntObjConsumer<? super Map.Entry<K,V>,E> action) throws E
      Type Parameters:
      K -
      V -
      E -
      Parameters:
      map -
      action -
      Throws:
      E - the e
    • forEachIndexed

      public static <K, V, E extends Exception> void forEachIndexed(Map<K,V> map, Throwables.IntBiObjConsumer<? super K,? super V,E> action) throws E
      Type Parameters:
      K -
      V -
      E -
      Parameters:
      map -
      action -
      Throws:
      E - the e
    • forEachIndexed

      public static <T, E extends Exception> void forEachIndexed(Iterable<? extends T> c, Throwables.IntObjConsumer<? super T,E> elementConsumer, int processThreadNum)
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      elementConsumer -
      processThreadNum -
      See Also:
    • forEachIndexed

      public static <T, E extends Exception> void forEachIndexed(Iterable<? extends T> c, Throwables.IntObjConsumer<? super T,E> elementConsumer, int processThreadNum, Executor executor)
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      elementConsumer -
      processThreadNum -
      executor -
      See Also:
    • forEachIndexed

      public static <T, E extends Exception> void forEachIndexed(Iterator<? extends T> iter, Throwables.IntObjConsumer<? super T,E> elementConsumer, int processThreadNum)
      Type Parameters:
      T -
      E -
      Parameters:
      iter -
      elementConsumer -
      processThreadNum -
      See Also:
    • forEachIndexed

      public static <T, E extends Exception> void forEachIndexed(Iterator<? extends T> iter, Throwables.IntObjConsumer<? super T,E> elementConsumer, int processThreadNum, Executor executor) throws IllegalArgumentException
      Type Parameters:
      T -
      E -
      Parameters:
      iter -
      elementConsumer -
      processThreadNum -
      executor -
      Throws:
      IllegalArgumentException
      See Also:
    • forEachPair

      public static <T, E extends Exception> void forEachPair(T[] a, Throwables.BiConsumer<? super T,? super T,E> action) throws E
      For each pair.
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      action -
      Throws:
      E - the e
    • forEachPair

      public static <T, E extends Exception> void forEachPair(T[] a, int increment, Throwables.BiConsumer<? super T,? super T,E> action) throws E
      For each pair.
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      increment -
      action -
      Throws:
      E - the e
    • forEachPair

      public static <T, E extends Exception> void forEachPair(Iterable<? extends T> c, Throwables.BiConsumer<? super T,? super T,E> action) throws E
      For each pair.
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      action -
      Throws:
      E - the e
    • forEachPair

      public static <T, E extends Exception> void forEachPair(Iterable<? extends T> c, int increment, Throwables.BiConsumer<? super T,? super T,E> action) throws E
      For each pair.
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      increment -
      action -
      Throws:
      E - the e
    • forEachPair

      public static <T, E extends Exception> void forEachPair(Iterator<? extends T> iter, Throwables.BiConsumer<? super T,? super T,E> action) throws E
      For each pair.
      Type Parameters:
      T -
      E -
      Parameters:
      iter -
      action -
      Throws:
      E - the e
    • forEachPair

      public static <T, E extends Exception> void forEachPair(Iterator<? extends T> iter, int increment, Throwables.BiConsumer<? super T,? super T,E> action) throws E
      For each pair.
      Type Parameters:
      T -
      E -
      Parameters:
      iter -
      increment -
      action -
      Throws:
      E - the e
    • forEachTriple

      public static <T, E extends Exception> void forEachTriple(T[] a, Throwables.TriConsumer<? super T,? super T,? super T,E> action) throws E
      For each triple.
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      action -
      Throws:
      E - the e
    • forEachTriple

      public static <T, E extends Exception> void forEachTriple(T[] a, int increment, Throwables.TriConsumer<? super T,? super T,? super T,E> action) throws E
      For each triple.
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      increment -
      action -
      Throws:
      E - the e
    • forEachTriple

      public static <T, E extends Exception> void forEachTriple(Iterable<? extends T> c, Throwables.TriConsumer<? super T,? super T,? super T,E> action) throws E
      For each triple.
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      action -
      Throws:
      E - the e
    • forEachTriple

      public static <T, E extends Exception> void forEachTriple(Iterable<? extends T> c, int increment, Throwables.TriConsumer<? super T,? super T,? super T,E> action) throws E
      For each triple.
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      increment -
      action -
      Throws:
      E - the e
    • forEachTriple

      public static <T, E extends Exception> void forEachTriple(Iterator<? extends T> iter, Throwables.TriConsumer<? super T,? super T,? super T,E> action) throws E
      For each triple.
      Type Parameters:
      T -
      E -
      Parameters:
      iter -
      action -
      Throws:
      E - the e
    • forEachTriple

      public static <T, E extends Exception> void forEachTriple(Iterator<? extends T> iter, int increment, Throwables.TriConsumer<? super T,? super T,? super T,E> action) throws E
      For each triple.
      Type Parameters:
      T -
      E -
      Parameters:
      iter -
      increment -
      action -
      Throws:
      E - the e
    • execute

      public static void execute(Throwables.Runnable<? extends Exception> cmd, int retryTimes, long retryIntervallInMillis, Predicate<? super Exception> retryCondition)
      Executes a command with the possibility of retrying in case of failure.
      Parameters:
      cmd - The command to be executed. It's a functional interface where the execution logic should be implemented.
      retryTimes - The number of times to retry the command execution if it fails.
      retryIntervallInMillis - The interval in milliseconds to wait between each retry.
      retryCondition - The condition to be checked after each execution failure to decide whether to retry or not.
      Throws:
      RuntimeException - if the command execution fails and no more retries are allowed.
      See Also:
    • execute

      public static <R> R execute(Callable<R> cmd, int retryTimes, long retryIntervallInMillis, BiPredicate<? super R,? super Exception> retryCondition)
      Executes a Callable task with the possibility of retrying in case of failure.
      Type Parameters:
      R - The type of the result returned by the Callable task.
      Parameters:
      cmd - The Callable task to be executed.
      retryTimes - The number of times to retry the task execution if it fails.
      retryIntervallInMillis - The interval in milliseconds to wait between each retry.
      Returns:
      The result returned by the Callable task.
      Throws:
      RuntimeException - if the task execution fails and no more retries are allowed.
      See Also:
    • asyncExecute

      public static ContinuableFuture<Void> asyncExecute(Throwables.Runnable<? extends Exception> command)
      Executes the provided command asynchronously.
      Parameters:
      command - The runnable command to be executed asynchronously. It should be an instance of Throwables.Runnable which can throw exceptions.
      Returns:
      A ContinuableFuture representing the result of the asynchronous computation. The computation is void, hence the future returns null upon completion.
      See Also:
    • asyncExecute

      public static ContinuableFuture<Void> asyncExecute(Throwables.Runnable<? extends Exception> command, long delayInMillis)
      Executes the provided command asynchronously after a specified delay.
      Parameters:
      command - The runnable command to be executed asynchronously. It should be an instance of Throwables.Runnable which can throw exceptions.
      delayInMillis - The delay before the command is executed, in milliseconds.
      Returns:
      A ContinuableFuture representing the result of the asynchronous computation. The computation is void, hence the future returns null upon completion.
      See Also:
    • asyncExecute

      public static List<ContinuableFuture<Void>> asyncExecute(List<? extends Throwables.Runnable<? extends Exception>> commands)
      Parameters:
      commands -
      Returns:
      See Also:
    • asyncExecute

      public static List<ContinuableFuture<Void>> asyncExecute(List<? extends Throwables.Runnable<? extends Exception>> commands, Executor executor)
      Parameters:
      commands -
      executor -
      Returns:
      See Also:
    • asyncExecute

      public static <R> ContinuableFuture<R> asyncExecute(Callable<R> command)
      Executes the provided command asynchronously.
      Parameters:
      command - The callable command to be executed asynchronously. It should be an instance of Callable which can return a result and throw exceptions.
      Returns:
      A ContinuableFuture representing the result of the asynchronous computation. The computation's result is the return value of the Callable command.
      See Also:
    • asyncExecute

      public static <R> ContinuableFuture<R> asyncExecute(Callable<R> command, long delayInMillis)
      Executes the provided command asynchronously after a specified delay.
      Parameters:
      command - The callable command to be executed asynchronously. It should be an instance of Callable which can return a result and throw exceptions.
      delayInMillis - The delay before the command is executed, in milliseconds.
      Returns:
      A ContinuableFuture representing the result of the asynchronous computation. The computation's result is the return value of the Callable command.
      See Also:
    • asyncExecute

      public static <R> List<ContinuableFuture<R>> asyncExecute(Collection<? extends Callable<R>> commands)
      Type Parameters:
      R -
      Parameters:
      commands -
      Returns:
      See Also:
    • asyncExecute

      public static <R> List<ContinuableFuture<R>> asyncExecute(Collection<? extends Callable<R>> commands, Executor executor)
      Type Parameters:
      R -
      Parameters:
      commands -
      executor -
      Returns:
      See Also:
    • asyncExecute

      public static ContinuableFuture<Void> asyncExecute(Throwables.Runnable<? extends Exception> cmd, int retryTimes, long retryIntervallInMillisInMillis, Predicate<? super Exception> retryCondition)
      Executes a Runnable task asynchronously with the possibility of retrying in case of failure.
      Parameters:
      cmd - The Runnable task to be executed. It's a functional interface where the execution logic should be implemented.
      retryTimes - The number of times to retry the task execution if it fails.
      Returns:
      A ContinuableFuture representing pending completion of the task, and whose get() method will return null upon completion.
      Throws:
      Exception - if the task execution fails and no more retries are allowed.
      See Also:
    • asyncExecute

      public static <R> ContinuableFuture<R> asyncExecute(Callable<R> cmd, int retryTimes, long retryIntervallInMillisInMillis, BiPredicate<? super R,? super Exception> retryCondition)
      Executes a Runnable task asynchronously with the possibility of retrying in case of failure.
      Parameters:
      cmd - The Runnable task to be executed. It's a functional interface where the execution logic should be implemented.
      retryTimes - The number of times to retry the task execution if it fails.
      retryIntervallInMillisInMillis - The interval in milliseconds to wait between each retry.
      retryCondition - The condition to be met for the task to be retried. It's a functional interface where the condition logic should be implemented.
      Returns:
      A ContinuableFuture representing pending completion of the task, and whose get() method will return R upon completion.
      Throws:
      Exception - if the task execution fails and no more retries are allowed.
      See Also:
    • asyncExecute

      public static ContinuableFuture<Void> asyncExecute(Throwables.Runnable<? extends Exception> command, Executor executor)
      Parameters:
      command -
      executor -
      Returns:
      See Also:
    • asyncExecute

      public static <R> ContinuableFuture<R> asyncExecute(Callable<R> command, Executor executor)
      Type Parameters:
      R -
      Parameters:
      command -
      executor -
      Returns:
      See Also:
    • asynRun

      public static ObjIterator<Void> asynRun(Collection<? extends Throwables.Runnable<? extends Exception>> commands)
      Executes the specified commands/tasks asynchronous and immediately returns an iterator for iterating the result lazily. The first element will be the result of the command/task which is completed first.
      If error happens in one command/task, iteration will be interrupted and error will be thrown. But other commands/tasks won't be impacted or cancelled.
      Parameters:
      commands -
      Returns:
      See Also:
    • asynRun

      public static ObjIterator<Void> asynRun(Collection<? extends Throwables.Runnable<? extends Exception>> commands, Executor executor) throws IllegalArgumentException
      Executes the specified commands/tasks asynchronous and immediately returns an iterator for iterating the result lazily. The first element will be the result of the command/task which is completed first.
      If error happens in one command/task, iteration will be interrupted and error will be thrown. But other commands/tasks won't be impacted or cancelled.
      Parameters:
      commands -
      executor -
      Returns:
      Throws:
      IllegalArgumentException
      See Also:
    • asynCall

      public static <R> ObjIterator<R> asynCall(Collection<? extends Callable<? extends R>> commands)
      Executes the specified commands/tasks asynchronous and immediately returns an iterator for iterating the result lazily. The first element will be the result of the command/task which is completed first.
      If error happens in one command/task, iteration will be interrupted and error will be thrown. But other commands/tasks won't be impacted or cancelled.
      Type Parameters:
      R -
      Parameters:
      commands -
      Returns:
      See Also:
    • asynCall

      public static <R> ObjIterator<R> asynCall(Collection<? extends Callable<? extends R>> commands, Executor executor) throws IllegalArgumentException
      Executes the specified commands/tasks asynchronous and immediately returns an iterator for iterating the result lazily. The first element will be the result of the command/task which is completed first.
      If error happens in one command/task, iteration will be interrupted and error will be thrown. But other commands/tasks won't be impacted or cancelled.
      Type Parameters:
      R -
      Parameters:
      commands -
      executor -
      Returns:
      Throws:
      IllegalArgumentException
      See Also:
    • runInParallel

      public static void runInParallel(Throwables.Runnable<? extends Exception> command, Throwables.Runnable<? extends Exception> command2)
      Executes and complete the input commands in parallel.
      if error happens in one task, cancel will be called for other unfinished tasks.
      Parameters:
      command - to be completed in current thread.
      command2 - to be completed in another thread.
      See Also:
    • runInParallel

      public static void runInParallel(Throwables.Runnable<? extends Exception> command, Throwables.Runnable<? extends Exception> command2, Throwables.Runnable<? extends Exception> command3)
      Executes and complete the input commands in parallel.
      if error happens in one task, cancel will be called for other unfinished tasks.
      Parameters:
      command - to be completed in current thread.
      command2 - to be completed in another thread.
      command3 - to be completed in another thread.
      See Also:
    • runInParallel

      public static void runInParallel(Throwables.Runnable<? extends Exception> command, Throwables.Runnable<? extends Exception> command2, Throwables.Runnable<? extends Exception> command3, Throwables.Runnable<? extends Exception> command4)
      Executes and complete the input commands in parallel.
      if error happens in one task, cancel will be called for other unfinished tasks.
      Parameters:
      command - to be completed in current thread.
      command2 - to be completed in another thread.
      command3 - to be completed in another thread.
      command4 - to be completed in another thread.
      See Also:
    • runInParallel

      public static void runInParallel(Throwables.Runnable<? extends Exception> command, Throwables.Runnable<? extends Exception> command2, Throwables.Runnable<? extends Exception> command3, Throwables.Runnable<? extends Exception> command4, Throwables.Runnable<? extends Exception> command5)
      Executes and complete the input commands in parallel.
      if error happens in one task, cancel will be called for other unfinished tasks.
      Parameters:
      command - to be completed in current thread.
      command2 - to be completed in another thread.
      command3 - to be completed in another thread.
      command4 - to be completed in another thread.
      command5 - to be completed in another thread.
      See Also:
    • runInParallel

      public static void runInParallel(Collection<? extends Throwables.Runnable<? extends Exception>> commands)
      Executes and complete the input commands in parallel.
      if error happens in one task, cancel will be called for other unfinished tasks.
      Parameters:
      commands -
    • runInParallel

      public static void runInParallel(Collection<? extends Throwables.Runnable<? extends Exception>> commands, Executor executor) throws IllegalArgumentException
      Executes and complete the input commands in parallel.
      if error happens in one task, cancel will be called for other unfinished tasks.
      Parameters:
      commands -
      executor -
      Throws:
      IllegalArgumentException
    • callInParallel

      public static <R, R2> Tuple.Tuple2<R,R2> callInParallel(Callable<R> command, Callable<R2> command2)
      Executes and complete the input commands in parallel.
      if error happens in one task, cancel will be called for other unfinished tasks.
      Type Parameters:
      R -
      R2 -
      Parameters:
      command - to be completed in current thread.
      command2 - to be completed in another thread.
      Returns:
      See Also:
    • callInParallel

      public static <R, R2, R3> Tuple.Tuple3<R,R2,R3> callInParallel(Callable<R> command, Callable<R2> command2, Callable<R3> command3)
      Executes and complete the input commands in parallel.
      if error happens in one task, cancel will be called for other unfinished tasks.
      Type Parameters:
      R -
      R2 -
      R3 -
      Parameters:
      command - to be completed in current thread.
      command2 - to be completed in another thread.
      command3 - to be completed in another thread.
      Returns:
      See Also:
    • callInParallel

      public static <R, R2, R3, R4> Tuple.Tuple4<R,R2,R3,R4> callInParallel(Callable<R> command, Callable<R2> command2, Callable<R3> command3, Callable<R4> command4)
      Executes and complete the input commands in parallel.
      if error happens in one task, cancel will be called for other unfinished tasks.
      Type Parameters:
      R -
      R2 -
      R3 -
      R4 -
      Parameters:
      command - to be completed in current thread.
      command2 - to be completed in another thread.
      command3 - to be completed in another thread.
      command4 - to be completed in another thread.
      Returns:
      See Also:
    • callInParallel

      public static <R, R2, R3, R4, R5> Tuple.Tuple5<R,R2,R3,R4,R5> callInParallel(Callable<R> command, Callable<R2> command2, Callable<R3> command3, Callable<R4> command4, Callable<R5> command5)
      Executes and complete the input commands in parallel.
      if error happens in one task, cancel will be called for other unfinished tasks.
      Type Parameters:
      R -
      R2 -
      R3 -
      R4 -
      R5 -
      Parameters:
      command - to be completed in current thread.
      command2 - to be completed in another thread.
      command3 - to be completed in another thread.
      command4 - to be completed in another thread.
      command5 - to be completed in another thread.
      Returns:
      See Also:
    • callInParallel

      public static <R> List<R> callInParallel(Collection<? extends Callable<? extends R>> commands)
      Executes and complete the input commands in parallel.
      if error happens in one task, cancel will be called for other unfinished tasks.
      Type Parameters:
      R -
      Parameters:
      commands -
      Returns:
    • callInParallel

      public static <R> List<R> callInParallel(Collection<? extends Callable<? extends R>> commands, Executor executor) throws IllegalArgumentException
      Executes and complete the input commands in parallel.
      if error happens in one task, cancel will be called for other unfinished tasks.
      Type Parameters:
      R -
      Parameters:
      commands -
      executor -
      Returns:
      Throws:
      IllegalArgumentException
    • runByBatch

      public static <T, E extends Exception> void runByBatch(T[] a, int batchSize, Throwables.Consumer<? super List<T>,E> batchAction) throws IllegalArgumentException, E
      Executes a given action on batches of elements from the provided array.
      The batchAction must not update or cache the input batch elements.
      Type Parameters:
      T - The type of the elements in the array.
      E - The type of the exception that the action may throw.
      Parameters:
      a - The array whose elements are to be processed.
      batchSize - The size of the batches to be processed at a time.
      batchAction - The action to be executed on each batch of elements. The batchAction must not update or cache the input batch elements.
      Throws:
      IllegalArgumentException - if the batchSize is not positive or batchAction is null.
      E - if the batchAction throws an exception.
    • runByBatch

      public static <T, E extends Exception> void runByBatch(Iterable<? extends T> iter, int batchSize, Throwables.Consumer<? super List<T>,E> batchAction) throws IllegalArgumentException, E
      Executes a given action on batches of elements from the provided iterable.
      The batchAction must not update or cache the input batch elements.
      Type Parameters:
      T - The type of the elements in the iterable.
      E - The type of the exception that the action may throw.
      Parameters:
      iter - The iterable whose elements are to be processed.
      batchSize - The size of the batches to be processed at a time.
      batchAction - The action to be executed on each batch of elements. The batchAction must not update or cache the input batch elements.
      Throws:
      IllegalArgumentException - if the batchSize is not positive or batchAction is null.
      E - if the batchAction throws an exception.
    • runByBatch

      public static <T, E extends Exception> void runByBatch(Iterator<? extends T> iter, int batchSize, Throwables.Consumer<? super List<T>,E> batchAction) throws IllegalArgumentException, E
      Executes a given action on batches of elements from the provided iterator.
      The batchAction must not update or cache the input batch elements.
      Type Parameters:
      T - The type of the elements in the iterator.
      E - The type of the exception that the action may throw.
      Parameters:
      iter - The iterator whose elements are to be processed.
      batchSize - The size of the batches to be processed at a time.
      batchAction - The action to be executed on each batch of elements. The batchAction must not update or cache the input batch elements.
      Throws:
      IllegalArgumentException - if the batchSize is not positive or batchAction is null.
      E - if the batchAction throws an exception.
    • runByBatch

      public static <T, E extends Exception, E2 extends Exception> void runByBatch(T[] a, int batchSize, Throwables.IntObjConsumer<? super T,E> elementConsumer, Throwables.Runnable<E2> batchAction) throws IllegalArgumentException, E, E2
      Executes a given action on batches of elements from the provided array.
      The batchAction must not update or cache the input batch elements.
      Type Parameters:
      T - The type of the elements in the array.
      E - The type of the exception that the elementConsumer may throw.
      E2 - The type of the exception that the batchAction may throw.
      Parameters:
      a - The array whose elements are to be processed.
      batchSize - The size of the batches to be processed at a time.
      elementConsumer - The action to be executed on each element. It's a functional interface where the execution logic should be implemented.
      batchAction - The action to be executed on each batch of elements. The batchAction must not update or cache the input batch elements.
      Throws:
      IllegalArgumentException - if the batchSize is not positive or batchAction is null.
      E - if the elementConsumer throws an exception.
      E2 - if the batchAction throws an exception.
    • runByBatch

      public static <T, E extends Exception, E2 extends Exception> void runByBatch(Iterable<? extends T> iter, int batchSize, Throwables.IntObjConsumer<? super T,E> elementConsumer, Throwables.Runnable<E2> batchAction) throws IllegalArgumentException, E, E2
      Executes a given action on batches of elements from the provided iterable.
      The batchAction must not update or cache the input batch elements.
      Type Parameters:
      T - The type of the elements in the iterable.
      E - The type of the exception that the elementConsumer may throw.
      E2 - The type of the exception that the batchAction may throw.
      Parameters:
      iter - The iterable whose elements are to be processed.
      batchSize - The size of the batches to be processed at a time.
      elementConsumer - The action to be executed on each element. It's a functional interface where the execution logic should be implemented.
      batchAction - The action to be executed on each batch of elements. The batchAction must not update or cache the input batch elements.
      Throws:
      IllegalArgumentException - if the batchSize is not positive or batchAction is null.
      E - if the elementConsumer throws an exception.
      E2 - if the batchAction throws an exception.
    • runByBatch

      public static <T, E extends Exception, E2 extends Exception> void runByBatch(Iterator<? extends T> iter, int batchSize, Throwables.IntObjConsumer<? super T,E> elementConsumer, Throwables.Runnable<E2> batchAction) throws IllegalArgumentException, E, E2
      Executes a given action on batches of elements from the provided iterator.
      The batchAction must not update or cache the input batch elements.
      Type Parameters:
      T - The type of the elements in the iterator.
      E - The type of the exception that the elementConsumer may throw.
      E2 - The type of the exception that the batchAction may throw.
      Parameters:
      iter - The iterator whose elements are to be processed.
      batchSize - The size of the batches to be processed at a time.
      elementConsumer - The action to be executed on each element. It's a functional interface where the execution logic should be implemented.
      batchAction - The action to be executed on each batch of elements. The batchAction must not update or cache the input batch elements.
      Throws:
      IllegalArgumentException - if the batchSize is not positive or batchAction is null.
      E - if the elementConsumer throws an exception.
      E2 - if the batchAction throws an exception.
    • callByBatch

      public static <T, R, E extends Exception> List<R> callByBatch(T[] a, int batchSize, Throwables.Function<? super List<T>,R,E> batchAction) throws IllegalArgumentException, E
      Executes a given function on batches of elements from the provided array.
      The batchAction must not update or cache the input batch elements.
      Type Parameters:
      T - The type of the elements in the array.
      R - The type of the result returned by the batchAction function.
      E - The type of the exception that the batchAction may throw.
      Parameters:
      a - The array whose elements are to be processed.
      batchSize - The size of the batches to be processed at a time.
      batchAction - The action to be executed on each batch of elements. The batchAction must not update or cache the input batch elements.
      Returns:
      A list of results returned by the batchAction function for each batch of elements.
      Throws:
      IllegalArgumentException - if the batchSize is not positive or batchAction is null.
      E - if the batchAction throws an exception.
    • callByBatch

      public static <T, R, E extends Exception> List<R> callByBatch(Iterable<? extends T> iter, int batchSize, Throwables.Function<? super List<T>,R,E> batchAction) throws IllegalArgumentException, E
      Executes a given function on batches of elements from the provided iterable.
      The batchAction must not update or cache the input batch elements.
      Type Parameters:
      T - The type of the elements in the iterable.
      R - The type of the result returned by the batchAction function.
      E - The type of the exception that the batchAction may throw.
      Parameters:
      iter - The iterable whose elements are to be processed.
      batchSize - The size of the batches to be processed at a time.
      batchAction - The action to be executed on each batch of elements. The batchAction must not update or cache the input batch elements.
      Returns:
      A list of results returned by the batchAction function for each batch of elements.
      Throws:
      IllegalArgumentException - if the batchSize is not positive or batchAction is null.
      E - if the batchAction throws an exception.
    • callByBatch

      public static <T, R, E extends Exception> List<R> callByBatch(Iterator<? extends T> iter, int batchSize, Throwables.Function<? super List<T>,R,E> batchAction) throws IllegalArgumentException, E
      Executes a given function on batches of elements from the provided iterator.
      The batchAction must not update or cache the input batch elements.
      Type Parameters:
      T - The type of the elements in the iterator.
      R - The type of the result returned by the batchAction function.
      E - The type of the exception that the batchAction may throw.
      Parameters:
      iter - The iterator whose elements are to be processed.
      batchSize - The size of the batches to be processed at a time.
      batchAction - The action to be executed on each batch of elements. The batchAction must not update or cache the input batch elements.
      Returns:
      A list of results returned by the batchAction function for each batch of elements.
      Throws:
      IllegalArgumentException - if the batchSize is not positive or batchAction is null.
      E - if the batchAction throws an exception.
    • callByBatch

      public static <T, R, E extends Exception, E2 extends Exception> List<R> callByBatch(T[] a, int batchSize, Throwables.IntObjConsumer<? super T,E> elementConsumer, Throwables.Callable<? extends R,E2> batchAction) throws IllegalArgumentException, E, E2
      Executes a given consumer on batches of elements from the provided array, then executes a batch action after each batch.
      The batchAction must not update or cache the input batch elements.
      Type Parameters:
      T - The type of the elements in the array.
      R - The type of the result returned by the batchAction function.
      E - The type of the exception that the elementConsumer may throw.
      E2 - The type of the exception that the batchAction may throw.
      Parameters:
      a - The array whose elements are to be processed.
      batchSize - The size of the batches to be processed at a time.
      elementConsumer - The consumer to be executed on each element in the batch. It's a functional interface where the execution logic should be implemented.
      batchAction - The action to be executed on each batch of elements. The batchAction must not update or cache the input batch elements.
      Returns:
      A list of results returned by the batchAction function for each batch of elements.
      Throws:
      IllegalArgumentException - if the batchSize is not positive or batchAction is null.
      E - if the elementConsumer throws an exception.
      E2 - if the batchAction throws an exception.
    • callByBatch

      public static <T, R, E extends Exception, E2 extends Exception> List<R> callByBatch(Iterable<? extends T> iter, int batchSize, Throwables.IntObjConsumer<? super T,E> elementConsumer, Throwables.Callable<? extends R,E2> batchAction) throws IllegalArgumentException, E, E2
      Executes a given consumer on each element from the provided iterable in batches, then executes a batch action after each batch.
      The batchAction must not update or cache the input batch elements.
      Type Parameters:
      T - The type of the elements in the iterable.
      R - The type of the result returned by the batchAction function.
      E - The type of the exception that the elementConsumer may throw.
      E2 - The type of the exception that the batchAction may throw.
      Parameters:
      iter - The iterable whose elements are to be processed.
      batchSize - The size of the batches to be processed at a time.
      elementConsumer - The consumer to be executed on each element in the batch. It's a functional interface where the execution logic should be implemented.
      batchAction - The action to be executed on each batch of elements. The batchAction must not update or cache the input batch elements.
      Throws:
      IllegalArgumentException - if the batchSize is not positive or batchAction is null.
      E - if the elementConsumer throws an exception.
      E2 - if the batchAction throws an exception.
    • callByBatch

      public static <T, R, E extends Exception, E2 extends Exception> List<R> callByBatch(Iterator<? extends T> iter, int batchSize, Throwables.IntObjConsumer<? super T,E> elementConsumer, Throwables.Callable<? extends R,E2> batchAction) throws IllegalArgumentException, E, E2
      Executes a given consumer on each element from the provided iterator in batches, then executes a batch action after each batch.
      The batchAction must not update or cache the input batch elements.
      Type Parameters:
      T - The type of the elements in the iterator.
      R - The type of the result returned by the batchAction function.
      E - The type of the exception that the elementConsumer may throw.
      E2 - The type of the exception that the batchAction may throw.
      Parameters:
      iter - The iterator whose elements are to be processed.
      batchSize - The size of the batches to be processed at a time.
      elementConsumer - The consumer to be executed on each element in the batch. It's a functional interface where the execution logic should be implemented.
      batchAction - The action to be executed on each batch of elements. The batchAction must not update or cache the input batch elements.
      Returns:
      A list of results returned by the batchAction function for each batch of elements.
      Throws:
      IllegalArgumentException - if the batchSize is not positive or batchAction is null.
      E - if the elementConsumer throws an exception.
      E2 - if the batchAction throws an exception.
    • runUninterruptibly

      public static void runUninterruptibly(Throwables.Runnable<InterruptedException> cmd) throws IllegalArgumentException
      Note: Copied from Google Guava under Apache License v2.0

      If a thread is interrupted during such a call, the call continues to block until the result is available or the timeout elapses, and only then re-interrupts the thread.
      Parameters:
      cmd -
      Throws:
      IllegalArgumentException
    • runUninterruptibly

      public static void runUninterruptibly(long timeoutInMillis, Throwables.LongConsumer<InterruptedException> cmd) throws IllegalArgumentException
      Note: Copied from Google Guava under Apache License v2.0

      If a thread is interrupted during such a call, the call continues to block until the result is available or the timeout elapses, and only then re-interrupts the thread.
      Parameters:
      timeoutInMillis -
      cmd -
      Throws:
      IllegalArgumentException
    • runUninterruptibly

      public static void runUninterruptibly(long timeout, @NotNull TimeUnit unit, @NotNull Throwables.BiConsumer<Long,TimeUnit,InterruptedException> cmd) throws IllegalArgumentException
      Note: Copied from Google Guava under Apache License v2.0

      If a thread is interrupted during such a call, the call continues to block until the result is available or the timeout elapses, and only then re-interrupts the thread.
      Parameters:
      timeout -
      unit -
      cmd -
      Throws:
      IllegalArgumentException - if the specified unit/cmd is null.
    • callUninterruptibly

      public static <T> T callUninterruptibly(Throwables.Callable<T,InterruptedException> cmd) throws IllegalArgumentException
      Note: Copied from Google Guava under Apache License v2.0

      If a thread is interrupted during such a call, the call continues to block until the result is available or the timeout elapses, and only then re-interrupts the thread.
      Type Parameters:
      T -
      Parameters:
      cmd -
      Returns:
      Throws:
      IllegalArgumentException
    • callUninterruptibly

      public static <T> T callUninterruptibly(long timeoutInMillis, Throwables.LongFunction<? extends T,InterruptedException> cmd) throws IllegalArgumentException
      Note: Copied from Google Guava under Apache License v2.0

      If a thread is interrupted during such a call, the call continues to block until the result is available or the timeout elapses, and only then re-interrupts the thread.
      Type Parameters:
      T -
      Parameters:
      timeoutInMillis -
      cmd -
      Returns:
      Throws:
      IllegalArgumentException
    • callUninterruptibly

      public static <T> T callUninterruptibly(long timeout, @NotNull TimeUnit unit, @NotNull Throwables.BiFunction<Long,TimeUnit,T,InterruptedException> cmd) throws IllegalArgumentException
      Note: Copied from Google Guava under Apache License v2.0

      If a thread is interrupted during such a call, the call continues to block until the result is available or the timeout elapses, and only then re-interrupts the thread.
      Type Parameters:
      T -
      Parameters:
      timeout -
      unit -
      cmd -
      Returns:
      Throws:
      IllegalArgumentException - if the specified unit/cmd is null.
    • sleep

      public static void sleep(long timeoutInMillis)
      Pauses the execution of the current thread for a specified time.
      Parameters:
      timeoutInMillis - The time, in milliseconds, to pause the thread.
    • sleep

      public static void sleep(long timeout, @NotNull TimeUnit unit) throws IllegalArgumentException
      Pauses the execution of the current thread for a specified time.
      Parameters:
      timeout - The time to pause the thread. The unit of time is determined by the 'unit' parameter.
      unit - The unit of time for the 'timeout' parameter. This should be a valid TimeUnit enumeration value.
      Throws:
      IllegalArgumentException - if the specified unit is null.
    • sleepUninterruptibly

      public static void sleepUninterruptibly(long timeoutInMillis)
      Note: Copied from Google Guava under Apache License v2.0

      If a thread is interrupted during such a call, the call continues to block until the result is available or the timeout elapses, and only then re-interrupts the thread.
      Parameters:
      timeoutInMillis -
    • sleepUninterruptibly

      public static void sleepUninterruptibly(long timeout, @NotNull TimeUnit unit) throws IllegalArgumentException
      Note: Copied from Google Guava under Apache License v2.0

      If a thread is interrupted during such a call, the call continues to block until the result is available or the timeout elapses, and only then re-interrupts the thread.
      Parameters:
      timeout -
      unit -
      Throws:
      IllegalArgumentException - if the specified unit is null.
    • tryOrEmptyIfExceptionOccurred

      @Beta public static <R> u.Nullable<R> tryOrEmptyIfExceptionOccurred(Callable<R> cmd)
      Returns a Nullable with the value returned by action or an empty Nullable if exception happens.
      Type Parameters:
      R -
      Parameters:
      cmd -
      Returns:
      See Also:
    • tryOrEmptyIfExceptionOccurred

      @Beta public static <T, R> u.Nullable<R> tryOrEmptyIfExceptionOccurred(T init, Throwables.Function<? super T,? extends R,? extends Exception> func)
      Returns a Nullable with the value returned by func.apply(init) or an empty Nullable if exception happens.
      Type Parameters:
      T -
      R -
      Parameters:
      init -
      func -
      Returns:
      See Also:
    • tryOrDefaultIfExceptionOccurred

      @Beta public static <R> R tryOrDefaultIfExceptionOccurred(Callable<R> cmd, R defaultIfExceptionOccurred)
      Returns the value returned by action or defaultIfExceptionOccurred if exception happens.
      Type Parameters:
      R -
      Parameters:
      cmd -
      defaultIfExceptionOccurred -
      Returns:
      See Also:
    • tryOrDefaultIfExceptionOccurred

      @Beta public static <T, R> R tryOrDefaultIfExceptionOccurred(T init, Throwables.Function<? super T,? extends R,? extends Exception> func, R defaultIfExceptionOccurred)
      Returns the value returned by action or defaultIfExceptionOccurred if exception happens.
      Type Parameters:
      T -
      R -
      Parameters:
      init -
      func -
      defaultIfExceptionOccurred -
      Returns:
      See Also:
    • tryOrDefaultIfExceptionOccurred

      @Beta public static <R> R tryOrDefaultIfExceptionOccurred(Callable<R> cmd, Supplier<R> supplierForDefaultIfExceptionOccurred)
      Returns the value returned by action or {@code supplierForDefaultIfExceptionOccurred} if exception happens.
      Type Parameters:
      R -
      Parameters:
      cmd -
      supplierForDefaultIfExceptionOccurred -
      Returns:
      See Also:
    • tryOrDefaultIfExceptionOccurred

      @Beta public static <T, R> R tryOrDefaultIfExceptionOccurred(T init, Throwables.Function<? super T,? extends R,? extends Exception> func, Supplier<R> supplierForDefaultIfExceptionOccurred)
      Returns the value returned by action or defaultIfExceptionOccurred if exception happens.
      Type Parameters:
      T -
      R -
      Parameters:
      init -
      func -
      supplierForDefaultIfExceptionOccurred -
      Returns:
      See Also:
    • ifOrEmpty

      @Beta public static <R, E extends Exception> u.Nullable<R> ifOrEmpty(boolean b, Throwables.Supplier<R,E> supplier) throws E
      Returns a Nullable with value got from the specified supplier if b is true, otherwise returns an empty Nullable if b is false.
      Type Parameters:
      R -
      E -
      Parameters:
      b -
      supplier -
      Returns:
      Throws:
      E - the e
    • ifOrElse

      @Beta public static <E1 extends Exception, E2 extends Exception> void ifOrElse(boolean b, Throwables.Runnable<E1> actionForTrue, Throwables.Runnable<E2> actionForFalse) throws E1, E2
      Executes the provided actions based on the boolean condition.
      Type Parameters:
      E1 - The type of exception that the first action may throw.
      E2 - The type of exception that the second action may throw.
      Parameters:
      b - The boolean condition to test.
      actionForTrue - The action to be executed if the condition is true.
      actionForFalse - The action to be executed if the condition is false.
      Throws:
      E1 - if the condition is true and the execution of actionForTrue throws this exception.
      E2 - if the condition is false and the execution of actionForFalse throws this exception.
    • ifNotNull

      @Beta public static <T, E extends Exception> void ifNotNull(T obj, Throwables.Consumer<? super T,E> cmd) throws E
      Throws:
      E
    • ifNotEmpty

      @Beta public static <C extends CharSequence, E extends Exception> void ifNotEmpty(C c, Throwables.Consumer<? super C,E> cmd) throws E
      Executes the provided action if the given CharSequence is not empty.
      Type Parameters:
      C - The type of the CharSequence.
      E - The type of exception that the action may throw.
      Parameters:
      c - The CharSequence to be tested for emptiness.
      cmd - The action to be executed if the CharSequence is not empty.
      Throws:
      E - if the execution of the action throws this exception.
    • ifNotEmpty

      @Beta public static <C extends Collection, E extends Exception> void ifNotEmpty(C c, Throwables.Consumer<? super C,E> cmd) throws E
      Executes the provided action if the given collection is not empty.
      Type Parameters:
      C - The type of the collection.
      E - The type of exception that the action may throw.
      Parameters:
      c - The collection to be tested for emptiness.
      cmd - The action to be executed if the collection is not empty.
      Throws:
      E - if the execution of the action throws this exception.
    • ifNotEmpty

      @Beta public static <M extends Map, E extends Exception> void ifNotEmpty(M m, Throwables.Consumer<? super M,E> cmd) throws E
      Executes the provided action if the given map is not empty.
      Type Parameters:
      M - The type of the map.
      E - The type of exception that the action may throw.
      Parameters:
      m - The map to be tested for emptiness.
      cmd - The action to be executed if the map is not empty.
      Throws:
      E - if the execution of the action throws this exception.
    • applyToEach

      @Beta public static <T, E extends Exception> void applyToEach(T[] a, Throwables.Function<? super T,? extends T,E> converter) throws IllegalArgumentException, E
      Updates each element in the specified array with specified function converter.
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      converter -
      Throws:
      IllegalArgumentException
      E
    • applyToEach

      @Beta public static <T, E extends Exception> void applyToEach(List<T> c, Throwables.Function<? super T,? extends T,E> converter) throws IllegalArgumentException, E
      Updates each element in the specified List with specified function converter.
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      converter -
      Throws:
      IllegalArgumentException
      E
    • copyThenApplyToEach

      @MayReturnNull public static <T, E extends Exception> T[] copyThenApplyToEach(T[] a, Throwables.Function<? super T,? extends T,E> converter) throws E
      Copies the specified array first, then applies the provided converter function to each element of the copy.
      Type Parameters:
      T - the type of elements in the array
      E - the type of exception that the converter function may throw
      Parameters:
      a - the array to be copied and processed
      converter - the function to apply to each element of the copied array
      Returns:
      a new array with the converted elements, or nulll if the specified array is null
      Throws:
      E - if the converter function throws an exception
    • lazyInit

      @Beta public static <T> Supplier<T> lazyInit(Supplier<T> supplier)
      Creates a lazy-initialized supplier from the provided supplier. The supplier's get() method will not be called until necessary and only be called only because the returned value will be cached.
      Type Parameters:
      T - The type of results supplied by this supplier
      Parameters:
      supplier - The supplier to be lazily initialized
      Returns:
      A lazy-initialized supplier
    • lazyInitialize

      @Beta public static <T, E extends Exception> Throwables.Supplier<T,E> lazyInitialize(Throwables.Supplier<T,E> supplier)
      Creates a lazy-initialized supplier from the provided supplier. The supplier's get() method will not be called until necessary and only be called only because the returned value will be cached.
      Type Parameters:
      T - The type of results supplied by this supplier
      Parameters:
      supplier - The supplier to be lazily initialized
      Returns:
      A lazy-initialized supplier
    • toRuntimeException

      @Beta public static RuntimeException toRuntimeException(Exception e)
      Converts the provided exception to a runtime exception.
      Parameters:
      e - The exception to be converted to a runtime exception.
      Returns:
      A RuntimeException that represents the provided exception.
      See Also:
    • toRuntimeException

      @Beta public static RuntimeException toRuntimeException(Throwable e)
      Converts the specified Throwable to a RuntimeException if it's a checked exception or an Error, otherwise returns itself.
      Parameters:
      e -
      Returns:
      See Also:
    • toRuntimeException

      @Beta public static RuntimeException toRuntimeException(Throwable e, boolean throwIfItIsError)
      Converts the specified Throwable to a RuntimeException if it's a checked exception, or throw it if it's an Error. Otherwise returns itself.
      Parameters:
      e -
      throwIfItIsError -
      Returns:
      See Also:
    • println

      public static <T> T println(T obj)
      Prints the given object to the standard output stream (System.out) and returns the object. The object's string representation is obtained by calling N.toString(Object) method.
      Type Parameters:
      T - The type of the object to be printed.
      Parameters:
      obj - The object to be printed.
      Returns:
      The same object that was printed.
    • fprintln

      @SafeVarargs public static <T> T[] fprintln(String format, T... args)
      Prints a formatted string and an array of arguments, following the syntax rules of String.format(String, Object...). The result string is then printed to the standard output stream (System.out) and returned as an array of the provided arguments.
      Type Parameters:
      T - The type of the arguments.
      Parameters:
      format - A format string as described in Format string syntax.
      args - Arguments referenced by the format specifiers in the format string.
      Returns:
      The same array of arguments that was printed.
    • typeOf

      public static <T> com.landawn.abacus.type.Type<T> typeOf(@NotNull String typeName) throws IllegalArgumentException
      Gets a Type by the given type name.
      Parameters:
      typeName - the name of the type to be retrieved.
      Returns:
      the Type corresponding to the given type name.
      Throws:
      IllegalArgumentException - if the specified typeName is null.
    • typeOf

      public static <T> com.landawn.abacus.type.Type<T> typeOf(@NotNull Class<?> cls) throws IllegalArgumentException
      Gets a Type by the given Class.
      Parameters:
      typeName - the name of the type to be retrieved.
      Returns:
      the Type corresponding to the given type name.
      Throws:
      IllegalArgumentException - if the specified Class is null.
    • defaultValueOf

      public static <T> T defaultValueOf(Class<T> cls)
      Returns the default value of the given class type.
      Type Parameters:
      T -
      Parameters:
      cls - the class type for which the default value is to be returned.
      Returns:
      the default value of the given class type. For example, for an Integer class type, it will return 0.
      Throws:
      IllegalArgumentException - if the specified class type is null.
    • defaultIfNull

      public static boolean defaultIfNull(Boolean b)
      Returns the default value of the given type if the specified object is null or itself if the specified object is not null.
      Parameters:
      b -
      Returns:
    • defaultIfNull

      public static boolean defaultIfNull(Boolean b, boolean defaultForNull)
      Returns the specified default value if the specified object is null or itself if the specified object is not null.
      Parameters:
      b -
      defaultForNull -
      Returns:
    • defaultIfNull

      public static char defaultIfNull(Character c)
      Returns the default value of the given type if the specified object is null or itself if the specified object is not null.
      Parameters:
      c -
      Returns:
    • defaultIfNull

      public static char defaultIfNull(Character c, char defaultForNull)
      Returns the specified default value if the specified object is null or itself if the specified object is not null.
      Parameters:
      c -
      defaultForNull -
      Returns:
    • defaultIfNull

      public static byte defaultIfNull(Byte b)
      Returns the default value of the given type if the specified object is null or itself if the specified object is not null.
      Parameters:
      b -
      Returns:
    • defaultIfNull

      public static byte defaultIfNull(Byte b, byte defaultForNull)
      Returns the specified default value if the specified object is null or itself if the specified object is not null.
      Parameters:
      b -
      defaultForNull -
      Returns:
    • defaultIfNull

      public static short defaultIfNull(Short b)
      Returns the default value of the given type if the specified object is null or itself if the specified object is not null.
      Parameters:
      b -
      Returns:
    • defaultIfNull

      public static short defaultIfNull(Short b, short defaultForNull)
      Returns the specified default value if the specified object is null or itself if the specified object is not null.
      Parameters:
      b -
      defaultForNull -
      Returns:
    • defaultIfNull

      public static int defaultIfNull(Integer b)
      Returns the default value of the given type if the specified object is null or itself if the specified object is not null.
      Parameters:
      b -
      Returns:
    • defaultIfNull

      public static int defaultIfNull(Integer b, int defaultForNull)
      Returns the specified default value if the specified object is null or itself if the specified object is not null.
      Parameters:
      b -
      defaultForNull -
      Returns:
    • defaultIfNull

      public static long defaultIfNull(Long b)
      Returns the default value of the given type if the specified object is null or itself if the specified object is not null.
      Parameters:
      b -
      Returns:
    • defaultIfNull

      public static long defaultIfNull(Long b, long defaultForNull)
      Returns the specified default value if the specified object is null or itself if the specified object is not null.
      Parameters:
      b -
      defaultForNull -
      Returns:
    • defaultIfNull

      public static float defaultIfNull(Float b)
      Returns the default value of the given type if the specified object is null or itself if the specified object is not null.
      Parameters:
      b -
      Returns:
    • defaultIfNull

      public static float defaultIfNull(Float b, float defaultForNull)
      Returns the specified default value if the specified object is null or itself if the specified object is not null.
      Parameters:
      b -
      defaultForNull -
      Returns:
    • defaultIfNull

      public static double defaultIfNull(Double b)
      Returns the default value of the given type if the specified object is null or itself if the specified object is not null.
      Parameters:
      b -
      Returns:
    • defaultIfNull

      public static double defaultIfNull(Double b, double defaultForNull)
      Returns the specified default value if the specified object is null or itself if the specified object is not null.
      Parameters:
      b -
      defaultForNull -
      Returns:
    • defaultIfNull

      public static <T> T defaultIfNull(T obj, T defaultForNull)
      Returns the specified default value if the specified object is null or itself if the specified object is not null.
      Type Parameters:
      T -
      Parameters:
      obj -
      defaultForNull -
      Returns:
    • defaultIfNull

      public static <T> T defaultIfNull(T obj, Supplier<? extends T> supplierForDefault)
      Returns the default value provided by specified Supplier if the specified object is null or itself if the specified object is not null.
      Type Parameters:
      T -
      Parameters:
      obj -
      supplierForDefault -
      Returns:
    • defaultIfEmpty

      public static <T extends CharSequence> T defaultIfEmpty(T str, T defaultStr)
      Returns the specified default value if the specified object is empty or itself if the specified object is not empty.
      Type Parameters:
      T -
      Parameters:
      str -
      defaultStr -
      Returns:
      See Also:
    • defaultIfEmpty

      public static <T extends CharSequence> T defaultIfEmpty(T str, Supplier<? extends T> getterForDefaultStr)
      Returns the default value provided by specified Supplier if the specified object is empty or itself if the specified object is not empty.
      Type Parameters:
      T -
      Parameters:
      str -
      getterForDefaultStr -
      Returns:
      See Also:
    • defaultIfBlank

      public static <T extends CharSequence> T defaultIfBlank(T str, T defaultStr)
      Returns the specified default value if the specified object is blank or itself if the specified object is not blank.
      Type Parameters:
      T -
      Parameters:
      str -
      defaultStr -
      Returns:
      See Also:
    • defaultIfBlank

      public static <T extends CharSequence> T defaultIfBlank(T str, Supplier<? extends T> getterForDefaultStr)
      Returns the default value provided by specified Supplier if the specified object is blank or itself if the specified object is not blank.
      Type Parameters:
      T -
      Parameters:
      str -
      getterForDefaultStr -
      Returns:
      See Also:
    • defaultIfEmpty

      public static <T extends Collection<?>> T defaultIfEmpty(T c, T defaultColl)
      Returns the specified default value if the specified Collection/Map is empty or itself if the specified object is not empty.
      Type Parameters:
      T -
      Parameters:
      c -
      defaultColl -
      Returns:
    • defaultIfEmpty

      public static <T extends Map<?, ?>> T defaultIfEmpty(T m, T defaultMap)
      Returns the specified default value if the specified Collection/Map is empty or itself if the specified object is not empty.
      Type Parameters:
      T -
      Parameters:
      m -
      defaultMap -
      Returns:
    • stringOf

      public static String stringOf(boolean val)
      Converts the given value to its corresponding String representation.
      Parameters:
      val - the value to be converted.
      Returns:
      the String representation of the given value. Returns "true" if the value is true, "false" otherwise.
    • stringOf

      public static String stringOf(char val)
      Converts the given value to its corresponding String representation.
      Parameters:
      val - the value to be converted.
      Returns:
      the String representation of the given value.
    • stringOf

      public static String stringOf(byte val)
      Converts the given value to its corresponding String representation.
      Parameters:
      val - the value to be converted.
      Returns:
      the String representation of the given value.
    • stringOf

      public static String stringOf(short val)
      Converts the given value to its corresponding String representation.
      Parameters:
      val - the value to be converted.
      Returns:
      the String representation of the given value.
    • stringOf

      public static String stringOf(int val)
      Converts the given value to its corresponding String representation.
      Parameters:
      val - the value to be converted.
      Returns:
      the String representation of the given value.
    • stringOf

      public static String stringOf(long val)
      Converts the given value to its corresponding String representation.
      Parameters:
      val - the value to be converted.
      Returns:
      the String representation of the given value.
    • stringOf

      public static String stringOf(float val)
      Converts the given value to its corresponding String representation.
      Parameters:
      val - the value to be converted.
      Returns:
      the String representation of the given value.
    • stringOf

      public static String stringOf(double val)
      Converts the given value to its corresponding String representation.
      Parameters:
      val - the value to be converted.
      Returns:
      the String representation of the given value.
    • stringOf

      public static String stringOf(Object obj)
      Converts the given value to its corresponding String representation.
      Parameters:
      val - the value to be converted.
      Returns:
      the String representation of the given value. null if the specified object is null
    • valueOf

      public static <T> T valueOf(String str, Class<? extends T> targetType)
      Converts the given string to its corresponding value of the specified target type.
      Type Parameters:
      T - The type of the target object after conversion.
      Parameters:
      str - The string to be converted.
      targetType - The class of the target type to which the string is to be converted.
      Returns:
      The converted value of the specified target type. If the input string is null, it returns the default value of the target type.
      Throws:
      IllegalArgumentException - if the specified target type is null.
    • registerConverter

      public static boolean registerConverter(@NotNull Class<?> srcClass, BiFunction<?,Class<?>,?> converter) throws IllegalArgumentException
      Registers a converter for a specific source class. The converter is a function that takes an object of the source class and a target class, and converts the source object into an instance of the target class.
      Type Parameters:
      T - The type of the source object to be converted.
      R - The type of the target object after conversion.
      Parameters:
      srcClass - The source class that the converter can convert from. This must not be a built-in class.
      converter - The converter function that takes a source object and a target class, and returns an instance of the target class.
      Returns:
      true if there is no converter registered with specified srcClass yet before this call.
      Throws:
      IllegalArgumentException - if the specified srcClass is a built-in class or if either srcClass or converter is null.
    • convert

      public static <T> T convert(Object srcObj, Class<? extends T> targetType) throws IllegalArgumentException, NumberFormatException, RuntimeException
      Converts the given source object to the specified target type. If the source object is null, the default value of the target type is returned. If the source object can be converted to the target type, an instance of the target type is returned.
      Type Parameters:
      T - The type of the target object after conversion.
      Parameters:
      srcObj - The source object to be converted. If null, the default value of the target type is returned.
      targetType - The class of the target type to which the source object is to be converted.
      Returns:
      An instance of the target type converted from the source object, or the default value of the target type if the source object is null.
      Throws:
      IllegalArgumentException - if the source object cannot be converted to the target type.
      NumberFormatException - if string value of the source object cannot be parsed to the target(Number) type.
      RuntimeException - if any other error occurs during the conversion.
    • convert

      public static <T> T convert(Object srcObj, com.landawn.abacus.type.Type<? extends T> targetType) throws IllegalArgumentException, NumberFormatException, RuntimeException
      Converts the given source object to the specified target type using the provided Type instance. If the source object is null, the default value of the target type is returned. If the source object can be converted to the target type, an instance of the target type is returned.
      Type Parameters:
      T - The type of the target object after conversion.
      Parameters:
      srcObj - The source object to be converted.
      targetType - The Type instance of the target type to which the source object is to be converted.
      Returns:
      An instance of the target type converted from the source object, or the default value of the target type if the source object is null.
      Throws:
      IllegalArgumentException - if the source object cannot be converted to the target type.
      NumberFormatException - if string value of the source object cannot be parsed to the target(Number) type.
      RuntimeException - if any other error occurs during the conversion.
    • castIfAssignable

      @Beta public static <T> u.Nullable<T> castIfAssignable(Object val, Class<? extends T> targetType)
      Casts the given object to the specified target type if possible. If the object is null or cannot be assigned to the target type, an empty Nullable is returned. Note that null can be assigned to any Object type except primitive types: boolean/char/byte/short/int/long/double.
      Type Parameters:
      T - The type of the target object after casting.
      Parameters:
      val - The object to be casted.
      targetType - The class of the target type to which the object is to be casted.
      Returns:
      A Nullable containing the casted object if the casting is successful, or an empty Nullable if the object is null or cannot be casted to the target type.
    • castIfAssignable

      @Beta public static <T> u.Nullable<T> castIfAssignable(Object val, com.landawn.abacus.type.Type<? extends T> targetType)
      Casts the given object to the specified target type if possible using the provided Type instance. If the object is null or cannot be assigned to the target type, an empty Nullable is returned. Note that null can be assigned to any Object type except primitive types: boolean/char/byte/short/int/long/double.
      Type Parameters:
      T - The type of the target object after casting.
      Parameters:
      val - The object to be casted.
      targetType - The Type instance of the target type to which the object is to be casted.
      Returns:
      A Nullable containing the casted object if the casting is successful, or an empty Nullable if the object is null or cannot be casted to the target type.
    • getPropNames

      public static ImmutableList<String> getPropNames(Class<?> beanClass)
      Retrieves the property names of the given bean class.
      Parameters:
      beanClass - the class of the bean whose property names are to be retrieved.
      Returns:
      an ImmutableList of strings representing the property names of the given bean class.
      Throws:
      IllegalArgumentException - if the specified bean class is null.
    • getPropNames

      public static List<String> getPropNames(Class<?> beanClass, Set<String> propNameToExclude)
      Retrieves the property names of the given bean class excluding the specified property names.
      Parameters:
      beanClass - the class of the bean whose property names are to be retrieved.
      propNameToExclude - a set of property names to be excluded from the returned list.
      Returns:
      a List of strings representing the property names of the given bean class excluding the specified property names.
      Throws:
      IllegalArgumentException - if the specified bean class is null.
      See Also:
    • getPropNames

      public static List<String> getPropNames(Object bean)
      Retrieves the property names of the given bean object.
      Parameters:
      bean - The bean object whose property names are to be retrieved.
      Returns:
      A list of strings representing the property names of the given bean object.
      Throws:
      IllegalArgumentException - if the specified bean object is null.
      See Also:
    • getPropNames

      public static List<String> getPropNames(Object bean, boolean ignoreNullValue)
      Retrieves the property names of the given bean object.
      Parameters:
      bean - The bean object whose property names are to be retrieved.
      ignoreNullValue - If true, the method will ignore property names with null values.
      Returns:
      A list of strings representing the property names of the given bean object. If ignoreNullValue is true, properties with null values are not included in the list.
      Throws:
      IllegalArgumentException - if the specified bean object is null.
      See Also:
    • getPropValue

      public static <T> T getPropValue(Object bean, String propName)
      Retrieves the value of the specified property from the given bean object.
      Type Parameters:
      T - The type of the property value.
      Parameters:
      bean - The bean object from which the property value is to be retrieved.
      propName - The name of the property whose value is to be retrieved.
      Returns:
      The value of the specified property of the given bean object.
      Throws:
      IllegalArgumentException - if the specified bean object is null.
      See Also:
    • getPropValue

      public static <T> T getPropValue(Object bean, String propName, boolean ignoreUnmatchedProperty)
      Retrieves the value of the specified property from the given bean object.
      Type Parameters:
      T - The type of the property value.
      Parameters:
      bean - The bean object from which the property value is to be retrieved.
      propName - The name of the property whose value is to be retrieved.
      ignoreUnmatchedProperty - If true, the method will not throw an exception if the property does not exist in the bean object.
      Returns:
      The value of the specified property of the given bean object.
      Throws:
      IllegalArgumentException - if the specified bean object is null or if the property does not exist and ignoreUnmatchedProperty is false.
      See Also:
    • setPropValue

      @Deprecated public static void setPropValue(Object bean, String propName, Object propValue)
      Sets the value of the specified property in the given bean object.
      Refer to setPropValue(Method, Object, Object).
      Parameters:
      bean - The bean object in which the property value is to be set.
      propName - The name of the property whose value is to be set. The property name is case insensitive.
      propValue - The new value to be set for the specified property in the given bean object.
      Throws:
      IllegalArgumentException - if the specified bean object is null.
      See Also:
    • clone

      @MayReturnNull public static <T> T clone(T obj)
      Clones the given object. The object must be serializable and deserializable through Kryo or JSON.
      Type Parameters:
      T -
      Parameters:
      obj - a Java object which must be serializable and deserializable through Kryo or JSON.
      Returns:
      null if bean is null
    • clone

      public static <T> T clone(Object obj, @NotNull Class<? extends T> targetType) throws IllegalArgumentException
      Deeply copy by: obj -> serialize -> kryo/Json -> deserialize -> new object.
      Type Parameters:
      T -
      Parameters:
      obj - a Java object which must be serializable and deserialiable through Kryo or JSON.
      targetType -
      Returns:
      a new instance of targetType even if bean is null.
      Throws:
      IllegalArgumentException - if targetType is null.
    • copy

      @MayReturnNull public static <T> T copy(T sourceBean)
      Returns a copy of the given source bean.
      Type Parameters:
      T - the type of the source bean
      Parameters:
      sourceBean - the source bean to copy
      Returns:
      a new instance of the same class with the same properties copied from the source bean, or null if the source bean is null
    • copy

      @MayReturnNull public static <T> T copy(T sourceBean, Collection<String> selectPropNames)
      Returns a copy of the given source bean with selected properties.
      Type Parameters:
      T - the type of the source bean
      Parameters:
      sourceBean - the source bean to copy
      selectPropNames - the collection of property names to be copied
      Returns:
      a new instance of the same class with the selected properties copied from the source bean, or null if the source bean is null
    • copy

      @MayReturnNull public static <T> T copy(T sourceBean, BiPredicate<? super String,?> propFilter)
      Returns a copy of the given source bean with properties filtered by the specified predicate.
      Type Parameters:
      T - the type of the source bean
      Parameters:
      sourceBean - the source bean to copy
      propFilter - the predicate to filter properties to be copied
      Returns:
      a new instance of the same class with the filtered properties copied from the source bean, or null if the source bean is null
    • copy

      public static <T> T copy(Object sourceBean, Class<? extends T> targetType) throws IllegalArgumentException
      Returns a new instance of specified targetType with properties copied from the given source bean.
      Type Parameters:
      T - the type of the target bean
      Parameters:
      sourceBean - the source bean to copy
      targetType - the class of the target type
      Returns:
      a new instance of the target type, even if the source bean is null
      Throws:
      IllegalArgumentException - if the specified targetType is null
    • copy

      public static <T> T copy(Object sourceBean, Collection<String> selectPropNames, @NotNull Class<? extends T> targetType) throws IllegalArgumentException
      Returns a new instance of specified targetType with properties copied from the given source bean with selected properties.
      Type Parameters:
      T - the type of the target bean
      Parameters:
      sourceBean - the source bean to copy
      selectPropNames - the collection of property names to be copied
      targetType - the class of the target type
      Returns:
      a new instance of the target type, even if the source bean is null
      Throws:
      IllegalArgumentException - if the specified targetType is null
    • copy

      public static <T> T copy(Object sourceBean, Collection<String> selectPropNames, Function<String,String> propNameConverter, @NotNull Class<? extends T> targetType) throws IllegalArgumentException
      Returns a new instance of specified targetType with properties copied from the given source bean with selected properties.
      Type Parameters:
      T - the type of the target bean
      Parameters:
      sourceBean - the source bean to copy
      selectPropNames - the collection of property names to be copied
      propNameConverter - A Function used to convert the property names from the source object to the target object. The function takes a property name from the source object and returns the corresponding property name in the target object.
      targetType - the class of the target type
      Returns:
      a new instance of the target type, even if the source bean is null
      Throws:
      IllegalArgumentException - if the specified targetType is null
    • copy

      public static <T> T copy(Object sourceBean, BiPredicate<? super String,?> propFilter, Class<? extends T> targetType) throws IllegalArgumentException
      Returns a new instance of specified targetType with properties copied from the given source bean, filtered by the specified predicate.
      Type Parameters:
      T - the type of the target bean
      Parameters:
      sourceBean - the source bean to copy
      propFilter - A BiPredicate used to filter the properties to be copied. The predicate takes a property name and its value, and returns true if the property should be copied.
      targetType - the class of the target type
      Returns:
      a new instance of the target type, even if the source bean is null
      Throws:
      IllegalArgumentException - if targetBean is null.
    • copy

      public static <T> T copy(Object sourceBean, BiPredicate<? super String,?> propFilter, Function<String,String> propNameConverter, Class<? extends T> targetType) throws IllegalArgumentException
      Returns a new instance of specified targetType with properties copied from the given source bean, filtered by the specified predicate.
      Type Parameters:
      T - the type of the target bean
      Parameters:
      sourceBean - the source bean to copy
      propFilter - A BiPredicate used to filter the properties to be copied. The predicate takes a property name and its value, and returns true if the property should be copied.
      propNameConverter - A Function used to convert the property names from the source object to the target object. The function takes a property name from the source object and returns the corresponding property name in the target object.
      targetType - the class of the target type
      Returns:
      a new instance of the target type, even if the source bean is null
      Throws:
      IllegalArgumentException - if targetBean is null.
    • copy

      public static <T> T copy(Object sourceBean, boolean ignoreUnmatchedProperty, Set<String> ignoredPropNames, @NotNull Class<? extends T> targetType) throws IllegalArgumentException
      Returns a new instance of specified targetType with properties copied from the given source bean, except the properties specified in the ignoredPropNames set.
      Type Parameters:
      T - the type of the target bean
      Parameters:
      sourceBean - the source bean to copy
      ignoreUnmatchedProperty - if true, unmatched properties will be ignored, otherwise an exception will be thrown if unmatched properties are found
      ignoredPropNames - the set of property names to be ignored during copying
      targetType - the class of the target type
      Returns:
      a new instance of the target type, even if the source bean is null
      Throws:
      IllegalArgumentException - if the specified targetType is null
    • merge

      public static <T> T merge(Object sourceBean, T targetBean) throws IllegalArgumentException
      Merges the properties from the source object into the target object. The source object's properties will overwrite the same properties in the target object.
      Type Parameters:
      T - The type of the target object.
      Parameters:
      sourceBean - The source object from which properties are to be copied. This object should allow access to properties using getter methods.
      targetBean - The target object into which properties are to be copied. This object should allow access to properties using setter methods.
      Returns:
      The specified target object with the merged properties.
      Throws:
      IllegalArgumentException - if targetBean is null.
    • merge

      public static <T> T merge(Object sourceBean, T targetBean, BinaryOperator<?> mergeFunc) throws IllegalArgumentException
      Merges the properties from the source object into the target object using the specified merge function. The source object's properties will overwrite the same properties in the target object.
      Type Parameters:
      T - The type of the target object.
      Parameters:
      sourceBean - The source object from which properties are to be copied. This object should allow access to properties using getter methods.
      targetBean - The target object into which properties are to be copied. This object should allow access to properties using setter methods.
      mergeFunc - A BinaryOperator used to merge the property values from the source object and the target object. The operator takes two parameters: the source property value and the target property value, and returns the resolved value to be set in the target object.
      Returns:
      The specified target object with the merged properties.
      Throws:
      IllegalArgumentException - if targetBean is null.
    • merge

      public static <T> T merge(Object sourceBean, T targetBean, Function<String,String> propNameConverter, BinaryOperator<?> mergeFunc) throws IllegalArgumentException
      Merges the properties from the source object into the target object using the specified merge function. The source object's properties will overwrite the same properties in the target object.
      Type Parameters:
      T - The type of the target object.
      Parameters:
      sourceBean - The source object from which properties are to be copied. This object should allow access to properties using getter methods.
      targetBean - The target object into which properties are to be copied. This object should allow access to properties using setter methods.
      propNameConverter - A Function used to convert the property names from the source object to the target object. The function takes a property name from the source object and returns the corresponding property name in the target object.
      mergeFunc - A BinaryOperator used to merge the property values from the source object and the target object. The operator takes two parameters: the source property value and the target property value, and returns the resolved value to be set in the target object.
      Returns:
      The specified target object with the merged properties.
      Throws:
      IllegalArgumentException - if targetBean is null.
    • merge

      public static <T> T merge(Object sourceBean, @NotNull T targetBean, Collection<String> selectPropNames) throws IllegalArgumentException
      Merges the selected properties from the source object into the target object. The source object's properties will overwrite the same properties in the target object.
      Type Parameters:
      T - The type of the target object.
      Parameters:
      sourceBean - The source object from which properties are to be copied. This object should allow access to properties using getter methods.
      targetBean - The target object into which properties are to be copied. This object should allow access to properties using setter methods.
      selectPropNames - The collection of property names to be merged.
      Returns:
      The specified target object with the merged properties.
      Throws:
      IllegalArgumentException - if targetBean is null.
    • merge

      public static <T> T merge(Object sourceBean, @NotNull T targetBean, Collection<String> selectPropNames, BinaryOperator<?> mergeFunc) throws IllegalArgumentException
      Merges the selected properties from the source object into the target object using the specified merge function. The source object's properties will overwrite the same properties in the target object.
      Type Parameters:
      T - The type of the target object.
      Parameters:
      sourceBean - The source object from which properties are to be copied. This object should allow access to properties using getter methods.
      targetBean - The target object into which properties are to be copied. This object should allow access to properties using setter methods.
      selectPropNames - The collection of property names to be merged.
      mergeFunc - A BinaryOperator used to merge the property values from the source object and the target object. The operator takes two parameters: the source property value and the target property value, and returns the resolved value to be set in the target object.
      Returns:
      The specified target object with the merged properties.
      Throws:
      IllegalArgumentException - if targetBean is null.
    • merge

      public static <T> T merge(Object sourceBean, @NotNull T targetBean, Collection<String> selectPropNames, Function<String,String> propNameConverter) throws IllegalArgumentException
      Merges the selected properties from the source object into the target object. The source object's properties will overwrite the same properties in the target object.
      Type Parameters:
      T - The type of the target object.
      Parameters:
      sourceBean - The source object from which properties are to be copied. This object should allow access to properties using getter methods.
      targetBean - The target object into which properties are to be copied. This object should allow access to properties using setter methods.
      selectPropNames - The collection of property names to be merged.
      propNameConverter - A Function used to convert the property names from the source object to the target object. The function takes a property name from the source object and returns the corresponding property name in the target object.
      Returns:
      The specified target object with the merged properties.
      Throws:
      IllegalArgumentException - if targetBean is null.
    • merge

      public static <T> T merge(Object sourceBean, @NotNull T targetBean, Collection<String> selectPropNames, Function<String,String> propNameConverter, BinaryOperator<?> mergeFunc) throws IllegalArgumentException
      Merges the selected properties from the source object into the target object using the specified merge function. The source object's properties will overwrite the same properties in the target object.
      Type Parameters:
      T - The type of the target object.
      Parameters:
      sourceBean - The source object from which properties are to be copied. This object should allow access to properties using getter methods.
      targetBean - The target object into which properties are to be copied. This object should allow access to properties using setter methods.
      selectPropNames - The collection of property names to be merged.
      propNameConverter - A Function used to convert the property names from the source object to the target object. The function takes a property name from the source object and returns the corresponding property name in the target object.
      mergeFunc - A BinaryOperator used to merge the property values from the source object and the target object. The operator takes two parameters: the source property value and the target property value, and returns the resolved value to be set in the target object.
      Returns:
      The specified target object with the merged properties.
      Throws:
      IllegalArgumentException - if targetBean is null.
    • merge

      public static <T> T merge(Object sourceBean, T targetBean, BiPredicate<? super String,?> propFilter) throws IllegalArgumentException
      Merges the filtered properties from the source object into the target object, The source object's properties will overwrite the same properties in the target object.
      Type Parameters:
      T - The type of the target object.
      Parameters:
      sourceBean - The source object from which properties are to be copied. This object should allow access to properties using getter methods.
      targetBean - The target object into which properties are to be copied. This object should allow access to properties using setter methods.
      propFilter - A BiPredicate used to filter the properties to be merged. The predicate takes a property name and its value, and returns true if the property should be merged.
      Returns:
      The specified target object with the merged properties.
      Throws:
      IllegalArgumentException - if targetBean is null.
    • merge

      public static <T> T merge(Object sourceBean, @NotNull T targetBean, BiPredicate<? super String,?> propFilter, BinaryOperator<?> mergeFunc) throws IllegalArgumentException
      Merges the filtered properties from the source object into the target object using the specified merge function. The source object's properties will overwrite the same properties in the target object.
      Type Parameters:
      T - The type of the target object after merging.
      Parameters:
      sourceBean - The source object whose properties are to be merged. This object should allow access to properties using getter methods.
      targetBean - The target object to which the properties are to be merged. This object should allow access to properties using setter methods.
      propFilter - A BiPredicate used to filter the properties to be merged. The predicate takes a property name and its value, and returns true if the property should be merged.
      mergeFunc - A BinaryOperator used to merge the property values from the source object and the target object. The operator takes two parameters: the source property value and the target property value, and returns the resolved value to be set in the target object.
      Returns:
      The specified target object with the merged properties.
      Throws:
      IllegalArgumentException - if targetBean is null.
    • merge

      public static <T> T merge(Object sourceBean, @NotNull T targetBean, BiPredicate<? super String,?> propFilter, Function<String,String> propNameConverter) throws IllegalArgumentException
      Merges the filtered properties from the source object into the target object using the specified merge function. The source object's properties will overwrite the same properties in the target object.
      Type Parameters:
      T - The type of the target object after merging.
      Parameters:
      sourceBean - The source object whose properties are to be merged. This object should allow access to properties using getter methods.
      targetBean - The target object to which the properties are to be merged. This object should allow access to properties using setter methods.
      propFilter - A BiPredicate used to filter the properties to be merged. The predicate takes a property name and its value, and returns true if the property should be merged.
      propNameConverter - A Function used to convert the property names from the source object to the target object. The function takes a property name from the source object and returns the corresponding property name in the target object.
      Returns:
      The specified target object with the merged properties.
      Throws:
      IllegalArgumentException - if targetBean is null.
    • merge

      public static <T> T merge(Object sourceBean, @NotNull T targetBean, BiPredicate<? super String,?> propFilter, Function<String,String> propNameConverter, BinaryOperator<?> mergeFunc) throws IllegalArgumentException
      Merges the filtered properties from the source object into the target object using the specified merge function. The source object's properties will overwrite the same properties in the target object.
      Type Parameters:
      T - The type of the target object after merging.
      Parameters:
      sourceBean - The source object whose properties are to be merged. This object should allow access to properties using getter methods.
      targetBean - The target object to which the properties are to be merged. This object should allow access to properties using setter methods.
      propFilter - A BiPredicate used to filter the properties to be merged. The predicate takes a property name and its value, and returns true if the property should be merged.
      propNameConverter - A Function used to convert the property names from the source object to the target object. The function takes a property name from the source object and returns the corresponding property name in the target object.
      mergeFunc - A BinaryOperator used to merge the property values from the source object and the target object. The operator takes two parameters: the source property value and the target property value, and returns the resolved value to be set in the target object.
      Returns:
      The specified target object with the merged properties.
      Throws:
      IllegalArgumentException - if targetBean is null.
    • merge

      public static <T> T merge(Object sourceBean, @NotNull T targetBean, boolean ignoreUnmatchedProperty, Set<String> ignoredPropNames) throws IllegalArgumentException
      Merges the properties from the source object into the target object, except the properties specified in the ignoredPropNames set. The source object's properties will overwrite the same properties in the target object.
      Type Parameters:
      T - The type of the target object.
      Parameters:
      sourceBean - The source object from which properties are to be copied. This object should allow access to properties using getter methods.
      targetBean - The target object into which properties are to be copied. This object should allow access to properties using setter methods.
      ignoreUnmatchedProperty - if true, unmatched properties will be ignored, otherwise an exception will be thrown if unmatched properties are found
      ignoredPropNames - The set of property names to be ignored during merging.
      Returns:
      The specified target object with the merged properties.
      Throws:
      IllegalArgumentException - if targetBean is null.
    • merge

      public static <T> T merge(Object sourceBean, @NotNull T targetBean, boolean ignoreUnmatchedProperty, Set<String> ignoredPropNames, BinaryOperator<?> mergeFunc) throws IllegalArgumentException
      Merges the properties from the source object into the target object using the specified merge function, except the properties specified in the ignoredPropNames set. The source object's properties will overwrite the same properties in the target object.
      Type Parameters:
      T - The type of the target object.
      Parameters:
      sourceBean - The source object from which properties are to be copied. This object should allow access to properties using getter methods.
      targetBean - The target object into which properties are to be copied. This object should allow access to properties using setter methods.
      ignoreUnmatchedProperty - if true, unmatched properties will be ignored, otherwise an exception will be thrown if unmatched properties are found
      ignoredPropNames - The set of property names to be ignored during merging.
      mergeFunc - A BinaryOperator used to merge the property values from the source object and the target object. The operator takes two parameters: the source property value and the target property value, and returns the resolved value to be set in the target object.
      Returns:
      The specified target object with the merged properties.
      Throws:
      IllegalArgumentException - if targetBean is null.
    • erase

      @SafeVarargs public static void erase(Object bean, String... propNames)
      Erases the properties of the given bean object. This method sets the properties specified by the property names to their default values. The default value is determined by the type of the property. For example, primitive numeric properties are set to 0, primitive boolean properties are set to false, and object properties are set to null.
      Parameters:
      bean - The bean object whose properties are to be erased. If this is null, the method does nothing.
      propNames - The names of the properties to be erased. These should correspond to the getter/setter methods in the bean object. If this is empty, the method does nothing.
    • erase

      public static void erase(Object bean, Collection<String> propNames)
      Erases the properties of the given bean object. This method sets the properties specified by the property names to their default values. The default value is determined by the type of the property. For example, primitive numeric properties are set to 0, primitive boolean properties are set to false, and object properties are set to null.
      Parameters:
      bean - The bean object whose properties are to be erased. If this is null, the method does nothing.
      propNames - The names of the properties to be erased. These should correspond to the getter/setter methods in the bean object. If this is empty, the method does nothing.
    • eraseAll

      public static void eraseAll(Object bean)
      Erases all the properties of the given bean object. This method sets all properties of the bean object to their default values. The default value is determined by the type of the property. For example, primitive numeric properties are set to 0, primitive boolean properties are set to false, and object properties are set to null.
      Parameters:
      bean - The bean object whose properties are to be erased. If this is null, the method does nothing.
    • enumListOf

      public static <E extends Enum<E>> ImmutableList<E> enumListOf(Class<E> enumClass)
      Returns an immutable/unmodifiable list of all the enum constants in the specified enum class. This method retrieves all the enum constants defined in the given enum class and returns them as an ImmutableList. The order of the constants in the list is the order in which they're declared in the enum class.
      Type Parameters:
      E - The type of the enum constants. This should be an enum type.
      Parameters:
      enumClass - The class object of the enum type whose constants are to be listed. Must not be null.
      Returns:
      An ImmutableList containing all the enum constants in the order they're declared in the enum class.
    • enumSetOf

      public static <E extends Enum<E>> ImmutableSet<E> enumSetOf(Class<E> enumClass)
      Returns an immutable/unmodifiable set of all the enum constants in the specified enum class. This method retrieves all the enum constants defined in the given enum class and returns them as an ImmutableSet. The order of the constants in the set is the order in which they're declared in the enum class.
      Type Parameters:
      E - The type of the enum constants. This should be an enum type.
      Parameters:
      enumClass - The class object of the enum type whose constants are to be listed. Must not be null.
      Returns:
      An ImmutableSet containing all the enum constants in the order they're declared in the enum class.
    • enumMapOf

      public static <E extends Enum<E>> ImmutableBiMap<E,String> enumMapOf(Class<E> enumClass)
      Returns an immutable/unmodifiable bi-directional map of all the enum constants in the specified enum class to their names. This method retrieves all the enum constants defined in the given enum class and maps them to their names as an ImmutableBiMap. The order of the constants in the map is the order in which they're declared in the enum class.
      Type Parameters:
      E - The type of the enum constants. This should be an enum type.
      Parameters:
      enumClass - The class object of the enum type whose constants are to be listed. Must not be null.
      Returns:
      An ImmutableBiMap where each key-value pair corresponds to an enum constant and its name.
    • newInstance

      public static <T> T newInstance(Class<T> cls)
      Type Parameters:
      T -
      Parameters:
      cls -
      Returns:
      T
      See Also:
    • newProxyInstance

      public static <T> T newProxyInstance(Class<T> interfaceClass, InvocationHandler h)
      Creates a new proxy instance for the specified interface using the provided invocation handler. This method is a utility for creating dynamic proxies. A dynamic proxy class is a class that implements a list of interfaces specified at runtime such that a method invocation through one of the interfaces on an instance of the class will be encoded and dispatched to another object through a uniform interface. Thus, a dynamic proxy class can be used to create an object that can implement an arbitrary set of interfaces specified at runtime.
      Type Parameters:
      T - The type of the interface for the proxy class to implement.
      Parameters:
      interfaceClass - The Class object of the interface for the proxy class to implement. Must not be null.
      h - The invocation handler to dispatch method invocations to. It's a object that implements the InvocationHandler interface.
      Returns:
      a proxy instance that implements the specified interface(s) and dispatches method invocations to the specified invocation handler.
      See Also:
    • newProxyInstance

      public static <T> T newProxyInstance(Class<?>[] interfaceClasses, InvocationHandler h)
      Creates a new proxy instance for the specified interfaces using the provided invocation handler. This method is a utility for creating dynamic proxies. A dynamic proxy class is a class that implements a list of interfaces specified at runtime such that a method invocation through one of the interfaces on an instance of the class will be encoded and dispatched to another object through a uniform interface. Thus, a dynamic proxy class can be used to create an object that can implement an arbitrary set of interfaces specified at runtime.
      Type Parameters:
      T - The type of the interface for the proxy class to implement.
      Parameters:
      interfaceClasses - The array of Class objects of the interfaces for the proxy class to implement. Must not be null.
      h - The invocation handler to dispatch method invocations to. It's an object that implements the InvocationHandler interface.
      Returns:
      a proxy instance that implements the specified interface(s) and dispatches method invocations to the specified invocation handler.
      See Also:
    • newCollection

      public static <T> Collection<T> newCollection(Class<? extends Collection> targetType)
      Type Parameters:
      T -
      Parameters:
      targetType -
      Returns:
      See Also:
    • newCollection

      public static <T> Collection<T> newCollection(Class<? extends Collection> targetType, int size)
      Type Parameters:
      T -
      Parameters:
      targetType -
      size -
      Returns:
      See Also:
    • newMap

      public static <K, V> Map<K,V> newMap(Class<? extends Map> targetType)
      Type Parameters:
      K -
      V -
      Parameters:
      targetType -
      Returns:
      See Also:
    • newMap

      public static <K, V> Map<K,V> newMap(Class<? extends Map> targetType, int size)
      Type Parameters:
      K -
      V -
      Parameters:
      targetType -
      size -
      Returns:
      See Also:
    • newArray

      public static <T> T newArray(Class<?> componentType, int length)
      Type Parameters:
      T -
      Parameters:
      componentType -
      length -
      Returns:
      T[]
      See Also:
    • newArray

      @SafeVarargs public static <T> T newArray(Class<?> componentType, int... dimensions) throws IllegalArgumentException, NegativeArraySizeException
      Type Parameters:
      T -
      Parameters:
      componentType -
      dimensions -
      Returns:
      Throws:
      IllegalArgumentException
      NegativeArraySizeException
      See Also:
    • newBean

      public static <T> T newBean(Class<T> targetType)
      Type Parameters:
      T -
      Parameters:
      targetType -
      Returns:
    • newBean

      public static <T> T newBean(Class<T> targetType, String beanName)
      Type Parameters:
      T -
      Parameters:
      targetType -
      beanName -
      Returns:
    • newArrayList

      public static <T> ArrayList<T> newArrayList()
      New array list.
      Type Parameters:
      T -
      Returns:
    • newArrayList

      public static <T> ArrayList<T> newArrayList(int initialCapacity)
      New array list.
      Type Parameters:
      T -
      Parameters:
      initialCapacity -
      Returns:
    • newArrayList

      public static <T> ArrayList<T> newArrayList(Collection<? extends T> c)
      New array list.
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
    • newLinkedList

      public static <T> LinkedList<T> newLinkedList()
      New linked list.
      Type Parameters:
      T -
      Returns:
    • newLinkedList

      public static <T> LinkedList<T> newLinkedList(Collection<? extends T> c)
      New linked list.
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
    • newHashSet

      public static <T> Set<T> newHashSet()
      New hash set.
      Type Parameters:
      T -
      Returns:
    • newHashSet

      public static <T> Set<T> newHashSet(int initialCapacity)
      New hash set.
      Type Parameters:
      T -
      Parameters:
      initialCapacity -
      Returns:
    • newHashSet

      public static <T> Set<T> newHashSet(Collection<? extends T> c)
      New hash set.
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
    • newLinkedHashSet

      public static <T> Set<T> newLinkedHashSet()
      New linked hash set.
      Type Parameters:
      T -
      Returns:
    • newLinkedHashSet

      public static <T> Set<T> newLinkedHashSet(int initialCapacity)
      New linked hash set.
      Type Parameters:
      T -
      Parameters:
      initialCapacity -
      Returns:
    • newLinkedHashSet

      public static <T> Set<T> newLinkedHashSet(Collection<? extends T> c)
      New linked hash set.
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
    • newTreeSet

      public static <T extends Comparable<? super T>> TreeSet<T> newTreeSet()
      New tree set.
      Type Parameters:
      T -
      Returns:
    • newTreeSet

      public static <T> TreeSet<T> newTreeSet(Comparator<? super T> comparator)
      New tree set.
      Type Parameters:
      T -
      Parameters:
      comparator -
      Returns:
    • newTreeSet

      public static <T extends Comparable<? super T>> TreeSet<T> newTreeSet(Collection<? extends T> c)
      New tree set.
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
    • newTreeSet

      public static <T> TreeSet<T> newTreeSet(SortedSet<T> c)
      New tree set.
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
    • newConcurrentHashSet

      public static <T> Set<T> newConcurrentHashSet()
      New hash set.
      Type Parameters:
      T -
      Returns:
      See Also:
    • newConcurrentHashSet

      public static <T> Set<T> newConcurrentHashSet(int initialCapacity)
      New hash set.
      Type Parameters:
      T -
      Parameters:
      initialCapacity -
      Returns:
      See Also:
    • newConcurrentHashSet

      public static <T> Set<T> newConcurrentHashSet(Collection<? extends T> c)
      New hash set.
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
      See Also:
    • newSetFromMap

      public static <E> Set<E> newSetFromMap(Map<E,Boolean> map)
      Returns a set backed by the specified map.
      Type Parameters:
      E -
      Parameters:
      map - the backing map
      Returns:
      See Also:
    • newMultiset

      public static <T> Multiset<T> newMultiset()
      Type Parameters:
      T -
      Returns:
    • newMultiset

      public static <T> Multiset<T> newMultiset(int initialCapacity)
      Type Parameters:
      T -
      Parameters:
      initialCapacity -
      Returns:
    • newMultiset

      public static <T> Multiset<T> newMultiset(Class<? extends Map> valueMapType)
      Type Parameters:
      T -
      Parameters:
      valueMapType -
      Returns:
    • newMultiset

      public static <T> Multiset<T> newMultiset(Supplier<? extends Map<T,?>> mapSupplier)
      Type Parameters:
      T -
      Parameters:
      mapSupplier -
      Returns:
    • newMultiset

      public static <T> Multiset<T> newMultiset(Collection<? extends T> c)
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
    • newArrayDeque

      public static <T> ArrayDeque<T> newArrayDeque()
      New array deque.
      Type Parameters:
      T -
      Returns:
    • newArrayDeque

      public static <T> ArrayDeque<T> newArrayDeque(int numElements)
      Constructs an empty array deque with an initial capacity sufficient to hold the specified number of elements.
      Type Parameters:
      T -
      Parameters:
      numElements - lower bound on initial capacity of the deque.
      Returns:
    • newArrayDeque

      public static <E> ArrayDeque<E> newArrayDeque(Collection<? extends E> c)
      Constructs a deque containing the elements of the specified collection, in the order they are returned by the collection's iterator.
      Type Parameters:
      E -
      Parameters:
      c -
      Returns:
    • newEntry

      public static <K, V> Map.Entry<K,V> newEntry(K key, V value)
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      key -
      value -
      Returns:
    • newImmutableEntry

      public static <K, V> ImmutableEntry<K,V> newImmutableEntry(K key, V value)
      New immutable/unmodifiable entry.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      key -
      value -
      Returns:
    • newHashMap

      public static <K, V> Map<K,V> newHashMap()
      New hash map.
      Type Parameters:
      K - the key type
      V - the value type
      Returns:
    • newHashMap

      public static <K, V> Map<K,V> newHashMap(int initialCapacity)
      New hash map.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      initialCapacity -
      Returns:
    • newHashMap

      public static <K, V> Map<K,V> newHashMap(Map<? extends K,? extends V> m)
      New hash map.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      m -
      Returns:
    • newHashMap

      public static <K, V> Map<K,V> newHashMap(Collection<? extends V> c, Function<? super V,? extends K> keyMapper) throws IllegalArgumentException
      New hash map.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      c -
      keyMapper -
      Returns:
      Throws:
      IllegalArgumentException
    • newLinkedHashMap

      public static <K, V> Map<K,V> newLinkedHashMap()
      New linked hash map.
      Type Parameters:
      K - the key type
      V - the value type
      Returns:
    • newLinkedHashMap

      public static <K, V> Map<K,V> newLinkedHashMap(int initialCapacity)
      New linked hash map.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      initialCapacity -
      Returns:
    • newLinkedHashMap

      public static <K, V> Map<K,V> newLinkedHashMap(Map<? extends K,? extends V> m)
      New linked hash map.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      m -
      Returns:
    • newLinkedHashMap

      public static <K, V> Map<K,V> newLinkedHashMap(Collection<? extends V> c, Function<? super V,? extends K> keyMapper) throws IllegalArgumentException
      New linked hash map.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      c -
      keyMapper -
      Returns:
      Throws:
      IllegalArgumentException
    • newTreeMap

      public static <K extends Comparable<? super K>, V> TreeMap<K,V> newTreeMap()
      New tree map.
      Type Parameters:
      K - the key type
      V - the value type
      Returns:
    • newTreeMap

      public static <C, K extends C, V> TreeMap<K,V> newTreeMap(Comparator<C> comparator)
      New tree map.
      Type Parameters:
      C -
      K - the key type
      V - the value type
      Parameters:
      comparator -
      Returns:
    • newTreeMap

      public static <K extends Comparable<? super K>, V> TreeMap<K,V> newTreeMap(Map<? extends K,? extends V> m)
      New tree map.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      m -
      Returns:
    • newTreeMap

      public static <K, V> TreeMap<K,V> newTreeMap(SortedMap<K,? extends V> m)
      New tree map.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      m -
      Returns:
    • newIdentityHashMap

      public static <K, V> IdentityHashMap<K,V> newIdentityHashMap()
      New identity hash map.
      Type Parameters:
      K - the key type
      V - the value type
      Returns:
    • newIdentityHashMap

      public static <K, V> IdentityHashMap<K,V> newIdentityHashMap(int initialCapacity)
      New identity hash map.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      initialCapacity -
      Returns:
    • newIdentityHashMap

      public static <K, V> IdentityHashMap<K,V> newIdentityHashMap(Map<? extends K,? extends V> m)
      New identity hash map.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      m -
      Returns:
    • newConcurrentHashMap

      public static <K, V> ConcurrentHashMap<K,V> newConcurrentHashMap()
      New concurrent hash map.
      Type Parameters:
      K - the key type
      V - the value type
      Returns:
    • newConcurrentHashMap

      public static <K, V> ConcurrentHashMap<K,V> newConcurrentHashMap(int initialCapacity)
      New concurrent hash map.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      initialCapacity -
      Returns:
    • newConcurrentHashMap

      public static <K, V> ConcurrentHashMap<K,V> newConcurrentHashMap(Map<? extends K,? extends V> m)
      New concurrent hash map.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      m -
      Returns:
    • newBiMap

      public static <K, V> BiMap<K,V> newBiMap()
      New bi map.
      Type Parameters:
      K - the key type
      V - the value type
      Returns:
    • newBiMap

      public static <K, V> BiMap<K,V> newBiMap(int initialCapacity)
      New bi map.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      initialCapacity -
      Returns:
    • newBiMap

      public static <K, V> BiMap<K,V> newBiMap(int initialCapacity, float loadFactor)
      New bi map.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      initialCapacity -
      loadFactor -
      Returns:
    • newBiMap

      public static <K, V> BiMap<K,V> newBiMap(Class<? extends Map> keyMapType, Class<? extends Map> valueMapType)
      New bi map.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      keyMapType -
      valueMapType -
      Returns:
    • newBiMap

      public static <K, V> BiMap<K,V> newBiMap(Supplier<? extends Map<K,V>> keyMapSupplier, Supplier<? extends Map<V,K>> valueMapSupplier)
      New bi map.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      keyMapSupplier -
      valueMapSupplier -
      Returns:
    • newMultimap

      public static <K, E, V extends Collection<E>> Multimap<K,E,V> newMultimap(Supplier<? extends Map<K,V>> mapSupplier, Supplier<? extends V> valueSupplier)
      Type Parameters:
      K - the key type
      E -
      V - the value type
      Parameters:
      mapSupplier -
      valueSupplier -
      Returns:
    • newListMultimap

      public static <K, E> ListMultimap<K,E> newListMultimap()
      New list multimap.
      Type Parameters:
      K - the key type
      E -
      Returns:
    • newListMultimap

      public static <K, E> ListMultimap<K,E> newListMultimap(int initialCapacity)
      New list multimap.
      Type Parameters:
      K - the key type
      E -
      Parameters:
      initialCapacity -
      Returns:
    • newListMultimap

      public static <K, E> ListMultimap<K,E> newListMultimap(Class<? extends Map> mapType)
      New list multimap.
      Type Parameters:
      K - the key type
      E -
      Parameters:
      mapType -
      Returns:
    • newListMultimap

      public static <K, E> ListMultimap<K,E> newListMultimap(Class<? extends Map> mapType, Class<? extends List> valueType)
      New list multimap.
      Type Parameters:
      K - the key type
      E -
      Parameters:
      mapType -
      valueType -
      Returns:
    • newListMultimap

      public static <K, E> ListMultimap<K,E> newListMultimap(Supplier<? extends Map<K,List<E>>> mapSupplier, Supplier<? extends List<E>> valueSupplier)
      New list multimap.
      Type Parameters:
      K - the key type
      E -
      Parameters:
      mapSupplier -
      valueSupplier -
      Returns:
    • newListMultimap

      public static <K, E> ListMultimap<K,E> newListMultimap(Map<? extends K,? extends E> m)
      New list multimap.
      Type Parameters:
      K - the key type
      E -
      Parameters:
      m -
      Returns:
    • newListMultimap

      public static <T, K> ListMultimap<K,T> newListMultimap(Collection<? extends T> c, Function<? super T,? extends K> keyMapper)
      Type Parameters:
      T -
      K - the key type
      Parameters:
      c -
      keyMapper -
      Returns:
    • newListMultimap

      public static <T, K, E> ListMultimap<K,E> newListMultimap(Collection<? extends T> c, Function<? super T,? extends K> keyMapper, Function<? super T,? extends E> valueExtractor)
      Type Parameters:
      T -
      K - the key type
      E -
      Parameters:
      c -
      keyMapper -
      valueExtractor -
      Returns:
    • newLinkedListMultimap

      public static <K, E> ListMultimap<K,E> newLinkedListMultimap()
      Returns a ListMultimap backed by LinkedHashMap. 'Linked' is about the map, not the value.
      Type Parameters:
      K - the key type
      E -
      Returns:
    • newLinkedListMultimap

      public static <K, E> ListMultimap<K,E> newLinkedListMultimap(int initialCapacity)
      Returns a ListMultimap backed by LinkedHashMap. 'Linked' is about the map, not the value.
      Type Parameters:
      K - the key type
      E -
      Parameters:
      initialCapacity -
      Returns:
    • newLinkedListMultimap

      public static <K, E> ListMultimap<K,E> newLinkedListMultimap(Map<? extends K,? extends E> m)
      Returns a ListMultimap backed by LinkedHashMap. 'Linked' is about the map, not the value.
      Type Parameters:
      K - the key type
      E -
      Parameters:
      m -
      Returns:
    • newSortedListMultimap

      public static <K extends Comparable<? super K>, E> ListMultimap<K,E> newSortedListMultimap()
      Returns a ListMultimap backed by SortedMap. 'Sorted' is about the map, not the value.
      Type Parameters:
      K - the key type
      E -
      Returns:
    • newSortedListMultimap

      public static <K extends Comparable<? super K>, E> ListMultimap<K,E> newSortedListMultimap(Map<? extends K,? extends E> m)
      Returns a ListMultimap backed by SortedMap. 'Sorted' is about the map, not the value.
      Type Parameters:
      K - the key type
      E -
      Parameters:
      m -
      Returns:
    • newSetMultimap

      public static <K, E> SetMultimap<K,E> newSetMultimap()
      New set multimap.
      Type Parameters:
      K - the key type
      E -
      Returns:
    • newSetMultimap

      public static <K, E> SetMultimap<K,E> newSetMultimap(int initialCapacity)
      New set multimap.
      Type Parameters:
      K - the key type
      E -
      Parameters:
      initialCapacity -
      Returns:
    • newSetMultimap

      public static <K, E> SetMultimap<K,E> newSetMultimap(Class<? extends Map> mapType)
      New set multimap.
      Type Parameters:
      K - the key type
      E -
      Parameters:
      mapType -
      Returns:
    • newSetMultimap

      public static <K, E> SetMultimap<K,E> newSetMultimap(Class<? extends Map> mapType, Class<? extends Set> valueType)
      New set multimap.
      Type Parameters:
      K - the key type
      E -
      Parameters:
      mapType -
      valueType -
      Returns:
    • newSetMultimap

      public static <K, E> SetMultimap<K,E> newSetMultimap(Supplier<? extends Map<K,Set<E>>> mapSupplier, Supplier<? extends Set<E>> valueSupplier)
      New set multimap.
      Type Parameters:
      K - the key type
      E -
      Parameters:
      mapSupplier -
      valueSupplier -
      Returns:
    • newSetMultimap

      public static <K, E> SetMultimap<K,E> newSetMultimap(Map<? extends K,? extends E> m)
      New set multimap.
      Type Parameters:
      K - the key type
      E -
      Parameters:
      m -
      Returns:
    • newSetMultimap

      public static <T, K> SetMultimap<K,T> newSetMultimap(Collection<? extends T> c, Function<? super T,? extends K> keyMapper)
      Type Parameters:
      T -
      K - the key type
      Parameters:
      c -
      keyMapper -
      Returns:
    • newSetMultimap

      public static <T, K, E> SetMultimap<K,E> newSetMultimap(Collection<? extends T> c, Function<? super T,? extends K> keyMapper, Function<? super T,? extends E> valueExtractor)
      Type Parameters:
      T -
      K - the key type
      E -
      Parameters:
      c -
      keyMapper -
      valueExtractor -
      Returns:
    • newLinkedSetMultimap

      public static <K, E> SetMultimap<K,E> newLinkedSetMultimap()
      Returns a SetMultimap backed by LinkedHashMap. 'Linked' is about the map, not the value.
      Type Parameters:
      K - the key type
      E -
      Returns:
    • newLinkedSetMultimap

      public static <K, E> SetMultimap<K,E> newLinkedSetMultimap(int initialCapacity)
      Returns a SetMultimap backed by LinkedHashMap. 'Linked' is about the map, not the value.
      Type Parameters:
      K - the key type
      E -
      Parameters:
      initialCapacity -
      Returns:
    • newLinkedSetMultimap

      public static <K, E> SetMultimap<K,E> newLinkedSetMultimap(Map<? extends K,? extends E> m)
      Returns a SetMultimap backed by LinkedHashMap. 'Linked' is about the map, not the value.
      Type Parameters:
      K - the key type
      E -
      Parameters:
      m -
      Returns:
    • newSortedSetMultimap

      public static <K extends Comparable<? super K>, E> SetMultimap<K,E> newSortedSetMultimap()
      Returns a SetMultimap backed by SortedMap. 'Sorted' is about the map, not the value.
      Type Parameters:
      K - the key type
      E -
      Returns:
    • newSortedSetMultimap

      public static <K extends Comparable<? super K>, E> SetMultimap<K,E> newSortedSetMultimap(Map<? extends K,? extends E> m)
      Returns a SetMultimap backed by SortedMap. 'Sorted' is about the map, not the value.
      Type Parameters:
      K - the key type
      E -
      Parameters:
      m -
      Returns:
    • newEmptyDataSet

      public static DataSet newEmptyDataSet()
      Creates a new empty DataSet. The DataSet is a data structure that stores data in a tabular format, similar to a table in a database. This method creates a DataSet with no rows or columns.
      Returns:
      A new empty DataSet.
      See Also:
    • newEmptyDataSet

      public static DataSet newEmptyDataSet(Collection<String> columnNames)
      Creates a new empty DataSet with the specified column names. The DataSet is a data structure that stores data in a tabular format, similar to a table in a database. This method creates a DataSet with no rows, but with the specified column names.
      Parameters:
      columnNames - A collection of strings representing the names of the columns in the DataSet.
      Returns:
      A new empty DataSet with the specified column names.
      See Also:
    • newEmptyDataSet

      public static DataSet newEmptyDataSet(Collection<String> columnNames, Map<String,Object> properties)
      Creates a new empty DataSet with the specified column names and properties. The DataSet is a data structure that stores data in a tabular format, similar to a table in a database. This method creates a DataSet with no rows, but with the specified column names and properties.
      Parameters:
      columnNames - A collection of strings representing the names of the columns in the DataSet.
      properties - A map representing the properties of the DataSet. The keys are property names and the values are the corresponding property values.
      Returns:
      A new empty DataSet with the specified column names and properties.
      See Also:
    • newDataSet

      public static DataSet newDataSet(Collection<?> rows) throws IllegalArgumentException
      Creates a new DataSet with the specified rows. The DataSet is a data structure that stores data in a tabular format, similar to a table in a database. The 'rows' parameter is a collection where each item represents a row in the DataSet.
      Parameters:
      rows - A collection of objects representing the data in the DataSet. Each object is a row which can be: Map/Bean.
      Returns:
      A new DataSet with the specified rows.
      Throws:
      IllegalArgumentException - If the provided rows do not align properly.
      See Also:
    • newDataSet

      public static DataSet newDataSet(Collection<?> rows, Map<String,Object> properties) throws IllegalArgumentException
      Creates a new DataSet with the specified rows and properties. The DataSet is a data structure that stores data in a tabular format, similar to a table in a database. The 'rows' parameter is a collection where each item represents a row in the DataSet. The 'properties' parameter is a map where each entry represents a property of the DataSet.
      Parameters:
      rows - A collection of objects representing the data in the DataSet. Each object is a row which can be: Map/Bean.
      properties - A map of properties for the DataSet. Each key is a property name and each value is the property value.
      Returns:
      A new DataSet with the specified rows and properties.
      Throws:
      IllegalArgumentException - If the provided rows and properties do not align properly.
      See Also:
    • newDataSet

      public static DataSet newDataSet(Collection<String> columnNames, Collection<?> rows) throws IllegalArgumentException
      Creates a new DataSet with the specified column names and rows. The DataSet is a data structure that stores data in a tabular format, similar to a table in a database. Each item in the 'columnNames' collection represents a column in the DataSet. The 'rows' parameter is a collection where each item represents a row in the DataSet. The order of elements in each row should correspond to the order of column names.
      Parameters:
      columnNames - A collection of strings representing the names of the columns in the DataSet.
      rows - A collection of objects representing the data in the DataSet. Each object is a row which can be: Map/Bean/Array/List.
      Returns:
      A new DataSet with the specified column names and rows.
      Throws:
      IllegalArgumentException - If the provided columnNames and rows do not align properly.
      See Also:
    • newDataSet

      public static DataSet newDataSet(Collection<String> columnNames, Collection<?> rows, Map<String,Object> properties) throws IllegalArgumentException
      Creates a new DataSet with the specified column names, rows, and properties. The DataSet is a data structure that stores data in a tabular format, similar to a table in a database. Each item in the 'columnNames' collection represents a column in the DataSet. The 'rows' parameter is a collection where each item represents a row in the DataSet. The order of elements in each row should correspond to the order of column names. The 'properties' parameter is a map where each entry represents a property of the DataSet.
      Parameters:
      columnNames - A collection of strings representing the names of the columns in the DataSet.
      rows - A collection of objects representing the data in the DataSet. Each object is a row which can be: Map/Bean/Array/List.
      properties - A map of properties for the DataSet. Each key is a property name and each value is the property value.
      Returns:
      A new DataSet with the specified column names, rows, and properties.
      Throws:
      IllegalArgumentException - If the provided columnNames and rows do not align properly.
      See Also:
    • newDataSet

      public static DataSet newDataSet(Collection<String> columnNames, Object[][] rowList) throws IllegalArgumentException
      Creates a new DataSet with the specified column names and rows. The DataSet is a data structure that stores data in a tabular format, similar to a table in a database. Each item in the 'columnNames' collection represents a column in the DataSet. The 'rowList' parameter is a 2D array where each sub-array represents a row in the DataSet. The order of elements in each row should correspond to the order of column names.
      Parameters:
      columnNames - A collection of strings representing the names of the columns in the DataSet.
      rowList - A 2D array of objects representing the data in the DataSet. Each sub-array is a row.
      Returns:
      A new DataSet with the specified column names and rows.
      Throws:
      IllegalArgumentException - If the length of 'columnNames' is not equal to the length of the sub-arrays in 'rowList'.
      See Also:
    • newDataSet

      public static DataSet newDataSet(String keyColumnName, String valueColumnName, Map<?,?> m)
      Creates a new DataSet from the provided Map. The DataSet will have two columns: one for keys and one for values from the Map.
      Parameters:
      keyColumnName - The name of the column for the keys from the Map.
      valueColumnName - The name of the column for the values from the Map.
      m - The Map to convert into a DataSet.
      Returns:
      A new DataSet with two columns: one for keys and one for values from the Map.
    • newDataSet

      public static <C extends Collection<?>> DataSet newDataSet(Map<String,C> map)
      Creates a new DataSet from the provided Map. The DataSet will have as many columns as there are entries in the Map. The column names are the keys from the Map. Each column corresponds to a Collection in the Map. If a column has fewer rows than the maximum number of rows, the missing rows will be filled with null values. Eventually all the columns will have the same number of rows.
      Type Parameters:
      C - The type of the Collection values in the Map.
      Parameters:
      map - The Map to convert into a DataSet. The keys of the map represent the column names and the values (which are collections) represent the data in the columns.
      Returns:
      A new DataSet with columns created from the Map.
    • newDataSet

      public static DataSet newDataSet(String columnName, Collection<?> column) throws IllegalArgumentException
      Creates a new DataSet with single column from the provided Collection. The DataSet will have one column with the provided column name. The data in the column is the data from the provided Collection.
      Parameters:
      columnName - The name of the column in the DataSet.
      column - The Collection to convert into a DataSet column.
      Returns:
      A new DataSet with one column containing the data from the provided Collection.
      Throws:
      IllegalArgumentException - if the provided columnName is empty.
    • merge

      public static DataSet merge(@NotNull DataSet a, @NotNull DataSet b) throws IllegalArgumentException
      Merges two given DataSets into a single DataSet.
      Parameters:
      a - The first DataSet to be merged.
      b - The second DataSet to be merged.
      Returns:
      A new DataSet which is the result of merging DataSet a and DataSet b.
      Throws:
      IllegalArgumentException - if either a or b is null.
    • merge

      Merges three given DataSets into a single DataSet.
      Parameters:
      a - The first DataSet to be merged.
      b - The second DataSet to be merged.
      c - The third DataSet to be merged.
      Returns:
      A new DataSet which is the result of merging DataSet a, b and c.
      Throws:
      IllegalArgumentException - if either a, b or c is null.
    • merge

      public static DataSet merge(Collection<? extends DataSet> dss) throws IllegalArgumentException
      Merges a collection of DataSets into a single DataSet.
      Parameters:
      dss - The collection of DataSets to be merged.
      Returns:
      A new DataSet which is the result of merging all the DataSets in the provided collection.
      Throws:
      IllegalArgumentException - if the provided collection is null.
    • merge

      public static DataSet merge(Collection<? extends DataSet> dss, boolean requiresSameColumns) throws IllegalArgumentException
      Merges a collection of DataSets into a single DataSet.
      Parameters:
      dss - The collection of DataSets to be merged.
      requiresSameColumns - A boolean flag that indicates whether the DataSets in the collection should have the same columns. If set to true, all DataSets in the collection must have the same columns. If set to false, the DataSets in the collection can have different columns.
      Returns:
      A new DataSet which is the result of merging all the DataSets in the provided collection.
      Throws:
      IllegalArgumentException - if the provided collection is null or requiresSameColumns is true and the DataSets in dss don't have the same the same column names.
    • toArray

      public static Object[] toArray(Collection<?> c)
      Returns an empty array if the specified collection is null or empty.
      Parameters:
      c -
      Returns:
    • toArray

      public static Object[] toArray(Collection<?> c, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Converts the specified range in the specified collection into an array.
      Parameters:
      c - The collection to be converted into an array.
      fromIndex - The starting (inclusive) index of the range to be converted.
      toIndex - The ending (exclusive) index of the range to be converted.
      Returns:
      An array containing the elements of the specified range of the collection.
      Throws:
      IndexOutOfBoundsException - if the provided indices are out of the collection's range.
    • toArray

      public static <A, T extends A> A[] toArray(Collection<? extends T> c, @NotNull A[] a) throws IndexOutOfBoundsException, IllegalArgumentException
      Converts a collection into an array. If the provided array is large enough to hold the elements of the collection, it is filled with the collection's elements, otherwise, a new array of the same runtime type is allocated for this purpose.
      Type Parameters:
      A - The type of the array.
      T - The type of the elements in the collection. It must extend or be the same as the type of the array.
      Parameters:
      c - The collection to be converted into an array.
      a - The array into which the elements of the collection are to be stored, if it is big enough; otherwise, a new array of the same runtime type is allocated for this purpose.
      Returns:
      The array containing the elements of the collection. If the provided array was large enough to hold the collection's elements, it is the same as the provided array.
      Throws:
      IllegalArgumentException - if the specified Array is null.
      IndexOutOfBoundsException
    • toArray

      public static <A, T extends A> A[] toArray(Collection<? extends T> c, int fromIndex, int toIndex, @NotNull A[] a) throws IllegalArgumentException
      Converts the specified range in the specified collection into an array. If the provided array is large enough to hold the elements of the collection, it is filled with the collection's elements, otherwise, a new array of the same runtime type is allocated for this purpose.
      Type Parameters:
      A - The type of the array.
      T - The type of the elements in the collection. It must extend or be the same as the type of the array.
      Parameters:
      c - The collection to be converted into an array.
      fromIndex - The starting (inclusive) index of the range to be converted.
      toIndex - The ending (exclusive) index of the range to be converted.
      a - The array into which the elements of the collection are to be stored, if it is big enough; otherwise, a new array of the same runtime type is allocated for this purpose.
      Returns:
      The array containing the elements of the specified portion of the collection. If the provided array was large enough to hold the collection's elements, it is the same as the provided array.
      Throws:
      IllegalArgumentException - if the specified Array is null.
    • toArray

      public static <A, T extends A> A[] toArray(Collection<? extends T> c, IntFunction<A[]> arraySupplier)
      Converts a collection into an array using a provided array supplier function. The array supplier function is responsible for creating a new array of the appropriate type and size.
      Type Parameters:
      A - The type of the array.
      T - The type of the elements in the collection. It must extend or be the same as the type of the array.
      Parameters:
      c - The collection to be converted into an array.
      arraySupplier - The function to generate a new array of the appropriate type and size.
    • toArray

      public static <A, T extends A> A[] toArray(Collection<? extends T> c, int fromIndex, int toIndex, IntFunction<A[]> arraySupplier) throws IndexOutOfBoundsException
      Converts the specified range in the specified collection into an array using a provided array supplier function. The array supplier function is responsible for creating a new array of the appropriate type and size.
      Type Parameters:
      A - The type of the array.
      T - The type of the elements in the collection. It must extend or be the same as the type of the array.
      Parameters:
      c - The collection to be converted into an array.
      fromIndex - The starting (inclusive) index of the portion to be converted.
      toIndex - The ending (exclusive) index of the portion to be converted.
      arraySupplier - The function to generate a new array of the appropriate type and size.
      Returns:
      The array containing the elements of the specified portion of the collection.
      Throws:
      IndexOutOfBoundsException - if the specified fromIndex or toIndex is out of the collection's range.
    • toArray

      public static <A, T extends A> A[] toArray(Collection<? extends T> c, @NotNull Class<A[]> targetType) throws IndexOutOfBoundsException, IllegalArgumentException
      Converts a collection into an array of a specified type.
      Type Parameters:
      A - The type of the array.
      T - The type of the elements in the collection. It must extend or be the same as the type of the array.
      Parameters:
      c - The collection to be converted into an array.
      targetType - The Class object representing the type of the array to be returned.
      Returns:
      The array containing the elements of the collection.
      Throws:
      IllegalArgumentException - if the specified Class is null.
      IndexOutOfBoundsException
    • toArray

      public static <A, T extends A> A[] toArray(Collection<? extends T> c, int fromIndex, int toIndex, @NotNull Class<A[]> targetType) throws IllegalArgumentException
      Converts the specified range in the specified collection into an array of a specified type.
      Type Parameters:
      A - The type of the array.
      T - The type of the elements in the collection. It must extend or be the same as the type of the array.
      Parameters:
      c - The collection to be converted into an array.
      fromIndex - The starting (inclusive) index of the range to be converted.
      toIndex - The ending (exclusive) index of the range to be converted.
      targetType - The Class object representing the type of the array to be returned.
      Returns:
      The array containing the elements of the specified portion of the collection.
      Throws:
      IllegalArgumentException - if the specified Class is null.
      IndexOutOfBoundsException - if the specified fromIndex or toIndex is out of the collection's range.
    • toBooleanArray

      public static boolean[] toBooleanArray(Collection<Boolean> c)
      To boolean array.
      Parameters:
      c -
      Returns:
    • toBooleanArray

      public static boolean[] toBooleanArray(Collection<Boolean> c, int fromIndex, int toIndex)
      To boolean array.
      Parameters:
      c -
      fromIndex -
      toIndex -
      Returns:
    • toBooleanArray

      public static boolean[] toBooleanArray(Collection<Boolean> c, boolean defaultForNull)
      To boolean array.
      Parameters:
      c -
      defaultForNull -
      Returns:
    • toBooleanArray

      public static boolean[] toBooleanArray(Collection<Boolean> c, int fromIndex, int toIndex, boolean defaultForNull) throws IndexOutOfBoundsException
      To boolean array.
      Parameters:
      c -
      fromIndex -
      toIndex -
      defaultForNull -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • toBooleanArray

      public static boolean[] toBooleanArray(byte[] a)
      Converts a byte array to a boolean array. Each byte with positive value(> 0) is converted to a boolean value true, 0 and negative value to false.
      Parameters:
      a - the byte array to be converted
      Returns:
      a boolean array with the same length as the input array, or an empty boolean array if the input array is null or empty
    • toBooleanArray

      public static boolean[] toBooleanArray(int[] a)
      Converts an int array to a boolean array. Each int with positive value(> 0) is converted to a boolean value true, 0 and negative value to false.
      Parameters:
      a - the byte array to be converted
      Returns:
      a boolean array with the same length as the input array, or an empty boolean array if the input array is null or empty
    • toCharArray

      public static char[] toCharArray(Collection<Character> c)
      To char array.
      Parameters:
      c -
      Returns:
    • toCharArray

      public static char[] toCharArray(Collection<Character> c, int fromIndex, int toIndex)
      To char array.
      Parameters:
      c -
      fromIndex -
      toIndex -
      Returns:
    • toCharArray

      public static char[] toCharArray(Collection<Character> c, char defaultForNull)
      To char array.
      Parameters:
      c -
      defaultForNull -
      Returns:
    • toCharArray

      public static char[] toCharArray(Collection<Character> c, int fromIndex, int toIndex, char defaultForNull) throws IndexOutOfBoundsException
      To char array.
      Parameters:
      c -
      fromIndex -
      toIndex -
      defaultForNull -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • toByteArray

      public static byte[] toByteArray(Collection<? extends Number> c)
      To byte array.
      Parameters:
      c -
      Returns:
    • toByteArray

      public static byte[] toByteArray(Collection<? extends Number> c, int fromIndex, int toIndex)
      To byte array.
      Parameters:
      c -
      fromIndex -
      toIndex -
      Returns:
    • toByteArray

      public static byte[] toByteArray(Collection<? extends Number> c, byte defaultForNull)
      To byte array.
      Parameters:
      c -
      defaultForNull -
      Returns:
    • toByteArray

      public static byte[] toByteArray(Collection<? extends Number> c, int fromIndex, int toIndex, byte defaultForNull) throws IndexOutOfBoundsException
      To byte array.
      Parameters:
      c -
      fromIndex -
      toIndex -
      defaultForNull -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • toByteArray

      public static byte[] toByteArray(boolean[] a)
      Converts a boolean array to a byte array. Each boolean value is converted to a byte value: true to 1 and false to 0.
      Parameters:
      a - the boolean array to be converted
      Returns:
      a byte array with the same length as the input array, or an empty byte array if the input array is null or empty
    • toShortArray

      public static short[] toShortArray(Collection<? extends Number> c)
      To short array.
      Parameters:
      c -
      Returns:
    • toShortArray

      public static short[] toShortArray(Collection<? extends Number> c, int fromIndex, int toIndex)
      To short array.
      Parameters:
      c -
      fromIndex -
      toIndex -
      Returns:
    • toShortArray

      public static short[] toShortArray(Collection<? extends Number> c, short defaultForNull)
      To short array.
      Parameters:
      c -
      defaultForNull -
      Returns:
    • toShortArray

      public static short[] toShortArray(Collection<? extends Number> c, int fromIndex, int toIndex, short defaultForNull) throws IndexOutOfBoundsException
      To short array.
      Parameters:
      c -
      fromIndex -
      toIndex -
      defaultForNull -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • toIntArray

      public static int[] toIntArray(Collection<? extends Number> c)
      To int array.
      Parameters:
      c -
      Returns:
    • toIntArray

      public static int[] toIntArray(Collection<? extends Number> c, int fromIndex, int toIndex)
      To int array.
      Parameters:
      c -
      fromIndex -
      toIndex -
      Returns:
    • toIntArray

      public static int[] toIntArray(Collection<? extends Number> c, int defaultForNull)
      To int array.
      Parameters:
      c -
      defaultForNull -
      Returns:
    • toIntArray

      public static int[] toIntArray(Collection<? extends Number> c, int fromIndex, int toIndex, int defaultForNull) throws IndexOutOfBoundsException
      To int array.
      Parameters:
      c -
      fromIndex -
      toIndex -
      defaultForNull -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • toIntArray

      public static int[] toIntArray(char[] a)
      Converts a char array to an int array. Each char value is converted to its corresponding int value.
      Parameters:
      a - the char array to be converted
      Returns:
      an int array with the same length as the input array, or an empty byte array if the input array is null or empty
    • toIntArray

      public static int[] toIntArray(boolean[] a)
      Converts a boolean array to an int array. Each boolean value is converted to an int value: true to 1 and false to 0.
      Parameters:
      a - the boolean array to be converted
      Returns:
      an int array with the same length as the input array, or an empty byte array if the input array is null or empty
    • toLongArray

      public static long[] toLongArray(Collection<? extends Number> c)
      To long array.
      Parameters:
      c -
      Returns:
    • toLongArray

      public static long[] toLongArray(Collection<? extends Number> c, int fromIndex, int toIndex)
      To long array.
      Parameters:
      c -
      fromIndex -
      toIndex -
      Returns:
    • toLongArray

      public static long[] toLongArray(Collection<? extends Number> c, long defaultForNull)
      To long array.
      Parameters:
      c -
      defaultForNull -
      Returns:
    • toLongArray

      public static long[] toLongArray(Collection<? extends Number> c, int fromIndex, int toIndex, long defaultForNull) throws IndexOutOfBoundsException
      To long array.
      Parameters:
      c -
      fromIndex -
      toIndex -
      defaultForNull -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • toFloatArray

      public static float[] toFloatArray(Collection<? extends Number> c)
      To float array.
      Parameters:
      c -
      Returns:
    • toFloatArray

      public static float[] toFloatArray(Collection<? extends Number> c, int fromIndex, int toIndex)
      To float array.
      Parameters:
      c -
      fromIndex -
      toIndex -
      Returns:
    • toFloatArray

      public static float[] toFloatArray(Collection<? extends Number> c, float defaultForNull)
      To float array.
      Parameters:
      c -
      defaultForNull -
      Returns:
    • toFloatArray

      public static float[] toFloatArray(Collection<? extends Number> c, int fromIndex, int toIndex, float defaultForNull) throws IndexOutOfBoundsException
      To float array.
      Parameters:
      c -
      fromIndex -
      toIndex -
      defaultForNull -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • toDoubleArray

      public static double[] toDoubleArray(Collection<? extends Number> c)
      To double array.
      Parameters:
      c -
      Returns:
    • toDoubleArray

      public static double[] toDoubleArray(Collection<? extends Number> c, int fromIndex, int toIndex)
      To double array.
      Parameters:
      c -
      fromIndex -
      toIndex -
      Returns:
    • toDoubleArray

      public static double[] toDoubleArray(Collection<? extends Number> c, double defaultForNull)
      To double array.
      Parameters:
      c -
      defaultForNull -
      Returns:
    • toDoubleArray

      public static double[] toDoubleArray(Collection<? extends Number> c, int fromIndex, int toIndex, double defaultForNull) throws IndexOutOfBoundsException
      To double array.
      Parameters:
      c -
      fromIndex -
      toIndex -
      defaultForNull -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • toList

      public static List<Boolean> toList(boolean[] a)
      Parameters:
      a -
      Returns:
    • toList

      public static List<Boolean> toList(boolean[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • toList

      public static List<Character> toList(char[] a)
      Parameters:
      a -
      Returns:
    • toList

      public static List<Character> toList(char[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • toList

      public static List<Byte> toList(byte[] a)
      Parameters:
      a -
      Returns:
    • toList

      public static List<Byte> toList(byte[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • toList

      public static List<Short> toList(short[] a)
      Parameters:
      a -
      Returns:
    • toList

      public static List<Short> toList(short[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • toList

      public static List<Integer> toList(int[] a)
      Parameters:
      a -
      Returns:
    • toList

      public static List<Integer> toList(int[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • toList

      public static List<Long> toList(long[] a)
      Parameters:
      a -
      Returns:
    • toList

      public static List<Long> toList(long[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • toList

      public static List<Float> toList(float[] a)
      Parameters:
      a -
      Returns:
    • toList

      public static List<Float> toList(float[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • toList

      public static List<Double> toList(double[] a)
      Parameters:
      a -
      Returns:
    • toList

      public static List<Double> toList(double[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • toList

      public static <T> List<T> toList(T[] a)
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • toList

      public static <T> List<T> toList(T[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • toList

      public static <T> List<T> toList(Iterator<? extends T> iter)
      Type Parameters:
      T -
      Parameters:
      iter -
      Returns:
    • toSet

      public static Set<Boolean> toSet(boolean[] a)
      Parameters:
      a -
      Returns:
    • toSet

      public static Set<Boolean> toSet(boolean[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • toSet

      public static Set<Character> toSet(char[] a)
      Parameters:
      a -
      Returns:
    • toSet

      public static Set<Character> toSet(char[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • toSet

      public static Set<Byte> toSet(byte[] a)
      Parameters:
      a -
      Returns:
    • toSet

      public static Set<Byte> toSet(byte[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • toSet

      public static Set<Short> toSet(short[] a)
      Parameters:
      a -
      Returns:
    • toSet

      public static Set<Short> toSet(short[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • toSet

      public static Set<Integer> toSet(int[] a)
      Parameters:
      a -
      Returns:
    • toSet

      public static Set<Integer> toSet(int[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • toSet

      public static Set<Long> toSet(long[] a)
      Parameters:
      a -
      Returns:
    • toSet

      public static Set<Long> toSet(long[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • toSet

      public static Set<Float> toSet(float[] a)
      Parameters:
      a -
      Returns:
    • toSet

      public static Set<Float> toSet(float[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • toSet

      public static Set<Double> toSet(double[] a)
      Parameters:
      a -
      Returns:
    • toSet

      public static Set<Double> toSet(double[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • toSet

      public static <T> Set<T> toSet(T[] a)
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • toSet

      public static <T> Set<T> toSet(T[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • toSet

      public static <T> Set<T> toSet(Iterator<? extends T> iter)
      Type Parameters:
      T -
      Parameters:
      iter -
      Returns:
    • toCollection

      public static <C extends Collection<Boolean>> C toCollection(boolean[] a, IntFunction<? extends C> supplier)
      Type Parameters:
      C -
      Parameters:
      a -
      supplier -
      Returns:
    • toCollection

      public static <C extends Collection<Boolean>> C toCollection(boolean[] a, int fromIndex, int toIndex, IntFunction<? extends C> supplier) throws IndexOutOfBoundsException
      Type Parameters:
      C -
      Parameters:
      a -
      fromIndex -
      toIndex -
      supplier -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • toCollection

      public static <C extends Collection<Character>> C toCollection(char[] a, IntFunction<? extends C> supplier)
      Type Parameters:
      C -
      Parameters:
      a -
      supplier -
      Returns:
    • toCollection

      public static <C extends Collection<Character>> C toCollection(char[] a, int fromIndex, int toIndex, IntFunction<? extends C> supplier) throws IndexOutOfBoundsException
      Type Parameters:
      C -
      Parameters:
      a -
      fromIndex -
      toIndex -
      supplier -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • toCollection

      public static <C extends Collection<Byte>> C toCollection(byte[] a, IntFunction<? extends C> supplier)
      Type Parameters:
      C -
      Parameters:
      a -
      supplier -
      Returns:
    • toCollection

      public static <C extends Collection<Byte>> C toCollection(byte[] a, int fromIndex, int toIndex, IntFunction<? extends C> supplier) throws IndexOutOfBoundsException
      Type Parameters:
      C -
      Parameters:
      a -
      fromIndex -
      toIndex -
      supplier -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • toCollection

      public static <C extends Collection<Short>> C toCollection(short[] a, IntFunction<? extends C> supplier)
      Type Parameters:
      C -
      Parameters:
      a -
      supplier -
      Returns:
    • toCollection

      public static <C extends Collection<Short>> C toCollection(short[] a, int fromIndex, int toIndex, IntFunction<? extends C> supplier) throws IndexOutOfBoundsException
      Type Parameters:
      C -
      Parameters:
      a -
      fromIndex -
      toIndex -
      supplier -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • toCollection

      public static <C extends Collection<Integer>> C toCollection(int[] a, IntFunction<? extends C> supplier)
      Type Parameters:
      C -
      Parameters:
      a -
      supplier -
      Returns:
    • toCollection

      public static <C extends Collection<Integer>> C toCollection(int[] a, int fromIndex, int toIndex, IntFunction<? extends C> supplier) throws IndexOutOfBoundsException
      Type Parameters:
      C -
      Parameters:
      a -
      fromIndex -
      toIndex -
      supplier -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • toCollection

      public static <C extends Collection<Long>> C toCollection(long[] a, IntFunction<? extends C> supplier)
      Type Parameters:
      C -
      Parameters:
      a -
      supplier -
      Returns:
    • toCollection

      public static <C extends Collection<Long>> C toCollection(long[] a, int fromIndex, int toIndex, IntFunction<? extends C> supplier) throws IndexOutOfBoundsException
      Type Parameters:
      C -
      Parameters:
      a -
      fromIndex -
      toIndex -
      supplier -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • toCollection

      public static <C extends Collection<Float>> C toCollection(float[] a, IntFunction<? extends C> supplier)
      Type Parameters:
      C -
      Parameters:
      a -
      supplier -
      Returns:
    • toCollection

      public static <C extends Collection<Float>> C toCollection(float[] a, int fromIndex, int toIndex, IntFunction<? extends C> supplier) throws IndexOutOfBoundsException
      Type Parameters:
      C -
      Parameters:
      a -
      fromIndex -
      toIndex -
      supplier -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • toCollection

      public static <C extends Collection<Double>> C toCollection(double[] a, IntFunction<? extends C> supplier)
      Type Parameters:
      C -
      Parameters:
      a -
      supplier -
      Returns:
    • toCollection

      public static <C extends Collection<Double>> C toCollection(double[] a, int fromIndex, int toIndex, IntFunction<? extends C> supplier) throws IndexOutOfBoundsException
      Type Parameters:
      C -
      Parameters:
      a -
      fromIndex -
      toIndex -
      supplier -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • toCollection

      public static <T, C extends Collection<T>> C toCollection(T[] a, IntFunction<? extends C> supplier)
      Type Parameters:
      T -
      C -
      Parameters:
      a -
      supplier -
      Returns:
    • toCollection

      public static <T, C extends Collection<T>> C toCollection(T[] a, int fromIndex, int toIndex, IntFunction<? extends C> supplier) throws IndexOutOfBoundsException
      Type Parameters:
      T -
      C -
      Parameters:
      a -
      fromIndex -
      toIndex -
      supplier -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • toCollection

      public static <T, C extends Collection<T>> C toCollection(Iterable<? extends T> c, IntFunction<? extends C> supplier)
      Type Parameters:
      T -
      C -
      Parameters:
      c -
      supplier -
      Returns:
    • toCollection

      public static <T, C extends Collection<T>> C toCollection(Iterator<? extends T> iter, Supplier<? extends C> supplier)
      Type Parameters:
      T -
      C -
      Parameters:
      iter -
      supplier -
      Returns:
    • toMap

      public static <T, K> Map<K,T> toMap(Iterable<? extends T> c, Function<? super T,? extends K> keyMapper) throws IllegalArgumentException
      Type Parameters:
      T -
      K - the key type
      Parameters:
      c -
      keyMapper -
      Returns:
      Throws:
      IllegalArgumentException
    • toMap

      public static <T, K, V> Map<K,V> toMap(Iterable<? extends T> c, Function<? super T,? extends K> keyMapper, Function<? super T,? extends V> valueExtractor) throws IllegalArgumentException
      Type Parameters:
      T -
      K - the key type
      V - the value type
      Parameters:
      c -
      keyMapper -
      valueExtractor -
      Returns:
      Throws:
      IllegalArgumentException
    • toMap

      public static <T, K, V, M extends Map<K, V>> M toMap(Iterable<? extends T> c, Function<? super T,? extends K> keyMapper, Function<? super T,? extends V> valueExtractor, IntFunction<? extends M> mapSupplier) throws IllegalArgumentException
      Type Parameters:
      T -
      K - the key type
      V - the value type
      M -
      Parameters:
      c -
      keyMapper -
      valueExtractor -
      mapSupplier -
      Returns:
      Throws:
      IllegalArgumentException
    • toMap

      public static <T, K, V, M extends Map<K, V>> M toMap(Iterable<? extends T> c, Function<? super T,? extends K> keyMapper, Function<? super T,? extends V> valueExtractor, BiFunction<? super V,? super V,? extends V> mergeFunction, IntFunction<? extends M> mapSupplier) throws IllegalArgumentException
      Type Parameters:
      T -
      K -
      V -
      M -
      Parameters:
      c -
      keyMapper -
      valueExtractor -
      mergeFunction -
      mapSupplier -
      Returns:
      Throws:
      IllegalArgumentException
    • toMap

      public static <T, K> Map<K,T> toMap(Iterator<? extends T> iter, Function<? super T,K> keyMapper) throws IllegalArgumentException
      Type Parameters:
      T -
      K - the key type
      Parameters:
      iter -
      keyMapper -
      Returns:
      Throws:
      IllegalArgumentException
    • toMap

      public static <T, K, V> Map<K,V> toMap(Iterator<? extends T> iter, Function<? super T,K> keyMapper, Function<? super T,? extends V> valueExtractor) throws IllegalArgumentException
      Type Parameters:
      T -
      K - the key type
      V - the value type
      Parameters:
      iter -
      keyMapper -
      valueExtractor -
      Returns:
      Throws:
      IllegalArgumentException
    • toMap

      public static <T, K, V, M extends Map<K, V>> M toMap(Iterator<? extends T> iter, Function<? super T,K> keyMapper, Function<? super T,? extends V> valueExtractor, Supplier<? extends M> mapSupplier) throws IllegalArgumentException
      Type Parameters:
      T -
      K - the key type
      V - the value type
      M -
      Parameters:
      iter -
      keyMapper -
      valueExtractor -
      mapSupplier -
      Returns:
      Throws:
      IllegalArgumentException
    • toMap

      public static <T, K, V, M extends Map<K, V>> M toMap(Iterator<? extends T> iter, Function<? super T,K> keyMapper, Function<? super T,? extends V> valueExtractor, BiFunction<? super V,? super V,? extends V> mergeFunction, Supplier<? extends M> mapSupplier) throws IllegalArgumentException
      Type Parameters:
      T -
      K -
      V -
      M -
      Parameters:
      iter -
      keyMapper -
      valueExtractor -
      mergeFunction -
      mapSupplier -
      Returns:
      Throws:
      IllegalArgumentException
    • asArray

      @SafeVarargs public static <T> T[] asArray(T... a)
      The input array is returned.
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • asMap

      public static <K, V> Map<K,V> asMap(K k1, V v1)
      Returns a modifiable Map with specified key/value.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      k1 -
      v1 -
      Returns:
    • asMap

      public static <K, V> Map<K,V> asMap(K k1, V v1, K k2, V v2)
      Returns a modifiable Map with specified keys/values.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      k1 -
      v1 -
      k2 -
      v2 -
      Returns:
    • asMap

      public static <K, V> Map<K,V> asMap(K k1, V v1, K k2, V v2, K k3, V v3)
      Returns a modifiable Map with specified keys/values.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      k1 -
      v1 -
      k2 -
      v2 -
      k3 -
      v3 -
      Returns:
    • asMap

      public static <K, V> Map<K,V> asMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4)
      Returns a modifiable Map with specified keys/values.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      k1 -
      v1 -
      k2 -
      v2 -
      k3 -
      v3 -
      k4 -
      v4 -
      Returns:
    • asMap

      public static <K, V> Map<K,V> asMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5)
      Returns a modifiable Map with specified keys/values.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      k1 -
      v1 -
      k2 -
      v2 -
      k3 -
      v3 -
      k4 -
      v4 -
      k5 -
      v5 -
      Returns:
    • asMap

      public static <K, V> Map<K,V> asMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6)
      Returns a modifiable Map with specified keys/values.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      k1 -
      v1 -
      k2 -
      v2 -
      k3 -
      v3 -
      k4 -
      v4 -
      k5 -
      v5 -
      k6 -
      v6 -
      Returns:
    • asMap

      public static <K, V> Map<K,V> asMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7)
      Returns a modifiable Map with specified keys/values.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      k1 -
      v1 -
      k2 -
      v2 -
      k3 -
      v3 -
      k4 -
      v4 -
      k5 -
      v5 -
      k6 -
      v6 -
      k7 -
      v7 -
      Returns:
    • asMap

      @Deprecated @SafeVarargs @NullSafe public static <K, V> Map<K,V> asMap(Object... a)
      Deprecated.
      Returns a modifiable Map with specified key/value.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      a -
      Returns:
    • asLinkedHashMap

      public static <K, V> Map<K,V> asLinkedHashMap(K k1, V v1)
      Returns a modifiable LinkedHashMap with specified keys/values.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      k1 -
      v1 -
      Returns:
    • asLinkedHashMap

      public static <K, V> Map<K,V> asLinkedHashMap(K k1, V v1, K k2, V v2)
      Returns a modifiable LinkedHashMap with specified keys/values.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      k1 -
      v1 -
      k2 -
      v2 -
      Returns:
    • asLinkedHashMap

      public static <K, V> Map<K,V> asLinkedHashMap(K k1, V v1, K k2, V v2, K k3, V v3)
      Returns a modifiable LinkedHashMap with specified keys/values.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      k1 -
      v1 -
      k2 -
      v2 -
      k3 -
      v3 -
      Returns:
    • asLinkedHashMap

      public static <K, V> Map<K,V> asLinkedHashMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4)
      Returns a modifiable LinkedHashMap with specified keys/values.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      k1 -
      v1 -
      k2 -
      v2 -
      k3 -
      v3 -
      k4 -
      v4 -
      Returns:
    • asLinkedHashMap

      public static <K, V> Map<K,V> asLinkedHashMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5)
      Returns a modifiable LinkedHashMap with specified keys/values.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      k1 -
      v1 -
      k2 -
      v2 -
      k3 -
      v3 -
      k4 -
      v4 -
      k5 -
      v5 -
      Returns:
    • asLinkedHashMap

      public static <K, V> Map<K,V> asLinkedHashMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6)
      Returns a modifiable LinkedHashMap with specified keys/values.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      k1 -
      v1 -
      k2 -
      v2 -
      k3 -
      v3 -
      k4 -
      v4 -
      k5 -
      v5 -
      k6 -
      v6 -
      Returns:
    • asLinkedHashMap

      public static <K, V> Map<K,V> asLinkedHashMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7)
      Returns a modifiable LinkedHashMap with specified keys/values.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      k1 -
      v1 -
      k2 -
      v2 -
      k3 -
      v3 -
      k4 -
      v4 -
      k5 -
      v5 -
      k6 -
      v6 -
      k7 -
      v7 -
      Returns:
    • asLinkedHashMap

      @Deprecated @SafeVarargs public static <K, V> Map<K,V> asLinkedHashMap(Object... a)
      Deprecated.
      Returns a modifiable LinkedHashMap with specified keys/values.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      a -
      Returns:
    • asProps

      public static Map<String,Object> asProps(String propName, Object propValue)
      Returns a modifiable Map with specified key/value.
      Parameters:
      propName -
      propValue -
      Returns:
    • asProps

      public static Map<String,Object> asProps(String propName1, Object propValue1, String propName2, Object propValue2)
      Returns a modifiable Map with specified keys/values.
      Parameters:
      propName1 -
      propValue1 -
      propName2 -
      propValue2 -
      Returns:
    • asProps

      public static Map<String,Object> asProps(String propName1, Object propValue1, String propName2, Object propValue2, String propName3, Object propValue3)
      Returns a modifiable Map with specified keys/values.
      Parameters:
      propName1 -
      propValue1 -
      propName2 -
      propValue2 -
      propName3 -
      propValue3 -
      Returns:
    • asProps

      public static Map<String,Object> asProps(String propName1, Object propValue1, String propName2, Object propValue2, String propName3, Object propValue3, String propName4, Object propValue4)
      Returns a modifiable Map with specified keys/values.
      Parameters:
      propName1 -
      propValue1 -
      propName2 -
      propValue2 -
      propName3 -
      propValue3 -
      propName4 -
      propValue4 -
      Returns:
    • asProps

      public static Map<String,Object> asProps(String propName1, Object propValue1, String propName2, Object propValue2, String propName3, Object propValue3, String propName4, Object propValue4, String propName5, Object propValue5)
      Returns a modifiable Map with specified keys/values.
      Parameters:
      propName1 -
      propValue1 -
      propName2 -
      propValue2 -
      propName3 -
      propValue3 -
      propName4 -
      propValue4 -
      propName5 -
      propValue5 -
      Returns:
    • asProps

      @Deprecated @SafeVarargs public static Map<String,Object> asProps(Object... a)
      Deprecated.
      Returns a modifiable Map with specified keys/values.
      Parameters:
      a - pairs of property name and value or a Java Bean Object what allows access to properties using getter and setter methods.
      Returns:
    • asList

      public static <T> List<T> asList(T e)
      Returns a modifiable List with specified element.
      Type Parameters:
      T -
      Parameters:
      e -
      Returns:
    • asList

      public static <T> List<T> asList(T e1, T e2)
      Returns a modifiable List with specified elements.
      Type Parameters:
      T -
      Parameters:
      e1 -
      e2 -
      Returns:
    • asList

      public static <T> List<T> asList(T e1, T e2, T e3)
      Returns a modifiable List with specified elements.
      Type Parameters:
      T -
      Parameters:
      e1 -
      e2 -
      e3 -
      Returns:
    • asList

      public static <T> List<T> asList(T e1, T e2, T e3, T e4)
      Returns a modifiable List with specified elements.
      Type Parameters:
      T -
      Parameters:
      e1 -
      e2 -
      e3 -
      e4 -
      Returns:
    • asList

      public static <T> List<T> asList(T e1, T e2, T e3, T e4, T e5)
      Returns a modifiable List with specified elements.
      Type Parameters:
      T -
      Parameters:
      e1 -
      e2 -
      e3 -
      e4 -
      e5 -
      Returns:
    • asList

      public static <T> List<T> asList(T e1, T e2, T e3, T e4, T e5, T e6)
      Returns a modifiable List with specified elements.
      Type Parameters:
      T -
      Parameters:
      e1 -
      e2 -
      e3 -
      e4 -
      e5 -
      e6 -
      Returns:
    • asList

      public static <T> List<T> asList(T e1, T e2, T e3, T e4, T e5, T e6, T e7)
      Returns a modifiable List with specified elements.
      Type Parameters:
      T -
      Parameters:
      e1 -
      e2 -
      e3 -
      e4 -
      e5 -
      e6 -
      e7 -
      Returns:
    • asList

      public static <T> List<T> asList(T e1, T e2, T e3, T e4, T e5, T e6, T e7, T e8)
      Returns a modifiable List with specified elements.
      Type Parameters:
      T -
      Parameters:
      e1 -
      e2 -
      e3 -
      e4 -
      e5 -
      e6 -
      e7 -
      e8 -
      Returns:
    • asList

      public static <T> List<T> asList(T e1, T e2, T e3, T e4, T e5, T e6, T e7, T e8, T e9)
      Returns a modifiable List with specified elements.
      Type Parameters:
      T -
      Parameters:
      e1 -
      e2 -
      e3 -
      e4 -
      e5 -
      e6 -
      e7 -
      e8 -
      e9 -
      Returns:
    • asList

      @SafeVarargs @NullSafe public static <T> List<T> asList(@NullSafe T... a)
      Returns a modifiable List with specified elements. And it's not backed by the specified array. If the specified array is null or empty, an empty modifiable List is returned.
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
      See Also:
    • asLinkedList

      public static <T> LinkedList<T> asLinkedList(T e)
      Returns a modifiable LinkedList with specified element.
      Type Parameters:
      T -
      Parameters:
      e -
      Returns:
    • asLinkedList

      public static <T> LinkedList<T> asLinkedList(T e1, T e2)
      Returns a modifiable LinkedList with specified elements.
      Type Parameters:
      T -
      Parameters:
      e1 -
      e2 -
      Returns:
    • asLinkedList

      public static <T> LinkedList<T> asLinkedList(T e1, T e2, T e3)
      Returns a modifiable LinkedList with specified elements.
      Type Parameters:
      T -
      Parameters:
      e1 -
      e2 -
      e3 -
      Returns:
    • asLinkedList

      public static <T> LinkedList<T> asLinkedList(T e1, T e2, T e3, T e4)
      Returns a modifiable LinkedList with specified elements.
      Type Parameters:
      T -
      Parameters:
      e1 -
      e2 -
      e3 -
      e4 -
      Returns:
    • asLinkedList

      public static <T> LinkedList<T> asLinkedList(T e1, T e2, T e3, T e4, T e5)
      Returns a modifiable LinkedList with specified elements.
      Type Parameters:
      T -
      Parameters:
      e1 -
      e2 -
      e3 -
      e4 -
      e5 -
      Returns:
    • asLinkedList

      public static <T> LinkedList<T> asLinkedList(T e1, T e2, T e3, T e4, T e5, T e6)
      Returns a modifiable LinkedList with specified elements.
      Type Parameters:
      T -
      Parameters:
      e1 -
      e2 -
      e3 -
      e4 -
      e5 -
      e6 -
      Returns:
    • asLinkedList

      public static <T> LinkedList<T> asLinkedList(T e1, T e2, T e3, T e4, T e5, T e6, T e7)
      Returns a modifiable LinkedList with specified elements.
      Type Parameters:
      T -
      Parameters:
      e1 -
      e2 -
      e3 -
      e4 -
      e5 -
      e6 -
      e7 -
      Returns:
    • asLinkedList

      @SafeVarargs @NullSafe public static <T> LinkedList<T> asLinkedList(T... a)
      Returns a modifiable LinkedList with specified elements. And it's not backed by the specified array. If the specified array is null or empty, an empty modifiable List is returned.
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • asSet

      public static <T> Set<T> asSet(T e)
      Returns a modifiable Set with specified element.
      Type Parameters:
      T -
      Parameters:
      e -
      Returns:
    • asSet

      public static <T> Set<T> asSet(T e1, T e2)
      Returns a modifiable Set with specified elements.
      Type Parameters:
      T -
      Parameters:
      e1 -
      e2 -
      Returns:
    • asSet

      public static <T> Set<T> asSet(T e1, T e2, T e3)
      Returns a modifiable Set with specified elements.
      Type Parameters:
      T -
      Parameters:
      e1 -
      e2 -
      e3 -
      Returns:
    • asSet

      public static <T> Set<T> asSet(T e1, T e2, T e3, T e4)
      Returns a modifiable Set with specified elements.
      Type Parameters:
      T -
      Parameters:
      e1 -
      e2 -
      e3 -
      e4 -
      Returns:
    • asSet

      public static <T> Set<T> asSet(T e1, T e2, T e3, T e4, T e5)
      Returns a modifiable Set with specified elements.
      Type Parameters:
      T -
      Parameters:
      e1 -
      e2 -
      e3 -
      e4 -
      e5 -
      Returns:
    • asSet

      public static <T> Set<T> asSet(T e1, T e2, T e3, T e4, T e5, T e6)
      Returns a modifiable Set with specified elements.
      Type Parameters:
      T -
      Parameters:
      e1 -
      e2 -
      e3 -
      e4 -
      e5 -
      e6 -
      Returns:
    • asSet

      public static <T> Set<T> asSet(T e1, T e2, T e3, T e4, T e5, T e6, T e7)
      Returns a modifiable Set with specified elements.
      Type Parameters:
      T -
      Parameters:
      e1 -
      e2 -
      e3 -
      e4 -
      e5 -
      e6 -
      e7 -
      Returns:
    • asSet

      public static <T> Set<T> asSet(T e1, T e2, T e3, T e4, T e5, T e6, T e7, T e8)
      Returns a modifiable Set with specified elements.
      Type Parameters:
      T -
      Parameters:
      e1 -
      e2 -
      e3 -
      e4 -
      e5 -
      e6 -
      e7 -
      e8 -
      Returns:
    • asSet

      public static <T> Set<T> asSet(T e1, T e2, T e3, T e4, T e5, T e6, T e7, T e8, T e9)
      Returns a modifiable Set with specified elements.
      Type Parameters:
      T -
      Parameters:
      e1 -
      e2 -
      e3 -
      e4 -
      e5 -
      e6 -
      e7 -
      e8 -
      e9 -
      Returns:
    • asSet

      @SafeVarargs @NullSafe public static <T> Set<T> asSet(T... a)
      Returns a modifiable Set with specified elements. And it's not backed by the specified array. If the specified array is null or empty, an empty modifiable Set is returned.
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • asLinkedHashSet

      public static <T> Set<T> asLinkedHashSet(T e)
      Returns a modifiable LinkedHashSet with specified element.
      Type Parameters:
      T -
      Parameters:
      e -
      Returns:
    • asLinkedHashSet

      public static <T> Set<T> asLinkedHashSet(T e1, T e2)
      Returns a modifiable LinkedHashSet with specified elements.
      Type Parameters:
      T -
      Parameters:
      e1 -
      e2 -
      Returns:
    • asLinkedHashSet

      public static <T> Set<T> asLinkedHashSet(T e1, T e2, T e3)
      Returns a modifiable LinkedHashSet with specified elements.
      Type Parameters:
      T -
      Parameters:
      e1 -
      e2 -
      e3 -
      Returns:
    • asLinkedHashSet

      public static <T> Set<T> asLinkedHashSet(T e1, T e2, T e3, T e4)
      Returns a modifiable LinkedHashSet with specified elements.
      Type Parameters:
      T -
      Parameters:
      e1 -
      e2 -
      e3 -
      e4 -
      Returns:
    • asLinkedHashSet

      public static <T> Set<T> asLinkedHashSet(T e1, T e2, T e3, T e4, T e5)
      Returns a modifiable LinkedHashSet with specified elements.
      Type Parameters:
      T -
      Parameters:
      e1 -
      e2 -
      e3 -
      e4 -
      e5 -
      Returns:
    • asLinkedHashSet

      public static <T> Set<T> asLinkedHashSet(T e1, T e2, T e3, T e4, T e5, T e6)
      Returns a modifiable LinkedHashSet with specified elements.
      Type Parameters:
      T -
      Parameters:
      e1 -
      e2 -
      e3 -
      e4 -
      e5 -
      e6 -
      Returns:
    • asLinkedHashSet

      public static <T> Set<T> asLinkedHashSet(T e1, T e2, T e3, T e4, T e5, T e6, T e7)
      Returns a modifiable LinkedHashSet with specified elements.
      Type Parameters:
      T -
      Parameters:
      e1 -
      e2 -
      e3 -
      e4 -
      e5 -
      e6 -
      e7 -
      Returns:
    • asLinkedHashSet

      @SafeVarargs @NullSafe public static <T> Set<T> asLinkedHashSet(T... a)
      Returns a modifiable LinkedHashSet with specified elements. And it's not backed by the specified array.
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • asSortedSet

      @SafeVarargs @NullSafe public static <T> SortedSet<T> asSortedSet(T... a)
      Returns a modifiable SortedSet with specified elements. It's not backed by the specified array.
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • asNavigableSet

      @SafeVarargs public static <T> NavigableSet<T> asNavigableSet(T... a)
      Returns a modifiable NavigableSet with specified elements. It's not backed by the specified array.
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • asQueue

      @SafeVarargs public static <T> Queue<T> asQueue(T... a)
      Returns a modifiable Queue with specified elements. It's not backed by the specified array.
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • asArrayBlockingQueue

      @SafeVarargs public static <T> ArrayBlockingQueue<T> asArrayBlockingQueue(T... a)
      Returns a modifiable ArrayBlockingQueue with specified elements. It's not backed by the specified array.
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • asLinkedBlockingQueue

      @SafeVarargs public static <T> LinkedBlockingQueue<T> asLinkedBlockingQueue(T... a)
      Returns a modifiable LinkedBlockingQueue with specified elements. It's not backed by the specified array.
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • asConcurrentLinkedQueue

      @SafeVarargs public static <T> ConcurrentLinkedQueue<T> asConcurrentLinkedQueue(T... a)
      Returns a modifiable ConcurrentLinkedQueue with specified elements. It's not backed by the specified array.
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • asDelayQueue

      @SafeVarargs public static <T extends Delayed> DelayQueue<T> asDelayQueue(T... a)
      Returns a modifiable DelayQueue with specified elements. It's not backed by the specified array.
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • asPriorityQueue

      @SafeVarargs public static <T> PriorityQueue<T> asPriorityQueue(T... a)
      Returns a modifiable PriorityQueue with specified elements. It's not backed by the specified array.
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • asDeque

      @SafeVarargs public static <T> Deque<T> asDeque(T... a)
      Returns a modifiable Deque with specified elements. It's not backed by the specified array.
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • asArrayDeque

      @SafeVarargs public static <T> ArrayDeque<T> asArrayDeque(T... a)
      Returns a modifiable ArrayDeque with specified elements. It's not backed by the specified array.
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • asLinkedBlockingDeque

      @SafeVarargs public static <T> LinkedBlockingDeque<T> asLinkedBlockingDeque(T... a)
      Returns a modifiable LinkedBlockingDeque with specified elements. It's not backed by the specified array.
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • asConcurrentLinkedDeque

      @SafeVarargs public static <T> ConcurrentLinkedDeque<T> asConcurrentLinkedDeque(T... a)
      Returns a modifiable ConcurrentLinkedDeque with specified elements. It's not backed by the specified array.
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • asMultiset

      @SafeVarargs public static <T> Multiset<T> asMultiset(T... a)
      Returns a modifiable Multiset with specified elements. It's not backed by the specified array.
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • asSingletonList

      @Immutable public static <T> List<T> asSingletonList(T o)
      Wrap the specified value with a singleton list.
      Type Parameters:
      T -
      Parameters:
      o -
      Returns:
      an immutable/unmodifiable list
      See Also:
    • asSingletonSet

      @Immutable public static <T> Set<T> asSingletonSet(T o)
      Wrap the specified value with a singleton set.
      Type Parameters:
      T -
      Parameters:
      o -
      Returns:
      an immutable/unmodifiable set
      See Also:
    • asSingletonMap

      @Immutable public static <K, V> Map<K,V> asSingletonMap(K key, V value)
      Wrap the specified key/value with a singleton map.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      key -
      value -
      Returns:
      an immutable/unmodifiable Map
      See Also:
    • emptyList

      @Immutable public static <T> List<T> emptyList()
      Returns an empty immutable/unmodifiable List.
      Type Parameters:
      T -
      Returns:
      See Also:
    • emptySet

      @Immutable public static <T> Set<T> emptySet()
      Returns an empty immutable/unmodifiable Set.
      Type Parameters:
      T -
      Returns:
      See Also:
    • emptySortedSet

      @Immutable public static <T> SortedSet<T> emptySortedSet()
      Returns an empty immutable/unmodifiable SortedSet.
      Type Parameters:
      T -
      Returns:
      See Also:
    • emptyNavigableSet

      @Immutable public static <T> NavigableSet<T> emptyNavigableSet()
      Returns an empty immutable/unmodifiable NavigableSet.
      Type Parameters:
      T -
      Returns:
      See Also:
    • emptyMap

      @Immutable public static <K, V> Map<K,V> emptyMap()
      Returns an empty immutable/unmodifiable Map.
      Type Parameters:
      K - the key type
      V - the value type
      Returns:
      See Also:
    • emptySortedMap

      @Immutable public static <K, V> SortedMap<K,V> emptySortedMap()
      Returns an empty immutable/unmodifiable SortedMap.
      Type Parameters:
      K - the key type
      V - the value type
      Returns:
      See Also:
    • emptyNavigableMap

      @Immutable public static <K, V> NavigableMap<K,V> emptyNavigableMap()
      Returns an empty immutable/unmodifiable NavigableMap.
      Type Parameters:
      K - the key type
      V - the value type
      Returns:
      See Also:
    • emptyIterator

      public static <T> Iterator<T> emptyIterator()
      Returns an empty immutable/unmodifiable Iterator.
      Type Parameters:
      T -
      Returns:
      See Also:
    • emptyListIterator

      @Immutable public static <T> ListIterator<T> emptyListIterator()
      Returns an empty immutable/unmodifiable ListIterator.
      Type Parameters:
      T -
      Returns:
      See Also:
    • emptyInputStream

      @Immutable public static InputStream emptyInputStream()
      Returns an empty immutable/unmodifiable InputStream.
      Returns:
    • emptyDataSet

      @Immutable public static DataSet emptyDataSet()
      Returns an unmodifiable empty DataSet.
      Returns:
      See Also:
    • getElement

      public static <T> T getElement(@NotNull Iterable<? extends T> c, int index) throws IllegalArgumentException, IndexOutOfBoundsException
      Retrieves an element from an Iterable at a specified index.
      Type Parameters:
      T - the type of elements in the Iterable
      Parameters:
      c - the Iterable to retrieve the element from. Must not be null.
      index - the index of the element to retrieve. Must be a non-negative integer.
      Returns:
      the element at the specified index in the Iterable
      Throws:
      IllegalArgumentException - if the Iterable is null
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index >= size of Iterable)
    • getElement

      public static <T> T getElement(@NotNull Iterator<? extends T> iter, long index) throws IllegalArgumentException, IndexOutOfBoundsException
      Retrieves an element from an Iterator at a specified index.
      Type Parameters:
      T - the type of elements in the Iterator
      Parameters:
      iter - the Iterator to retrieve the element from. Must not be null.
      index - the index of the element to retrieve. Must be a non-negative integer.
      Returns:
      the element at the specified index in the Iterator
      Throws:
      IllegalArgumentException - if the Iterator is null
      IndexOutOfBoundsException - if the index is out of range (index invalid input: '<' 0 || index >= size of Iterator)
    • getOnlyElement

      public static <T> u.Nullable<T> getOnlyElement(Iterable<? extends T> c) throws TooManyElementsException
      Returns the only element in the given Iterable.
      Type Parameters:
      T - the type of elements in the Iterable
      Parameters:
      c - the Iterable to get the element from
      Returns:
      a Nullable containing the only element in the Iterable if it exists, otherwise an empty Nullable
      Throws:
      TooManyElementsException - if the Iterable contains more than one element
    • getOnlyElement

      public static <T> u.Nullable<T> getOnlyElement(Iterator<? extends T> iter) throws TooManyElementsException
      Returns the only element in the given Iterator.
      Type Parameters:
      T - the type of elements in the Iterator
      Parameters:
      iter - the Iterator to get the element from
      Returns:
      a Nullable containing the only element in the Iterator if it exists, otherwise an empty Nullable
      Throws:
      TooManyElementsException - if the Iterator contains more than one element
    • firstElement

      public static <T> u.Nullable<T> firstElement(Iterable<? extends T> c)
      Returns the first element in the given Iterable wrapped in a Nullable. If the Iterable is empty, it returns a Nullable with no value.
      Type Parameters:
      T - the type of elements in the Iterable
      Parameters:
      c - the Iterable to get the first element from
      Returns:
      a Nullable containing the first element in the Iterable if it exists, otherwise an empty Nullable
    • firstElement

      public static <T> u.Nullable<T> firstElement(Iterator<? extends T> iter)
      Returns the first element in the given Iterator wrapped in a Nullable. If the Iterator is empty, it returns a Nullable with no value.
      Type Parameters:
      T - the type of elements in the Iterator
      Parameters:
      iter - the Iterator to get the first element from
      Returns:
      a Nullable containing the first element in the Iterator if it exists, otherwise an empty Nullable
    • lastElement

      public static <T> u.Nullable<T> lastElement(Iterable<? extends T> c)
      Returns the last element in the given Iterable wrapped in a Nullable. If the Iterable is empty, it returns a Nullable with no value.
      Type Parameters:
      T - the type of elements in the Iterable
      Parameters:
      c - the Iterable to get the last element from
      Returns:
      a Nullable containing the last element in the Iterable if it exists, otherwise an empty Nullable
    • lastElement

      public static <T> u.Nullable<T> lastElement(Iterator<? extends T> iter)
      Returns the last element in the given Iterator wrapped in a Nullable. If the Iterator is empty, it returns a Nullable with no value.
      Type Parameters:
      T - the type of elements in the Iterator
      Parameters:
      iter - the Iterator to get the last element from
      Returns:
      a Nullable containing the last element in the Iterator if it exists, otherwise an empty Nullable
    • firstElements

      @Beta public static <T> List<T> firstElements(Iterable<? extends T> c, int n) throws IllegalArgumentException
      Returns a list containing the first n elements from the given Iterable. If the Iterable has less than n elements, it returns a list with all the elements in the Iterable.
      Type Parameters:
      T - the type of elements in the Iterable
      Parameters:
      c - the Iterable to get the elements from
      n - the number of elements to retrieve from the Iterable
      Returns:
      a list containing the first n elements from the Iterable
      Throws:
      IllegalArgumentException - if n is negative
    • firstElements

      @Beta public static <T> List<T> firstElements(Iterator<? extends T> iter, int n) throws IllegalArgumentException
      Returns a list containing the first n elements from the given Iterator. If the Iterator has less than n elements, it returns a list with all the elements in the Iterator.
      Type Parameters:
      T - the type of elements in the Iterator
      Parameters:
      iter - the Iterator to get the elements from
      n - the number of elements to retrieve from the Iterator
      Returns:
      a list containing the first n elements from the Iterator
      Throws:
      IllegalArgumentException - if n is negative
    • lastElements

      @Beta public static <T> List<T> lastElements(Iterable<? extends T> c, int n) throws IllegalArgumentException
      Returns a list containing the last 'n' elements from the given Iterable. If the Iterable has less than 'n' elements, it returns a list with all the elements in the Iterable.
      Type Parameters:
      T - the type of elements in the Iterable
      Parameters:
      c - the Iterable to get the elements from
      n - the number of elements to retrieve from the end of the Iterable
      Returns:
      a list containing the last 'n' elements from the Iterable
      Throws:
      IllegalArgumentException - if 'n' is negative
    • lastElements

      @Beta public static <T> List<T> lastElements(Iterator<? extends T> iter, int n) throws IllegalArgumentException
      Returns a list containing the last n elements from the given Iterator. If the Iterator has less than n elements, it returns a list with all the elements in the Iterator.
      Type Parameters:
      T - the type of elements in the Iterator
      Parameters:
      iter - the Iterator to get the elements from
      n - the number of elements to retrieve from the Iterator
      Returns:
      a list containing the last n elements from the Iterator
      Throws:
      IllegalArgumentException - if n is negative
    • firstNonNull

      public static <T> u.Optional<T> firstNonNull(T a, T b)
      Returns the first non-null value among the two provided values. If both values are null, it returns an empty Optional.
      Type Parameters:
      T - the type of the values
      Parameters:
      a - the first value to check
      b - the second value to check
      Returns:
      an Optional containing the first non-null value if it exists, otherwise an empty Optional
    • firstNonNull

      public static <T> u.Optional<T> firstNonNull(T a, T b, T c)
      Returns the first non-null value among the three provided values. If all values are null, it returns an empty Optional.
      Type Parameters:
      T - the type of the values
      Parameters:
      a - the first value to check
      b - the second value to check
      c - the third value to check
      Returns:
      an Optional containing the first non-null value if it exists, otherwise an empty Optional
    • firstNonNull

      @SafeVarargs public static <T> u.Optional<T> firstNonNull(T... a)
      Returns the first non-null value among the provided values. If all values are null, it returns an empty Optional.
      Type Parameters:
      T - the type of the values
      Parameters:
      a - the array of values to check
      Returns:
      an Optional containing the first non-null value if it exists, otherwise an empty Optional
    • firstNonNull

      public static <T> u.Optional<T> firstNonNull(Iterable<? extends T> c)
      Returns the first non-null value from the provided iterable. If all values are null, it returns an empty Optional.
      Type Parameters:
      T - the type of the values
      Parameters:
      c - the iterable of values to check
      Returns:
      an Optional containing the first non-null value if it exists, otherwise an empty Optional
    • firstNonNull

      public static <T> u.Optional<T> firstNonNull(Iterator<? extends T> iter)
      Returns the first non-null value from the provided iterator. If all values are null, it returns an empty Optional.
      Type Parameters:
      T - the type of the values
      Parameters:
      iter - the iterator of values to check
      Returns:
      an Optional containing the first non-null value if it exists, otherwise an empty Optional
    • lastNonNull

      public static <T> u.Optional<T> lastNonNull(T a, T b)
      Returns the last non-null value from the provided values. If both values are null, it returns an empty Optional.
      Type Parameters:
      T - the type of the values
      Parameters:
      a - the first value to check
      b - the second value to check
      Returns:
      an Optional containing the last non-null value if it exists, otherwise an empty Optional
    • lastNonNull

      public static <T> u.Optional<T> lastNonNull(T a, T b, T c)
      Returns the last non-null value from the provided values. If all values are null, it returns an empty Optional.
      Type Parameters:
      T - the type of the values
      Parameters:
      a - the first value to check
      b - the second value to check
      c - the third value to check
      Returns:
      an Optional containing the last non-null value if it exists, otherwise an empty Optional
    • lastNonNull

      @SafeVarargs public static <T> u.Optional<T> lastNonNull(T... a)
      Returns the last non-null value from the provided array of values. If all values are null, it returns an empty Optional.
      Type Parameters:
      T - the type of the values
      Parameters:
      a - the array of values to check
      Returns:
      an Optional containing the last non-null value if it exists, otherwise an empty Optional
    • lastNonNull

      public static <T> u.Optional<T> lastNonNull(Iterable<? extends T> c)
      Returns the last non-null value from the provided iterable. If all values are null, it returns an empty Optional.
      Type Parameters:
      T - the type of the values
      Parameters:
      c - the iterable to check
      Returns:
      an Optional containing the last non-null value if it exists, otherwise an empty Optional
    • lastNonNull

      public static <T> u.Optional<T> lastNonNull(Iterator<? extends T> iter)
      Returns the last non-null value from the provided iterator. If all values are null, it returns an empty Optional.
      Type Parameters:
      T - the type of the values
      Parameters:
      iter - the iterator to check
      Returns:
      an Optional containing the last non-null value if it exists, otherwise an empty Optional
    • firstNonEmpty

      public static <T> u.Optional<T[]> firstNonEmpty(T[] a, T[] b)
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      Returns:
    • firstNonEmpty

      public static <T> u.Optional<T[]> firstNonEmpty(T[] a, T[] b, T[] c)
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      c -
      Returns:
    • firstNonEmpty

      public static <T extends Collection<?>> u.Optional<T> firstNonEmpty(T a, T b)
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      Returns:
    • firstNonEmpty

      public static <T extends Collection<?>> u.Optional<T> firstNonEmpty(T a, T b, T c)
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      c -
      Returns:
    • firstNonEmpty

      public static <T extends CharSequence> u.Optional<T> firstNonEmpty(T a, T b)
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      Returns:
    • firstNonEmpty

      public static <T extends CharSequence> u.Optional<T> firstNonEmpty(T a, T b, T c)
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      c -
      Returns:
    • firstNonEmpty

      public static <T extends CharSequence> u.Optional<T> firstNonEmpty(T... a)
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • firstNonBlank

      public static <T extends CharSequence> u.Optional<T> firstNonBlank(T a, T b)
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      Returns:
    • firstNonBlank

      public static <T extends CharSequence> u.Optional<T> firstNonBlank(T a, T b, T c)
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      c -
      Returns:
    • firstNonBlank

      public static <T extends CharSequence> u.Optional<T> firstNonBlank(T... a)
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • firstEntry

      public static <K, V> u.Optional<Map.Entry<K,V>> firstEntry(Map<K,V> map)
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      map -
      Returns:
    • lastEntry

      public static <K, V> u.Optional<Map.Entry<K,V>> lastEntry(Map<K,V> map)
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      map -
      Returns:
    • firstOrNullIfEmpty

      public static <T> T firstOrNullIfEmpty(T[] a)
      First or null if empty.
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • firstOrNullIfEmpty

      public static <T> T firstOrNullIfEmpty(Iterable<? extends T> c)
      First or null if empty.
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
    • firstOrNullIfEmpty

      public static <T> T firstOrNullIfEmpty(Iterator<? extends T> iter)
      First or null if empty.
      Type Parameters:
      T -
      Parameters:
      iter -
      Returns:
    • firstOrDefaultIfEmpty

      public static <T> T firstOrDefaultIfEmpty(T[] a, T defaultValueForEmpty)
      First or default if empty.
      Type Parameters:
      T -
      Parameters:
      a -
      defaultValueForEmpty -
      Returns:
    • firstOrDefaultIfEmpty

      public static <T> T firstOrDefaultIfEmpty(Iterable<? extends T> c, T defaultValueForEmpty)
      First or default if empty.
      Type Parameters:
      T -
      Parameters:
      c -
      defaultValueForEmpty -
      Returns:
    • firstOrDefaultIfEmpty

      public static <T> T firstOrDefaultIfEmpty(Iterator<? extends T> iter, T defaultValueForEmpty)
      First or default if empty.
      Type Parameters:
      T -
      Parameters:
      iter -
      defaultValueForEmpty -
      Returns:
    • lastOrNullIfEmpty

      public static <T> T lastOrNullIfEmpty(T[] a)
      Last or null if empty.
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • lastOrNullIfEmpty

      public static <T> T lastOrNullIfEmpty(Iterable<? extends T> c)
      Last or null if empty.
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
    • lastOrNullIfEmpty

      public static <T> T lastOrNullIfEmpty(Iterator<? extends T> iter)
      Last or null if empty.
      Type Parameters:
      T -
      Parameters:
      iter -
      Returns:
    • lastOrDefaultIfEmpty

      public static <T> T lastOrDefaultIfEmpty(T[] a, T defaultValueForEmpty)
      Last or default if empty.
      Type Parameters:
      T -
      Parameters:
      a -
      defaultValueForEmpty -
      Returns:
    • lastOrDefaultIfEmpty

      public static <T> T lastOrDefaultIfEmpty(Iterable<? extends T> c, T defaultValueForEmpty)
      Last or default if empty.
      Type Parameters:
      T -
      Parameters:
      c -
      defaultValueForEmpty -
      Returns:
    • lastOrDefaultIfEmpty

      public static <T> T lastOrDefaultIfEmpty(Iterator<? extends T> iter, T defaultValueForEmpty)
      Last or default if empty.
      Type Parameters:
      T -
      Parameters:
      iter -
      defaultValueForEmpty -
      Returns:
    • findFirst

      public static <T> u.Nullable<T> findFirst(T[] a, Predicate<? super T> predicate)
      Type Parameters:
      T -
      Parameters:
      a -
      predicate -
      Returns:
      the nullable
    • findFirst

      public static <T> u.Nullable<T> findFirst(Iterable<? extends T> c, Predicate<? super T> predicate)
      Type Parameters:
      T -
      Parameters:
      c -
      predicate -
      Returns:
      the nullable
    • findFirst

      public static <T> u.Nullable<T> findFirst(Iterator<? extends T> iter, Predicate<? super T> predicate)
      Type Parameters:
      T -
      Parameters:
      iter -
      predicate -
      Returns:
    • findLast

      public static <T> u.Nullable<T> findLast(T[] a, Predicate<? super T> predicate)
      Type Parameters:
      T -
      Parameters:
      a -
      predicate -
      Returns:
      the nullable
    • findLast

      public static <T> u.Nullable<T> findLast(Iterable<? extends T> c, Predicate<? super T> predicate)
      Type Parameters:
      T -
      Parameters:
      c -
      predicate -
      Returns:
      the nullable
    • findFirstNonNull

      public static <T> u.Optional<T> findFirstNonNull(T[] a, Predicate<? super T> predicate)
      Find first non null.
      Type Parameters:
      T -
      Parameters:
      a -
      predicate -
      Returns:
      the optional
    • findFirstNonNull

      public static <T> u.Optional<T> findFirstNonNull(Iterable<? extends T> c, Predicate<? super T> predicate)
      Find first non null.
      Type Parameters:
      T -
      Parameters:
      c -
      predicate -
      Returns:
      the optional
    • findFirstNonNull

      public static <T> u.Optional<T> findFirstNonNull(Iterator<? extends T> iter, Predicate<? super T> predicate)
      Type Parameters:
      T -
      Parameters:
      iter -
      predicate -
      Returns:
    • findLastNonNull

      public static <T> u.Optional<T> findLastNonNull(T[] a, Predicate<? super T> predicate)
      Find last non null.
      Type Parameters:
      T -
      Parameters:
      a -
      predicate -
      Returns:
      the optional
    • findLastNonNull

      public static <T> u.Optional<T> findLastNonNull(Iterable<? extends T> c, Predicate<? super T> predicate)
      Find last non null.
      Type Parameters:
      T -
      Parameters:
      c -
      predicate -
      Returns:
      the optional
    • len

      public static int len(CharSequence s)
      Returns the length of the specified CharSequence, or 0 if it's empty or null.
      Parameters:
      s -
      Returns:
    • len

      public static int len(boolean[] a)
      Returns the length/size of the specified Array/Collection/Map, or 0 if it's empty or null.
      Parameters:
      a -
      Returns:
    • len

      public static int len(char[] a)
      Returns the length/size of the specified Array/Collection/Map, or 0 if it's empty or null.
      Parameters:
      a -
      Returns:
    • len

      public static int len(byte[] a)
      Returns the length/size of the specified Array/Collection/Map, or 0 if it's empty or null.
      Parameters:
      a -
      Returns:
    • len

      public static int len(short[] a)
      Returns the length/size of the specified Array/Collection/Map, or 0 if it's empty or null.
      Parameters:
      a -
      Returns:
    • len

      public static int len(int[] a)
      Returns the length/size of the specified Array/Collection/Map, or 0 if it's empty or null.
      Parameters:
      a -
      Returns:
    • len

      public static int len(long[] a)
      Returns the length/size of the specified Array/Collection/Map, or 0 if it's empty or null.
      Parameters:
      a -
      Returns:
    • len

      public static int len(float[] a)
      Returns the length/size of the specified Array/Collection/Map, or 0 if it's empty or null.
      Parameters:
      a -
      Returns:
    • len

      public static int len(double[] a)
      Returns the length/size of the specified Array/Collection/Map, or 0 if it's empty or null.
      Parameters:
      a -
      Returns:
    • len

      public static int len(Object[] a)
      Returns the length/size of the specified Array/Collection/Map, or 0 if it's empty or null.
      Parameters:
      a -
      Returns:
    • size

      public static int size(Collection<?> c)
      Returns the length/size of the specified Array/Collection/Map, or 0 if it's empty or null.
      Parameters:
      c -
      Returns:
    • size

      public static int size(Map<?,?> m)
      Returns the length/size of the specified Array/Collection/Map, or 0 if it's empty or null.
      Parameters:
      m -
      Returns:
    • size

      @Beta public static int size(PrimitiveList c)
      Returns the length/size of the specified Array/Collection/Map, or 0 if it's empty or null.
      Parameters:
      c -
      Returns:
    • nullToEmpty

      @Beta public static String nullToEmpty(String str)
      Parameters:
      str -
      Returns:
      See Also:
    • nullToEmpty

      public static <T> List<T> nullToEmpty(List<T> list)
      Returns an empty immutable/unmodifiable list if the specified List is null, otherwise itself is returned.
      Type Parameters:
      T -
      Parameters:
      list -
      Returns:
      See Also:
    • nullToEmpty

      public static <T> Set<T> nullToEmpty(Set<T> set)
      Returns an empty immutable/unmodifiable set if the specified Set is null, otherwise itself is returned.
      Type Parameters:
      T -
      Parameters:
      set -
      Returns:
      See Also:
    • nullToEmpty

      public static <T> SortedSet<T> nullToEmpty(SortedSet<T> set)
      Returns an empty immutable/unmodifiable SortedSet if the specified SortedSet is null, otherwise itself is returned.
      Type Parameters:
      T -
      Parameters:
      set -
      Returns:
      See Also:
    • nullToEmpty

      public static <T> NavigableSet<T> nullToEmpty(NavigableSet<T> set)
      Returns an empty immutable/unmodifiable NavigableSet if the specified NavigableSet is null, otherwise itself is returned.
      Type Parameters:
      T -
      Parameters:
      set -
      Returns:
      See Also:
    • nullToEmpty

      public static <T> Collection<T> nullToEmpty(Collection<T> c)
      Returns an empty immutable/unmodifiable list if the specified Collection is null, otherwise itself is returned.
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
    • nullToEmpty

      public static <K, V> Map<K,V> nullToEmpty(Map<K,V> map)
      Returns an empty immutable/unmodifiable map if the specified Map is null, otherwise itself is returned.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      map -
      Returns:
      See Also:
    • nullToEmpty

      public static <K, V> SortedMap<K,V> nullToEmpty(SortedMap<K,V> map)
      Returns an empty immutable/unmodifiable SortedMap if the specified SortedMap is null, otherwise itself is returned.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      map -
      Returns:
      See Also:
    • nullToEmpty

      public static <K, V> NavigableMap<K,V> nullToEmpty(NavigableMap<K,V> map)
      Returns an empty immutable/unmodifiable NavigableMap if the specified NavigableMap is null, otherwise itself is returned.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      map -
      Returns:
      See Also:
    • nullToEmpty

      public static <T> Iterator<T> nullToEmpty(Iterator<T> iter)
      Returns an empty immutable/unmodifiable Iterator if the specified Iterator is null, otherwise itself is returned.
      Type Parameters:
      T -
      Parameters:
      iter -
      Returns:
      See Also:
    • nullToEmpty

      public static <T> ListIterator<T> nullToEmpty(ListIterator<T> iter)
      Returns an empty immutable/unmodifiable ListIterator if the specified ListIterator is null, otherwise itself is returned.
      Type Parameters:
      T -
      Parameters:
      iter -
      Returns:
      See Also:
    • nullToEmpty

      public static boolean[] nullToEmpty(boolean[] a)
      Null to empty.
      Parameters:
      a -
      Returns:
    • nullToEmpty

      public static char[] nullToEmpty(char[] a)
      Null to empty.
      Parameters:
      a -
      Returns:
    • nullToEmpty

      public static byte[] nullToEmpty(byte[] a)
      Null to empty.
      Parameters:
      a -
      Returns:
    • nullToEmpty

      public static short[] nullToEmpty(short[] a)
      Null to empty.
      Parameters:
      a -
      Returns:
    • nullToEmpty

      public static int[] nullToEmpty(int[] a)
      Null to empty.
      Parameters:
      a -
      Returns:
    • nullToEmpty

      public static long[] nullToEmpty(long[] a)
      Null to empty.
      Parameters:
      a -
      Returns:
    • nullToEmpty

      public static float[] nullToEmpty(float[] a)
      Null to empty.
      Parameters:
      a -
      Returns:
    • nullToEmpty

      public static double[] nullToEmpty(double[] a)
      Null to empty.
      Parameters:
      a -
      Returns:
    • nullToEmpty

      public static BigInteger[] nullToEmpty(BigInteger[] a)
      Null to empty.
      Parameters:
      a -
      Returns:
    • nullToEmpty

      public static BigDecimal[] nullToEmpty(BigDecimal[] a)
      Null to empty.
      Parameters:
      a -
      Returns:
    • nullToEmpty

      public static String[] nullToEmpty(String[] a)
      Null to empty.
      Parameters:
      a -
      Returns:
      See Also:
    • nullToEmptyForEach

      @Beta public static String[] nullToEmptyForEach(String[] a)
      Converts the specified String array to an empty String[0] if it's null and each null element String to empty String "".
      Parameters:
      a -
      Returns:
      See Also:
    • nullToEmpty

      public static Date[] nullToEmpty(Date[] a)
      Null to empty.
      Parameters:
      a -
      Returns:
    • nullToEmpty

      public static Date[] nullToEmpty(Date[] a)
      Null to empty.
      Parameters:
      a -
      Returns:
    • nullToEmpty

      public static Time[] nullToEmpty(Time[] a)
      Null to empty.
      Parameters:
      a -
      Returns:
    • nullToEmpty

      public static Timestamp[] nullToEmpty(Timestamp[] a)
      Null to empty.
      Parameters:
      a -
      Returns:
    • nullToEmpty

      public static Calendar[] nullToEmpty(Calendar[] a)
      Null to empty.
      Parameters:
      a -
      Returns:
    • nullToEmpty

      public static Object[] nullToEmpty(Object[] a)
      Null to empty.
      Parameters:
      a -
      Returns:
    • nullToEmpty

      public static <T> T[] nullToEmpty(T[] a, Class<T[]> arrayType)
      Null to empty.
      Type Parameters:
      T -
      Parameters:
      a -
      arrayType -
      Returns:
    • nullToEmpty

      public static <T> ImmutableCollection<T> nullToEmpty(ImmutableCollection<T> c)
      Returns an empty immutable/unmodifiable Collection if the specified ImmutableCollection is null, otherwise itself is returned.
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
    • nullToEmpty

      public static <T> ImmutableList<T> nullToEmpty(ImmutableList<T> list)
      Returns an empty immutable/unmodifiable list if the specified ImmutableList is null, otherwise itself is returned.
      Type Parameters:
      T -
      Parameters:
      list -
      Returns:
    • nullToEmpty

      public static <T> ImmutableSet<T> nullToEmpty(ImmutableSet<T> set)
      Returns an empty immutable/unmodifiable list if the specified ImmutableSet is null, otherwise itself is returned.
      Type Parameters:
      T -
      Parameters:
      set -
      Returns:
    • nullToEmpty

      public static <T> ImmutableSortedSet<T> nullToEmpty(ImmutableSortedSet<T> set)
      Returns an empty immutable/unmodifiable list if the specified ImmutableSortedSet is null, otherwise itself is returned.
      Type Parameters:
      T -
      Parameters:
      set -
      Returns:
    • nullToEmpty

      public static <T> ImmutableNavigableSet<T> nullToEmpty(ImmutableNavigableSet<T> set)
      Returns an empty immutable/unmodifiable list if the specified ImmutableNavigableSet is null, otherwise itself is returned.
      Type Parameters:
      T -
      Parameters:
      set -
      Returns:
    • nullToEmpty

      public static <K, V> ImmutableMap<K,V> nullToEmpty(ImmutableMap<K,V> map)
      Returns an empty immutable/unmodifiable map if the specified ImmutableMap is null, otherwise itself is returned.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      map -
      Returns:
    • nullToEmpty

      public static <K, V> ImmutableSortedMap<K,V> nullToEmpty(ImmutableSortedMap<K,V> map)
      Returns an empty immutable/unmodifiable map if the specified ImmutableSortedMap is null, otherwise itself is returned.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      map -
      Returns:
    • nullToEmpty

      public static <K, V> ImmutableNavigableMap<K,V> nullToEmpty(ImmutableNavigableMap<K,V> map)
      Returns an empty immutable/unmodifiable map if the specified ImmutableNavigableMap is null, otherwise itself is returned.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      map -
      Returns:
    • nullToEmpty

      public static <K, V> ImmutableBiMap<K,V> nullToEmpty(ImmutableBiMap<K,V> map)
      Returns an empty immutable/unmodifiable map if the specified ImmutableBiMap is null, otherwise itself is returned.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      map -
      Returns:
    • isEmpty

      public static boolean isEmpty(CharSequence cs)
      Checks if the specified CharSequence is null or empty.
      Parameters:
      cs -
      Returns:
    • isEmpty

      public static boolean isEmpty(boolean[] a)
      Checks if is null or empty.
      Parameters:
      a -
      Returns:
      true, if is null or empty
    • isEmpty

      public static boolean isEmpty(char[] a)
      Checks if is null or empty.
      Parameters:
      a -
      Returns:
      true, if is null or empty
    • isEmpty

      public static boolean isEmpty(byte[] a)
      Checks if is null or empty.
      Parameters:
      a -
      Returns:
      true, if is null or empty
    • isEmpty

      public static boolean isEmpty(short[] a)
      Checks if is null or empty.
      Parameters:
      a -
      Returns:
      true, if is null or empty
    • isEmpty

      public static boolean isEmpty(int[] a)
      Checks if is null or empty.
      Parameters:
      a -
      Returns:
      true, if is null or empty
    • isEmpty

      public static boolean isEmpty(long[] a)
      Checks if is null or empty.
      Parameters:
      a -
      Returns:
      true, if is null or empty
    • isEmpty

      public static boolean isEmpty(float[] a)
      Checks if is null or empty.
      Parameters:
      a -
      Returns:
      true, if is null or empty
    • isEmpty

      public static boolean isEmpty(double[] a)
      Checks if is null or empty.
      Parameters:
      a -
      Returns:
      true, if is null or empty
    • isEmpty

      public static boolean isEmpty(Object[] a)
      Checks if is null or empty.
      Parameters:
      a -
      Returns:
      true, if is null or empty
    • isEmpty

      public static boolean isEmpty(Collection<?> c)
      Checks if is null or empty.
      Parameters:
      c -
      Returns:
      true, if is null or empty
    • isEmpty

      @Beta public static boolean isEmpty(Iterable<?> iter)
      Not null or empty.
      Parameters:
      iter -
      Returns:
    • isEmpty

      @Beta public static boolean isEmpty(Iterator<?> iter)
      Not null or empty.
      Parameters:
      iter -
      Returns:
    • isEmpty

      public static boolean isEmpty(Map<?,?> m)
      Checks if is null or empty.
      Parameters:
      m -
      Returns:
      true, if is null or empty
    • isEmpty

      public static boolean isEmpty(PrimitiveList list)
      Checks if is null or empty.
      Parameters:
      list -
      Returns:
      true, if is null or empty
    • isEmpty

      public static boolean isEmpty(Multiset<?> s)
      Checks if is null or empty.
      Parameters:
      s -
      Returns:
      true, if is null or empty
    • isEmpty

      public static boolean isEmpty(Multimap<?,?,?> m)
      Checks if is null or empty.
      Parameters:
      m -
      Returns:
      true, if is null or empty
    • isEmpty

      public static boolean isEmpty(DataSet rs)
      Checks if is null or empty.
      Parameters:
      rs -
      Returns:
      true, if is null or empty
    • isBlank

      public static boolean isBlank(CharSequence cs)
      Checks if the specified CharSequence is null or blank.
      Parameters:
      cs -
      Returns:
    • notEmpty

      public static boolean notEmpty(CharSequence cs)
      Parameters:
      cs -
      Returns:
    • notEmpty

      public static boolean notEmpty(boolean[] a)
      Not null or empty.
      Parameters:
      a -
      Returns:
    • notEmpty

      public static boolean notEmpty(char[] a)
      Not null or empty.
      Parameters:
      a -
      Returns:
    • notEmpty

      public static boolean notEmpty(byte[] a)
      Not null or empty.
      Parameters:
      a -
      Returns:
    • notEmpty

      public static boolean notEmpty(short[] a)
      Not null or empty.
      Parameters:
      a -
      Returns:
    • notEmpty

      public static boolean notEmpty(int[] a)
      Not null or empty.
      Parameters:
      a -
      Returns:
    • notEmpty

      public static boolean notEmpty(long[] a)
      Not null or empty.
      Parameters:
      a -
      Returns:
    • notEmpty

      public static boolean notEmpty(float[] a)
      Not null or empty.
      Parameters:
      a -
      Returns:
    • notEmpty

      public static boolean notEmpty(double[] a)
      Not null or empty.
      Parameters:
      a -
      Returns:
    • notEmpty

      public static boolean notEmpty(Object[] a)
      Not null or empty.
      Parameters:
      a -
      Returns:
    • notEmpty

      public static boolean notEmpty(Collection<?> c)
      Not null or empty.
      Parameters:
      c -
      Returns:
    • notEmpty

      @Beta public static boolean notEmpty(Iterable<?> iter)
      Not null or empty.
      Parameters:
      iter -
      Returns:
    • notEmpty

      @Beta public static boolean notEmpty(Iterator<?> iter)
      Not null or empty.
      Parameters:
      iter -
      Returns:
    • notEmpty

      public static boolean notEmpty(Map<?,?> m)
      Not null or empty.
      Parameters:
      m -
      Returns:
    • notEmpty

      public static boolean notEmpty(PrimitiveList list)
      Not null or empty.
      Parameters:
      list -
      Returns:
    • notEmpty

      public static boolean notEmpty(Multiset<?> s)
      Not null or empty.
      Parameters:
      s -
      Returns:
    • notEmpty

      public static boolean notEmpty(Multimap<?,?,?> m)
      Not null or empty.
      Parameters:
      m -
      Returns:
    • notEmpty

      public static boolean notEmpty(DataSet rs)
      Not null or empty.
      Parameters:
      rs -
      Returns:
    • notBlank

      public static boolean notBlank(CharSequence cs)
      Parameters:
      cs -
      Returns:
    • anyNull

      public static <A, B> boolean anyNull(A a, B b)
      Type Parameters:
      A -
      B -
      Parameters:
      a -
      b -
      Returns:
    • anyNull

      public static <A, B, C> boolean anyNull(A a, B b, C c)
      Type Parameters:
      A -
      B -
      C -
      Parameters:
      a -
      b -
      c -
      Returns:
    • anyNull

      @SafeVarargs public static <T> boolean anyNull(T... a)
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • anyNull

      public static boolean anyNull(Collection<?> c)
      Parameters:
      c -
      Returns:
    • anyEmpty

      public static boolean anyEmpty(CharSequence a, CharSequence b)
      Parameters:
      a -
      b -
      Returns:
    • anyEmpty

      public static boolean anyEmpty(CharSequence a, CharSequence b, CharSequence c)
      Parameters:
      a -
      b -
      c -
      Returns:
    • anyEmpty

      public static boolean anyEmpty(CharSequence... css)

      Checks if any of the CharSequences are empty ("") or null.

       Strings.anyEmpty((String) null)    = true
       Strings.anyEmpty((String[]) null)  = false
       Strings.anyEmpty(null, "foo")      = true
       Strings.anyEmpty("", "bar")        = true
       Strings.anyEmpty("bob", "")        = true
       Strings.anyEmpty("  bob  ", null)  = true
       Strings.anyEmpty(" ", "bar")       = false
       Strings.anyEmpty("foo", "bar")     = false
       Strings.anyEmpty(new String[]{})   = false
       Strings.anyEmpty(new String[]{""}) = true
       
      Parameters:
      css - the CharSequences to check, may be null or empty
      Returns:
      true if any of the CharSequences are empty or null
      See Also:
    • anyEmpty

      public static boolean anyEmpty(Collection<? extends CharSequence> css)
      Parameters:
      css -
      Returns:
      See Also:
    • anyEmpty

      public static <A, B> boolean anyEmpty(A[] a, B[] b)
      Type Parameters:
      A -
      B -
      Parameters:
      a -
      b -
      Returns:
    • anyEmpty

      public static <A, B, C> boolean anyEmpty(A[] a, B[] b, C[] c)
      Type Parameters:
      A -
      B -
      C -
      Parameters:
      a -
      b -
      c -
      Returns:
    • anyEmpty

      public static boolean anyEmpty(Collection<?> a, Collection<?> b)
      Parameters:
      a -
      b -
      Returns:
    • anyEmpty

      public static boolean anyEmpty(Collection<?> a, Collection<?> b, Collection<?> c)
      Parameters:
      a -
      b -
      c -
      Returns:
    • anyBlank

      public static boolean anyBlank(CharSequence a, CharSequence b)
      Parameters:
      a -
      b -
      Returns:
    • anyBlank

      public static boolean anyBlank(CharSequence a, CharSequence b, CharSequence c)
      Parameters:
      a -
      b -
      c -
      Returns:
    • anyBlank

      public static boolean anyBlank(CharSequence... css)

      Checks if any of the CharSequences are empty ("") or null or whitespace only.

      Whitespace is defined by Character.isWhitespace(char).

       Strings.anyBlank((String) null)    = true
       Strings.anyBlank((String[]) null)  = false
       Strings.anyBlank(null, "foo")      = true
       Strings.anyBlank(null, null)       = true
       Strings.anyBlank("", "bar")        = true
       Strings.anyBlank("bob", "")        = true
       Strings.anyBlank("  bob  ", null)  = true
       Strings.anyBlank(" ", "bar")       = true
       Strings.anyBlank(new String[] {})  = false
       Strings.anyBlank(new String[]{""}) = true
       Strings.anyBlank("foo", "bar")     = false
       
      Parameters:
      css - the CharSequences to check, may be null or empty
      Returns:
      true if any of the CharSequences are empty or null or whitespace only
      See Also:
    • anyBlank

      public static boolean anyBlank(Collection<? extends CharSequence> css)
      Parameters:
      css -
      Returns:
      See Also:
      • invalid reference
        Strings#isAnyBlank(Collection)
    • allNull

      public static <A, B> boolean allNull(A a, B b)
      Type Parameters:
      A -
      B -
      Parameters:
      a -
      b -
      Returns:
    • allNull

      public static <A, B, C> boolean allNull(A a, B b, C c)
      Type Parameters:
      A -
      B -
      C -
      Parameters:
      a -
      b -
      c -
      Returns:
    • allNull

      @SafeVarargs public static <T> boolean allNull(T... a)
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • allNull

      public static boolean allNull(Collection<?> c)
      Parameters:
      c -
      Returns:
    • allEmpty

      public static boolean allEmpty(CharSequence a, CharSequence b)
      Parameters:
      a -
      b -
      Returns:
    • allEmpty

      public static boolean allEmpty(CharSequence a, CharSequence b, CharSequence c)
      Parameters:
      a -
      b -
      c -
      Returns:
    • allEmpty

      public static boolean allEmpty(CharSequence... css)

      Checks if all of the CharSequences are empty ("") or null.

       Strings.allEmpty(null)             = true
       Strings.allEmpty(null, "")         = true
       Strings.allEmpty(new String[] {})  = true
       Strings.allEmpty(null, "foo")      = false
       Strings.allEmpty("", "bar")        = false
       Strings.allEmpty("bob", "")        = false
       Strings.allEmpty("  bob  ", null)  = false
       Strings.allEmpty(" ", "bar")       = false
       Strings.allEmpty("foo", "bar")     = false
       
      Parameters:
      css - the CharSequences to check, may be null or empty
      Returns:
      true if all of the CharSequences are empty or null
      See Also:
    • allEmpty

      public static boolean allEmpty(Collection<? extends CharSequence> css)
      Parameters:
      css -
      Returns:
      See Also:
      • invalid reference
        Strings#isAllEmpty(Collection)
    • allEmpty

      public static <A, B> boolean allEmpty(A[] a, B[] b)
      Type Parameters:
      A -
      B -
      Parameters:
      a -
      b -
      Returns:
    • allEmpty

      public static <A, B, C> boolean allEmpty(A[] a, B[] b, C[] c)
      Type Parameters:
      A -
      B -
      C -
      Parameters:
      a -
      b -
      c -
      Returns:
    • allEmpty

      public static boolean allEmpty(Collection<?> a, Collection<?> b)
      Parameters:
      a -
      b -
      Returns:
    • allEmpty

      public static boolean allEmpty(Collection<?> a, Collection<?> b, Collection<?> c)
      Parameters:
      a -
      b -
      c -
      Returns:
    • allBlank

      public static boolean allBlank(CharSequence a, CharSequence b)
      Parameters:
      a -
      b -
      Returns:
    • allBlank

      public static boolean allBlank(CharSequence a, CharSequence b, CharSequence c)
      Parameters:
      a -
      b -
      c -
      Returns:
    • allBlank

      public static boolean allBlank(CharSequence... css)

      Checks if all of the CharSequences are empty (""), null or whitespace only.

      Whitespace is defined by Character.isWhitespace(char).

       Strings.allBlank(null)             = true
       Strings.allBlank(null, "foo")      = false
       Strings.allBlank(null, null)       = true
       Strings.allBlank("", "bar")        = false
       Strings.allBlank("bob", "")        = false
       Strings.allBlank("  bob  ", null)  = false
       Strings.allBlank(" ", "bar")       = false
       Strings.allBlank("foo", "bar")     = false
       Strings.allBlank(new String[] {})  = true
       
      Parameters:
      css - the CharSequences to check, may be null or empty
      Returns:
      true if all of the CharSequences are empty or null or whitespace only
      See Also:
    • allBlank

      public static boolean allBlank(Collection<? extends CharSequence> css)
      Parameters:
      css -
      Returns:
      See Also:
      • invalid reference
        Strings#isAllBlank(Collection)
    • checkIndex

      public static void checkIndex(int index, int length) throws IndexOutOfBoundsException
      Parameters:
      index -
      length -
      Throws:
      IndexOutOfBoundsException - the index out of bounds exception
    • checkFromToIndex

      public static void checkFromToIndex(int fromIndex, int toIndex, int length) throws IndexOutOfBoundsException
      Check from to index.
      Parameters:
      fromIndex -
      toIndex -
      length -
      Throws:
      IndexOutOfBoundsException - the index out of bounds exception
    • checkFromIndexSize

      public static void checkFromIndexSize(int fromIndex, int size, int length) throws IndexOutOfBoundsException
      Check from index size.
      Parameters:
      fromIndex - the lower-bound (inclusive) of the sub-interval
      size - the size of the sub-range
      length - the upper-bound (exclusive) of the range
      Throws:
      IndexOutOfBoundsException - the index out of bounds exception
    • checkArgNotNull

      public static <T> T checkArgNotNull(T obj) throws IllegalArgumentException
      Check arg not null.
      Type Parameters:
      T -
      Parameters:
      obj -
      Returns:
      Throws:
      IllegalArgumentException - if obj is null
    • checkArgNotNull

      public static <T> T checkArgNotNull(T obj, String errorMessage) throws IllegalArgumentException
      Check arg not null.
      Type Parameters:
      T -
      Parameters:
      obj -
      errorMessage -
      Returns:
      Throws:
      IllegalArgumentException - if obj is null
    • checkArgNotEmpty

      public static <T extends CharSequence> T checkArgNotEmpty(T arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified arg is null or empty, and throws IllegalArgumentException if it is.
      Type Parameters:
      T -
      Parameters:
      arg -
      argNameOrErrorMsg -
      Returns:
      Throws:
      IllegalArgumentException - if the specified arg is null or empty.
    • checkArgNotEmpty

      public static boolean[] checkArgNotEmpty(boolean[] arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified arg is null or empty, and throws IllegalArgumentException if it is.
      Parameters:
      arg -
      argNameOrErrorMsg -
      Returns:
      Throws:
      IllegalArgumentException - if the specified arg is null or empty.
    • checkArgNotEmpty

      public static char[] checkArgNotEmpty(char[] arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified arg is null or empty, and throws IllegalArgumentException if it is.
      Parameters:
      arg -
      argNameOrErrorMsg -
      Returns:
      Throws:
      IllegalArgumentException - if the specified arg is null or empty.
    • checkArgNotEmpty

      public static byte[] checkArgNotEmpty(byte[] arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified arg is null or empty, and throws IllegalArgumentException if it is.
      Parameters:
      arg -
      argNameOrErrorMsg -
      Returns:
      Throws:
      IllegalArgumentException - if the specified arg is null or empty.
    • checkArgNotEmpty

      public static short[] checkArgNotEmpty(short[] arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified arg is null or empty, and throws IllegalArgumentException if it is.
      Parameters:
      arg -
      argNameOrErrorMsg -
      Returns:
      Throws:
      IllegalArgumentException - if the specified arg is null or empty.
    • checkArgNotEmpty

      public static int[] checkArgNotEmpty(int[] arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified arg is null or empty, and throws IllegalArgumentException if it is.
      Parameters:
      arg -
      argNameOrErrorMsg -
      Returns:
      Throws:
      IllegalArgumentException - if the specified arg is null or empty.
    • checkArgNotEmpty

      public static long[] checkArgNotEmpty(long[] arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified arg is null or empty, and throws IllegalArgumentException if it is.
      Parameters:
      arg -
      argNameOrErrorMsg -
      Returns:
      Throws:
      IllegalArgumentException - if the specified arg is null or empty.
    • checkArgNotEmpty

      public static float[] checkArgNotEmpty(float[] arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified arg is null or empty, and throws IllegalArgumentException if it is.
      Parameters:
      arg -
      argNameOrErrorMsg -
      Returns:
      Throws:
      IllegalArgumentException - if the specified arg is null or empty.
    • checkArgNotEmpty

      public static double[] checkArgNotEmpty(double[] arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified arg is null or empty, and throws IllegalArgumentException if it is.
      Parameters:
      arg -
      argNameOrErrorMsg -
      Returns:
      Throws:
      IllegalArgumentException - if the specified arg is null or empty.
    • checkArgNotEmpty

      public static <T> T[] checkArgNotEmpty(T[] arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified arg is null or empty, and throws IllegalArgumentException if it is.
      Type Parameters:
      T -
      Parameters:
      arg -
      argNameOrErrorMsg -
      Returns:
      Throws:
      IllegalArgumentException - if the specified arg is null or empty.
    • checkArgNotEmpty

      public static <T extends Collection<?>> T checkArgNotEmpty(T arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified arg is null or empty, and throws IllegalArgumentException if it is.
      Type Parameters:
      T -
      Parameters:
      arg -
      argNameOrErrorMsg -
      Returns:
      Throws:
      IllegalArgumentException - if the specified arg is null or empty.
    • checkArgNotEmpty

      @Beta public static <T extends Iterable<?>> T checkArgNotEmpty(T arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified arg is null or empty, and throws IllegalArgumentException if it is.
      Type Parameters:
      T -
      Parameters:
      arg -
      argNameOrErrorMsg -
      Returns:
      Throws:
      IllegalArgumentException - if the specified arg is null or empty.
    • checkArgNotEmpty

      @Beta public static <T extends Iterator<?>> T checkArgNotEmpty(T arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified arg is null or empty, and throws IllegalArgumentException if it is.
      Type Parameters:
      T -
      Parameters:
      arg -
      argNameOrErrorMsg -
      Returns:
      Throws:
      IllegalArgumentException - if the specified arg is null or empty.
    • checkArgNotEmpty

      public static <T extends Map<?, ?>> T checkArgNotEmpty(T arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified arg is null or empty, and throws IllegalArgumentException if it is.
      Type Parameters:
      T -
      Parameters:
      arg -
      argNameOrErrorMsg -
      Returns:
      Throws:
      IllegalArgumentException - if the specified arg is null or empty.
    • checkArgNotEmpty

      public static <T extends PrimitiveList<?, ?, ?>> T checkArgNotEmpty(T arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified arg is null or empty, and throws IllegalArgumentException if it is.
      Type Parameters:
      T -
      Parameters:
      arg -
      argNameOrErrorMsg -
      Returns:
      Throws:
      IllegalArgumentException - if the specified arg is null or empty.
    • checkArgNotEmpty

      public static <T> Multiset<T> checkArgNotEmpty(Multiset<T> arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified arg is null or empty, and throws IllegalArgumentException if it is.
      Type Parameters:
      T -
      Parameters:
      arg -
      argNameOrErrorMsg -
      Returns:
      Throws:
      IllegalArgumentException - if the specified arg is null or empty.
    • checkArgNotEmpty

      public static <T extends Multimap<?, ?, ?>> T checkArgNotEmpty(T arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified arg is null or empty, and throws IllegalArgumentException if it is.
      Type Parameters:
      T -
      Parameters:
      arg -
      argNameOrErrorMsg -
      Returns:
      Throws:
      IllegalArgumentException - if the specified arg is null or empty.
    • checkArgNotEmpty

      public static <T extends DataSet> T checkArgNotEmpty(T arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified arg is null or empty, and throws IllegalArgumentException if it is.
      Type Parameters:
      T -
      Parameters:
      arg -
      argNameOrErrorMsg -
      Returns:
      Throws:
      IllegalArgumentException - if the specified arg is null or empty.
    • checkArgNotBlank

      public static <T extends CharSequence> T checkArgNotBlank(T arg, String msg) throws IllegalArgumentException

      Checks if a CharSequence is NOT null, empty ("") or whitespace only.

      Type Parameters:
      T -
      Parameters:
      arg -
      msg - name of parameter or error message
      Returns:
      Throws:
      IllegalArgumentException - if the specified parameter is null, empty ("") or whitespace only.
      See Also:
    • checkArgNotNegative

      public static byte checkArgNotNegative(byte arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified arg is not negative, and throws IllegalArgumentException if it is.
      Parameters:
      arg -
      argNameOrErrorMsg -
      Returns:
      Throws:
      IllegalArgumentException - if the specified arg is negative.
    • checkArgNotNegative

      public static short checkArgNotNegative(short arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified arg is not negative, and throws IllegalArgumentException if it is.
      Parameters:
      arg -
      argNameOrErrorMsg -
      Returns:
      Throws:
      IllegalArgumentException - if the specified arg is negative.
    • checkArgNotNegative

      public static int checkArgNotNegative(int arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified arg is not negative, and throws IllegalArgumentException if it is.
      Parameters:
      arg -
      argNameOrErrorMsg -
      Returns:
      Throws:
      IllegalArgumentException - if the specified arg is negative.
    • checkArgNotNegative

      public static long checkArgNotNegative(long arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified arg is not negative, and throws IllegalArgumentException if it is.
      Parameters:
      arg -
      argNameOrErrorMsg -
      Returns:
      Throws:
      IllegalArgumentException - if the specified arg is negative.
    • checkArgNotNegative

      public static float checkArgNotNegative(float arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified arg is not negative, and throws IllegalArgumentException if it is.
      Parameters:
      arg -
      argNameOrErrorMsg -
      Returns:
      Throws:
      IllegalArgumentException - if the specified arg is negative.
    • checkArgNotNegative

      public static double checkArgNotNegative(double arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified arg is not negative, and throws IllegalArgumentException if it is.
      Parameters:
      arg -
      argNameOrErrorMsg -
      Returns:
      Throws:
      IllegalArgumentException - if the specified arg is negative.
    • checkArgPositive

      public static byte checkArgPositive(byte arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified arg is positive, and throws IllegalArgumentException if it is not.
      Parameters:
      arg -
      argNameOrErrorMsg -
      Returns:
      Throws:
      IllegalArgumentException - if the specified arg is negative.
    • checkArgPositive

      public static short checkArgPositive(short arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified arg is positive, and throws IllegalArgumentException if it is not.
      Parameters:
      arg -
      argNameOrErrorMsg -
      Returns:
      Throws:
      IllegalArgumentException - if the specified arg is negative.
    • checkArgPositive

      public static int checkArgPositive(int arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified arg is positive, and throws IllegalArgumentException if it is not.
      Parameters:
      arg -
      argNameOrErrorMsg -
      Returns:
      Throws:
      IllegalArgumentException - if the specified arg is negative.
    • checkArgPositive

      public static long checkArgPositive(long arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified arg is positive, and throws IllegalArgumentException if it is not.
      Parameters:
      arg -
      argNameOrErrorMsg -
      Returns:
      Throws:
      IllegalArgumentException - if the specified arg is negative.
    • checkArgPositive

      public static float checkArgPositive(float arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified arg is positive, and throws IllegalArgumentException if it is not.
      Parameters:
      arg -
      argNameOrErrorMsg -
      Returns:
      Throws:
      IllegalArgumentException - if the specified arg is negative.
    • checkArgPositive

      public static double checkArgPositive(double arg, String argNameOrErrorMsg) throws IllegalArgumentException
      Checks if the specified arg is positive, and throws IllegalArgumentException if it is not.
      Parameters:
      arg -
      argNameOrErrorMsg -
      Returns:
      Throws:
      IllegalArgumentException - if the specified arg is negative.
    • checkElementNotNull

      public static void checkElementNotNull(Object[] a) throws IllegalArgumentException
      Check if the specified Array contains any null element.
      Parameters:
      a -
      Throws:
      IllegalArgumentException - if null element found in a
    • checkElementNotNull

      public static void checkElementNotNull(Object[] a, String argNameOrErrorMsg) throws IllegalArgumentException
      Check if the specified Array contains any null element.
      Parameters:
      a -
      argNameOrErrorMsg -
      Throws:
      IllegalArgumentException - if null element found in a
    • checkElementNotNull

      public static void checkElementNotNull(Collection<?> c) throws IllegalArgumentException
      Check if the specified Collection contains any null element.
      Parameters:
      c -
      Throws:
      IllegalArgumentException - if null element found in c
    • checkElementNotNull

      public static void checkElementNotNull(Collection<?> c, String argNameOrErrorMsg) throws IllegalArgumentException
      Check if the specified Collection contains any null element.
      Parameters:
      c -
      argNameOrErrorMsg -
      Throws:
      IllegalArgumentException - if null element found in c
    • checkKeyNotNull

      public static void checkKeyNotNull(Map<?,?> m) throws IllegalArgumentException
      Check if the specified Map contains any null key.
      Parameters:
      m -
      Throws:
      IllegalArgumentException - if null key found in m
    • checkKeyNotNull

      public static void checkKeyNotNull(Map<?,?> m, String argNameOrErrorMsg) throws IllegalArgumentException
      Check if the specified Map contains any null key.
      Parameters:
      m -
      argNameOrErrorMsg -
      Throws:
      IllegalArgumentException - if null key found in m
    • checkValueNotNull

      public static void checkValueNotNull(Map<?,?> m) throws IllegalArgumentException
      Check if the specified Map contains any null value.
      Parameters:
      m -
      Throws:
      IllegalArgumentException - if null value found in m
    • checkValueNotNull

      public static void checkValueNotNull(Map<?,?> m, String argNameOrErrorMsg) throws IllegalArgumentException
      Check if the specified Map contains any null value.
      Parameters:
      m -
      argNameOrErrorMsg -
      Throws:
      IllegalArgumentException - if null value found in m
    • checkArgument

      public static void checkArgument(boolean expression) throws IllegalArgumentException
      Ensures the truth of an expression involving one or more parameters to the calling method.
      Parameters:
      expression - a boolean expression
      Throws:
      IllegalArgumentException - if expression is false
    • checkArgument

      public static void checkArgument(boolean expression, String errorMessage) throws IllegalArgumentException
      Ensures the truth of an expression involving one or more parameters to the calling method.
      Parameters:
      expression - a boolean expression
      errorMessage - the exception message to use if the check fails; will be converted to a string using String.valueOf(Object)
      Throws:
      IllegalArgumentException - if expression is false
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, boolean p) throws IllegalArgumentException
      Ensures the truth of an expression involving one or more parameters to the calling method.

      See checkArgument(boolean, String, Object...) for details.

      Parameters:
      b -
      errorMessageTemplate -
      p -
      Throws:
      IllegalArgumentException
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, boolean p1, boolean p2) throws IllegalArgumentException
      Ensures the truth of an expression involving one or more parameters to the calling method.

      See checkArgument(boolean, String, Object...) for details.

      Parameters:
      b -
      errorMessageTemplate -
      p1 -
      p2 -
      Throws:
      IllegalArgumentException
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, boolean p1, boolean p2, boolean p3) throws IllegalArgumentException
      Ensures the truth of an expression involving one or more parameters to the calling method.

      See checkArgument(boolean, String, Object...) for details.

      Parameters:
      b -
      errorMessageTemplate -
      p1 -
      p2 -
      p3 -
      Throws:
      IllegalArgumentException
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, char p) throws IllegalArgumentException
      Ensures the truth of an expression involving one or more parameters to the calling method.

      See checkArgument(boolean, String, Object...) for details.

      Parameters:
      b -
      errorMessageTemplate -
      p -
      Throws:
      IllegalArgumentException
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, byte p) throws IllegalArgumentException
      Ensures the truth of an expression involving one or more parameters to the calling method.

      See checkArgument(boolean, String, Object...) for details.

      Parameters:
      b -
      errorMessageTemplate -
      p -
      Throws:
      IllegalArgumentException
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, short p) throws IllegalArgumentException
      Ensures the truth of an expression involving one or more parameters to the calling method.

      See checkArgument(boolean, String, Object...) for details.

      Parameters:
      b -
      errorMessageTemplate -
      p -
      Throws:
      IllegalArgumentException
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, int p) throws IllegalArgumentException
      Ensures the truth of an expression involving one or more parameters to the calling method.

      See checkArgument(boolean, String, Object...) for details.

      Parameters:
      b -
      errorMessageTemplate -
      p -
      Throws:
      IllegalArgumentException
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, int p1, int p2) throws IllegalArgumentException
      Ensures the truth of an expression involving one or more parameters to the calling method.

      See checkArgument(boolean, String, Object...) for details.

      Parameters:
      b -
      errorMessageTemplate -
      p1 -
      p2 -
      Throws:
      IllegalArgumentException
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, int p1, int p2, int p3) throws IllegalArgumentException
      Ensures the truth of an expression involving one or more parameters to the calling method.

      See checkArgument(boolean, String, Object...) for details.

      Parameters:
      b -
      errorMessageTemplate -
      p1 -
      p2 -
      p3 -
      Throws:
      IllegalArgumentException
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, long p) throws IllegalArgumentException
      Ensures the truth of an expression involving one or more parameters to the calling method.

      See checkArgument(boolean, String, Object...) for details.

      Parameters:
      b -
      errorMessageTemplate -
      p -
      Throws:
      IllegalArgumentException
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, long p1, long p2) throws IllegalArgumentException
      Ensures the truth of an expression involving one or more parameters to the calling method.

      See checkArgument(boolean, String, Object...) for details.

      Parameters:
      b -
      errorMessageTemplate -
      p1 -
      p2 -
      Throws:
      IllegalArgumentException
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, long p1, long p2, long p3) throws IllegalArgumentException
      Ensures the truth of an expression involving one or more parameters to the calling method.

      See checkArgument(boolean, String, Object...) for details.

      Parameters:
      b -
      errorMessageTemplate -
      p1 -
      p2 -
      p3 -
      Throws:
      IllegalArgumentException
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, float p) throws IllegalArgumentException
      Ensures the truth of an expression involving one or more parameters to the calling method.

      See checkArgument(boolean, String, Object...) for details.

      Parameters:
      b -
      errorMessageTemplate -
      p -
      Throws:
      IllegalArgumentException
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, float p1, float p2) throws IllegalArgumentException
      Ensures the truth of an expression involving one or more parameters to the calling method.

      See checkArgument(boolean, String, Object...) for details.

      Parameters:
      b -
      errorMessageTemplate -
      p1 -
      p2 -
      Throws:
      IllegalArgumentException
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, float p1, float p2, float p3) throws IllegalArgumentException
      Ensures the truth of an expression involving one or more parameters to the calling method.

      See checkArgument(boolean, String, Object...) for details.

      Parameters:
      b -
      errorMessageTemplate -
      p1 -
      p2 -
      p3 -
      Throws:
      IllegalArgumentException
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, double p) throws IllegalArgumentException
      Ensures the truth of an expression involving one or more parameters to the calling method.

      See checkArgument(boolean, String, Object...) for details.

      Parameters:
      b -
      errorMessageTemplate -
      p -
      Throws:
      IllegalArgumentException
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, double p1, double p2) throws IllegalArgumentException
      Ensures the truth of an expression involving one or more parameters to the calling method.

      See checkArgument(boolean, String, Object...) for details.

      Parameters:
      b -
      errorMessageTemplate -
      p1 -
      p2 -
      Throws:
      IllegalArgumentException
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, double p1, double p2, double p3) throws IllegalArgumentException
      Ensures the truth of an expression involving one or more parameters to the calling method.

      See checkArgument(boolean, String, Object...) for details.

      Parameters:
      b -
      errorMessageTemplate -
      p1 -
      p2 -
      p3 -
      Throws:
      IllegalArgumentException
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, Object p) throws IllegalArgumentException
      Ensures the truth of an expression involving one or more parameters to the calling method.

      See checkArgument(boolean, String, Object...) for details.

      Parameters:
      b -
      errorMessageTemplate -
      p -
      Throws:
      IllegalArgumentException
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, Object p1, Object p2) throws IllegalArgumentException
      Ensures the truth of an expression involving one or more parameters to the calling method.

      See checkArgument(boolean, String, Object...) for details.

      Parameters:
      b -
      errorMessageTemplate -
      p1 -
      p2 -
      Throws:
      IllegalArgumentException
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, Object p1, Object p2, Object p3) throws IllegalArgumentException
      Ensures the truth of an expression involving one or more parameters to the calling method.

      See checkArgument(boolean, String, Object...) for details.

      Parameters:
      b -
      errorMessageTemplate -
      p1 -
      p2 -
      p3 -
      Throws:
      IllegalArgumentException
    • checkArgument

      public static void checkArgument(boolean b, Supplier<String> errorMessageSupplier) throws IllegalArgumentException
      Parameters:
      b -
      errorMessageSupplier -
      Throws:
      IllegalArgumentException
    • checkState

      public static void checkState(boolean expression)
      Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.
      Parameters:
      expression - a boolean expression
      Throws:
      IllegalStateException - if expression is false
    • checkState

      public static void checkState(boolean expression, String errorMessage)
      Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.
      Parameters:
      expression - a boolean expression
      errorMessage - the exception message to use if the check fails; will be converted to a string using String.valueOf(Object)
      Throws:
      IllegalStateException - if expression is false
    • checkState

      public static void checkState(boolean b, String errorMessageTemplate, int p)
      Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.

      See checkState(boolean, String, Object...) for details.

      Parameters:
      b -
      errorMessageTemplate -
      p -
    • checkState

      public static void checkState(boolean b, String errorMessageTemplate, int p1, int p2)
      Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.

      See checkState(boolean, String, Object...) for details.

      Parameters:
      b -
      errorMessageTemplate -
      p1 -
      p2 -
    • checkState

      public static void checkState(boolean b, String errorMessageTemplate, int p1, int p2, int p3)
      Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.

      See checkState(boolean, String, Object...) for details.

      Parameters:
      b -
      errorMessageTemplate -
      p1 -
      p2 -
      p3 -
    • checkState

      public static void checkState(boolean b, String errorMessageTemplate, long p)
      Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.

      See checkState(boolean, String, Object...) for details.

      Parameters:
      b -
      errorMessageTemplate -
      p -
    • checkState

      public static void checkState(boolean b, String errorMessageTemplate, long p1, long p2)
      Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.

      See checkState(boolean, String, Object...) for details.

      Parameters:
      b -
      errorMessageTemplate -
      p1 -
      p2 -
    • checkState

      public static void checkState(boolean b, String errorMessageTemplate, long p1, long p2, long p3)
      Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.

      See checkState(boolean, String, Object...) for details.

      Parameters:
      b -
      errorMessageTemplate -
      p1 -
      p2 -
      p3 -
    • checkState

      public static void checkState(boolean b, String errorMessageTemplate, float p)
      Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.

      See checkState(boolean, String, Object...) for details.

      Parameters:
      b -
      errorMessageTemplate -
      p -
    • checkState

      public static void checkState(boolean b, String errorMessageTemplate, float p1, float p2)
      Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.

      See checkState(boolean, String, Object...) for details.

      Parameters:
      b -
      errorMessageTemplate -
      p1 -
      p2 -
    • checkState

      public static void checkState(boolean b, String errorMessageTemplate, float p1, float p2, float p3)
      Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.

      See checkState(boolean, String, Object...) for details.

      Parameters:
      b -
      errorMessageTemplate -
      p1 -
      p2 -
      p3 -
    • checkState

      public static void checkState(boolean b, String errorMessageTemplate, double p)
      Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.

      See checkState(boolean, String, Object...) for details.

      Parameters:
      b -
      errorMessageTemplate -
      p -
    • checkState

      public static void checkState(boolean b, String errorMessageTemplate, double p1, double p2)
      Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.

      See checkState(boolean, String, Object...) for details.

      Parameters:
      b -
      errorMessageTemplate -
      p1 -
      p2 -
    • checkState

      public static void checkState(boolean b, String errorMessageTemplate, double p1, double p2, double p3)
      Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.

      See checkState(boolean, String, Object...) for details.

      Parameters:
      b -
      errorMessageTemplate -
      p1 -
      p2 -
      p3 -
    • checkState

      public static void checkState(boolean b, String errorMessageTemplate, Object p)
      Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.

      See checkState(boolean, String, Object...) for details.

      Parameters:
      b -
      errorMessageTemplate -
      p -
    • checkState

      public static void checkState(boolean b, String errorMessageTemplate, Object p1, Object p2)
      Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.

      See checkState(boolean, String, Object...) for details.

      Parameters:
      b -
      errorMessageTemplate -
      p1 -
      p2 -
    • checkState

      public static void checkState(boolean b, String errorMessageTemplate, Object p1, Object p2, Object p3)
      Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.

      See checkState(boolean, String, Object...) for details.

      Parameters:
      b -
      errorMessageTemplate -
      p1 -
      p2 -
      p3 -
    • checkState

      public static void checkState(boolean b, Supplier<String> errorMessageSupplier)
      Parameters:
      b -
      errorMessageSupplier -
    • requireNonNull

      @Beta public static <T> T requireNonNull(T obj) throws NullPointerException
      Ensures that the specified object reference is not null.
      Type Parameters:
      T - the type of the object
      Parameters:
      obj - the object reference to check for nullity
      Returns:
      the non-null object reference that was validated
      Throws:
      NullPointerException - if the specified obj is null
      See Also:
    • requireNonNull

      @Beta public static <T> T requireNonNull(T obj, String errorMessage) throws NullPointerException
      Ensures that the specified object reference is not null.
      Type Parameters:
      T - the type of the object
      Parameters:
      obj - the object reference to check for nullity
      errorMessage - the detail message to be used in the event that a NullPointerException is thrown
      Returns:
      the non-null object reference that was validated
      Throws:
      NullPointerException - if the specified obj is null
      See Also:
    • requireNonNull

      @Beta public static <T> T requireNonNull(T obj, Supplier<String> errorMessageSupplier) throws NullPointerException
      Ensures that the specified object reference is not null.
      Type Parameters:
      T - the type of the object
      Parameters:
      obj - the object reference to check for nullity
      errorMessageSupplier - the supplier of the detail message to be used in the event that a NullPointerException is thrown
      Returns:
      the non-null object reference that was validated
      Throws:
      NullPointerException - if the specified obj is null
      See Also:
    • compare

      public static int compare(boolean a, boolean b)
      Parameters:
      a -
      b -
      Returns:
    • compare

      public static int compare(byte a, byte b)
      Parameters:
      a -
      b -
      Returns:
    • compareUnsigned

      public static int compareUnsigned(byte a, byte b)
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • compare

      public static int compare(short a, short b)
      Parameters:
      a -
      b -
      Returns:
    • compareUnsigned

      public static int compareUnsigned(short a, short b)
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • compare

      public static int compare(int a, int b)
      Parameters:
      a -
      b -
      Returns:
    • compareUnsigned

      public static int compareUnsigned(int a, int b)
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • compare

      public static int compare(long a, long b)
      Parameters:
      a -
      b -
      Returns:
    • compareUnsigned

      public static int compareUnsigned(long a, long b)
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • compare

      public static int compare(float a, float b)
      Parameters:
      a -
      b -
      Returns:
    • compare

      public static int compare(double a, double b)
      Parameters:
      a -
      b -
      Returns:
    • compare

      public static <T extends Comparable<? super T>> int compare(T a, T b)
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      Returns:
    • compare

      public static <T> int compare(T a, T b, Comparator<? super T> cmp)
      Returns 0 if the arguments are identical and c.compare(a, b) otherwise. Consequently, if both arguments are null 0 is returned.

      Note that if one of the arguments is null, a NullPointerException may or may not be thrown depending on what ordering policy, if any, the Comparator chooses to have for null values.

      Type Parameters:
      T - the type of the objects being compared
      Parameters:
      a - an object
      b - an object to be compared with a
      cmp - the Comparator to compare the first two arguments
      Returns:
      0 if the arguments are identical and c.compare(a, b) otherwise.
      See Also:
    • compare

      public static <T1 extends Comparable<T1>, T2 extends Comparable<T2>> int compare(T1 a1, T1 b1, T2 a2, T2 b2)
      Continue to compare the pairs of values (a1, b1), (a2, b2) until they're not equal. 0 is returned if all of the pairs of values are equal.
      Type Parameters:
      T1 -
      T2 -
      Parameters:
      a1 -
      b1 -
      a2 -
      b2 -
      Returns:
    • compare

      public static <T1 extends Comparable<T1>, T2 extends Comparable<T2>, T3 extends Comparable<T3>> int compare(T1 a1, T1 b1, T2 a2, T2 b2, T3 a3, T3 b3)
      Continue to compare the pairs of values (a1, b1), (a2, b2), (a3, b3) until they're not equal. 0 is returned if all of the pairs of values are equal.
      Type Parameters:
      T1 -
      T2 -
      T3 -
      Parameters:
      a1 -
      b1 -
      a2 -
      b2 -
      a3 -
      b3 -
      Returns:
    • compare

      @Deprecated public static <T1 extends Comparable<T1>, T2 extends Comparable<T2>, T3 extends Comparable<T3>, T4 extends Comparable<T4>> int compare(T1 a1, T1 b1, T2 a2, T2 b2, T3 a3, T3 b3, T4 a4, T4 b4)
      Deprecated.
      please use Builder.ComparisonBuilder
      Continue to compare the pairs of values (a1, b1), (a2, b2), (a3, b3), (a4, b4) until they're not equal. 0 is returned if all of the pairs of values are equal.
      Type Parameters:
      T1 -
      T2 -
      T3 -
      T4 -
      Parameters:
      a1 -
      b1 -
      a2 -
      b2 -
      a3 -
      b3 -
      a4 -
      b4 -
      Returns:
      See Also:
    • compare

      @Deprecated public static <T1 extends Comparable<T1>, T2 extends Comparable<T2>, T3 extends Comparable<T3>, T4 extends Comparable<T4>, T5 extends Comparable<T5>> int compare(T1 a1, T1 b1, T2 a2, T2 b2, T3 a3, T3 b3, T4 a4, T4 b4, T5 a5, T5 b5)
      Deprecated.
      please use Builder.ComparisonBuilder
      Continue to compare the pairs of values (a1, b1), (a2, b2), (a3, b3), (a4, b4), (a5, b5) until they're not equal. 0 is returned if all of the pairs of values are equal.
      Type Parameters:
      T1 -
      T2 -
      T3 -
      T4 -
      T5 -
      Parameters:
      a1 -
      b1 -
      a2 -
      b2 -
      a3 -
      b3 -
      a4 -
      b4 -
      a5 -
      b5 -
      Returns:
      See Also:
    • compare

      @Deprecated public static <T1 extends Comparable<T1>, T2 extends Comparable<T2>, T3 extends Comparable<T3>, T4 extends Comparable<T4>, T5 extends Comparable<T5>, T6 extends Comparable<T6>> int compare(T1 a1, T1 b1, T2 a2, T2 b2, T3 a3, T3 b3, T4 a4, T4 b4, T5 a5, T5 b5, T6 a6, T6 b6)
      Deprecated.
      please use Builder.ComparisonBuilder
      Continue to compare the pairs of values (a1, b1), (a2, b2), (a3, b3), (a4, b4), (a5, b5), (a6, b6) until they're not equal. 0 is returned if all of the pairs of values are equal.
      Type Parameters:
      T1 -
      T2 -
      T3 -
      T4 -
      T5 -
      T6 -
      Parameters:
      a1 -
      b1 -
      a2 -
      b2 -
      a3 -
      b3 -
      a4 -
      b4 -
      a5 -
      b5 -
      a6 -
      b6 -
      Returns:
      See Also:
    • compare

      @Deprecated public static <T1 extends Comparable<T1>, T2 extends Comparable<T2>, T3 extends Comparable<T3>, T4 extends Comparable<T4>, T5 extends Comparable<T5>, T6 extends Comparable<T6>, T7 extends Comparable<T7>> int compare(T1 a1, T1 b1, T2 a2, T2 b2, T3 a3, T3 b3, T4 a4, T4 b4, T5 a5, T5 b5, T6 a6, T6 b6, T7 a7, T7 b7)
      Deprecated.
      please use Builder.ComparisonBuilder
      Continue to compare the pairs of values (a1, b1), (a2, b2), (a3, b3), (a4, b4), (a5, b5), (a6, b6), (a7, b7) until they're not equal. 0 is returned if all of the pairs of values are equal.
      Type Parameters:
      T1 -
      T2 -
      T3 -
      T4 -
      T5 -
      T6 -
      T7 -
      Parameters:
      a1 -
      b1 -
      a2 -
      b2 -
      a3 -
      b3 -
      a4 -
      b4 -
      a5 -
      b5 -
      a6 -
      b6 -
      a7 -
      b7 -
      Returns:
      See Also:
    • compare

      public static int compare(boolean[] a, boolean[] b)
      Compares two arrays lexicographically.
      Parameters:
      a - the first array to compare
      b - the second array to compare
      Returns:
      a negative integer, zero, or a positive integer as the first array is less than, equal to, or greater than the second
    • compare

      public static int compare(boolean[] a, int fromIndexA, boolean[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Compares two arrays lexicographically over the specified range.
      Parameters:
      a - the first array to compare
      fromIndexA - the starting index in the first array
      b - the second array to compare
      fromIndexB - the starting index in the second array
      len - the number of elements to compare
      Returns:
      a negative integer, zero, or a positive integer as the first array is less than, equal to, or greater than the second array
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the specified ranges are out of bounds
    • compare

      public static int compare(char[] a, char[] b)
      Compares two arrays lexicographically.
      Parameters:
      a - the first array to compare
      b - the second array to compare
      Returns:
      a negative integer, zero, or a positive integer as the first array is less than, equal to, or greater than the second
    • compare

      public static int compare(char[] a, int fromIndexA, char[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Compares two arrays lexicographically over the specified range.
      Parameters:
      a - the first array to compare
      fromIndexA - the starting index in the first array
      b - the second array to compare
      fromIndexB - the starting index in the second array
      len - the number of elements to compare
      Returns:
      a negative integer, zero, or a positive integer as the first array is less than, equal to, or greater than the second array
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the specified ranges are out of bounds
    • compare

      public static int compare(byte[] a, byte[] b)
      Compares two arrays lexicographically.
      Parameters:
      a - the first array to compare
      b - the second array to compare
      Returns:
      a negative integer, zero, or a positive integer as the first array is less than, equal to, or greater than the second
    • compare

      public static int compare(byte[] a, int fromIndexA, byte[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Compares two arrays lexicographically over the specified range.
      Parameters:
      a - the first array to compare
      fromIndexA - the starting index in the first array
      b - the second array to compare
      fromIndexB - the starting index in the second array
      len - the number of elements to compare
      Returns:
      a negative integer, zero, or a positive integer as the first array is less than, equal to, or greater than the second array
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the specified ranges are out of bounds
    • compareUnsigned

      public static int compareUnsigned(byte[] a, byte[] b)
      Compares two arrays lexicographically, treating the values as unsigned.
      Parameters:
      a - the first array to compare
      b - the second array to compare
      Returns:
      a negative integer, zero, or a positive integer as the first array is less than, equal to, or greater than the second
      See Also:
    • compareUnsigned

      public static int compareUnsigned(byte[] a, int fromIndexA, byte[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Compares two subarrays lexicographically, treating the values as unsigned.
      Parameters:
      a - the first array to compare
      fromIndexA - the starting index (inclusive) of the first subarray
      b - the second array to compare
      fromIndexB - the starting index (inclusive) of the second subarray
      len - the length of the subarrays to compare
      Returns:
      a negative integer, zero, or a positive integer as the first subarray is less than, equal to, or greater than the second subarray
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the specified indices are out of bounds
      See Also:
    • compare

      public static int compare(short[] a, short[] b)
      Compares two arrays lexicographically.
      Parameters:
      a - the first array to compare
      b - the second array to compare
      Returns:
      a negative integer, zero, or a positive integer as the first array is less than, equal to, or greater than the second
    • compare

      public static int compare(short[] a, int fromIndexA, short[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Compares two arrays lexicographically over the specified range.
      Parameters:
      a - the first array to compare
      fromIndexA - the starting index in the first array
      b - the second array to compare
      fromIndexB - the starting index in the second array
      len - the number of elements to compare
      Returns:
      a negative integer, zero, or a positive integer as the first array is less than, equal to, or greater than the second array
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the specified ranges are out of bounds
    • compareUnsigned

      public static int compareUnsigned(short[] a, short[] b)
      Compares two arrays lexicographically, treating the values as unsigned.
      Parameters:
      a - the first array to compare
      b - the second array to compare
      Returns:
      a negative integer, zero, or a positive integer as the first array is less than, equal to, or greater than the second
      See Also:
    • compareUnsigned

      public static int compareUnsigned(short[] a, int fromIndexA, short[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Compares two subarrays lexicographically, treating the values as unsigned.
      Parameters:
      a - the first array to compare
      fromIndexA - the starting index (inclusive) of the first subarray
      b - the second array to compare
      fromIndexB - the starting index (inclusive) of the second subarray
      len - the length of the subarrays to compare
      Returns:
      a negative integer, zero, or a positive integer as the first subarray is less than, equal to, or greater than the second subarray
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the specified indices are out of bounds
      See Also:
    • compare

      public static int compare(int[] a, int[] b)
      Compares two arrays lexicographically.
      Parameters:
      a - the first array to compare
      b - the second array to compare
      Returns:
      a negative integer, zero, or a positive integer as the first array is less than, equal to, or greater than the second
    • compare

      public static int compare(int[] a, int fromIndexA, int[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Compares two arrays lexicographically over the specified range.
      Parameters:
      a - the first array to compare
      fromIndexA - the starting index in the first array
      b - the second array to compare
      fromIndexB - the starting index in the second array
      len - the number of elements to compare
      Returns:
      a negative integer, zero, or a positive integer as the first array is less than, equal to, or greater than the second array
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the specified ranges are out of bounds
    • compareUnsigned

      public static int compareUnsigned(int[] a, int[] b)
      Compares two arrays lexicographically, treating the values as unsigned.
      Parameters:
      a - the first array to compare
      b - the second array to compare
      Returns:
      a negative integer, zero, or a positive integer as the first array is less than, equal to, or greater than the second
      See Also:
    • compareUnsigned

      public static int compareUnsigned(int[] a, int fromIndexA, int[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Compares two subarrays lexicographically, treating the values as unsigned.
      Parameters:
      a - the first array to compare
      fromIndexA - the starting index (inclusive) of the first subarray
      b - the second array to compare
      fromIndexB - the starting index (inclusive) of the second subarray
      len - the length of the subarrays to compare
      Returns:
      a negative integer, zero, or a positive integer as the first subarray is less than, equal to, or greater than the second subarray
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the specified indices are out of bounds
      See Also:
    • compare

      public static int compare(long[] a, long[] b)
      Compares two arrays lexicographically.
      Parameters:
      a - the first array to compare
      b - the second array to compare
      Returns:
      a negative integer, zero, or a positive integer as the first array is less than, equal to, or greater than the second
    • compare

      public static int compare(long[] a, int fromIndexA, long[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Compares two arrays lexicographically over the specified range.
      Parameters:
      a - the first array to compare
      fromIndexA - the starting index in the first array
      b - the second array to compare
      fromIndexB - the starting index in the second array
      len - the number of elements to compare
      Returns:
      a negative integer, zero, or a positive integer as the first array is less than, equal to, or greater than the second array
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the specified ranges are out of bounds
    • compareUnsigned

      public static int compareUnsigned(long[] a, long[] b)
      Compares two arrays lexicographically, treating the values as unsigned.
      Parameters:
      a - the first array to compare
      b - the second array to compare
      Returns:
      a negative integer, zero, or a positive integer as the first array is less than, equal to, or greater than the second
      See Also:
    • compareUnsigned

      public static int compareUnsigned(long[] a, int fromIndexA, long[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Compares two subarrays lexicographically, treating the values as unsigned.
      Parameters:
      a - the first array to compare
      fromIndexA - the starting index (inclusive) of the first subarray
      b - the second array to compare
      fromIndexB - the starting index (inclusive) of the second subarray
      len - the length of the subarrays to compare
      Returns:
      a negative integer, zero, or a positive integer as the first subarray is less than, equal to, or greater than the second subarray
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the specified indices are out of bounds
      See Also:
    • compare

      public static int compare(float[] a, float[] b)
      Compares two arrays lexicographically.
      Parameters:
      a - the first array to compare
      b - the second array to compare
      Returns:
      a negative integer, zero, or a positive integer as the first array is less than, equal to, or greater than the second
    • compare

      public static int compare(float[] a, int fromIndexA, float[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Compares two arrays lexicographically over the specified range.
      Parameters:
      a - the first array to compare
      fromIndexA - the starting index in the first array
      b - the second array to compare
      fromIndexB - the starting index in the second array
      len - the number of elements to compare
      Returns:
      a negative integer, zero, or a positive integer as the first array is less than, equal to, or greater than the second array
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the specified ranges are out of bounds
    • compare

      public static int compare(double[] a, double[] b)
      Compares two arrays lexicographically.
      Parameters:
      a - the first array to compare
      b - the second array to compare
      Returns:
      a negative integer, zero, or a positive integer as the first array is less than, equal to, or greater than the second
    • compare

      public static int compare(double[] a, int fromIndexA, double[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Compares two arrays lexicographically over the specified range.
      Parameters:
      a - the first array to compare
      fromIndexA - the starting index in the first array
      b - the second array to compare
      fromIndexB - the starting index in the second array
      len - the number of elements to compare
      Returns:
      a negative integer, zero, or a positive integer as the first array is less than, equal to, or greater than the second array
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the specified ranges are out of bounds
    • compare

      public static <T extends Comparable<? super T>> int compare(T[] a, T[] b)
      Compares two arrays lexicographically.
      Parameters:
      a - the first array to compare
      b - the second array to compare
      Returns:
      a negative integer, zero, or a positive integer as the first array is less than, equal to, or greater than the second
    • compare

      public static <T extends Comparable<? super T>> int compare(T[] a, int fromIndexA, T[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Compares two arrays lexicographically over the specified range.
      Parameters:
      a - the first array to compare
      fromIndexA - the starting index in the first array
      b - the second array to compare
      fromIndexB - the starting index in the second array
      len - the number of elements to compare
      Returns:
      a negative integer, zero, or a positive integer as the first array is less than, equal to, or greater than the second array
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the specified ranges are out of bounds
    • compare

      public static <T> int compare(T[] a, T[] b, Comparator<? super T> cmp)
      Compares two arrays using the specified comparator.
      Type Parameters:
      T - the type of elements in the arrays
      Parameters:
      a - the first array to compare
      b - the second array to compare
      cmp - the comparator to compare array elements
      Returns:
      a negative integer, zero, or a positive integer as the first array is less than, equal to, or greater than the second array
    • compare

      public static <T> int compare(T[] a, int fromIndexA, T[] b, int fromIndexB, int len, Comparator<? super T> cmp) throws IllegalArgumentException, IndexOutOfBoundsException
      Compares two arrays lexicographically over the specified range using the specified comparator.
      Parameters:
      a - the first array to compare
      fromIndexA - the starting index in the first array
      b - the second array to compare
      fromIndexB - the starting index in the second array
      len - the number of elements to compare
      cmp - the comparator to compare array elements
      Returns:
      a negative integer, zero, or a positive integer as the first array is less than, equal to, or greater than the second array
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the specified ranges are out of bounds
    • compare

      public static <T> int compare(Collection<T> a, int fromIndexA, Collection<T> b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Compares two collections lexicographically over the specified range.
      Parameters:
      a - the first collection to compare
      fromIndexA - the starting index in the first collection
      b - the second collection to compare
      fromIndexB - the starting index in the second collection
      len - the number of elements to compare
      Returns:
      a negative integer, zero, or a positive integer as the first collection is less than, equal to, or greater than the second collection
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the specified ranges are out of bounds
    • compare

      public static <T extends Comparable<? super T>> int compare(Iterable<T> a, Iterable<T> b)
      Compares two iterables lexicographically.
      Type Parameters:
      T - the type of elements in the iterables, which must be comparable
      Parameters:
      a - the first iterable to compare
      b - the second iterable to compare
      Returns:
      a negative integer, zero, or a positive integer as the first iterable is less than, equal to, or greater than the second iterable
    • compare

      public static <T extends Comparable<? super T>> int compare(Iterator<T> a, Iterator<T> b)
      Compares two iterators lexicographically.
      Type Parameters:
      T - the type of elements in the iterators, which must be comparable
      Parameters:
      a - the first iterator to compare
      b - the second iterator to compare
      Returns:
      a negative integer, zero, or a positive integer as the first iterator is less than, equal to, or greater than the second iterator
    • compare

      public static <T> int compare(Collection<T> a, int fromIndexA, Collection<T> b, int fromIndexB, int len, Comparator<? super T> cmp) throws IllegalArgumentException, IndexOutOfBoundsException
      Compares two collections lexicographically over the specified range using the specified comparator.
      Type Parameters:
      T - the type of elements in the collections
      Parameters:
      a - the first collection to compare
      fromIndexA - the starting index in the first collection
      b - the second collection to compare
      fromIndexB - the starting index in the second collection
      len - the number of elements to compare
      cmp - the comparator to compare collection elements
      Returns:
      a negative integer, zero, or a positive integer as the first collection is less than, equal to, or greater than the second collection
      Throws:
      IllegalArgumentException - if the specified length is negative
      IndexOutOfBoundsException - if the specified indices are out of range
    • compare

      public static <T> int compare(Iterable<T> a, Iterable<T> b, Comparator<? super T> cmp)
      Compares two iterables using the specified comparator.
      Type Parameters:
      T - the type of elements in the iterables
      Parameters:
      a - the first iterable to compare
      b - the second iterable to compare
      cmp - the comparator to compare elements from iterables
      Returns:
      a negative integer, zero, or a positive integer as the first iterable is less than, equal to, or greater than the second iterable
    • compare

      public static <T> int compare(Iterator<T> a, Iterator<T> b, Comparator<? super T> cmp)
      Compares two iterators using the specified comparator.
      Type Parameters:
      T - the type of elements in the iterators
      Parameters:
      a - the first iterator to compare
      b - the second iterator to compare
      cmp - the comparator to compare elements from iterators
      Returns:
      a negative integer, zero, or a positive integer as the first iterator is less than, equal to, or greater than the second iterator
    • compareIgnoreCase

      public static int compareIgnoreCase(String a, String b)
      Compares two strings lexicographically, ignoring case differences.
      Parameters:
      a - the first string to compare
      b - the second string to compare
      Returns:
      a negative integer, zero, or a positive integer as the first string is less than, equal to, or greater than the second string, ignoring case considerations
    • compareIgnoreCase

      public static int compareIgnoreCase(String[] a, String[] b)
      Compares two arrays of strings lexicographically, ignoring case differences.
      Parameters:
      a - the first array of strings to compare
      b - the second array of strings to compare
      Returns:
      a negative integer, zero, or a positive integer as the first array is less than, equal to, or greater than the second array, ignoring case considerations
    • compareByProps

      @Deprecated public static int compareByProps(@NotNull Object bean1, @NotNull Object bean2, Collection<String> propNamesToCompare)
      Deprecated.
      call getPropValue by reflection apis during comparing or sorting may have huge impact to performance. Use Builder.ComparisonBuilder instead.
      Parameters:
      bean1 -
      bean2 -
      propNamesToCompare -
      Returns:
      Throws:
      IllegalArgumentException
      See Also:
    • mismatch

      public static int mismatch(boolean[] a, boolean[] b)
      Finds and returns the index of the first mismatch between two arrays. If the arrays are identical or both are null or empty, returns -1.
      Parameters:
      a - the first boolean array
      b - the second boolean array
      Returns:
      the index of the first mismatch, or -1 if the arrays are identical or both are null or empty.
      See Also:
    • mismatch

      public static int mismatch(boolean[] a, int fromIndexA, boolean[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Finds and returns the index of the first mismatch between two boolean arrays starting from specified indices. If the arrays are identical in the specified range, returns -1.
      Parameters:
      a - the first boolean array
      fromIndexA - the starting index in the first array
      b - the second boolean array
      fromIndexB - the starting index in the second array
      len - the number of elements to compare
      Returns:
      the index of the first mismatch, or -1 if the arrays are identical in the specified range
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the starting indices or length are out of bounds
      See Also:
    • mismatch

      public static int mismatch(char[] a, char[] b)
      Finds and returns the index of the first mismatch between two arrays. If the arrays are identical or both are null or empty, returns -1.
      Parameters:
      a - the first char array
      b - the second char array
      Returns:
      the index of the first mismatch, or -1 if the arrays are identical or both are null or empty.
      See Also:
    • mismatch

      public static int mismatch(char[] a, int fromIndexA, char[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Finds and returns the index of the first mismatch between two char arrays starting from specified indices. If the arrays are identical in the specified range, returns -1.
      Parameters:
      a - the first char array
      fromIndexA - the starting index in the first array
      b - the second char array
      fromIndexB - the starting index in the second array
      len - the number of elements to compare
      Returns:
      the index of the first mismatch, or -1 if the arrays are identical in the specified range
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the starting indices or length are out of bounds
      See Also:
    • mismatch

      public static int mismatch(byte[] a, byte[] b)
      Finds and returns the index of the first mismatch between two arrays. If the arrays are identical or both are null or empty, returns -1.
      Parameters:
      a - the first byte array
      b - the second byte array
      Returns:
      the index of the first mismatch, or -1 if the arrays are identical or both are null or empty.
      See Also:
    • mismatch

      public static int mismatch(byte[] a, int fromIndexA, byte[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Finds and returns the index of the first mismatch between two byte arrays starting from specified indices. If the arrays are identical in the specified range, returns -1.
      Parameters:
      a - the first byte array
      fromIndexA - the starting index in the first array
      b - the second byte array
      fromIndexB - the starting index in the second array
      len - the number of elements to compare
      Returns:
      the index of the first mismatch, or -1 if the arrays are identical in the specified range
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the starting indices or length are out of bounds
      See Also:
    • mismatch

      public static int mismatch(short[] a, short[] b)
      Finds and returns the index of the first mismatch between two arrays. If the arrays are identical or both are null or empty, returns -1.
      Parameters:
      a - the first short array
      b - the second short array
      Returns:
      the index of the first mismatch, or -1 if the arrays are identical or both are null or empty.
      See Also:
    • mismatch

      public static int mismatch(short[] a, int fromIndexA, short[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Finds and returns the index of the first mismatch between two short arrays starting from specified indices. If the arrays are identical in the specified range, returns -1.
      Parameters:
      a - the first short array
      fromIndexA - the starting index in the first array
      b - the second short array
      fromIndexB - the starting index in the second array
      len - the number of elements to compare
      Returns:
      the index of the first mismatch, or -1 if the arrays are identical in the specified range
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the starting indices or length are out of bounds
      See Also:
    • mismatch

      public static int mismatch(int[] a, int[] b)
      Finds and returns the index of the first mismatch between two arrays. If the arrays are identical or both are null or empty, returns -1.
      Parameters:
      a - the first int array
      b - the second int array
      Returns:
      the index of the first mismatch, or -1 if the arrays are identical or both are null or empty.
      See Also:
    • mismatch

      public static int mismatch(int[] a, int fromIndexA, int[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Finds and returns the index of the first mismatch between two int arrays starting from specified indices. If the arrays are identical in the specified range, returns -1.
      Parameters:
      a - the first int array
      fromIndexA - the starting index in the first array
      b - the second int array
      fromIndexB - the starting index in the second array
      len - the number of elements to compare
      Returns:
      the index of the first mismatch, or -1 if the arrays are identical in the specified range
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the starting indices or length are out of bounds
      See Also:
    • mismatch

      public static int mismatch(long[] a, long[] b)
      Finds and returns the index of the first mismatch between two arrays. If the arrays are identical or both are null or empty, returns -1.
      Parameters:
      a - the first long array
      b - the second long array
      Returns:
      the index of the first mismatch, or -1 if the arrays are identical or both are null or empty.
      See Also:
    • mismatch

      public static int mismatch(long[] a, int fromIndexA, long[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Finds and returns the index of the first mismatch between two long arrays starting from specified indices. If the arrays are identical in the specified range, returns -1.
      Parameters:
      a - the first long array
      fromIndexA - the starting index in the first array
      b - the second long array
      fromIndexB - the starting index in the second array
      len - the number of elements to compare
      Returns:
      the index of the first mismatch, or -1 if the arrays are identical in the specified range
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the starting indices or length are out of bounds
      See Also:
    • mismatch

      public static int mismatch(float[] a, float[] b)
      Finds and returns the index of the first mismatch between two arrays. If the arrays are identical or both are null or empty, returns -1.
      Parameters:
      a - the first float array
      b - the second float array
      Returns:
      the index of the first mismatch, or -1 if the arrays are identical or both are null or empty.
      See Also:
    • mismatch

      public static int mismatch(float[] a, int fromIndexA, float[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Finds and returns the index of the first mismatch between two float arrays starting from specified indices. If the arrays are identical in the specified range, returns -1.
      Parameters:
      a - the first float array
      fromIndexA - the starting index in the first array
      b - the second float array
      fromIndexB - the starting index in the second array
      len - the number of elements to compare
      Returns:
      the index of the first mismatch, or -1 if the arrays are identical in the specified range
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the starting indices or length are out of bounds
      See Also:
    • mismatch

      public static int mismatch(double[] a, double[] b)
      Finds and returns the index of the first mismatch between two arrays. If the arrays are identical or both are null or empty, returns -1.
      Parameters:
      a - the first double array
      b - the second double array
      Returns:
      the index of the first mismatch, or -1 if the arrays are identical or both are null or empty.
      See Also:
    • mismatch

      public static int mismatch(double[] a, int fromIndexA, double[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Finds and returns the index of the first mismatch between two double arrays starting from specified indices. If the arrays are identical in the specified range, returns -1.
      Parameters:
      a - the first double array
      fromIndexA - the starting index in the first array
      b - the second double array
      fromIndexB - the starting index in the second array
      len - the number of elements to compare
      Returns:
      the index of the first mismatch, or -1 if the arrays are identical in the specified range
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the starting indices or length are out of bounds
      See Also:
    • mismatch

      public static <T extends Comparable<? super T>> int mismatch(T[] a, T[] b)
      Finds and returns the index of the first mismatch between two arrays. If the arrays are identical or both are null or empty, returns -1.
      Type Parameters:
      T - the type of elements in the arrays, which must be Comparable
      Parameters:
      a - the first array
      b - the second array
      Returns:
      the index of the first mismatch, or -1 if the arrays are identical or both are null or empty.
      See Also:
    • mismatch

      public static <T extends Comparable<? super T>> int mismatch(T[] a, int fromIndexA, T[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Finds and returns the index of the first mismatch between two arrays starting from specified indices. If the arrays are identical in the specified range, returns -1.
      Parameters:
      a - the first array
      fromIndexA - the starting index in the first array
      b - the second array
      fromIndexB - the starting index in the second array
      len - the number of elements to compare
      Returns:
      the index of the first mismatch, or -1 if the arrays are identical in the specified range
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the starting indices or length are out of bounds
      See Also:
    • mismatch

      public static <T> int mismatch(T[] a, T[] b, Comparator<? super T> cmp)
      Finds and returns the index of the first mismatch between two arrays. If the arrays are identical or both are null or empty, returns -1.
      Type Parameters:
      T - the type of elements in the arrays, which must be Comparable
      Parameters:
      a - the first array
      b - the second array
      cmp - the comparator to compare array elements
      Returns:
      the index of the first mismatch, or -1 if the arrays are identical or both are null or empty.
      See Also:
    • mismatch

      public static <T> int mismatch(T[] a, int fromIndexA, T[] b, int fromIndexB, int len, Comparator<? super T> cmp) throws IllegalArgumentException, IndexOutOfBoundsException
      Finds and returns the index of the first mismatch between two arrays starting from specified indices. If the arrays are identical in the specified range, returns -1.
      Parameters:
      a - the first array
      fromIndexA - the starting index in the first array
      b - the second array
      fromIndexB - the starting index in the second array
      len - the number of elements to compare
      cmp - the comparator to compare array elements
      Returns:
      the index of the first mismatch, or -1 if the arrays are identical in the specified range
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the starting indices or length are out of bounds
      See Also:
    • mismatch

      public static <T> int mismatch(Collection<T> a, int fromIndexA, Collection<T> b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Finds and returns the index of the first mismatch between two collections starting from specified indices. If the collections are identical in the specified range, returns -1.
      Type Parameters:
      T - the type of elements in the collections
      Parameters:
      a - the first collection
      fromIndexA - the starting index in the first collection
      b - the second collection
      fromIndexB - the starting index in the second collection
      len - the number of elements to compare
      Returns:
      the index of the first mismatch, or -1 if the collections are identical in the specified range
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the starting indices or length are out of bounds
      See Also:
    • mismatch

      public static <T extends Comparable<? super T>> int mismatch(Iterable<T> a, Iterable<T> b)
      Finds and returns the index of the first mismatch between two iterables. If the iterables are identical or both are null or empty, returns -1.
      Type Parameters:
      T - the type of elements in the iterables
      Parameters:
      a - the first iterable
      b - the second iterable
      Returns:
      the index of the first mismatch, or -1 if the iterables are identical or both are null or empty
      See Also:
    • mismatch

      public static <T extends Comparable<? super T>> int mismatch(Iterator<T> a, Iterator<T> b)
      Finds and returns the index of the first mismatch between two iterators. If the iterators are identical or both are null or empty, returns -1.
      Type Parameters:
      T - the type of elements in the iterators
      Parameters:
      a - the first iterator
      b - the second iterator
      Returns:
      the index of the first mismatch, or -1 if the iterators are identical or both are null or empty
      See Also:
    • mismatch

      public static <T> int mismatch(Collection<T> a, int fromIndexA, Collection<T> b, int fromIndexB, int len, Comparator<? super T> cmp) throws IllegalArgumentException, IndexOutOfBoundsException
      Finds and returns the index of the first mismatch between two collections starting from specified indices. If the collections are identical in the specified range, returns -1.
      Type Parameters:
      T - the type of elements in the collections
      Parameters:
      a - the first collection
      fromIndexA - the starting index in the first collection
      b - the second collection
      fromIndexB - the starting index in the second collection
      len - the number of elements to compare
      cmp - the comparator to compare elements
      Returns:
      the index of the first mismatch, or -1 if the collections are identical in the specified range
      Throws:
      IllegalArgumentException - if the length is negative
      IndexOutOfBoundsException - if the starting indices or length are out of bounds
      See Also:
    • mismatch

      public static <T> int mismatch(Iterable<T> a, Iterable<T> b, Comparator<? super T> cmp)
      Finds and returns the index of the first mismatch between two iterables using the specified comparator. If the iterables are identical or both are null or empty, returns -1.
      Type Parameters:
      T - the type of elements in the iterables
      Parameters:
      a - the first iterable
      b - the second iterable
      cmp - the comparator to compare elements
      Returns:
      the index of the first mismatch, or -1 if the iterables are identical or both are null or empty
      See Also:
    • mismatch

      public static <T> int mismatch(Iterator<T> a, Iterator<T> b, Comparator<? super T> cmp)
      Finds and returns the index of the first mismatch between two iterators using the specified comparator. If the iterators are identical or both are null or empty, returns -1.
      Type Parameters:
      T - the type of elements in the iterators
      Parameters:
      a - the first iterator
      b - the second iterator
      cmp - the comparator to compare elements
      Returns:
      the index of the first mismatch, or -1 if the iterators are identical or both are null or empty
      See Also:
    • lessThan

      public static <T extends Comparable<? super T>> boolean lessThan(T a, T b)
      Returns true is a < b, otherwise false is returned.
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      Returns:
    • lessThan

      public static <T> boolean lessThan(T a, T b, Comparator<? super T> cmp)
      Returns true is a < b, otherwise false is returned.
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      cmp -
      Returns:
    • lessEqual

      public static <T extends Comparable<? super T>> boolean lessEqual(T a, T b)
      Returns true is a <= b, otherwise false is returned.
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      Returns:
    • lessEqual

      public static <T> boolean lessEqual(T a, T b, Comparator<? super T> cmp)
      Returns true is a <= b, otherwise false is returned.
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      cmp -
      Returns:
    • greaterThan

      public static <T extends Comparable<? super T>> boolean greaterThan(T a, T b)
      Returns true is a > b, otherwise false is returned.
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      Returns:
    • greaterThan

      public static <T> boolean greaterThan(T a, T b, Comparator<? super T> cmp)
      Returns true is a > b, otherwise false is returned.
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      cmp -
      Returns:
    • greaterEqual

      public static <T extends Comparable<? super T>> boolean greaterEqual(T a, T b)
      Returns true is a >= b, otherwise false is returned.
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      Returns:
    • greaterEqual

      public static <T> boolean greaterEqual(T a, T b, Comparator<? super T> cmp)
      Returns true is a >= b, otherwise false is returned.
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      cmp -
      Returns:
    • gtAndLt

      public static <T extends Comparable<? super T>> boolean gtAndLt(T value, T min, T max)
      Returns true is min < value < max, otherwise false is returned.
      Type Parameters:
      T -
      Parameters:
      value -
      min -
      max -
      Returns:
    • gtAndLt

      public static <T> boolean gtAndLt(T value, T min, T max, Comparator<? super T> cmp)
      Returns true is min < value < max, otherwise false is returned.
      Type Parameters:
      T -
      Parameters:
      value -
      min -
      max -
      cmp -
      Returns:
    • geAndLt

      public static <T extends Comparable<? super T>> boolean geAndLt(T value, T min, T max)
      Returns true is min <= value < max, otherwise false is returned.
      Type Parameters:
      T -
      Parameters:
      value -
      min -
      max -
      Returns:
    • geAndLt

      public static <T> boolean geAndLt(T value, T min, T max, Comparator<? super T> cmp)
      Returns true is min <= value < max, otherwise false is returned.
      Type Parameters:
      T -
      Parameters:
      value -
      min -
      max -
      cmp -
      Returns:
    • geAndLe

      public static <T extends Comparable<? super T>> boolean geAndLe(T value, T min, T max)
      Returns true is min <= value <= max, otherwise false is returned.
      Type Parameters:
      T -
      Parameters:
      value -
      min -
      max -
      Returns:
    • geAndLe

      public static <T> boolean geAndLe(T value, T min, T max, Comparator<? super T> cmp)
      Returns true is min <= value <= max, otherwise false is returned.
      Type Parameters:
      T -
      Parameters:
      value -
      min -
      max -
      cmp -
      Returns:
    • gtAndLe

      public static <T extends Comparable<? super T>> boolean gtAndLe(T value, T min, T max)
      Returns true is min < value <= max, otherwise false is returned.
      Type Parameters:
      T -
      Parameters:
      value -
      min -
      max -
      Returns:
    • gtAndLe

      public static <T> boolean gtAndLe(T value, T min, T max, Comparator<? super T> cmp)
      Returns true is min < value <= max, otherwise false is returned.
      Type Parameters:
      T -
      Parameters:
      value -
      min -
      max -
      cmp -
      Returns:
    • isBetween

      @Deprecated public static <T extends Comparable<? super T>> boolean isBetween(T value, T min, T max)
      Type Parameters:
      T -
      Parameters:
      value -
      min -
      max -
      Returns:
    • isBetween

      @Deprecated public static <T> boolean isBetween(T value, T min, T max, Comparator<? super T> cmp)
      Type Parameters:
      T -
      Parameters:
      value -
      min -
      max -
      cmp -
      Returns:
    • equals

      public static boolean equals(boolean a, boolean b)
      Parameters:
      a -
      b -
      Returns:
      boolean
    • equals

      public static boolean equals(char a, char b)
      Parameters:
      a -
      b -
      Returns:
      boolean
    • equals

      public static boolean equals(byte a, byte b)
      Parameters:
      a -
      b -
      Returns:
      boolean
    • equals

      public static boolean equals(short a, short b)
      Parameters:
      a -
      b -
      Returns:
      boolean
    • equals

      public static boolean equals(int a, int b)
      Parameters:
      a -
      b -
      Returns:
      boolean
    • equals

      public static boolean equals(long a, long b)
      Parameters:
      a -
      b -
      Returns:
      boolean
    • equals

      public static boolean equals(float a, float b)
      Parameters:
      a -
      b -
      Returns:
      boolean
    • equals

      public static boolean equals(double a, double b)
      Parameters:
      a -
      b -
      Returns:
      boolean
    • equals

      public static boolean equals(String a, String b)
      Parameters:
      a -
      b -
      Returns:
    • equalsIgnoreCase

      public static boolean equalsIgnoreCase(String a, String b)
      Equals ignore case.
      Parameters:
      a -
      b -
      Returns:
    • equals

      public static boolean equals(Object a, Object b)
      compare a and b by Arrays.equals(Object[], Object[]) if both of them are array.
      Parameters:
      a -
      b -
      Returns:
      boolean
    • equals

      public static boolean equals(boolean[] a, boolean[] b)
      Parameters:
      a -
      b -
      Returns:
      boolean
      See Also:
    • equals

      public static boolean equals(boolean[] a, int fromIndexA, boolean[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Parameters:
      a -
      fromIndexA -
      b -
      fromIndexB -
      len -
      Returns:
      Throws:
      IllegalArgumentException
      IndexOutOfBoundsException
    • equals

      public static boolean equals(char[] a, char[] b)
      Parameters:
      a -
      b -
      Returns:
      boolean
      See Also:
    • equals

      public static boolean equals(char[] a, int fromIndexA, char[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Parameters:
      a -
      fromIndexA -
      b -
      fromIndexB -
      len -
      Returns:
      Throws:
      IllegalArgumentException
      IndexOutOfBoundsException
    • equals

      public static boolean equals(byte[] a, byte[] b)
      Parameters:
      a -
      b -
      Returns:
      boolean
      See Also:
    • equals

      public static boolean equals(byte[] a, int fromIndexA, byte[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Parameters:
      a -
      fromIndexA -
      b -
      fromIndexB -
      len -
      Returns:
      Throws:
      IllegalArgumentException
      IndexOutOfBoundsException
    • equals

      public static boolean equals(short[] a, short[] b)
      Parameters:
      a -
      b -
      Returns:
      boolean
      See Also:
    • equals

      public static boolean equals(short[] a, int fromIndexA, short[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Parameters:
      a -
      fromIndexA -
      b -
      fromIndexB -
      len -
      Returns:
      Throws:
      IllegalArgumentException
      IndexOutOfBoundsException
    • equals

      public static boolean equals(int[] a, int[] b)
      Parameters:
      a -
      b -
      Returns:
      boolean
      See Also:
    • equals

      public static boolean equals(int[] a, int fromIndexA, int[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Parameters:
      a -
      fromIndexA -
      b -
      fromIndexB -
      len -
      Returns:
      Throws:
      IllegalArgumentException
      IndexOutOfBoundsException
    • equals

      public static boolean equals(long[] a, long[] b)
      Parameters:
      a -
      b -
      Returns:
      boolean
      See Also:
    • equals

      public static boolean equals(long[] a, int fromIndexA, long[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Parameters:
      a -
      fromIndexA -
      b -
      fromIndexB -
      len -
      Returns:
      Throws:
      IllegalArgumentException
      IndexOutOfBoundsException
    • equals

      public static boolean equals(float[] a, float[] b)
      Parameters:
      a -
      b -
      Returns:
      boolean
      See Also:
    • equals

      public static boolean equals(float[] a, int fromIndexA, float[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Parameters:
      a -
      fromIndexA -
      b -
      fromIndexB -
      len -
      Returns:
      Throws:
      IllegalArgumentException
      IndexOutOfBoundsException
    • equals

      public static boolean equals(double[] a, double[] b)
      Parameters:
      a -
      b -
      Returns:
      boolean
      See Also:
    • equals

      public static boolean equals(double[] a, int fromIndexA, double[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Parameters:
      a -
      fromIndexA -
      b -
      fromIndexB -
      len -
      Returns:
      Throws:
      IllegalArgumentException
      IndexOutOfBoundsException
    • equals

      public static boolean equals(Object[] a, Object[] b)
      Parameters:
      a -
      b -
      Returns:
      boolean
      See Also:
    • equals

      public static boolean equals(Object[] a, int fromIndexA, Object[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Parameters:
      a -
      fromIndexA -
      b -
      fromIndexB -
      len -
      Returns:
      Throws:
      IllegalArgumentException
      IndexOutOfBoundsException
    • deepEquals

      public static boolean deepEquals(Object a, Object b)
      compare a and b by Arrays.equals(Object[], Object[]) if both of them are array.
      Parameters:
      a -
      b -
      Returns:
      boolean
    • deepEquals

      public static boolean deepEquals(Object[] a, Object[] b)
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • deepEquals

      public static boolean deepEquals(Object[] a, int fromIndexA, Object[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Parameters:
      a -
      fromIndexA -
      b -
      fromIndexB -
      len -
      Returns:
      Throws:
      IllegalArgumentException
      IndexOutOfBoundsException
    • equalsIgnoreCase

      public static boolean equalsIgnoreCase(String[] a, String[] b)
      Equals ignore case.
      Parameters:
      a -
      b -
      Returns:
    • equalsIgnoreCase

      public static boolean equalsIgnoreCase(String[] a, int fromIndexA, String[] b, int fromIndexB, int len) throws IllegalArgumentException, IndexOutOfBoundsException
      Equals ignore case.
      Parameters:
      a -
      fromIndexA -
      b -
      fromIndexB -
      len -
      Returns:
      Throws:
      IllegalArgumentException
      IndexOutOfBoundsException
    • equalsByProps

      public static boolean equalsByProps(Object bean1, Object bean2, Collection<String> propNamesToCompare) throws IllegalArgumentException
      Parameters:
      bean1 -
      bean2 -
      propNamesToCompare -
      Returns:
      Throws:
      IllegalArgumentException
      See Also:
    • equalsByCommonProps

      public static boolean equalsByCommonProps(@NotNull Object bean1, @NotNull Object bean2) throws IllegalArgumentException
      Parameters:
      bean1 -
      bean2 -
      Returns:
      Throws:
      IllegalArgumentException
      See Also:
    • hashCode

      public static int hashCode(boolean value)
      Parameters:
      value -
      Returns:
      int
    • hashCode

      public static int hashCode(char value)
      Parameters:
      value -
      Returns:
      int
    • hashCode

      public static int hashCode(byte value)
      Parameters:
      value -
      Returns:
      int
    • hashCode

      public static int hashCode(short value)
      Parameters:
      value -
      Returns:
      int
    • hashCode

      public static int hashCode(int value)
      Parameters:
      value -
      Returns:
      int
    • hashCode

      public static int hashCode(long value)
      Parameters:
      value -
      Returns:
      int
    • hashCode

      public static int hashCode(float value)
      Parameters:
      value -
      Returns:
      int
    • hashCode

      public static int hashCode(double value)
      Parameters:
      value -
      Returns:
      int
    • hashCode

      public static int hashCode(Object obj)
      Parameters:
      obj -
      Returns:
      int
    • hashCode

      public static int hashCode(boolean[] a)
      Parameters:
      a -
      Returns:
      See Also:
    • hashCode

      public static int hashCode(boolean[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • hashCode

      public static int hashCode(char[] a)
      Parameters:
      a -
      Returns:
      See Also:
    • hashCode

      public static int hashCode(char[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • hashCode

      public static int hashCode(byte[] a)
      Parameters:
      a -
      Returns:
      See Also:
    • hashCode

      public static int hashCode(byte[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • hashCode

      public static int hashCode(short[] a)
      Parameters:
      a -
      Returns:
      See Also:
    • hashCode

      public static int hashCode(short[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • hashCode

      public static int hashCode(int[] a)
      Parameters:
      a -
      Returns:
      See Also:
    • hashCode

      public static int hashCode(int[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • hashCode

      public static int hashCode(long[] a)
      Parameters:
      a -
      Returns:
      See Also:
    • hashCode

      public static int hashCode(long[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • hashCode

      public static int hashCode(float[] a)
      Parameters:
      a -
      Returns:
      See Also:
    • hashCode

      public static int hashCode(float[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • hashCode

      public static int hashCode(double[] a)
      Parameters:
      a -
      Returns:
      See Also:
    • hashCode

      public static int hashCode(double[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • hashCode

      public static int hashCode(Object[] a)
      Parameters:
      a -
      Returns:
      See Also:
    • hashCode

      public static int hashCode(Object[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • deepHashCode

      public static int deepHashCode(Object obj)
      Parameters:
      obj -
      Returns:
      int
    • deepHashCode

      public static int deepHashCode(Object[] a)
      Deep hash code.
      Parameters:
      a -
      Returns:
      See Also:
    • deepHashCode

      public static int deepHashCode(Object[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Deep hash code.
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • toString

      public static String toString(boolean value)
      Parameters:
      value -
      Returns:
      int
    • toString

      public static String toString(char value)
      Parameters:
      value -
      Returns:
      int
    • toString

      public static String toString(byte value)
      Parameters:
      value -
      Returns:
      int
    • toString

      public static String toString(short value)
      Parameters:
      value -
      Returns:
      int
    • toString

      public static String toString(int value)
      Parameters:
      value -
      Returns:
      int
    • toString

      public static String toString(long value)
      Parameters:
      value -
      Returns:
      int
    • toString

      public static String toString(float value)
      Parameters:
      value -
      Returns:
      int
    • toString

      public static String toString(double value)
      Parameters:
      value -
      Returns:
      int
    • toString

      public static String toString(Object obj)
      Parameters:
      obj -
      Returns:
      int
    • toString

      public static String toString(Object a, String defaultIfNull)
      Parameters:
      a -
      defaultIfNull -
      Returns:
    • toString

      public static String toString(boolean[] a)
      Parameters:
      a -
      Returns:
      See Also:
    • toString

      public static String toString(boolean[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • toString

      public static String toString(char[] a)
      Parameters:
      a -
      Returns:
      See Also:
    • toString

      public static String toString(char[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • toString

      public static String toString(byte[] a)
      Parameters:
      a -
      Returns:
      See Also:
    • toString

      public static String toString(byte[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • toString

      public static String toString(short[] a)
      Parameters:
      a -
      Returns:
      See Also:
    • toString

      public static String toString(short[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • toString

      public static String toString(int[] a)
      Parameters:
      a -
      Returns:
      See Also:
    • toString

      public static String toString(int[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • toString

      public static String toString(long[] a)
      Parameters:
      a -
      Returns:
      See Also:
    • toString

      public static String toString(long[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • toString

      public static String toString(float[] a)
      Parameters:
      a -
      Returns:
      See Also:
    • toString

      public static String toString(float[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • toString

      public static String toString(double[] a)
      Parameters:
      a -
      Returns:
      See Also:
    • toString

      public static String toString(double[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • toString

      public static String toString(Object[] a)
      Parameters:
      a -
      Returns:
      See Also:
    • toString

      public static String toString(Object[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • deepToString

      public static String deepToString(Object obj)
      Parameters:
      obj -
      Returns:
      int
    • deepToString

      public static String deepToString(Object[] a)
      Deep to string.
      Parameters:
      a -
      Returns:
      See Also:
    • deepToString

      public static String deepToString(Object[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Deep to string.
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • deepToString

      public static String deepToString(Object[] a, String defaultIfNull)
      Deep to string.
      Parameters:
      a -
      defaultIfNull -
      Returns:
    • reverse

      public static void reverse(boolean[] a)

      Reverses the order of the given array.

      Parameters:
      a -
    • reverse

      public static void reverse(boolean[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException

      Reverses the order of the given array in the given range.

      Parameters:
      a -
      fromIndex -
      toIndex -
      Throws:
      IndexOutOfBoundsException
    • reverse

      public static void reverse(char[] a)

      Reverses the order of the given array.

      Parameters:
      a -
    • reverse

      public static void reverse(char[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException

      Reverses the order of the given array in the given range.

      Parameters:
      a -
      fromIndex -
      toIndex -
      Throws:
      IndexOutOfBoundsException
    • reverse

      public static void reverse(byte[] a)

      Reverses the order of the given array.

      Parameters:
      a -
    • reverse

      public static void reverse(byte[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException

      Reverses the order of the given array in the given range.

      Parameters:
      a -
      fromIndex -
      toIndex -
      Throws:
      IndexOutOfBoundsException
    • reverse

      public static void reverse(short[] a)

      Reverses the order of the given array.

      Parameters:
      a -
    • reverse

      public static void reverse(short[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException

      Reverses the order of the given array in the given range.

      Parameters:
      a -
      fromIndex -
      toIndex -
      Throws:
      IndexOutOfBoundsException
    • reverse

      public static void reverse(int[] a)

      Reverses the order of the given array.

      Parameters:
      a -
    • reverse

      public static void reverse(int[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException

      Reverses the order of the given array in the given range.

      Parameters:
      a -
      fromIndex -
      toIndex -
      Throws:
      IndexOutOfBoundsException
    • reverse

      public static void reverse(long[] a)

      Reverses the order of the given array.

      Parameters:
      a -
    • reverse

      public static void reverse(long[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException

      Reverses the order of the given array in the given range.

      Parameters:
      a -
      fromIndex -
      toIndex -
      Throws:
      IndexOutOfBoundsException
    • reverse

      public static void reverse(float[] a)

      Reverses the order of the given array.

      Parameters:
      a -
    • reverse

      public static void reverse(float[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException

      Reverses the order of the given array in the given range.

      Parameters:
      a -
      fromIndex -
      toIndex -
      Throws:
      IndexOutOfBoundsException
    • reverse

      public static void reverse(double[] a)

      Reverses the order of the given array.

      Parameters:
      a -
    • reverse

      public static void reverse(double[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException

      Reverses the order of the given array in the given range.

      Parameters:
      a -
      fromIndex -
      toIndex -
      Throws:
      IndexOutOfBoundsException
    • reverse

      public static void reverse(Object[] a)

      Reverses the order of the given array.

      There is no special handling for multi-dimensional arrays.

      Parameters:
      a -
    • reverse

      public static void reverse(Object[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException

      Reverses the order of the given array in the given range.

      Parameters:
      a -
      fromIndex -
      toIndex -
      Throws:
      IndexOutOfBoundsException
    • reverse

      public static void reverse(List<?> list)
      Parameters:
      list -
    • reverse

      public static void reverse(List<?> list, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      list -
      fromIndex -
      toIndex -
      Throws:
      IndexOutOfBoundsException
    • reverse

      public static void reverse(Collection<?> c)
      Parameters:
      c -
    • reverseToList

      public static <T> List<T> reverseToList(Collection<? extends T> c)
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
    • rotate

      public static void rotate(boolean[] a, int distance)
      Parameters:
      a -
      distance -
    • rotate

      public static void rotate(char[] a, int distance)
      Parameters:
      a -
      distance -
    • rotate

      public static void rotate(byte[] a, int distance)
      Parameters:
      a -
      distance -
    • rotate

      public static void rotate(short[] a, int distance)
      Parameters:
      a -
      distance -
    • rotate

      public static void rotate(int[] a, int distance)
      Parameters:
      a -
      distance -
    • rotate

      public static void rotate(long[] a, int distance)
      Parameters:
      a -
      distance -
    • rotate

      public static void rotate(float[] a, int distance)
      Parameters:
      a -
      distance -
    • rotate

      public static void rotate(double[] a, int distance)
      Parameters:
      a -
      distance -
    • rotate

      public static void rotate(Object[] a, int distance)
      Parameters:
      a -
      distance -
    • rotate

      public static void rotate(List<?> list, int distance)
      Parameters:
      list -
      distance -
      See Also:
    • rotate

      public static void rotate(Collection<?> c, int distance)
      Parameters:
      c -
      distance -
    • shuffle

      public static void shuffle(boolean[] a)
      Parameters:
      a -
    • shuffle

      public static void shuffle(boolean[] a, Random rnd)
      Parameters:
      a -
      rnd -
    • shuffle

      public static void shuffle(char[] a)
      Parameters:
      a -
    • shuffle

      public static void shuffle(char[] a, Random rnd)
      Parameters:
      a -
      rnd -
    • shuffle

      public static void shuffle(byte[] a)
      Parameters:
      a -
    • shuffle

      public static void shuffle(byte[] a, Random rnd)
      Parameters:
      a -
      rnd -
    • shuffle

      public static void shuffle(short[] a)
      Parameters:
      a -
    • shuffle

      public static void shuffle(short[] a, Random rnd)
      Parameters:
      a -
      rnd -
    • shuffle

      public static void shuffle(int[] a)
      Parameters:
      a -
    • shuffle

      public static void shuffle(int[] a, Random rnd)
      Parameters:
      a -
      rnd -
    • shuffle

      public static void shuffle(long[] a)
      Parameters:
      a -
    • shuffle

      public static void shuffle(long[] a, Random rnd)
      Parameters:
      a -
      rnd -
    • shuffle

      public static void shuffle(float[] a)
      Parameters:
      a -
    • shuffle

      public static void shuffle(float[] a, Random rnd)
      Parameters:
      a -
      rnd -
    • shuffle

      public static void shuffle(double[] a)
      Parameters:
      a -
    • shuffle

      public static void shuffle(double[] a, Random rnd)
      Parameters:
      a -
      rnd -
    • shuffle

      public static <T> void shuffle(T[] a)
      Type Parameters:
      T -
      Parameters:
      a -
    • shuffle

      public static <T> void shuffle(T[] a, Random rnd)
      Type Parameters:
      T -
      Parameters:
      a -
      rnd -
    • shuffle

      public static void shuffle(List<?> list)
      Parameters:
      list -
    • shuffle

      public static void shuffle(List<?> list, Random rnd)
      Parameters:
      list -
      rnd -
      See Also:
    • shuffle

      public static void shuffle(Collection<?> c)
      Parameters:
      c -
    • shuffle

      public static void shuffle(Collection<?> c, Random rnd)
      Parameters:
      c -
      rnd -
    • swap

      public static void swap(boolean[] a, int i, int j)
      Parameters:
      a -
      i -
      j -
    • swap

      public static void swap(char[] a, int i, int j)
      Parameters:
      a -
      i -
      j -
    • swap

      public static void swap(byte[] a, int i, int j)
      Parameters:
      a -
      i -
      j -
    • swap

      public static void swap(short[] a, int i, int j)
      Parameters:
      a -
      i -
      j -
    • swap

      public static void swap(int[] a, int i, int j)
      Parameters:
      a -
      i -
      j -
    • swap

      public static void swap(long[] a, int i, int j)
      Parameters:
      a -
      i -
      j -
    • swap

      public static void swap(float[] a, int i, int j)
      Parameters:
      a -
      i -
      j -
    • swap

      public static void swap(double[] a, int i, int j)
      Parameters:
      a -
      i -
      j -
    • swap

      public static void swap(Object[] a, int i, int j)
      Parameters:
      a -
      i -
      j -
    • swap

      public static void swap(List<?> list, int i, int j)
      Parameters:
      list -
      i -
      j -
    • swap

      public static <T> void swap(Pair<T,T> pair)
      Type Parameters:
      T -
      Parameters:
      pair -
    • swapIf

      public static <T> boolean swapIf(Pair<T,T> pair, Predicate<? super Pair<T,T>> predicate)
      Type Parameters:
      T -
      Parameters:
      pair -
      predicate -
      Returns:
    • swap

      public static <T, M> void swap(Triple<T,M,T> triple)
      Type Parameters:
      T -
      M -
      Parameters:
      triple -
    • swapIf

      public static <T, M> boolean swapIf(Triple<T,M,T> triple, Predicate<? super Triple<T,M,T>> predicate)
      Type Parameters:
      T -
      M -
      Parameters:
      triple -
      predicate -
      Returns:
    • fill

      public static void fill(boolean[] a, boolean val)
      Parameters:
      a -
      val -
    • fill

      public static void fill(boolean[] a, int fromIndex, int toIndex, boolean val)
      Parameters:
      a -
      fromIndex -
      toIndex -
      val -
    • fill

      public static void fill(char[] a, char val)
      Parameters:
      a -
      val -
    • fill

      public static void fill(char[] a, int fromIndex, int toIndex, char val)
      Parameters:
      a -
      fromIndex -
      toIndex -
      val -
    • fill

      public static void fill(byte[] a, byte val)
      Parameters:
      a -
      val -
    • fill

      public static void fill(byte[] a, int fromIndex, int toIndex, byte val)
      Parameters:
      a -
      fromIndex -
      toIndex -
      val -
    • fill

      public static void fill(short[] a, short val)
      Parameters:
      a -
      val -
    • fill

      public static void fill(short[] a, int fromIndex, int toIndex, short val)
      Parameters:
      a -
      fromIndex -
      toIndex -
      val -
    • fill

      public static void fill(int[] a, int val)
      Parameters:
      a -
      val -
    • fill

      public static void fill(int[] a, int fromIndex, int toIndex, int val)
      Parameters:
      a -
      fromIndex -
      toIndex -
      val -
    • fill

      public static void fill(long[] a, long val)
      Parameters:
      a -
      val -
    • fill

      public static void fill(long[] a, int fromIndex, int toIndex, long val)
      Parameters:
      a -
      fromIndex -
      toIndex -
      val -
    • fill

      public static void fill(float[] a, float val)
      Parameters:
      a -
      val -
    • fill

      public static void fill(float[] a, int fromIndex, int toIndex, float val)
      Parameters:
      a -
      fromIndex -
      toIndex -
      val -
    • fill

      public static void fill(double[] a, double val)
      Parameters:
      a -
      val -
    • fill

      public static void fill(double[] a, int fromIndex, int toIndex, double val)
      Parameters:
      a -
      fromIndex -
      toIndex -
      val -
    • fill

      public static void fill(Object[] a, Object val)
      Parameters:
      a -
      val -
    • fill

      public static void fill(Object[] a, int fromIndex, int toIndex, Object val)
      Parameters:
      a -
      fromIndex -
      toIndex -
      val -
    • fill

      public static <T> void fill(List<? super T> list, T val)
      Type Parameters:
      T -
      Parameters:
      list -
      val -
      See Also:
    • fill

      public static <T> void fill(List<? super T> list, int fromIndex, int toIndex, T val) throws IndexOutOfBoundsException
      The specified value will be added/inserted into the specified List. The List will be extended automatically if the size of the List is less than the specified toIndex.
      Type Parameters:
      T -
      Parameters:
      list -
      fromIndex -
      toIndex -
      val -
      Throws:
      IndexOutOfBoundsException
      See Also:
    • fill

      public static void fill(Object bean)
      Fill the properties of the bean with random values.
      Parameters:
      bean - a bean object with getter/setter method
    • fill

      public static <T> T fill(Class<? extends T> beanClass)
      Fill the properties of the bean with random values.
      Type Parameters:
      T -
      Parameters:
      beanClass - bean class with getter/setter methods
      Returns:
    • fill

      public static <T> List<T> fill(Class<? extends T> beanClass, int count)
      Fill the properties of the bean with random values.
      Type Parameters:
      T -
      Parameters:
      beanClass - bean class with getter/setter methods
      count -
      Returns:
    • padLeft

      public static <T> boolean padLeft(List<T> list, int minSize, T objToAdd) throws IllegalArgumentException
      Appends the provided object to the beginning of the list till the list has at least the specified minimum size.
      Type Parameters:
      T - the type of the elements in the list
      Parameters:
      list - the list to be padded
      minSize - the minimum size the list should have after this operation
      objToAdd - the object to add to the list if it is smaller than the specified minimum size
      Returns:
      true if the list was modified as a result of this operation, false otherwise
      Throws:
      IllegalArgumentException - if the provided list is null
    • padRight

      public static <T> boolean padRight(Collection<T> c, int minSize, T objToAdd) throws IllegalArgumentException
      Appends the provided object to the end of the list till the list has at least the specified minimum size.
      Type Parameters:
      T -
      Parameters:
      c -
      minSize -
      objToAdd -
      Returns:
      Throws:
      IllegalArgumentException
      See Also:
    • repeat

      public static <T> List<T> repeat(T value, int n) throws IllegalArgumentException
      Type Parameters:
      T -
      Parameters:
      value -
      n -
      Returns:
      Throws:
      IllegalArgumentException
      See Also:
    • repeatElements

      public static <T> List<T> repeatElements(Collection<? extends T> c, int n) throws IllegalArgumentException
      Repeats the elements in the specified Collection one by one.
       
       repeatElements(N.asList(1, 2, 3), 2) => [1, 1, 2, 2, 3, 3]
       
       
      Type Parameters:
      T -
      Parameters:
      c -
      n -
      Returns:
      Throws:
      IllegalArgumentException
      See Also:
    • repeatCollection

      public static <T> List<T> repeatCollection(Collection<T> c, int n) throws IllegalArgumentException
      Repeats the entire specified Collection n times.
       
       repeatCollection(N.asList(1, 2, 3), 2) => [1, 2, 3, 1, 2, 3]
       
       
      Type Parameters:
      T -
      Parameters:
      c -
      n -
      Returns:
      Throws:
      IllegalArgumentException
      See Also:
    • repeatElementsToSize

      public static <T> List<T> repeatElementsToSize(Collection<T> c, int size) throws IllegalArgumentException
      Repeats the elements in the specified Collection one by one till reach the specified size.
       
       repeatElementsToSize(N.asList(1, 2, 3), 5) => [1, 1, 2, 2, 3]
       
       
      Type Parameters:
      T -
      Parameters:
      c -
      size -
      Returns:
      Throws:
      IllegalArgumentException
      See Also:
    • repeatCollectionToSize

      public static <T> List<T> repeatCollectionToSize(Collection<? extends T> c, int size) throws IllegalArgumentException
      Repeats the entire specified Collection till reach the specified size.
       
       repeatCollectionToSize(N.asList(1, 2, 3), 5) => [1, 2, 3, 1, 2]
       
       
      Type Parameters:
      T -
      Parameters:
      c -
      size -
      Returns:
      Throws:
      IllegalArgumentException
      See Also:
    • copy

      public static <T> void copy(List<? extends T> src, List<? super T> dest)
      Copies all of the elements from one list into another. After the operation, the index of each copied element in the destination list will be identical to its index in the source list. The destination list must be at least as long as the source list. If it is longer, the remaining elements in the destination list are unaffected.

      This method runs in linear time.

      Type Parameters:
      T -
      Parameters:
      src -
      dest -
      Throws:
      IndexOutOfBoundsException - if the destination list is too small to contain the entire source List.
      UnsupportedOperationException - if the destination list's list-iterator does not support the set operation.
      See Also:
    • copy

      public static <T> void copy(List<? extends T> src, int srcPos, List<? super T> dest, int destPos, int length) throws IndexOutOfBoundsException
      Copies a portion of one list into another. The portion to be copied begins at the index srcPos in the source list and spans length elements. The elements are copied into the destination list starting at position destPos. Both source and destination positions are zero-based.
      Type Parameters:
      T - the type of elements in the lists
      Parameters:
      src - the source list from which to copy elements
      srcPos - the starting position in the source list
      dest - the destination list into which to copy elements
      destPos - the starting position in the destination list
      length - the number of elements to be copied
      Throws:
      IndexOutOfBoundsException - if copying would cause access of data outside list bounds
    • copy

      public static void copy(boolean[] src, int srcPos, boolean[] dest, int destPos, int length) throws IndexOutOfBoundsException
      Parameters:
      src -
      srcPos -
      dest -
      destPos -
      length -
      Throws:
      IndexOutOfBoundsException
    • copy

      public static void copy(char[] src, int srcPos, char[] dest, int destPos, int length) throws IndexOutOfBoundsException
      Parameters:
      src -
      srcPos -
      dest -
      destPos -
      length -
      Throws:
      IndexOutOfBoundsException
    • copy

      public static void copy(byte[] src, int srcPos, byte[] dest, int destPos, int length) throws IndexOutOfBoundsException
      Parameters:
      src -
      srcPos -
      dest -
      destPos -
      length -
      Throws:
      IndexOutOfBoundsException
    • copy

      public static void copy(short[] src, int srcPos, short[] dest, int destPos, int length) throws IndexOutOfBoundsException
      Parameters:
      src -
      srcPos -
      dest -
      destPos -
      length -
      Throws:
      IndexOutOfBoundsException
    • copy

      public static void copy(int[] src, int srcPos, int[] dest, int destPos, int length) throws IndexOutOfBoundsException
      Parameters:
      src -
      srcPos -
      dest -
      destPos -
      length -
      Throws:
      IndexOutOfBoundsException
    • copy

      public static void copy(long[] src, int srcPos, long[] dest, int destPos, int length) throws IndexOutOfBoundsException
      Parameters:
      src -
      srcPos -
      dest -
      destPos -
      length -
      Throws:
      IndexOutOfBoundsException
    • copy

      public static void copy(float[] src, int srcPos, float[] dest, int destPos, int length) throws IndexOutOfBoundsException
      Parameters:
      src -
      srcPos -
      dest -
      destPos -
      length -
      Throws:
      IndexOutOfBoundsException
    • copy

      public static void copy(double[] src, int srcPos, double[] dest, int destPos, int length) throws IndexOutOfBoundsException
      Parameters:
      src -
      srcPos -
      dest -
      destPos -
      length -
      Throws:
      IndexOutOfBoundsException
    • copy

      public static void copy(Object[] src, int srcPos, Object[] dest, int destPos, int length) throws IndexOutOfBoundsException
      Parameters:
      src -
      srcPos -
      dest -
      destPos -
      length -
      Throws:
      IndexOutOfBoundsException
    • copy

      public static void copy(Object src, int srcPos, Object dest, int destPos, int length) throws IndexOutOfBoundsException
      Parameters:
      src -
      srcPos -
      dest -
      destPos -
      length -
      Throws:
      IndexOutOfBoundsException
      See Also:
    • copyOf

      public static boolean[] copyOf(boolean[] original, int newLength)
      Parameters:
      original -
      newLength -
      Returns:
      See Also:
    • copyOf

      public static char[] copyOf(char[] original, int newLength)
      Parameters:
      original -
      newLength -
      Returns:
      See Also:
    • copyOf

      public static byte[] copyOf(byte[] original, int newLength)
      Parameters:
      original -
      newLength -
      Returns:
      See Also:
    • copyOf

      public static short[] copyOf(short[] original, int newLength)
      Parameters:
      original -
      newLength -
      Returns:
      See Also:
    • copyOf

      public static int[] copyOf(int[] original, int newLength)
      Parameters:
      original -
      newLength -
      Returns:
      See Also:
    • copyOf

      public static long[] copyOf(long[] original, int newLength)
      Parameters:
      original -
      newLength -
      Returns:
      See Also:
    • copyOf

      public static float[] copyOf(float[] original, int newLength)
      Parameters:
      original -
      newLength -
      Returns:
      See Also:
    • copyOf

      public static double[] copyOf(double[] original, int newLength)
      Parameters:
      original -
      newLength -
      Returns:
      See Also:
    • copyOf

      public static <T> T[] copyOf(T[] original, int newLength)
      Type Parameters:
      T -
      Parameters:
      original -
      newLength -
      Returns:
      See Also:
    • copyOf

      public static <T, U> T[] copyOf(U[] original, int newLength, Class<? extends T[]> newType)
      Type Parameters:
      T -
      U -
      Parameters:
      original -
      newLength -
      newType -
      Returns:
      See Also:
    • copyOfRange

      public static boolean[] copyOfRange(boolean[] original, int fromIndex, int toIndex)
      Copy all the elements in original, through to-from.
      Parameters:
      original -
      fromIndex -
      toIndex -
      Returns:
      See Also:
    • copyOfRange

      public static boolean[] copyOfRange(boolean[] original, int fromIndex, int toIndex, int step) throws IndexOutOfBoundsException
      Copy all the elements in original, through to-from, by step.
      Parameters:
      original -
      fromIndex -
      toIndex -
      step -
      Returns:
      Throws:
      IndexOutOfBoundsException
      See Also:
    • copyOfRange

      public static char[] copyOfRange(char[] original, int fromIndex, int toIndex)
      Copy all the elements in original, through to-from.
      Parameters:
      original -
      fromIndex -
      toIndex -
      Returns:
      See Also:
    • copyOfRange

      public static char[] copyOfRange(char[] original, int fromIndex, int toIndex, int step) throws IndexOutOfBoundsException
      Copy all the elements in original, through to-from, by step.
      Parameters:
      original -
      fromIndex -
      toIndex -
      step -
      Returns:
      Throws:
      IndexOutOfBoundsException
      See Also:
    • copyOfRange

      public static byte[] copyOfRange(byte[] original, int fromIndex, int toIndex)
      Copy all the elements in original, through to-from.
      Parameters:
      original -
      fromIndex -
      toIndex -
      Returns:
      See Also:
    • copyOfRange

      public static byte[] copyOfRange(byte[] original, int fromIndex, int toIndex, int step) throws IndexOutOfBoundsException
      Copy all the elements in original, through to-from, by step.
      Parameters:
      original -
      fromIndex -
      toIndex -
      step -
      Returns:
      Throws:
      IndexOutOfBoundsException
      See Also:
    • copyOfRange

      public static short[] copyOfRange(short[] original, int fromIndex, int toIndex)
      Copy all the elements in original, through to-from.
      Parameters:
      original -
      fromIndex -
      toIndex -
      Returns:
      See Also:
    • copyOfRange

      public static short[] copyOfRange(short[] original, int fromIndex, int toIndex, int step) throws IndexOutOfBoundsException
      Copy all the elements in original, through to-from, by step.
      Parameters:
      original -
      fromIndex -
      toIndex -
      step -
      Returns:
      Throws:
      IndexOutOfBoundsException
      See Also:
    • copyOfRange

      public static int[] copyOfRange(int[] original, int fromIndex, int toIndex)
      Copy all the elements in original, through to-from.
      Parameters:
      original -
      fromIndex -
      toIndex -
      Returns:
      See Also:
    • copyOfRange

      public static int[] copyOfRange(int[] original, int fromIndex, int toIndex, int step) throws IndexOutOfBoundsException
      Copy all the elements in original, through to-from, by step.
       
       int[] a = { 0, 1, 2, 3, 4, 5 };
       N.copyOfRange(a, 1, 5, 1)); // [1, 2, 3, 4]
       N.copyOfRange(a, 1, 5, 2); // [1, 3]
      
       N.copyOfRange(a, 5, 1, -1); // [5, 4, 3, 2]
       N.copyOfRange(a, 5, 1, -2); // [5, 3]
       N.copyOfRange(a, 5, -1, -1); // [5, 4, 3, 2, 1, 0]
       N.copyOfRange(a, 6, -1, -1); // [5, 4, 3, 2, 1, 0]
       
       
      Parameters:
      original -
      fromIndex -
      toIndex -
      step -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • copyOfRange

      public static long[] copyOfRange(long[] original, int fromIndex, int toIndex)
      Copy all the elements in original, through to-from.
      Parameters:
      original -
      fromIndex -
      toIndex -
      Returns:
      See Also:
    • copyOfRange

      public static long[] copyOfRange(long[] original, int fromIndex, int toIndex, int step) throws IndexOutOfBoundsException
      Copy all the elements in original, through to-from, by step.
      Parameters:
      original -
      fromIndex -
      toIndex -
      step -
      Returns:
      Throws:
      IndexOutOfBoundsException
      See Also:
    • copyOfRange

      public static float[] copyOfRange(float[] original, int fromIndex, int toIndex)
      Copy all the elements in original, through to-from.
      Parameters:
      original -
      fromIndex -
      toIndex -
      Returns:
      See Also:
    • copyOfRange

      public static float[] copyOfRange(float[] original, int fromIndex, int toIndex, int step) throws IndexOutOfBoundsException
      Copy all the elements in original, through to-from, by step.
      Parameters:
      original -
      fromIndex -
      toIndex -
      step -
      Returns:
      Throws:
      IndexOutOfBoundsException
      See Also:
    • copyOfRange

      public static double[] copyOfRange(double[] original, int fromIndex, int toIndex)
      Copy all the elements in original, through to-from.
      Parameters:
      original -
      fromIndex -
      toIndex -
      Returns:
      See Also:
    • copyOfRange

      public static double[] copyOfRange(double[] original, int fromIndex, int toIndex, int step) throws IndexOutOfBoundsException
      Copy all the elements in original, through to-from, by step.
      Parameters:
      original -
      fromIndex -
      toIndex -
      step -
      Returns:
      Throws:
      IndexOutOfBoundsException
      See Also:
    • copyOfRange

      public static <T> T[] copyOfRange(T[] original, int fromIndex, int toIndex)
      Copy all the elements in original, through to-from.
      Type Parameters:
      T -
      Parameters:
      original -
      fromIndex -
      toIndex -
      Returns:
      See Also:
    • copyOfRange

      public static <T> T[] copyOfRange(T[] original, int fromIndex, int toIndex, int step)
      Copy all the elements in original, through to-from, by step.
      Type Parameters:
      T -
      Parameters:
      original -
      fromIndex -
      toIndex -
      step -
      Returns:
    • copyOfRange

      public static <T, U> T[] copyOfRange(U[] original, int fromIndex, int toIndex, Class<? extends T[]> newType)
      Type Parameters:
      T -
      U -
      Parameters:
      original -
      fromIndex -
      toIndex -
      newType -
      Returns:
    • copyOfRange

      public static <T> T[] copyOfRange(T[] original, int fromIndex, int toIndex, int step, Class<? extends T[]> newType) throws IndexOutOfBoundsException
      Copy all the elements in original, through to-from, by step.
      Type Parameters:
      T -
      Parameters:
      original -
      fromIndex -
      toIndex -
      step -
      newType -
      Returns:
      Throws:
      IndexOutOfBoundsException
      See Also:
    • copyOfRange

      public static <T> List<T> copyOfRange(List<T> c, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Copy all the elements in original, through to-from.
      Type Parameters:
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
      See Also:
    • copyOfRange

      public static <T> List<T> copyOfRange(List<T> c, int fromIndex, int toIndex, int step) throws IndexOutOfBoundsException
      Copy all the elements in original, through to-from, by step.
      Type Parameters:
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      step -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • copyOfRange

      public static String copyOfRange(String str, int fromIndex, int toIndex)
      Copy all the chars in original, through to-from.
      Parameters:
      str -
      fromIndex -
      toIndex -
      Returns:
    • copyOfRange

      public static String copyOfRange(String str, int fromIndex, int toIndex, int step) throws IndexOutOfBoundsException
      Copy all the chars in original, through to-from, by step.
      Parameters:
      str -
      fromIndex -
      toIndex -
      step -
      Returns:
      Throws:
      IndexOutOfBoundsException
      See Also:
    • clone

      @MayReturnNull public static boolean[] clone(boolean[] original)
      Clone the original array. null is returned if the input array is null.
      Parameters:
      original -
      Returns:
    • clone

      @MayReturnNull public static char[] clone(char[] original)
      Clone the original array. null is returned if the input array is null.
      Parameters:
      original -
      Returns:
    • clone

      @MayReturnNull public static byte[] clone(byte[] original)
      Clone the original array. null is returned if the input array is null.
      Parameters:
      original -
      Returns:
    • clone

      @MayReturnNull public static short[] clone(short[] original)
      Clone the original array. null is returned if the input array is null.
      Parameters:
      original -
      Returns:
    • clone

      @MayReturnNull public static int[] clone(int[] original)
      Clone the original array. null is returned if the input array is null.
      Parameters:
      original -
      Returns:
    • clone

      @MayReturnNull public static long[] clone(long[] original)
      Clone the original array. null is returned if the input array is null.
      Parameters:
      original -
      Returns:
    • clone

      @MayReturnNull public static float[] clone(float[] original)
      Clone the original array. null is returned if the input array is null.
      Parameters:
      original -
      Returns:
    • clone

      @MayReturnNull public static double[] clone(double[] original)
      Clone the original array. null is returned if the input array is null.
      Parameters:
      original -
      Returns:
    • clone

      @MayReturnNull public static <T> T[] clone(T[] original)
      Clone the original array. null is returned if the input array is null.
      Type Parameters:
      T -
      Parameters:
      original -
      Returns:
    • clone

      @MayReturnNull public static boolean[][] clone(boolean[][] original)
      Clone the original array and its sub arrays. null is returned if the input array is null.
      Parameters:
      original -
      Returns:
    • clone

      @MayReturnNull public static char[][] clone(char[][] original)
      Clone the original array and its sub arrays. null is returned if the input array is null.
      Parameters:
      original -
      Returns:
    • clone

      @MayReturnNull public static byte[][] clone(byte[][] original)
      Clone the original array and its sub arrays. null is returned if the input array is null.
      Parameters:
      original -
      Returns:
    • clone

      @MayReturnNull public static short[][] clone(short[][] original)
      Clone the original array and its sub arrays. null is returned if the input array is null.
      Parameters:
      original -
      Returns:
    • clone

      @MayReturnNull public static int[][] clone(int[][] original)
      Clone the original array and its sub arrays. null is returned if the input array is null.
      Parameters:
      original -
      Returns:
    • clone

      @MayReturnNull public static long[][] clone(long[][] original)
      Clone the original array and its sub arrays. null is returned if the input array is null.
      Parameters:
      original -
      Returns:
    • clone

      @MayReturnNull public static float[][] clone(float[][] original)
      Clone the original array and its sub arrays. null is returned if the input array is null.
      Parameters:
      original -
      Returns:
    • clone

      @MayReturnNull public static double[][] clone(double[][] original)
      Clone the original array and its sub arrays. null is returned if the input array is null.
      Parameters:
      original -
      Returns:
    • clone

      @MayReturnNull public static <T> T[][] clone(T[][] original)
      Clone the original array and its sub arrays. null is returned if the input array is null.
      Type Parameters:
      T -
      Parameters:
      original -
      Returns:
    • clone

      @MayReturnNull public static boolean[][][] clone(boolean[][][] original)
      Clone the original array and its sub arrays. null is returned if the input array is null.
      Parameters:
      original -
      Returns:
    • clone

      @MayReturnNull public static char[][][] clone(char[][][] original)
      Clone the original array and its sub arrays. null is returned if the input array is null.
      Parameters:
      original -
      Returns:
    • clone

      @MayReturnNull public static byte[][][] clone(byte[][][] original)
      Clone the original array and its sub arrays. null is returned if the input array is null.
      Parameters:
      original -
      Returns:
    • clone

      @MayReturnNull public static short[][][] clone(short[][][] original)
      Clone the original array and its sub arrays. null is returned if the input array is null.
      Parameters:
      original -
      Returns:
    • clone

      @MayReturnNull public static int[][][] clone(int[][][] original)
      Clone the original array and its sub arrays. null is returned if the input array is null.
      Parameters:
      original -
      Returns:
    • clone

      @MayReturnNull public static long[][][] clone(long[][][] original)
      Clone the original array and its sub arrays. null is returned if the input array is null.
      Parameters:
      original -
      Returns:
    • clone

      @MayReturnNull public static float[][][] clone(float[][][] original)
      Clone the original array and its sub arrays. null is returned if the input array is null.
      Parameters:
      original -
      Returns:
    • clone

      @MayReturnNull public static double[][][] clone(double[][][] original)
      Clone the original array and its sub arrays. null is returned if the input array is null.
      Parameters:
      original -
      Returns:
    • clone

      @MayReturnNull public static <T> T[][][] clone(T[][][] original)
      Clone the original array and its sub arrays. null is returned if the input array is null.
      Type Parameters:
      T -
      Parameters:
      original -
      Returns:
    • isSorted

      public static boolean isSorted(boolean[] a)
      Parameters:
      a -
      Returns:
    • isSorted

      public static boolean isSorted(boolean[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • isSorted

      public static boolean isSorted(char[] a)
      Parameters:
      a -
      Returns:
    • isSorted

      public static boolean isSorted(char[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • isSorted

      public static boolean isSorted(byte[] a)
      Parameters:
      a -
      Returns:
    • isSorted

      public static boolean isSorted(byte[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • isSorted

      public static boolean isSorted(short[] a)
      Parameters:
      a -
      Returns:
    • isSorted

      public static boolean isSorted(short[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • isSorted

      public static boolean isSorted(int[] a)
      Parameters:
      a -
      Returns:
    • isSorted

      public static boolean isSorted(int[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • isSorted

      public static boolean isSorted(long[] a)
      Parameters:
      a -
      Returns:
    • isSorted

      public static boolean isSorted(long[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • isSorted

      public static boolean isSorted(float[] a)
      Parameters:
      a -
      Returns:
    • isSorted

      public static boolean isSorted(float[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • isSorted

      public static boolean isSorted(double[] a)
      Parameters:
      a -
      Returns:
    • isSorted

      public static boolean isSorted(double[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • isSorted

      public static <T extends Comparable<? super T>> boolean isSorted(T[] a)
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • isSorted

      public static <T extends Comparable<? super T>> boolean isSorted(T[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • isSorted

      public static <T> boolean isSorted(T[] a, Comparator<? super T> cmp)
      Type Parameters:
      T -
      Parameters:
      a -
      cmp -
      Returns:
    • isSorted

      public static <T> boolean isSorted(T[] a, int fromIndex, int toIndex, Comparator<? super T> cmp) throws IndexOutOfBoundsException
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      cmp -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • isSorted

      public static <T extends Comparable<? super T>> boolean isSorted(Collection<? extends T> c)
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
    • isSorted

      public static <T extends Comparable<? super T>> boolean isSorted(Collection<? extends T> c, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Type Parameters:
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • isSorted

      public static <T> boolean isSorted(Collection<? extends T> c, Comparator<? super T> cmp)
      Type Parameters:
      T -
      Parameters:
      c -
      cmp -
      Returns:
    • isSorted

      public static <T> boolean isSorted(Collection<? extends T> c, int fromIndex, int toIndex, Comparator<? super T> cmp) throws IndexOutOfBoundsException
      Type Parameters:
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      cmp -
      Returns:
      Throws:
      IndexOutOfBoundsException
    • sort

      public static void sort(boolean[] a)
      Parameters:
      a -
    • sort

      public static void sort(char[] a)
      Parameters:
      a -
    • sort

      public static void sort(char[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Throws:
      IndexOutOfBoundsException
    • sort

      public static void sort(byte[] a)
      Parameters:
      a -
    • sort

      public static void sort(byte[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Throws:
      IndexOutOfBoundsException
    • sort

      public static void sort(short[] a)
      Parameters:
      a -
    • sort

      public static void sort(short[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Throws:
      IndexOutOfBoundsException
    • sort

      public static void sort(int[] a)
      Parameters:
      a -
    • sort

      public static void sort(int[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Throws:
      IndexOutOfBoundsException
    • sort

      public static void sort(long[] a)
      Parameters:
      a -
    • sort

      public static void sort(long[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Throws:
      IndexOutOfBoundsException
    • sort

      public static void sort(float[] a)
      Parameters:
      a -
    • sort

      public static void sort(float[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Throws:
      IndexOutOfBoundsException
    • sort

      public static void sort(double[] a)
      Parameters:
      a -
    • sort

      public static void sort(double[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Throws:
      IndexOutOfBoundsException
    • sort

      public static void sort(Object[] a)
      Parameters:
      a -
    • sort

      public static void sort(Object[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
    • sort

      public static <T> void sort(T[] a, Comparator<? super T> cmp)
      Type Parameters:
      T -
      Parameters:
      a -
      cmp -
    • sort

      public static <T> void sort(T[] a, int fromIndex, int toIndex, Comparator<? super T> cmp) throws IndexOutOfBoundsException
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      cmp -
      Throws:
      IndexOutOfBoundsException
    • sort

      public static <T extends Comparable<? super T>> void sort(List<? extends T> list)
      Type Parameters:
      T -
      Parameters:
      list -
    • sort

      public static <T extends Comparable<? super T>> void sort(List<? extends T> list, int fromIndex, int toIndex)
      Type Parameters:
      T -
      Parameters:
      list -
      fromIndex -
      toIndex -
    • sort

      public static <T> void sort(List<? extends T> list, Comparator<? super T> cmp)
      Type Parameters:
      T -
      Parameters:
      list -
      cmp -
    • sort

      public static <T> void sort(List<? extends T> list, int fromIndex, int toIndex, Comparator<? super T> cmp)
      Type Parameters:
      T -
      Parameters:
      list -
      fromIndex -
      toIndex -
      cmp -
    • sortBy

      public static <T, U extends Comparable<? super U>> void sortBy(T[] a, Function<? super T,? extends U> keyMapper)
      Type Parameters:
      T -
      U -
      Parameters:
      a -
      keyMapper -
    • sortBy

      public static <T, U extends Comparable<? super U>> void sortBy(List<? extends T> list, Function<? super T,? extends U> keyMapper)
      Type Parameters:
      T -
      U -
      Parameters:
      list -
      keyMapper -
    • sortByInt

      public static <T> void sortByInt(T[] a, ToIntFunction<? super T> keyMapper)
      Sort by int.
      Type Parameters:
      T -
      Parameters:
      a -
      keyMapper -
    • sortByInt

      public static <T> void sortByInt(List<? extends T> list, ToIntFunction<? super T> keyMapper)
      Sort by int.
      Type Parameters:
      T -
      Parameters:
      list -
      keyMapper -
    • sortByLong

      public static <T> void sortByLong(T[] a, ToLongFunction<? super T> keyMapper)
      Sort by long.
      Type Parameters:
      T -
      Parameters:
      a -
      keyMapper -
    • sortByLong

      public static <T> void sortByLong(List<? extends T> list, ToLongFunction<? super T> keyMapper)
      Sort by long.
      Type Parameters:
      T -
      Parameters:
      list -
      keyMapper -
    • sortByFloat

      public static <T> void sortByFloat(T[] a, ToFloatFunction<? super T> keyMapper)
      Sort by float.
      Type Parameters:
      T -
      Parameters:
      a -
      keyMapper -
    • sortByFloat

      public static <T> void sortByFloat(List<? extends T> list, ToFloatFunction<? super T> keyMapper)
      Sort by float.
      Type Parameters:
      T -
      Parameters:
      list -
      keyMapper -
    • sortByDouble

      public static <T> void sortByDouble(T[] a, ToDoubleFunction<? super T> keyMapper)
      Sort by double.
      Type Parameters:
      T -
      Parameters:
      a -
      keyMapper -
    • sortByDouble

      public static <T> void sortByDouble(List<? extends T> list, ToDoubleFunction<? super T> keyMapper)
      Sort by double.
      Type Parameters:
      T -
      Parameters:
      list -
      keyMapper -
    • parallelSort

      public static void parallelSort(char[] a)
      Parameters:
      a -
    • parallelSort

      public static void parallelSort(char[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Throws:
      IndexOutOfBoundsException
    • parallelSort

      public static void parallelSort(byte[] a)
      Parameters:
      a -
    • parallelSort

      public static void parallelSort(byte[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Throws:
      IndexOutOfBoundsException
    • parallelSort

      public static void parallelSort(short[] a)
      Parameters:
      a -
    • parallelSort

      public static void parallelSort(short[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Throws:
      IndexOutOfBoundsException
    • parallelSort

      public static void parallelSort(int[] a)
      Parameters:
      a -
    • parallelSort

      public static void parallelSort(int[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Throws:
      IndexOutOfBoundsException
    • parallelSort

      public static void parallelSort(long[] a)
      Parameters:
      a -
    • parallelSort

      public static void parallelSort(long[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Throws:
      IndexOutOfBoundsException
    • parallelSort

      public static void parallelSort(float[] a)
      Parameters:
      a -
    • parallelSort

      public static void parallelSort(float[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Throws:
      IndexOutOfBoundsException
    • parallelSort

      public static void parallelSort(double[] a)
      Parameters:
      a -
    • parallelSort

      public static void parallelSort(double[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Throws:
      IndexOutOfBoundsException
    • parallelSort

      public static <T extends Comparable<? super T>> void parallelSort(T[] a)
      Type Parameters:
      T -
      Parameters:
      a -
    • parallelSort

      public static <T extends Comparable<? super T>> void parallelSort(T[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      Throws:
      IndexOutOfBoundsException
    • parallelSort

      public static <T> void parallelSort(T[] a, Comparator<? super T> cmp)
      Type Parameters:
      T -
      Parameters:
      a -
      cmp -
    • parallelSort

      public static <T> void parallelSort(T[] a, int fromIndex, int toIndex, Comparator<? super T> cmp) throws IndexOutOfBoundsException
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      cmp -
      Throws:
      IndexOutOfBoundsException
    • parallelSort

      public static <T extends Comparable<? super T>> void parallelSort(List<? extends T> list)
      Type Parameters:
      T -
      Parameters:
      list -
    • parallelSort

      public static <T extends Comparable<? super T>> void parallelSort(List<? extends T> list, int fromIndex, int toIndex)
      Type Parameters:
      T -
      Parameters:
      list -
      fromIndex -
      toIndex -
    • parallelSort

      public static <T> void parallelSort(List<? extends T> list, Comparator<? super T> cmp)
      Type Parameters:
      T -
      Parameters:
      list -
      cmp -
    • parallelSort

      public static <T> void parallelSort(List<? extends T> list, int fromIndex, int toIndex, Comparator<? super T> cmp)
      Type Parameters:
      T -
      Parameters:
      list -
      fromIndex -
      toIndex -
      cmp -
    • parallelSortBy

      public static <T, U extends Comparable<? super U>> void parallelSortBy(T[] a, Function<? super T,? extends U> keyMapper)
      Parallel sort by.
      Type Parameters:
      T -
      U -
      Parameters:
      a -
      keyMapper -
    • parallelSortBy

      public static <T, U extends Comparable<? super U>> void parallelSortBy(List<? extends T> list, Function<? super T,? extends U> keyMapper)
      Parallel sort by.
      Type Parameters:
      T -
      U -
      Parameters:
      list -
      keyMapper -
    • parallelSortByInt

      public static <T> void parallelSortByInt(T[] a, ToIntFunction<? super T> keyMapper)
      Parallel sort by int.
      Type Parameters:
      T -
      Parameters:
      a -
      keyMapper -
    • parallelSortByInt

      public static <T> void parallelSortByInt(List<? extends T> list, ToIntFunction<? super T> keyMapper)
      Parallel sort by int.
      Type Parameters:
      T -
      Parameters:
      list -
      keyMapper -
    • parallelSortByLong

      public static <T> void parallelSortByLong(T[] a, ToLongFunction<? super T> keyMapper)
      Parallel sort by long.
      Type Parameters:
      T -
      Parameters:
      a -
      keyMapper -
    • parallelSortByLong

      public static <T> void parallelSortByLong(List<? extends T> list, ToLongFunction<? super T> keyMapper)
      Parallel sort by long.
      Type Parameters:
      T -
      Parameters:
      list -
      keyMapper -
    • parallelSortByFloat

      public static <T> void parallelSortByFloat(T[] a, ToFloatFunction<? super T> keyMapper)
      Parallel sort by float.
      Type Parameters:
      T -
      Parameters:
      a -
      keyMapper -
    • parallelSortByFloat

      public static <T> void parallelSortByFloat(List<? extends T> list, ToFloatFunction<? super T> keyMapper)
      Parallel sort by float.
      Type Parameters:
      T -
      Parameters:
      list -
      keyMapper -
    • parallelSortByDouble

      public static <T> void parallelSortByDouble(T[] a, ToDoubleFunction<? super T> keyMapper)
      Parallel sort by double.
      Type Parameters:
      T -
      Parameters:
      a -
      keyMapper -
    • parallelSortByDouble

      public static <T> void parallelSortByDouble(List<? extends T> list, ToDoubleFunction<? super T> keyMapper)
      Parallel sort by double.
      Type Parameters:
      T -
      Parameters:
      list -
      keyMapper -
    • reverseSort

      public static void reverseSort(boolean[] a)
      Parameters:
      a -
    • reverseSort

      public static void reverseSort(char[] a)
      Parameters:
      a -
    • reverseSort

      public static void reverseSort(char[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
    • reverseSort

      public static void reverseSort(byte[] a)
      Parameters:
      a -
    • reverseSort

      public static void reverseSort(byte[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
    • reverseSort

      public static void reverseSort(short[] a)
      Parameters:
      a -
    • reverseSort

      public static void reverseSort(short[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
    • reverseSort

      public static void reverseSort(int[] a)
      Parameters:
      a -
    • reverseSort

      public static void reverseSort(int[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
    • reverseSort

      public static void reverseSort(long[] a)
      Parameters:
      a -
    • reverseSort

      public static void reverseSort(long[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
    • reverseSort

      public static void reverseSort(float[] a)
      Parameters:
      a -
    • reverseSort

      public static void reverseSort(float[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
    • reverseSort

      public static void reverseSort(double[] a)
      Parameters:
      a -
    • reverseSort

      public static void reverseSort(double[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
    • reverseSort

      public static void reverseSort(Object[] a)
      Parameters:
      a -
    • reverseSort

      public static void reverseSort(Object[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
    • reverseSort

      public static <T extends Comparable<? super T>> void reverseSort(List<? extends T> list)
      Type Parameters:
      T -
      Parameters:
      list -
    • reverseSort

      public static <T extends Comparable<? super T>> void reverseSort(List<? extends T> list, int fromIndex, int toIndex)
      Type Parameters:
      T -
      Parameters:
      list -
      fromIndex -
      toIndex -
    • reverseSortBy

      public static <T, U extends Comparable<? super U>> void reverseSortBy(T[] a, Function<? super T,? extends U> keyMapper)
      Reverse sort by.
      Type Parameters:
      T -
      U -
      Parameters:
      a -
      keyMapper -
    • reverseSortBy

      public static <T, U extends Comparable<? super U>> void reverseSortBy(List<? extends T> list, Function<? super T,? extends U> keyMapper)
      Reverse sort by.
      Type Parameters:
      T -
      U -
      Parameters:
      list -
      keyMapper -
    • reverseSortByInt

      public static <T> void reverseSortByInt(T[] a, ToIntFunction<? super T> keyMapper)
      Type Parameters:
      T -
      Parameters:
      a -
      keyMapper -
    • reverseSortByInt

      public static <T> void reverseSortByInt(List<? extends T> list, ToIntFunction<? super T> keyMapper)
      Type Parameters:
      T -
      Parameters:
      list -
      keyMapper -
    • reverseSortByLong

      public static <T> void reverseSortByLong(T[] a, ToLongFunction<? super T> keyMapper)
      Type Parameters:
      T -
      Parameters:
      a -
      keyMapper -
    • reverseSortByLong

      public static <T> void reverseSortByLong(List<? extends T> list, ToLongFunction<? super T> keyMapper)
      Type Parameters:
      T -
      Parameters:
      list -
      keyMapper -
    • reverseSortByFloat

      public static <T> void reverseSortByFloat(T[] a, ToFloatFunction<? super T> keyMapper)
      Type Parameters:
      T -
      Parameters:
      a -
      keyMapper -
    • reverseSortByFloat

      public static <T> void reverseSortByFloat(List<? extends T> list, ToFloatFunction<? super T> keyMapper)
      Type Parameters:
      T -
      Parameters:
      list -
      keyMapper -
    • reverseSortByDouble

      public static <T> void reverseSortByDouble(T[] a, ToDoubleFunction<? super T> keyMapper)
      Type Parameters:
      T -
      Parameters:
      a -
      keyMapper -
    • reverseSortByDouble

      public static <T> void reverseSortByDouble(List<? extends T> list, ToDoubleFunction<? super T> keyMapper) throws IndexOutOfBoundsException
      Type Parameters:
      T -
      Parameters:
      list -
      keyMapper -
      Throws:
      IndexOutOfBoundsException
    • binarySearch

      public static int binarySearch(char[] a, char valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
    • binarySearch

      public static int binarySearch(char[] a, int fromIndex, int toIndex, char valueToFind)
      Parameters:
      a -
      fromIndex -
      toIndex -
      valueToFind -
      Returns:
    • binarySearch

      public static int binarySearch(byte[] a, byte valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
    • binarySearch

      public static int binarySearch(byte[] a, int fromIndex, int toIndex, byte valueToFind)
      Parameters:
      a -
      fromIndex -
      toIndex -
      valueToFind -
      Returns:
    • binarySearch

      public static int binarySearch(short[] a, short valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
    • binarySearch

      public static int binarySearch(short[] a, int fromIndex, int toIndex, short valueToFind)
      Parameters:
      a -
      fromIndex -
      toIndex -
      valueToFind -
      Returns:
    • binarySearch

      public static int binarySearch(int[] a, int valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
    • binarySearch

      public static int binarySearch(int[] a, int fromIndex, int toIndex, int valueToFind)
      Parameters:
      a -
      fromIndex -
      toIndex -
      valueToFind -
      Returns:
    • binarySearch

      public static int binarySearch(long[] a, long valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
    • binarySearch

      public static int binarySearch(long[] a, int fromIndex, int toIndex, long valueToFind)
      Parameters:
      a -
      fromIndex -
      toIndex -
      valueToFind -
      Returns:
    • binarySearch

      public static int binarySearch(float[] a, float valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
    • binarySearch

      public static int binarySearch(float[] a, int fromIndex, int toIndex, float valueToFind)
      Parameters:
      a -
      fromIndex -
      toIndex -
      valueToFind -
      Returns:
    • binarySearch

      public static int binarySearch(double[] a, double valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
    • binarySearch

      public static int binarySearch(double[] a, int fromIndex, int toIndex, double valueToFind)
      Parameters:
      a -
      fromIndex -
      toIndex -
      valueToFind -
      Returns:
    • binarySearch

      public static int binarySearch(Object[] a, Object valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
    • binarySearch

      public static int binarySearch(Object[] a, int fromIndex, int toIndex, Object valueToFind)
      Parameters:
      a -
      fromIndex -
      toIndex -
      valueToFind -
      Returns:
    • binarySearch

      public static <T> int binarySearch(T[] a, T valueToFind, Comparator<? super T> cmp)
      Type Parameters:
      T -
      Parameters:
      a -
      valueToFind -
      cmp -
      Returns:
    • binarySearch

      public static <T> int binarySearch(T[] a, int fromIndex, int toIndex, T valueToFind, Comparator<? super T> cmp)
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      valueToFind -
      cmp -
      Returns:
    • binarySearch

      public static <T extends Comparable<? super T>> int binarySearch(List<? extends T> list, T valueToFind)
      Type Parameters:
      T -
      Parameters:
      list -
      valueToFind -
      Returns:
    • binarySearch

      public static <T extends Comparable<? super T>> int binarySearch(List<? extends T> list, int fromIndex, int toIndex, T valueToFind)
      Type Parameters:
      T -
      Parameters:
      list -
      fromIndex -
      toIndex -
      valueToFind -
      Returns:
    • binarySearch

      public static <T> int binarySearch(List<? extends T> list, T valueToFind, Comparator<? super T> cmp)
      Type Parameters:
      T -
      Parameters:
      list -
      valueToFind -
      cmp -
      Returns:
    • binarySearch

      public static <T> int binarySearch(List<? extends T> list, int fromIndex, int toIndex, T valueToFind, Comparator<? super T> cmp)
      Type Parameters:
      T -
      Parameters:
      list -
      fromIndex -
      toIndex -
      valueToFind -
      cmp -
      Returns:
      See Also:
    • indexOf

      public static int indexOf(boolean[] a, boolean valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
      -1 if no target value/element is found in the specified Collection/Array.
    • indexOf

      public static int indexOf(boolean[] a, boolean valueToFind, int fromIndex)
      Parameters:
      a -
      valueToFind -
      fromIndex - the index from which to start the search.
      Returns:
      -1 if no target value/element is found in the specified Collection/Array.
    • indexOf

      public static int indexOf(char[] a, char valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
      -1 if no target value/element is found in the specified Collection/Array.
    • indexOf

      public static int indexOf(char[] a, char valueToFind, int fromIndex)
      Parameters:
      a -
      valueToFind -
      fromIndex - the index from which to start the search.
      Returns:
      -1 if no target value/element is found in the specified Collection/Array.
    • indexOf

      public static int indexOf(byte[] a, byte valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
      -1 if no target value/element is found in the specified Collection/Array.
    • indexOf

      public static int indexOf(byte[] a, byte valueToFind, int fromIndex)
      Parameters:
      a -
      valueToFind -
      fromIndex - the index from which to start the search.
      Returns:
      -1 if no target value/element is found in the specified Collection/Array.
    • indexOf

      public static int indexOf(short[] a, short valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
      -1 if no target value/element is found in the specified Collection/Array.
    • indexOf

      public static int indexOf(short[] a, short valueToFind, int fromIndex)
      Parameters:
      a -
      valueToFind -
      fromIndex - the index from which to start the search.
      Returns:
      -1 if no target value/element is found in the specified Collection/Array.
    • indexOf

      public static int indexOf(int[] a, int valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
      -1 if no target value/element is found in the specified Collection/Array.
    • indexOf

      public static int indexOf(int[] a, int valueToFind, int fromIndex)
      Parameters:
      a -
      valueToFind -
      fromIndex - the index from which to start the search.
      Returns:
      -1 if no target value/element is found in the specified Collection/Array.
    • indexOf

      public static int indexOf(long[] a, long valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
      -1 if no target value/element is found in the specified Collection/Array.
    • indexOf

      public static int indexOf(long[] a, long valueToFind, int fromIndex)
      Parameters:
      a -
      valueToFind -
      fromIndex - the index from which to start the search.
      Returns:
      -1 if no target value/element is found in the specified Collection/Array.
    • indexOf

      public static int indexOf(float[] a, float valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
      -1 if no target value/element is found in the specified Collection/Array.
    • indexOf

      public static int indexOf(float[] a, float valueToFind, int fromIndex)
      Parameters:
      a -
      valueToFind -
      fromIndex - the index from which to start the search.
      Returns:
      -1 if no target value/element is found in the specified Collection/Array.
    • indexOf

      public static int indexOf(double[] a, double valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
      -1 if no target value/element is found in the specified Collection/Array.
    • indexOf

      public static int indexOf(double[] a, double valueToFind, int fromIndex)
      Parameters:
      a -
      valueToFind -
      fromIndex - the index from which to start the search.
      Returns:
      -1 if no target value/element is found in the specified Collection/Array.
    • indexOf

      public static int indexOf(double[] a, double valueToFind, double tolerance)

      Finds the index of the given value within a given tolerance in the array. This method will return the index of the first value which falls between the region defined by valueToFind - tolerance and valueToFind + tolerance.

      This method returns INDEX_NOT_FOUND (-1) for a null input array.

      Parameters:
      a - the array to search through for the object, may be null
      valueToFind -
      tolerance - tolerance of the search
      Returns:
      the index of the value within the array, INDEX_NOT_FOUND (-1) if not found or null array input
    • indexOf

      public static int indexOf(double[] a, double valueToFind, double tolerance, int fromIndex)

      Finds the index of the given value in the array starting at the given index. This method will return the index of the first value which falls between the region defined by valueToFind - tolerance and valueToFind + tolerance.

      This method returns INDEX_NOT_FOUND (-1) for a null input array.

      A negative startIndex is treated as zero. A startIndex larger than the array length will return INDEX_NOT_FOUND (-1).

      Parameters:
      a - the array to search through for the object, may be null
      valueToFind -
      tolerance - tolerance of the search
      fromIndex - the index to start searching at
      Returns:
      the index of the value within the array, INDEX_NOT_FOUND (-1) if not found or null array input
    • indexOf

      public static int indexOf(Object[] a, Object valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
      -1 if no target value/element is found in the specified Collection/Array.
    • indexOf

      public static int indexOf(Object[] a, Object valueToFind, int fromIndex)
      Parameters:
      a -
      valueToFind -
      fromIndex - the index from which to start the search.
      Returns:
      -1 if no target value/element is found in the specified Collection/Array.
    • indexOf

      public static int indexOf(Collection<?> c, Object valueToFind)
      Parameters:
      c -
      valueToFind -
      Returns:
      -1 if no target value/element is found in the specified Collection/Array.
    • indexOf

      public static int indexOf(Collection<?> c, Object valueToFind, int fromIndex)
      Parameters:
      c -
      valueToFind -
      fromIndex - the index from which to start the search.
      Returns:
      -1 if no target value/element is found in the specified Collection/Array.
    • indexOf

      public static int indexOf(Iterator<?> iter, Object valueToFind) throws ArithmeticException
      Returns the index of the first occurrence of the specified value in the given iterator.
      Parameters:
      iter - The iterator to be searched.
      valueToFind - The value to find in the iterator.
      Returns:
      The index of the first occurrence of the specified value in the iterator, or -1 if the value is not found.
      Throws:
      ArithmeticException - If the found index overflows an int.
    • indexOf

      public static int indexOf(Iterator<?> iter, Object valueToFind, int fromIndex) throws ArithmeticException
      Returns the index of the first occurrence of the specified value in the given iterator, starting the search from the specified index.
      Parameters:
      iter - The iterator to be searched.
      valueToFind - The value to find in the iterator.
      fromIndex - The index to start the search from.
      Returns:
      The index of the first occurrence of the specified value in the iterator, or -1 if the value is not found.
      Throws:
      ArithmeticException - If the found index overflows an int.
    • indexOfSubList

      public static int indexOfSubList(List<?> sourceList, List<?> subListToFind)
      Index of sub list.
      Parameters:
      sourceList -
      subListToFind -
      Returns:
      -1 if no target value/element is found in the specified Collection/Array.
      See Also:
    • indexOfSubList

      public static int indexOfSubList(List<?> sourceList, List<?> subListToFind, int fromIndex)
      Index of sub list.
      Parameters:
      sourceList -
      subListToFind -
      fromIndex -
      Returns:
      -1 if no target value/element is found in the specified Collection/Array.
      See Also:
    • indexOfIgnoreCase

      public static int indexOfIgnoreCase(String[] a, String valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
      -1 if no target value/element is found in the specified Collection/Array.
    • indexOfIgnoreCase

      public static int indexOfIgnoreCase(String[] a, String valueToFind, int fromIndex)
      Parameters:
      a -
      valueToFind -
      fromIndex -
      Returns:
      -1 if no target value/element is found in the specified Collection/Array.
    • lastIndexOf

      public static int lastIndexOf(boolean[] a, boolean valueToFind)
      Last index of.
      Parameters:
      a -
      valueToFind -
      Returns:
      -1 if no target value/element is found in the specified Collection/Array.
    • lastIndexOf

      public static int lastIndexOf(boolean[] a, boolean valueToFind, int startIndexFromBack)
      Last index of.
      Parameters:
      a -
      valueToFind -
      startIndexFromBack - the start index to traverse backwards from
      Returns:
      -1 if no target value/element is found in the specified Collection/Array.
    • lastIndexOf

      public static int lastIndexOf(char[] a, char valueToFind)
      Last index of.
      Parameters:
      a -
      valueToFind -
      Returns:
      -1 if no target value/element is found in the specified Collection/Array.
    • lastIndexOf

      public static int lastIndexOf(char[] a, char valueToFind, int startIndexFromBack)
      Last index of.
      Parameters:
      a -
      valueToFind -
      startIndexFromBack - the start index to traverse backwards from
      Returns:
      -1 if no target value/element is found in the specified Collection/Array.
    • lastIndexOf

      public static int lastIndexOf(byte[] a, byte valueToFind)
      Last index of.
      Parameters:
      a -
      valueToFind -
      Returns:
      -1 if no target value/element is found in the specified Collection/Array.
    • lastIndexOf

      public static int lastIndexOf(byte[] a, byte valueToFind, int startIndexFromBack)
      Last index of.
      Parameters:
      a -
      valueToFind -
      startIndexFromBack - the start index to traverse backwards from
      Returns:
      -1 if no target value/element is found in the specified Collection/Array.
    • lastIndexOf

      public static int lastIndexOf(short[] a, short valueToFind)
      Last index of.
      Parameters:
      a -
      valueToFind -
      Returns:
      -1 if no target value/element is found in the specified Collection/Array.
    • lastIndexOf

      public static int lastIndexOf(short[] a, short valueToFind, int startIndexFromBack)
      Last index of.
      Parameters:
      a -
      valueToFind -
      startIndexFromBack - the start index to traverse backwards from
      Returns:
      -1 if no target value/element is found in the specified Collection/Array.
    • lastIndexOf

      public static int lastIndexOf(int[] a, int valueToFind)
      Last index of.
      Parameters:
      a -
      valueToFind -
      Returns:
      -1 if no target value/element is found in the specified Collection/Array.
    • lastIndexOf

      public static int lastIndexOf(int[] a, int valueToFind, int startIndexFromBack)
      Last index of.
      Parameters:
      a -
      valueToFind -
      startIndexFromBack - the start index to traverse backwards from
      Returns:
      -1 if no target value/element is found in the specified Collection/Array.
    • lastIndexOf

      public static int lastIndexOf(long[] a, long valueToFind)
      Last index of.
      Parameters:
      a -
      valueToFind -
      Returns:
      -1 if no target value/element is found in the specified Collection/Array.
    • lastIndexOf

      public static int lastIndexOf(long[] a, long valueToFind, int startIndexFromBack)
      Last index of.
      Parameters:
      a -
      valueToFind -
      startIndexFromBack - the start index to traverse backwards from
      Returns:
      -1 if no target value/element is found in the specified Collection/Array.
    • lastIndexOf

      public static int lastIndexOf(float[] a, float valueToFind)
      Last index of.
      Parameters:
      a -
      valueToFind -
      Returns:
      -1 if no target value/element is found in the specified Collection/Array.
    • lastIndexOf

      public static int lastIndexOf(float[] a, float valueToFind, int startIndexFromBack)
      Last index of.
      Parameters:
      a -
      valueToFind -
      startIndexFromBack - the start index to traverse backwards from
      Returns:
      -1 if no target value/element is found in the specified Collection/Array.
    • lastIndexOf

      public static int lastIndexOf(double[] a, double valueToFind)
      Last index of.
      Parameters:
      a -
      valueToFind -
      Returns:
      -1 if no target value/element is found in the specified Collection/Array.
    • lastIndexOf

      public static int lastIndexOf(double[] a, double valueToFind, int startIndexFromBack)
      Last index of.
      Parameters:
      a -
      valueToFind -
      startIndexFromBack - the start index to traverse backwards from
      Returns:
      -1 if no target value/element is found in the specified Collection/Array.
    • lastIndexOf

      public static int lastIndexOf(double[] a, double valueToFind, double tolerance)

      Finds the last index of the given value within a given tolerance in the array. This method will return the index of the last value which falls between the region defined by valueToFind - tolerance and valueToFind + tolerance.

      This method returns INDEX_NOT_FOUND (-1) for a null input array.

      Parameters:
      a - the array to search through for the object, may be null
      valueToFind -
      tolerance - tolerance of the search
      Returns:
      the index of the value within the array, INDEX_NOT_FOUND (-1) if not found or null array input
    • lastIndexOf

      public static int lastIndexOf(double[] a, double valueToFind, double tolerance, int startIndexFromBack)

      Finds the last index of the given value in the array starting at the given index. This method will return the index of the last value which falls between the region defined by valueToFind - tolerance and valueToFind + tolerance.

      This method returns INDEX_NOT_FOUND (-1) for a null input array.

      A negative startIndex will return INDEX_NOT_FOUND (-1). A startIndex larger than the array length will search from the end of the array.

      Parameters:
      a - the array to traverse for looking for the object, may be null
      valueToFind -
      tolerance - search for value within plus/minus this amount
      startIndexFromBack - the start index to traverse backwards from
      Returns:
      the last index of the value within the array, INDEX_NOT_FOUND (-1) if not found or null array input
    • lastIndexOf

      public static int lastIndexOf(Object[] a, Object valueToFind)
      Last index of.
      Parameters:
      a -
      valueToFind -
      Returns:
      -1 if no target value/element is found in the specified Collection/Array.
    • lastIndexOf

      public static int lastIndexOf(Object[] a, Object valueToFind, int startIndexFromBack)
      Last index of.
      Parameters:
      a -
      valueToFind -
      startIndexFromBack - the start index to traverse backwards from
      Returns:
      -1 if no target value/element is found in the specified Collection/Array.
    • lastIndexOf

      public static int lastIndexOf(Collection<?> c, Object valueToFind)
      Last index of.
      Parameters:
      c -
      valueToFind -
      Returns:
      -1 if no target value/element is found in the specified Collection/Array.
    • lastIndexOf

      public static int lastIndexOf(Collection<?> c, Object valueToFind, int startIndexFromBack)
      Last index of.
      Parameters:
      c -
      valueToFind -
      startIndexFromBack - the start index to traverse backwards from
      Returns:
      -1 if no target value/element is found in the specified Collection/Array.
    • lastIndexOfSubList

      public static int lastIndexOfSubList(List<?> sourceList, List<?> subListToFind)
      Last index of sub list.
      Parameters:
      sourceList -
      subListToFind -
      Returns:
      -1 if no target value/element is found in the specified Collection/Array.
      See Also:
    • lastIndexOfSubList

      public static int lastIndexOfSubList(List<?> sourceList, List<?> subListToFind, int startIndexFromBack)
      Last index of sub list.
      Parameters:
      sourceList -
      subListToFind -
      startIndexFromBack -
      Returns:
      -1 if no target value/element is found in the specified Collection/Array.
      See Also:
    • lastIndexOfIgnoreCase

      public static int lastIndexOfIgnoreCase(String[] a, String valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
      -1 if no target value/element is found in the specified Collection/Array.
    • lastIndexOfIgnoreCase

      public static int lastIndexOfIgnoreCase(String[] a, String valueToFind, int startIndexFromBack)
      Parameters:
      a -
      valueToFind -
      startIndexFromBack -
      Returns:
    • findFirstIndex

      public static <T> u.OptionalInt findFirstIndex(T[] a, Predicate<? super T> predicate)
      Find first index.
      Type Parameters:
      T -
      Parameters:
      a -
      predicate -
      Returns:
      an OptionalInt with the index of found target value/element, or an empty OptionalInt no target value/element found.
    • findFirstIndex

      public static <T, U> u.OptionalInt findFirstIndex(T[] a, U u, BiPredicate<? super T,? super U> predicate)
      Find first index.
      Type Parameters:
      T -
      U -
      Parameters:
      a -
      u -
      predicate -
      Returns:
      an OptionalInt with the index of found target value/element, or an empty OptionalInt no target value/element found.
    • findFirstIndex

      public static <T> u.OptionalInt findFirstIndex(Collection<? extends T> c, Predicate<? super T> predicate)
      Find first index.
      Type Parameters:
      T -
      Parameters:
      c -
      predicate -
      Returns:
      an OptionalInt with the index of found target value/element, or an empty OptionalInt no target value/element found.
    • findFirstIndex

      public static <T, U> u.OptionalInt findFirstIndex(Collection<? extends T> c, U u, BiPredicate<? super T,? super U> predicate)
      Find first index.
      Type Parameters:
      T -
      U -
      Parameters:
      c -
      u -
      predicate -
      Returns:
      an OptionalInt with the index of found target value/element, or an empty OptionalInt no target value/element found.
    • findLastIndex

      public static <T> u.OptionalInt findLastIndex(T[] a, Predicate<? super T> predicate)
      Find last index.
      Type Parameters:
      T -
      Parameters:
      a -
      predicate -
      Returns:
      an OptionalInt with the index of found target value/element, or an empty OptionalInt no target value/element found.
    • findLastIndex

      public static <T, U> u.OptionalInt findLastIndex(T[] a, U u, BiPredicate<? super T,? super U> predicate)
      Find last index.
      Type Parameters:
      T -
      U -
      Parameters:
      a -
      u -
      predicate -
      Returns:
      an OptionalInt with the index of found target value/element, or an empty OptionalInt no target value/element found.
    • findLastIndex

      public static <T> u.OptionalInt findLastIndex(Collection<? extends T> c, Predicate<? super T> predicate)
      Find last index.
      Type Parameters:
      T -
      Parameters:
      c -
      predicate -
      Returns:
      an OptionalInt with the index of found target value/element, or an empty OptionalInt no target value/element found.
    • findLastIndex

      public static <T, U> u.OptionalInt findLastIndex(Collection<? extends T> c, U u, BiPredicate<? super T,? super U> predicate)
      Type Parameters:
      T -
      U -
      Parameters:
      c -
      u -
      predicate -
      Returns:
      an OptionalInt with the index of found target value/element, or an empty OptionalInt no target value/element found.
    • indicesOfAllMin

      public static <T extends Comparable<? super T>> int[] indicesOfAllMin(T[] a) throws IllegalArgumentException
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
      the indices of all minimum value/element in the specified Collection/Array.
      Throws:
      IllegalArgumentException
    • indicesOfAllMin

      public static <T> int[] indicesOfAllMin(T[] a, Comparator<? super T> cmp) throws IllegalArgumentException
      Type Parameters:
      T -
      Parameters:
      a -
      cmp -
      Returns:
      the indices of all minimum value/element in the specified Collection/Array.
      Throws:
      IllegalArgumentException
    • indicesOfAllMin

      public static <T extends Comparable<? super T>> int[] indicesOfAllMin(Collection<? extends T> c) throws IllegalArgumentException
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
      the indices of all minimum value/element in the specified Collection/Array.
      Throws:
      IllegalArgumentException
    • indicesOfAllMin

      public static <T> int[] indicesOfAllMin(Collection<? extends T> c, Comparator<? super T> cmp) throws IllegalArgumentException
      Type Parameters:
      T -
      Parameters:
      c -
      cmp -
      Returns:
      the indices of all minimum value/element in the specified Collection/Array.
      Throws:
      IllegalArgumentException
    • indicesOfAllMax

      public static <T extends Comparable<? super T>> int[] indicesOfAllMax(T[] a) throws IllegalArgumentException
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
      the indices of all maximum value/element in the specified Collection/Array.
      Throws:
      IllegalArgumentException
    • indicesOfAllMax

      public static <T> int[] indicesOfAllMax(T[] a, Comparator<? super T> cmp) throws IllegalArgumentException
      Type Parameters:
      T -
      Parameters:
      a -
      cmp -
      Returns:
      the indices of all maximum value/element in the specified Collection/Array.
      Throws:
      IllegalArgumentException
    • indicesOfAllMax

      public static <T extends Comparable<? super T>> int[] indicesOfAllMax(Collection<? extends T> c) throws IllegalArgumentException
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
      the indices of all maximum value/element in the specified Collection/Array.
      Throws:
      IllegalArgumentException
    • indicesOfAllMax

      public static <T> int[] indicesOfAllMax(Collection<? extends T> c, Comparator<? super T> cmp) throws IllegalArgumentException
      Type Parameters:
      T -
      Parameters:
      c -
      cmp -
      Returns:
      the indices of all maximum value/element in the specified Collection/Array.
      Throws:
      IllegalArgumentException
    • indicesOfAll

      public static int[] indicesOfAll(Object[] a, Object valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
      the indices of all found target value/element in the specified Collection/Array.
    • indicesOfAll

      public static int[] indicesOfAll(Object[] a, Object valueToFind, int startIndex)
      Parameters:
      a -
      valueToFind -
      startIndex -
      Returns:
      the indices of all found target value/element in the specified Collection/Array.
    • indicesOfAll

      public static int[] indicesOfAll(Collection<?> c, Object valueToFind)
      Parameters:
      c -
      valueToFind -
      Returns:
      the indices of all found target value/element in the specified Collection/Array.
    • indicesOfAll

      public static int[] indicesOfAll(Collection<?> c, Object valueToFind, int startIndex)
      Parameters:
      c -
      valueToFind -
      startIndex -
      Returns:
      the indices of all found target value/element in the specified Collection/Array.
    • indicesOfAll

      public static <T> int[] indicesOfAll(T[] a, Predicate<? super T> predicate)
      Type Parameters:
      T -
      Parameters:
      a -
      predicate -
      Returns:
      the indices of all found target value/element in the specified Collection/Array.
    • indicesOfAll

      public static <T> int[] indicesOfAll(T[] a, Predicate<? super T> predicate, int startIndex)
      Type Parameters:
      T -
      Parameters:
      a -
      predicate -
      startIndex -
      Returns:
      the indices of all found target value/element in the specified Collection/Array.
    • indicesOfAll

      public static <T> int[] indicesOfAll(Collection<? extends T> c, Predicate<? super T> predicate)
      Type Parameters:
      T -
      Parameters:
      c -
      predicate -
      Returns:
      the indices of all found target value/element in the specified Collection/Array.
    • indicesOfAll

      public static <T> int[] indicesOfAll(Collection<? extends T> c, Predicate<? super T> predicate, int fromIndex)
      Type Parameters:
      T -
      Parameters:
      c -
      predicate -
      fromIndex -
      Returns:
      the indices of all found target value/element in the specified Collection/Array.
    • isTrue

      @Beta public static boolean isTrue(Boolean bool)
      Returns true if the specified boolean is Boolean.TRUE, not null or Boolean.FALSE.
      Parameters:
      bool -
      Returns:
    • isNotTrue

      @Beta public static boolean isNotTrue(Boolean bool)
      Returns true if the specified boolean is null or Boolean.FALSE.
      Parameters:
      bool -
      Returns:
    • isFalse

      @Beta public static boolean isFalse(Boolean bool)
      Returns true if the specified boolean is Boolean.FALSE, not null or Boolean.TRUE.
      Parameters:
      bool -
      Returns:
    • isNotFalse

      @Beta public static boolean isNotFalse(Boolean bool)
      Returns true if the specified boolean is null or Boolean.TRUE.
      Parameters:
      bool -
      Returns:
    • negate

      @MayReturnNull @Beta public static Boolean negate(Boolean bool)

      Note: copied from Apache commons Lang under Apache license v2.0

      Negates the specified boolean.

      If null is passed in, null will be returned.

      NOTE: This returns null and will throw a NullPointerException if autoboxed to a boolean.

         BooleanUtils.negate(Boolean.TRUE)  = Boolean.FALSE;
         BooleanUtils.negate(Boolean.FALSE) = Boolean.TRUE;
         BooleanUtils.negate(null)          = null;
       
      Parameters:
      bool - the Boolean to negate, may be null
      Returns:
      the negated Boolean, or null if null input
    • negate

      @Beta public static void negate(boolean[] a)

      Negates boolean values in the specified boolean array

      .
      Parameters:
      a -
    • negate

      @Beta public static void negate(boolean[] a, int fromIndex, int toIndex) throws IndexOutOfBoundsException

      Negates boolean values fromIndex to toIndex in the specified boolean array

      .
      Parameters:
      a -
      fromIndex -
      toIndex -
      Throws:
      IndexOutOfBoundsException
    • unmodifiableCollection

      public static <T> Collection<T> unmodifiableCollection(Collection<? extends T> c)
      Returns an unmodifiable view of the specified Collection. Or an empty Collection if the specified collection is null.
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
      an empty Collection if the specified c is null.
    • unmodifiableList

      public static <T> List<T> unmodifiableList(List<? extends T> list)
      Returns an unmodifiable view of the specified List. Or an empty List if the specified list is null.
      Type Parameters:
      T -
      Parameters:
      list -
      Returns:
    • unmodifiableSet

      public static <T> Set<T> unmodifiableSet(Set<? extends T> s)
      Returns an unmodifiable view of the specified Set. Or an empty Set if the specified set is null.
      Type Parameters:
      T -
      Parameters:
      s -
      Returns:
    • unmodifiableSortedSet

      public static <T> SortedSet<T> unmodifiableSortedSet(SortedSet<T> s)
      Returns an unmodifiable view of the specified SortedSet. Or an empty SortedSet if the specified set is null.
      Type Parameters:
      T -
      Parameters:
      s -
      Returns:
    • unmodifiableNavigableSet

      public static <T> NavigableSet<T> unmodifiableNavigableSet(NavigableSet<T> s)
      Returns an unmodifiable view of the specified NavigableSet. Or an empty NavigableSet if the specified set is null.
      Type Parameters:
      T -
      Parameters:
      s -
      Returns:
    • unmodifiableMap

      public static <K, V> Map<K,V> unmodifiableMap(Map<? extends K,? extends V> m)
      Returns an unmodifiable view of the specified Map. Or an empty Map if the specified map is null.
      Type Parameters:
      K -
      V -
      Parameters:
      m -
      Returns:
      See Also:
    • unmodifiableSortedMap

      public static <K, V> SortedMap<K,V> unmodifiableSortedMap(SortedMap<K,? extends V> m)
      Returns an unmodifiable view of the specified SortedMap. Or an empty SortedMap if the specified map is null.
      Type Parameters:
      K -
      V -
      Parameters:
      m -
      Returns:
      See Also:
    • unmodifiableNavigableMap

      public static <K, V> NavigableMap<K,V> unmodifiableNavigableMap(NavigableMap<K,? extends V> m)
      Returns an unmodifiable view of the specified NavigableMap. Or an empty NavigableMap if the specified map is null.
      Type Parameters:
      K -
      V -
      Parameters:
      m -
      Returns:
      See Also: