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/Entity...: 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 trying to repeat/swap a null or empty string or operate Array/Collection by adding/removing...
Version:
$Revision: 0.8 $ 07/03/10
Author:
Haiyang Li
See Also:
  • Field Details

    • CPU_CORES

      public static final int CPU_CORES
    • MAX_MEMORY_IN_MB

      public static final int MAX_MEMORY_IN_MB
    • JAVA_VERSION

      public static final JavaVersion JAVA_VERSION
    • NULL_STRING

      public static final String NULL_STRING
    • NULL_CHAR_ARRAY

      public static final char[] NULL_CHAR_ARRAY
    • BYTE_0

      public static final byte BYTE_0
      See Also:
    • BYTE_1

      public static final byte BYTE_1
      See Also:
    • CHAR_0

      public static final char CHAR_0
      See Also:
    • ELEMENT_SEPARATOR

      public static final String ELEMENT_SEPARATOR
    • ELEMENT_SEPARATOR_CHAR_ARRAY

      public static final char[] ELEMENT_SEPARATOR_CHAR_ARRAY
    • 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_STRING

      public static final String EMPTY_STRING
    • EMPTY_BOOLEAN_ARRAY

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      public static final Double[] EMPTY_DOUBLE_OBJ_ARRAY
      An empty immutable Double array.
    • EMPTY_STRING_ARRAY

      public static final String[] EMPTY_STRING_ARRAY
      An empty immutable String array.
    • EMPTY_OBJECT_ARRAY

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

    • occurrencesOf

      public static int occurrencesOf(boolean[] a, boolean valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
    • occurrencesOf

      public static int occurrencesOf(char[] a, char valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
    • occurrencesOf

      public static int occurrencesOf(byte[] a, byte valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
    • occurrencesOf

      public static int occurrencesOf(short[] a, short valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
    • occurrencesOf

      public static int occurrencesOf(int[] a, int valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
    • occurrencesOf

      public static int occurrencesOf(long[] a, long valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
    • occurrencesOf

      public static int occurrencesOf(float[] a, float valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
    • occurrencesOf

      public static int occurrencesOf(double[] a, double valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
    • occurrencesOf

      public static int occurrencesOf(Object[] a, Object valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
    • occurrencesOf

      public static int occurrencesOf(Iterable<?> c, Object valueToFind)
      Parameters:
      c -
      valueToFind -
      Returns:
      See Also:
    • occurrencesOf

      public static long occurrencesOf(Iterator<?> iter, Object valueToFind)
    • occurrencesOf

      public static int occurrencesOf(String str, String substr)
      Parameters:
      str -
      substr -
      Returns:
      See Also:
    • occurrencesMap

      public static <T> Map<T,Integer> occurrencesMap(T[] a)
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
      See Also:
    • occurrencesMap

      public static <T> Map<T,Integer> occurrencesMap(T[] a, Supplier<Map<T,Integer>> mapSupplier)
      Type Parameters:
      T -
      Parameters:
      a -
      mapSupplier -
      Returns:
      See Also:
    • occurrencesMap

      public static <T> Map<T,Integer> occurrencesMap(Iterable<T> c)
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
      See Also:
    • occurrencesMap

      public static <T> Map<T,Integer> occurrencesMap(Iterable<T> c, Supplier<Map<T,Integer>> mapSupplier)
      Type Parameters:
      T -
      Parameters:
      c -
      mapSupplier -
      Returns:
      See Also:
    • occurrencesMap

      public static <T> Map<T,Integer> occurrencesMap(Iterator<T> iter)
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
      See Also:
    • occurrencesMap

      public static <T> Map<T,Integer> occurrencesMap(Iterator<T> iter, Supplier<Map<T,Integer>> mapSupplier)
      Type Parameters:
      T -
      Parameters:
      iter -
      mapSupplier -
      Returns:
      See Also:
    • contains

      public static boolean contains(boolean[] a, boolean valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
    • contains

      public static boolean contains(char[] a, char valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
    • contains

      public static boolean contains(byte[] a, byte valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
    • contains

      public static boolean contains(short[] a, short valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
    • contains

      public static boolean contains(int[] a, int valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
    • contains

      public static boolean contains(long[] a, long valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
    • contains

      public static boolean contains(float[] a, float valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
    • contains

      public static boolean contains(double[] a, double valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
    • contains

      public static boolean contains(Object[] a, Object valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
    • contains

      public static boolean contains(Collection<?> c, Object valueToFind)
      Parameters:
      c -
      valueToFind -
      Returns:
    • contains

      public static boolean contains(Iterator<?> iter, Object valueToFind)
    • containsAll

      public static boolean containsAll(Collection<?> c, Collection<?> valuesToFind)
      Parameters:
      c -
      valuesToFind - the objs to find
      Returns:
    • containsAll

      public static boolean containsAll(Collection<?> c, Object[] valuesToFind)
      Parameters:
      c -
      valuesToFind - the objs to find
      Returns:
    • containsAll

      public static boolean containsAll(Iterator<?> iter, Collection<?> valuesToFind)
    • containsAny

      public static boolean containsAny(Collection<?> c, Collection<?> valuesToFind)
      Parameters:
      c -
      valuesToFind - the objs to find
      Returns:
    • containsAny

      public static boolean containsAny(Collection<?> c, Object[] valuesToFind)
      Parameters:
      c -
      valuesToFind - the objs to find
      Returns:
    • containsAny

      public static boolean containsAny(Iterator<?> iter, Set<?> valuesToFind)
    • getOnlyElement

      public static <T> u.Nullable<T> getOnlyElement(Iterable<? extends T> iterable) throws DuplicatedResultException
      Gets the only element.
      Type Parameters:
      T -
      Parameters:
      iterable -
      Returns:
      throws DuplicatedResultException if there are more than one elements in the specified iterable.
      Throws:
      DuplicatedResultException
    • getOnlyElement

      public static <T> u.Nullable<T> getOnlyElement(Iterator<? extends T> iter) throws DuplicatedResultException
      Gets the only element.
      Type Parameters:
      T -
      Parameters:
      iter -
      Returns:
      throws DuplicatedResultException if there are more than one elements in the specified iter.
      Throws:
      DuplicatedResultException - the duplicated result exception
    • split

      public static List<boolean[]> split(boolean[] a, int chunkSize)
      Returns consecutive sub arrays of an array, each of the same size (the final list may be smaller), or an empty List if the specified array is null or empty.
      Parameters:
      a -
      chunkSize - the desired size of each sub array (the last may be smaller).
      Returns:
    • split

      public static List<boolean[]> split(boolean[] a, int fromIndex, int toIndex, int chunkSize)
      Returns consecutive sub arrays of an array, each of the same chunkSize (the final list may be smaller), or an empty List if the specified array is null or empty.
      Parameters:
      a -
      fromIndex -
      toIndex -
      chunkSize - the desired size of each sub array (the last may be smaller).
      Returns:
    • split

      public static List<char[]> split(char[] a, int chunkSize)
      Returns consecutive sub arrays of an array, each of the same chunkSize (the final list may be smaller), or an empty List if the specified array is null or empty.
      Parameters:
      a -
      chunkSize - the desired size of each sub array (the last may be smaller).
      Returns:
    • split

      public static List<char[]> split(char[] a, int fromIndex, int toIndex, int chunkSize)
      Returns consecutive sub arrays of an array, each of the same chunkSize (the final list may be smaller), or an empty List if the specified array is null or empty.
      Parameters:
      a -
      fromIndex -
      toIndex -
      chunkSize - the desired size of each sub array (the last may be smaller).
      Returns:
    • split

      public static List<byte[]> split(byte[] a, int chunkSize)
      Returns consecutive sub arrays of an array, each of the same chunkSize (the final list may be smaller), or an empty List if the specified array is null or empty.
      Parameters:
      a -
      chunkSize - the desired size of each sub array (the last may be smaller).
      Returns:
    • split

      public static List<byte[]> split(byte[] a, int fromIndex, int toIndex, int chunkSize)
      Returns consecutive sub arrays of an array, each of the same chunkSize (the final list may be smaller), or an empty List if the specified array is null or empty.
      Parameters:
      a -
      fromIndex -
      toIndex -
      chunkSize - the desired size of each sub array (the last may be smaller).
      Returns:
    • split

      public static List<short[]> split(short[] a, int chunkSize)
      Returns consecutive sub arrays of an array, each of the same chunkSize (the final list may be smaller), or an empty List if the specified array is null or empty.
      Parameters:
      a -
      chunkSize - the desired size of each sub array (the last may be smaller).
      Returns:
    • split

      public static List<short[]> split(short[] a, int fromIndex, int toIndex, int chunkSize)
      Returns consecutive sub arrays of an array, each of the same chunkSize (the final list may be smaller), or an empty List if the specified array is null or empty.
      Parameters:
      a -
      fromIndex -
      toIndex -
      chunkSize - the desired size of each sub array (the last may be smaller).
      Returns:
    • split

      public static List<int[]> split(int[] a, int chunkSize)
      Returns consecutive sub arrays of an array, each of the same chunkSize (the final list may be smaller), or an empty List if the specified array is null or empty.
      Parameters:
      a -
      chunkSize - the desired size of each sub array (the last may be smaller).
      Returns:
    • split

      public static List<int[]> split(int[] a, int fromIndex, int toIndex, int chunkSize)
      Returns consecutive sub arrays of an array, each of the same chunkSize (the final list may be smaller), or an empty List if the specified array is null or empty.
      Parameters:
      a -
      fromIndex -
      toIndex -
      chunkSize - the desired size of each sub array (the last may be smaller).
      Returns:
    • split

      public static List<long[]> split(long[] a, int chunkSize)
      Returns consecutive sub arrays of an array, each of the same chunkSize (the final list may be smaller), or an empty List if the specified array is null or empty.
      Parameters:
      a -
      chunkSize - the desired size of each sub array (the last may be smaller).
      Returns:
    • split

      public static List<long[]> split(long[] a, int fromIndex, int toIndex, int chunkSize)
      Returns consecutive sub arrays of an array, each of the same chunkSize (the final list may be smaller), or an empty List if the specified array is null or empty.
      Parameters:
      a -
      fromIndex -
      toIndex -
      chunkSize - the desired size of each sub array (the last may be smaller).
      Returns:
    • split

      public static List<float[]> split(float[] a, int chunkSize)
      Returns consecutive sub arrays of an array, each of the same chunkSize (the final list may be smaller), or an empty List if the specified array is null or empty.
      Parameters:
      a -
      chunkSize - the desired size of each sub array (the last may be smaller).
      Returns:
    • split

      public static List<float[]> split(float[] a, int fromIndex, int toIndex, int chunkSize)
      Returns consecutive sub arrays of an array, each of the same chunkSize (the final list may be smaller), or an empty List if the specified array is null or empty.
      Parameters:
      a -
      fromIndex -
      toIndex -
      chunkSize - the desired size of each sub array (the last may be smaller).
      Returns:
    • split

      public static List<double[]> split(double[] a, int chunkSize)
      Returns consecutive sub arrays of an array, each of the same chunkSize (the final list may be smaller), or an empty List if the specified array is null or empty.
      Parameters:
      a -
      chunkSize - the desired size of each sub array (the last may be smaller).
      Returns:
    • split

      public static List<double[]> split(double[] a, int fromIndex, int toIndex, int chunkSize)
      Returns consecutive sub arrays of an array, each of the same chunkSize (the final list may be smaller), or an empty List if the specified array is null or empty.
      Parameters:
      a -
      fromIndex -
      toIndex -
      chunkSize - the desired size of each sub array (the last may be smaller).
      Returns:
    • split

      public static <T> List<T[]> split(T[] a, int chunkSize)
      Returns consecutive sub arrays of an array, each of the same chunkSize (the final list may be smaller), or an empty List if the specified array is null or empty.
      Type Parameters:
      T -
      Parameters:
      a -
      chunkSize - the desired size of each sub array (the last may be smaller).
      Returns:
    • split

      public static <T> List<T[]> split(T[] a, int fromIndex, int toIndex, int chunkSize)
      Returns consecutive sub arrays of an array, each of the same chunkSize (the final list may be smaller), or an empty List if the specified array is null or empty.
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      chunkSize - the desired size of each sub array (the last may be smaller).
      Returns:
    • split

      public static <T> List<List<T>> split(Iterable<? extends T> c, int chunkSize)
      Returns consecutive sub lists of a collection, each of the same chunkSize (the final list may be smaller). or an empty List if the specified collection is null or empty. The order of elements in the original collection is kept
      Type Parameters:
      T -
      Parameters:
      c -
      chunkSize - the desired size of each sub list (the last may be smaller).
      Returns:
    • split

      public static <T> List<List<T>> split(Collection<? extends T> c, int fromIndex, int toIndex, int chunkSize)
      Returns consecutive sub lists of a collection, each of the same chunkSize (the final list may be smaller). or an empty List if the specified collection is null or empty. The order of elements in the original collection is kept
      Type Parameters:
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      chunkSize - the desired size of each sub list (the last may be smaller).
      Returns:
    • split

      public static <T> ObjIterator<List<T>> split(Iterator<? extends T> iter, int chunkSize)
    • split

      public 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.
      Parameters:
      str -
      chunkSize - the desired size of each sub String (the last may be smaller).
      Returns:
    • split

      public 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.
      Parameters:
      str -
      fromIndex -
      toIndex -
      chunkSize - the desired size of each sub String (the last may be smaller).
      Returns:
    • splitByCount

      public static <T> Stream<T> splitByCount(int maxCount, int totalSize, boolean smallerFirst, IntBiFunction<T> func)
       
       final int[] a = Array.rangeClosed(1, 7);
       splitByCount(5, 7, true, (fromIndex, toIndex) ->  N.copyOfRange(a, fromIndex, toIndex)).forEach(Fn.println()); // [[1], [2], [3], [4, 5], [6, 7]]
       splitByCount(5, 7, false, (fromIndex, toIndex) ->  N.copyOfRange(a, fromIndex, toIndex)).forEach(Fn.println()); // [[1, 2], [3, 4], [5], [6], [7]]
       
       
      Type Parameters:
      T -
      Parameters:
      maxCount - max count of chunk want to split totalSize into.
      totalSize -
      smallerFirst -
      func -
      Returns:
      the stream
    • concat

      public static boolean[] concat(boolean[] a, boolean[] b)
      Parameters:
      a -
      b -
      Returns:
    • concat

      @SafeVarargs public static boolean[] concat(boolean[]... aa)
      Parameters:
      aa -
      Returns:
    • concat

      public static char[] concat(char[] a, char[] b)
      Parameters:
      a -
      b -
      Returns:
    • concat

      @SafeVarargs public static char[] concat(char[]... aa)
      Parameters:
      aa -
      Returns:
    • concat

      public static byte[] concat(byte[] a, byte[] b)
      Parameters:
      a -
      b -
      Returns:
    • concat

      @SafeVarargs public static byte[] concat(byte[]... aa)
      Parameters:
      aa -
      Returns:
    • concat

      public static short[] concat(short[] a, short[] b)
      Parameters:
      a -
      b -
      Returns:
    • concat

      @SafeVarargs public static short[] concat(short[]... aa)
      Parameters:
      aa -
      Returns:
    • concat

      public static int[] concat(int[] a, int[] b)
      Parameters:
      a -
      b -
      Returns:
    • concat

      @SafeVarargs public static int[] concat(int[]... aa)
      Parameters:
      aa -
      Returns:
    • concat

      public static long[] concat(long[] a, long[] b)
      Parameters:
      a -
      b -
      Returns:
    • concat

      @SafeVarargs public static long[] concat(long[]... aa)
      Parameters:
      aa -
      Returns:
    • concat

      public static float[] concat(float[] a, float[] b)
      Parameters:
      a -
      b -
      Returns:
    • concat

      @SafeVarargs public static float[] concat(float[]... aa)
      Parameters:
      aa -
      Returns:
    • concat

      public static double[] concat(double[] a, double[] b)
      Parameters:
      a -
      b -
      Returns:
    • concat

      @SafeVarargs public static double[] concat(double[]... aa)
      Parameters:
      aa -
      Returns:
    • concat

      public static <T> T[] concat(T[] a, T[] b)
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      Returns:
    • concat

      @SafeVarargs public static <T> T[] concat(T[]... aa) throws IllegalArgumentException
      Type Parameters:
      T -
      Parameters:
      aa -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array is null.
    • concat

      public static <T> List<T> concat(Iterable<? extends T> a, Iterable<? extends T> b)
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      Returns:
    • concat

      @SafeVarargs public static <T> List<T> concat(Iterable<? extends T>... a)
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • concat

      public static <T> List<T> concat(Collection<? extends Iterable<? extends T>> c)
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
    • concat

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

      public static <T> ObjIterator<T> concat(Iterator<? extends T> a, Iterator<? extends T> b)
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • concat

      @SafeVarargs public static <T> ObjIterator<T> concat(Iterator<? extends T>... a)
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
      See Also:
    • intersection

      public static boolean[] intersection(boolean[] a, boolean[] b)
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • intersection

      public static char[] intersection(char[] a, char[] b)
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • intersection

      public static byte[] intersection(byte[] a, byte[] b)
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • intersection

      public static short[] intersection(short[] a, short[] b)
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • intersection

      public static int[] intersection(int[] a, int[] b)
      Returns a new array with all the elements in b removed by occurrences.
       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)
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • intersection

      public static float[] intersection(float[] a, float[] b)
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • intersection

      public static double[] intersection(double[] a, double[] b)
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • intersection

      public static <T> List<T> intersection(T[] a, Object[] b)
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • intersection

      public static <T> List<T> intersection(Collection<? extends T> a, Collection<?> b)
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • intersection

      public static <T> List<T> intersection(Collection<? extends Collection<? extends T>> c)
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
      See Also:
    • difference

      public static boolean[] difference(boolean[] a, boolean[] b)
      Returns the elements from a, but exclude the elements in b by occurrences.
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • difference

      public static char[] difference(char[] a, char[] b)
      Returns the elements from a, but exclude the elements in b by occurrences.
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • difference

      public static byte[] difference(byte[] a, byte[] b)
      Returns the elements from a, but exclude the elements in b by occurrences.
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • difference

      public static short[] difference(short[] a, short[] b)
      Returns the elements from a, but exclude the elements in b by occurrences.
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • difference

      public static int[] difference(int[] a, int[] b)
      Returns the elements from a, but exclude the elements in b by occurrences.
       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 the elements from a, but exclude the elements in b by occurrences.
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • difference

      public static float[] difference(float[] a, float[] b)
      Returns the elements from a, but exclude the elements in b by occurrences.
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • difference

      public static double[] difference(double[] a, double[] b)
      Returns the elements from a, but exclude the elements in b by occurrences.
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • difference

      public static <T> List<T> difference(T[] a, Object[] b)
      Returns the elements from a, but exclude the elements in b by occurrences.
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • difference

      public static <T> List<T> difference(Collection<? extends T> a, Collection<?> b)
      Returns the elements from a, but exclude the elements in b by occurrences.
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • symmetricDifference

      public static boolean[] symmetricDifference(boolean[] a, boolean[] b)
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • symmetricDifference

      public static char[] symmetricDifference(char[] a, char[] b)
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • symmetricDifference

      public static byte[] symmetricDifference(byte[] a, byte[] b)
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • symmetricDifference

      public static short[] symmetricDifference(short[] a, short[] b)
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • symmetricDifference

      public static int[] symmetricDifference(int[] a, int[] b)
       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)
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • symmetricDifference

      public static float[] symmetricDifference(float[] a, float[] b)
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • symmetricDifference

      public static double[] symmetricDifference(double[] a, double[] b)
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • symmetricDifference

      public static <T> List<T> symmetricDifference(T[] a, T[] b)
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • symmetricDifference

      public static <T> List<T> symmetricDifference(Collection<? extends T> a, Collection<? extends T> b)
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      Returns:
      See Also:
    • differentSet

      public static <T> Set<T> differentSet(Collection<? extends T> a, Collection<?> b)
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      Returns:
      the sets the
      See Also:
    • symmetricDifferentSet

      public static <T> Set<T> symmetricDifferentSet(Collection<? extends T> a, Collection<? extends T> b)
      Symmetric different set.
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      Returns:
      the sets the
      See Also:
    • commonSet

      public static <T> Set<T> commonSet(Collection<? extends T> a, Collection<?> b)
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      Returns:
      the sets the
      See Also:
    • commonSet

      public static <T> Set<T> commonSet(Collection<? extends Collection<? extends T>> c)
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
      the sets the
      See Also:
    • exclude

      public static <T> List<T> exclude(Collection<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<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<T> c, Collection<?> objsToExclude)
      Returns a new List with specified objsToExclude excluded. That's to say no more objsToExclude will present in the returned List.
      Parameters:
      c -
      objsToExclude -
      Returns:
      a new List
      See Also:
    • excludeAllToSet

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

      public 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.
      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
      See Also:
    • isProperSubCollection

      public static boolean isProperSubCollection(Collection<?> subColl, Collection<?> coll)
      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
      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)
      Parameters:
      a -
      oldVal -
      newVal -
      Returns:
    • replaceAll

      public static int replaceAll(char[] a, char oldVal, char newVal)
      Parameters:
      a -
      oldVal -
      newVal -
      Returns:
    • replaceAll

      public static int replaceAll(byte[] a, byte oldVal, byte newVal)
      Parameters:
      a -
      oldVal -
      newVal -
      Returns:
    • replaceAll

      public static int replaceAll(short[] a, short oldVal, short newVal)
      Parameters:
      a -
      oldVal -
      newVal -
      Returns:
    • replaceAll

      public static int replaceAll(int[] a, int oldVal, int newVal)
      Parameters:
      a -
      oldVal -
      newVal -
      Returns:
    • replaceAll

      public static int replaceAll(long[] a, long oldVal, long newVal)
      Parameters:
      a -
      oldVal -
      newVal -
      Returns:
    • replaceAll

      public static int replaceAll(float[] a, float oldVal, float newVal)
      Parameters:
      a -
      oldVal -
      newVal -
      Returns:
    • replaceAll

      public static int replaceAll(double[] a, double oldVal, double newVal)
      Parameters:
      a -
      oldVal -
      newVal -
      Returns:
    • replaceAll

      public static <T> int replaceAll(T[] a, Object oldVal, T newVal)
      Type Parameters:
      T -
      Parameters:
      a -
      oldVal -
      newVal -
      Returns:
    • replaceAll

      public static <T> int replaceAll(List<T> list, Object oldVal, T newVal)
      Type Parameters:
      T -
      Parameters:
      list -
      oldVal -
      newVal -
      Returns:
    • replaceAll

      public static <E extends Exception> void replaceAll(boolean[] a, Throwables.BooleanUnaryOperator<E> operator) throws E
      Throws:
      E extends Exception
    • replaceAll

      public static <E extends Exception> void replaceAll(char[] a, Throwables.CharUnaryOperator<E> operator) throws E
      Throws:
      E extends Exception
    • replaceAll

      public static <E extends Exception> void replaceAll(byte[] a, Throwables.ByteUnaryOperator<E> operator) throws E
      Throws:
      E extends Exception
    • replaceAll

      public static <E extends Exception> void replaceAll(short[] a, Throwables.ShortUnaryOperator<E> operator) throws E
      Throws:
      E extends Exception
    • replaceAll

      public static <E extends Exception> void replaceAll(int[] a, Throwables.IntUnaryOperator<E> operator) throws E
      Throws:
      E extends Exception
    • replaceAll

      public static <E extends Exception> void replaceAll(long[] a, Throwables.LongUnaryOperator<E> operator) throws E
      Throws:
      E extends Exception
    • replaceAll

      public static <E extends Exception> void replaceAll(float[] a, Throwables.FloatUnaryOperator<E> operator) throws E
      Throws:
      E extends Exception
    • replaceAll

      public static <E extends Exception> void replaceAll(double[] a, Throwables.DoubleUnaryOperator<E> operator) throws E
      Throws:
      E extends Exception
    • replaceAll

      public static <T, E extends Exception> void replaceAll(T[] a, Throwables.UnaryOperator<T,E> operator) throws E
      Throws:
      E extends Exception
    • replaceAll

      public static <T, E extends Exception> int replaceAll(List<T> list, Throwables.UnaryOperator<T,E> operator) throws E
      Throws:
      E extends Exception
    • replaceIf

      public static <E extends Exception> int replaceIf(boolean[] a, Throwables.BooleanPredicate<E> predicate, boolean newValue) throws E
      Throws:
      E extends Exception
    • replaceIf

      public static <E extends Exception> int replaceIf(char[] a, Throwables.CharPredicate<E> predicate, char newValue) throws E
      Throws:
      E extends Exception
    • replaceIf

      public static <E extends Exception> int replaceIf(byte[] a, Throwables.BytePredicate<E> predicate, byte newValue) throws E
      Throws:
      E extends Exception
    • replaceIf

      public static <E extends Exception> int replaceIf(short[] a, Throwables.ShortPredicate<E> predicate, short newValue) throws E
      Throws:
      E extends Exception
    • replaceIf

      public static <E extends Exception> int replaceIf(int[] a, Throwables.IntPredicate<E> predicate, int newValue) throws E
      Throws:
      E extends Exception
    • replaceIf

      public static <E extends Exception> int replaceIf(long[] a, Throwables.LongPredicate<E> predicate, long newValue) throws E
      Throws:
      E extends Exception
    • replaceIf

      public static <E extends Exception> int replaceIf(float[] a, Throwables.FloatPredicate<E> predicate, float newValue) throws E
      Throws:
      E extends Exception
    • replaceIf

      public static <E extends Exception> int replaceIf(double[] a, Throwables.DoublePredicate<E> predicate, double newValue) throws E
      Throws:
      E extends Exception
    • replaceIf

      public static <T, E extends Exception> int replaceIf(T[] a, Throwables.Predicate<? super T,E> predicate, T newValue) throws E
      Throws:
      E extends Exception
    • replaceIf

      public static <T, E extends Exception> int replaceIf(List<T> c, Throwables.Predicate<? super T,E> predicate, T newValue) throws E
      Throws:
      E extends Exception
    • add

      public static boolean[] add(boolean[] a, boolean elementToAdd)

      Copies the given array and adds the given elementToAdd at the end of the new array.

      Parameters:
      a -
      elementToAdd -
      Returns:
      A new array containing the existing elementToAdds plus the new elementToAdd
    • add

      public static char[] add(char[] a, char elementToAdd)

      Copies the given array and adds the given elementToAdd at the end of the new array.

      Parameters:
      a -
      elementToAdd -
      Returns:
      A new array containing the existing elementToAdds plus the new elementToAdd
    • add

      public static byte[] add(byte[] a, byte elementToAdd)

      Copies the given array and adds the given elementToAdd at the end of the new array.

      Parameters:
      a -
      elementToAdd -
      Returns:
      A new array containing the existing elementToAdds plus the new elementToAdd
    • add

      public static short[] add(short[] a, short elementToAdd)

      Copies the given array and adds the given elementToAdd at the end of the new array.

      Parameters:
      a -
      elementToAdd -
      Returns:
      A new array containing the existing elementToAdds plus the new elementToAdd
    • add

      public static int[] add(int[] a, int elementToAdd)

      Copies the given array and adds the given elementToAdd at the end of the new array.

      Parameters:
      a -
      elementToAdd -
      Returns:
      A new array containing the existing elementToAdds plus the new elementToAdd
    • add

      public static long[] add(long[] a, long elementToAdd)

      Copies the given array and adds the given elementToAdd at the end of the new array.

      Parameters:
      a -
      elementToAdd -
      Returns:
      A new array containing the existing elementToAdds plus the new elementToAdd
    • add

      public static float[] add(float[] a, float elementToAdd)

      Copies the given array and adds the given elementToAdd at the end of the new array.

      Parameters:
      a -
      elementToAdd -
      Returns:
      A new array containing the existing elementToAdds plus the new elementToAdd
    • add

      public static double[] add(double[] a, double elementToAdd)

      Copies the given array and adds the given elementToAdd at the end of the new array.

      Parameters:
      a -
      elementToAdd -
      Returns:
      A new array containing the existing elementToAdds plus the new elementToAdd
    • add

      public static String[] add(String[] a, String elementToAdd)

      Copies the given array and adds the given elementToAdd at the end of the new array.

      Parameters:
      a -
      elementToAdd -
      Returns:
      A new array containing the existing elementToAdds plus the new elementToAdd
    • add

      public static <T> T[] add(T[] a, T elementToAdd) throws IllegalArgumentException

      Copies the given array and adds the given elementToAdd at the end of the new array.

      Type Parameters:
      T -
      Parameters:
      a -
      elementToAdd -
      Returns:
      A new array containing the existing elementToAdds plus the new elementToAdd
      Throws:
      IllegalArgumentException - if the specified Array is null.
    • addAll

      @SafeVarargs public static boolean[] addAll(boolean[] a, boolean... elementsToAdd)

      Adds all the elementToAdds of the given arrays into a new array.

      Parameters:
      a - the first array whose elementToAdds are added to the new array.
      elementsToAdd - the second array whose elementToAdds are added to the new array.
      Returns:
      A new array containing the elementToAdds from a and b
    • addAll

      @SafeVarargs public static char[] addAll(char[] a, char... elementsToAdd)

      Adds all the elementToAdds of the given arrays into a new array.

      Parameters:
      a - the first array whose elementToAdds are added to the new array.
      elementsToAdd - the second array whose elementToAdds are added to the new array.
      Returns:
      A new array containing the elementToAdds from a and b
    • addAll

      @SafeVarargs public static byte[] addAll(byte[] a, byte... elementsToAdd)

      Adds all the elementToAdds of the given arrays into a new array.

      Parameters:
      a - the first array whose elementToAdds are added to the new array.
      elementsToAdd - the second array whose elementToAdds are added to the new array.
      Returns:
      A new array containing the elementToAdds from a and b
    • addAll

      @SafeVarargs public static short[] addAll(short[] a, short... elementsToAdd)

      Adds all the elementToAdds of the given arrays into a new array.

      Parameters:
      a - the first array whose elementToAdds are added to the new array.
      elementsToAdd - the second array whose elementToAdds are added to the new array.
      Returns:
      A new array containing the elementToAdds from a and b
    • addAll

      @SafeVarargs public static int[] addAll(int[] a, int... elementsToAdd)

      Adds all the elementToAdds of the given arrays into a new array.

      Parameters:
      a - the first array whose elementToAdds are added to the new array.
      elementsToAdd - the second array whose elementToAdds are added to the new array.
      Returns:
      A new array containing the elementToAdds from a and b
    • addAll

      @SafeVarargs public static long[] addAll(long[] a, long... elementsToAdd)

      Adds all the elementToAdds of the given arrays into a new array.

      Parameters:
      a - the first array whose elementToAdds are added to the new array.
      elementsToAdd - the second array whose elementToAdds are added to the new array.
      Returns:
      A new array containing the elementToAdds from a and b
    • addAll

      @SafeVarargs public static float[] addAll(float[] a, float... elementsToAdd)

      Adds all the elementToAdds of the given arrays into a new array.

      Parameters:
      a - the first array whose elementToAdds are added to the new array.
      elementsToAdd - the second array whose elementToAdds are added to the new array.
      Returns:
      A new array containing the elementToAdds from a and b
    • addAll

      @SafeVarargs public static double[] addAll(double[] a, double... elementsToAdd)

      Adds all the elementToAdds of the given arrays into a new array.

      Parameters:
      a - the first array whose elementToAdds are added to the new array.
      elementsToAdd - the second array whose elementToAdds are added to the new array.
      Returns:
      A new array containing the elementToAdds from a and b
    • addAll

      @SafeVarargs public static String[] addAll(String[] a, String... elementsToAdd)

      Adds all the elementToAdds of the given arrays into a new array.

      Parameters:
      a - the first array whose elementToAdds are added to the new array.
      elementsToAdd - the second array whose elementToAdds are added to the new array.
      Returns:
      A new array containing the elementToAdds from a and b
    • addAll

      @SafeVarargs public static <T> T[] addAll(T[] a, T... elementsToAdd) throws IllegalArgumentException

      Adds all the elementToAdds of the given arrays into a new array.

      Type Parameters:
      T -
      Parameters:
      a - the first array whose elementToAdds are added to the new array.
      elementsToAdd - the second array whose elementToAdds are added to the new array.
      Returns:
      A new array containing the elementToAdds from a and b
      Throws:
      IllegalArgumentException - if the specified Array is null.
    • addAll

      public static <T> boolean addAll(Collection<T> c, Iterator<? extends T> elementsToAdd) throws IllegalArgumentException
      Type Parameters:
      T -
      Parameters:
      c -
      elementsToAdd -
      Returns:
      true if the specified Collection c has been modified.
      Throws:
      IllegalArgumentException
    • insert

      public static boolean[] insert(boolean[] a, int index, boolean elementToInsert)

      Inserts the specified elementToInsert at the specified position in the array. Shifts the elementToInsert currently at that position (if any) and any subsequent elementToInserts to the right (adds one to their indices).

      This method returns a new array with the same elementToInserts of the input array plus the given elementToInsert on the specified position. The component type of the returned array is always the same as that of the input array.

      Parameters:
      a -
      index - the position of the new object
      elementToInsert - the object to add
      Returns:
      A new array containing the existing elementToInserts and the new elementToInsert
    • insert

      public static char[] insert(char[] a, int index, char elementToInsert)

      Inserts the specified elementToInsert at the specified position in the array. Shifts the elementToInsert currently at that position (if any) and any subsequent elementToInserts to the right (adds one to their indices).

      This method returns a new array with the same elementToInserts of the input array plus the given elementToInsert on the specified position. The component type of the returned array is always the same as that of the input array.

      Parameters:
      a -
      index - the position of the new object
      elementToInsert - the object to add
      Returns:
      A new array containing the existing elementToInserts and the new elementToInsert
    • insert

      public static byte[] insert(byte[] a, int index, byte elementToInsert)

      Inserts the specified elementToInsert at the specified position in the array. Shifts the elementToInsert currently at that position (if any) and any subsequent elementToInserts to the right (adds one to their indices).

      This method returns a new array with the same elementToInserts of the input array plus the given elementToInsert on the specified position. The component type of the returned array is always the same as that of the input array.

      Parameters:
      a -
      index - the position of the new object
      elementToInsert - the object to add
      Returns:
      A new array containing the existing elementToInserts and the new elementToInsert
    • insert

      public static short[] insert(short[] a, int index, short elementToInsert)

      Inserts the specified elementToInsert at the specified position in the array. Shifts the elementToInsert currently at that position (if any) and any subsequent elementToInserts to the right (adds one to their indices).

      This method returns a new array with the same elementToInserts of the input array plus the given elementToInsert on the specified position. The component type of the returned array is always the same as that of the input array.

      Parameters:
      a -
      index - the position of the new object
      elementToInsert - the object to add
      Returns:
      A new array containing the existing elementToInserts and the new elementToInsert
    • insert

      public static int[] insert(int[] a, int index, int elementToInsert)

      Inserts the specified elementToInsert at the specified position in the array. Shifts the elementToInsert currently at that position (if any) and any subsequent elementToInserts to the right (adds one to their indices).

      This method returns a new array with the same elementToInserts of the input array plus the given elementToInsert on the specified position. The component type of the returned array is always the same as that of the input array.

      Parameters:
      a -
      index - the position of the new object
      elementToInsert - the object to add
      Returns:
      A new array containing the existing elementToInserts and the new elementToInsert
    • insert

      public static long[] insert(long[] a, int index, long elementToInsert)

      Inserts the specified elementToInsert at the specified position in the array. Shifts the elementToInsert currently at that position (if any) and any subsequent elementToInserts to the right (adds one to their indices).

      This method returns a new array with the same elementToInserts of the input array plus the given elementToInsert on the specified position. The component type of the returned array is always the same as that of the input array.

      Parameters:
      a -
      index - the position of the new object
      elementToInsert - the object to add
      Returns:
      A new array containing the existing elementToInserts and the new elementToInsert
    • insert

      public static float[] insert(float[] a, int index, float elementToInsert)

      Inserts the specified elementToInsert at the specified position in the array. Shifts the elementToInsert currently at that position (if any) and any subsequent elementToInserts to the right (adds one to their indices).

      This method returns a new array with the same elementToInserts of the input array plus the given elementToInsert on the specified position. The component type of the returned array is always the same as that of the input array.

      Parameters:
      a -
      index - the position of the new object
      elementToInsert - the object to add
      Returns:
      A new array containing the existing elementToInserts and the new elementToInsert
    • insert

      public static double[] insert(double[] a, int index, double elementToInsert)

      Inserts the specified elementToInsert at the specified position in the array. Shifts the elementToInsert currently at that position (if any) and any subsequent elementToInserts to the right (adds one to their indices).

      This method returns a new array with the same elementToInserts of the input array plus the given elementToInsert on the specified position. The component type of the returned array is always the same as that of the input array.

      Parameters:
      a -
      index - the position of the new object
      elementToInsert - the object to add
      Returns:
      A new array containing the existing elementToInserts and the new elementToInsert
    • insert

      public static String[] insert(String[] a, int index, String elementToInsert)
      Parameters:
      a -
      index -
      elementToInsert -
      Returns:
    • insert

      public static <T> T[] insert(T[] a, int index, T elementToInsert) throws IllegalArgumentException

      Inserts the specified elementToInsert at the specified position in the array. Shifts the elementToInsert currently at that position (if any) and any subsequent elementToInserts to the right (adds one to their indices).

      This method returns a new array with the same elementToInserts of the input array plus the given elementToInsert on the specified position. The component type of the returned array is always the same as that of the input array.

      Type Parameters:
      T -
      Parameters:
      a -
      index - the position of the new object
      elementToInsert - the object to add
      Returns:
      A new array containing the existing elementToInserts and the new elementToInsert
      Throws:
      IllegalArgumentException - if the specified Array is null.
    • insert

      public static String insert(String str, int index, String strToInsert)
      Returns a new String
      Parameters:
      str -
      index -
      strToInsert -
      Returns:
      a new String
    • insertAll

      @SafeVarargs public static boolean[] insertAll(boolean[] a, int index, boolean... elementsToInsert)

      Inserts the specified elementToInserts at the specified position in the array. Shifts the elementToInsert currently at that position (if any) and any subsequent elementToInserts to the right (adds one to their indices).

      Parameters:
      a - the first array whose elementToInserts are added to the new array.
      index - the position of the new elementToInserts start from
      elementsToInsert - the second array whose elementToInserts are added to the new array.
      Returns:
      A new array containing the elementToInserts from a and b
    • insertAll

      @SafeVarargs public static char[] insertAll(char[] a, int index, char... elementsToInsert)

      Inserts the specified elementToInserts at the specified position in the array. Shifts the elementToInsert currently at that position (if any) and any subsequent elementToInserts to the right (adds one to their indices).

      Parameters:
      a - the first array whose elementToInserts are added to the new array.
      index - the position of the new elementToInserts start from
      elementsToInsert - the second array whose elementToInserts are added to the new array.
      Returns:
      A new array containing the elementToInserts from a and b
    • insertAll

      @SafeVarargs public static byte[] insertAll(byte[] a, int index, byte... elementsToInsert)

      Inserts the specified elementToInserts at the specified position in the array. Shifts the elementToInsert currently at that position (if any) and any subsequent elementToInserts to the right (adds one to their indices).

      Parameters:
      a - the first array whose elementToInserts are added to the new array.
      index - the position of the new elementToInserts start from
      elementsToInsert - the second array whose elementToInserts are added to the new array.
      Returns:
      A new array containing the elementToInserts from a and b
    • insertAll

      @SafeVarargs public static short[] insertAll(short[] a, int index, short... elementsToInsert)

      Inserts the specified elementToInserts at the specified position in the array. Shifts the elementToInsert currently at that position (if any) and any subsequent elementToInserts to the right (adds one to their indices).

      Parameters:
      a - the first array whose elementToInserts are added to the new array.
      index - the position of the new elementToInserts start from
      elementsToInsert - the second array whose elementToInserts are added to the new array.
      Returns:
      A new array containing the elementToInserts from a and b
    • insertAll

      @SafeVarargs public static int[] insertAll(int[] a, int index, int... elementsToInsert)

      Inserts the specified elementToInserts at the specified position in the array. Shifts the elementToInsert currently at that position (if any) and any subsequent elementToInserts to the right (adds one to their indices).

      Parameters:
      a - the first array whose elementToInserts are added to the new array.
      index - the position of the new elementToInserts start from
      elementsToInsert - the second array whose elementToInserts are added to the new array.
      Returns:
      A new array containing the elementToInserts from a and b
    • insertAll

      @SafeVarargs public static long[] insertAll(long[] a, int index, long... elementsToInsert)

      Inserts the specified elementToInserts at the specified position in the array. Shifts the elementToInsert currently at that position (if any) and any subsequent elementToInserts to the right (adds one to their indices).

      Parameters:
      a - the first array whose elementToInserts are added to the new array.
      index - the position of the new elementToInserts start from
      elementsToInsert - the second array whose elementToInserts are added to the new array.
      Returns:
      A new array containing the elementToInserts from a and b
    • insertAll

      @SafeVarargs public static float[] insertAll(float[] a, int index, float... elementsToInsert)

      Inserts the specified elementToInserts at the specified position in the array. Shifts the elementToInsert currently at that position (if any) and any subsequent elementToInserts to the right (adds one to their indices).

      Parameters:
      a - the first array whose elementToInserts are added to the new array.
      index - the position of the new elementToInserts start from
      elementsToInsert - the second array whose elementToInserts are added to the new array.
      Returns:
      A new array containing the elementToInserts from a and b
    • insertAll

      @SafeVarargs public static double[] insertAll(double[] a, int index, double... elementsToInsert)

      Inserts the specified elementToInserts at the specified position in the array. Shifts the elementToInsert currently at that position (if any) and any subsequent elementToInserts to the right (adds one to their indices).

      Parameters:
      a - the first array whose elementToInserts are added to the new array.
      index - the position of the new elementToInserts start from
      elementsToInsert - the second array whose elementToInserts are added to the new array.
      Returns:
      A new array containing the elementToInserts from a and b
    • insertAll

      @SafeVarargs public static String[] insertAll(String[] a, int index, String... elementsToInsert)
      Parameters:
      a -
      index -
      elementsToInsert -
      Returns:
    • insertAll

      @SafeVarargs public static <T> T[] insertAll(T[] a, int index, T... elementsToInsert) throws IllegalArgumentException

      Inserts the specified elementToInserts at the specified position in the array. Shifts the elementToInsert currently at that position (if any) and any subsequent elementToInserts to the right (adds one to their indices).

      Type Parameters:
      T -
      Parameters:
      a - the first array whose elementToInserts are added to the new array.
      index - the position of the new elementToInserts start from
      elementsToInsert - the second array whose elementToInserts are added to the new array.
      Returns:
      A new array containing the elementToInserts from a and b
      Throws:
      IllegalArgumentException - if the specified Array is null.
    • delete

      public static boolean[] delete(boolean[] a, int index)

      Removes the element at the specified position from the specified array. All subsequent elements are shifted to the left (subtracts one from their indices).

      This method returns a new array with the same elements of the input array except the element on the specified position. The component type of the returned array is always the same as that of the input array.

      Parameters:
      a -
      index - the position of the element to be removed
      Returns:
      A new array containing the existing elements except the element at the specified position.
    • delete

      public static char[] delete(char[] a, int index)

      Removes the element at the specified position from the specified array. All subsequent elements are shifted to the left (subtracts one from their indices).

      This method returns a new array with the same elements of the input array except the element on the specified position. The component type of the returned array is always the same as that of the input array.

      Parameters:
      a -
      index - the position of the element to be removed
      Returns:
      A new array containing the existing elements except the element at the specified position.
    • delete

      public static byte[] delete(byte[] a, int index)

      Removes the element at the specified position from the specified array. All subsequent elements are shifted to the left (subtracts one from their indices).

      This method returns a new array with the same elements of the input array except the element on the specified position. The component type of the returned array is always the same as that of the input array.

      Parameters:
      a -
      index - the position of the element to be removed
      Returns:
      A new array containing the existing elements except the element at the specified position.
    • delete

      public static short[] delete(short[] a, int index)

      Removes the element at the specified position from the specified array. All subsequent elements are shifted to the left (subtracts one from their indices).

      This method returns a new array with the same elements of the input array except the element on the specified position. The component type of the returned array is always the same as that of the input array.

      Parameters:
      a -
      index - the position of the element to be removed
      Returns:
      A new array containing the existing elements except the element at the specified position.
    • delete

      public static int[] delete(int[] a, int index)

      Removes the element at the specified position from the specified array. All subsequent elements are shifted to the left (subtracts one from their indices).

      This method returns a new array with the same elements of the input array except the element on the specified position. The component type of the returned array is always the same as that of the input array.

      Parameters:
      a -
      index - the position of the element to be removed
      Returns:
      A new array containing the existing elements except the element at the specified position.
    • delete

      public static long[] delete(long[] a, int index)

      Removes the element at the specified position from the specified array. All subsequent elements are shifted to the left (subtracts one from their indices).

      This method returns a new array with the same elements of the input array except the element on the specified position. The component type of the returned array is always the same as that of the input array.

      Parameters:
      a -
      index - the position of the element to be removed
      Returns:
      A new array containing the existing elements except the element at the specified position.
    • delete

      public static float[] delete(float[] a, int index)

      Removes the element at the specified position from the specified array. All subsequent elements are shifted to the left (subtracts one from their indices).

      This method returns a new array with the same elements of the input array except the element on the specified position. The component type of the returned array is always the same as that of the input array.

      Parameters:
      a -
      index - the position of the element to be removed
      Returns:
      A new array containing the existing elements except the element at the specified position.
    • delete

      public static double[] delete(double[] a, int index)

      Removes the element at the specified position from the specified array. All subsequent elements are shifted to the left (subtracts one from their indices).

      This method returns a new array with the same elements of the input array except the element on the specified position. The component type of the returned array is always the same as that of the input array.

      Parameters:
      a -
      index - the position of the element to be removed
      Returns:
      A new array containing the existing elements except the element at the specified position.
    • delete

      public static <T> T[] delete(T[] a, int index) throws IllegalArgumentException

      Removes the element at the specified position from the specified array. All subsequent elements are shifted to the left (subtracts one from their indices).

      This method returns a new array with the same elements of the input array except the element on the specified position. The component type of the returned array is always the same as that of the input array.

      Type Parameters:
      T - the component type of the array
      Parameters:
      a -
      index - the position of the element to be removed
      Returns:
      A new array containing the existing elements except the element at the specified position.
      Throws:
      IllegalArgumentException - if the specified Array is null.
    • deleteAll

      @SafeVarargs public static boolean[] deleteAll(boolean[] a, int... indices)

      Removes the elements at the specified positions from the specified array. All remaining elements are shifted to the left.

      This method returns a new array with the same elements of the input array except those at the specified positions. The component type of the returned array is always the same as that of the input array.

      If the input array is null, an IndexOutOfBoundsException will be thrown, because in that case no valid index can be specified.

       N.deleteAll([true, false, true], 0, 2) = [false]
       N.removeAll([true, false, true], 1, 2) = [true]
       
      Parameters:
      a - the array to remove the element from, may not be null
      indices - the positions of the elements to be removed
      Returns:
      A new array containing the existing elements except those at the specified positions.
    • deleteAll

      @SafeVarargs public static char[] deleteAll(char[] a, int... indices)

      Removes the elements at the specified positions from the specified array. All remaining elements are shifted to the left.

      This method returns a new array with the same elements of the input array except those at the specified positions. The component type of the returned array is always the same as that of the input array.

       N.deleteAll([1], 0)             = []
       N.deleteAll([2, 6], 0)          = [6]
       N.deleteAll([2, 6], 0, 1)       = []
       N.deleteAll([2, 6, 3], 1, 2)    = [2]
       N.deleteAll([2, 6, 3], 0, 2)    = [6]
       N.deleteAll([2, 6, 3], 0, 1, 2) = []
       
      Parameters:
      a -
      indices - the positions of the elements to be removed
      Returns:
      A new array containing the existing elements except those at the specified positions.
    • deleteAll

      @SafeVarargs public static byte[] deleteAll(byte[] a, int... indices)

      Removes the elements at the specified positions from the specified array. All remaining elements are shifted to the left.

      This method returns a new array with the same elements of the input array except those at the specified positions. The component type of the returned array is always the same as that of the input array.

       N.deleteAll([1], 0)             = []
       N.deleteAll([2, 6], 0)          = [6]
       N.deleteAll([2, 6], 0, 1)       = []
       N.deleteAll([2, 6, 3], 1, 2)    = [2]
       N.deleteAll([2, 6, 3], 0, 2)    = [6]
       N.deleteAll([2, 6, 3], 0, 1, 2) = []
       
      Parameters:
      a -
      indices - the positions of the elements to be removed
      Returns:
      A new array containing the existing elements except those at the specified positions.
    • deleteAll

      @SafeVarargs public static short[] deleteAll(short[] a, int... indices)

      Removes the elements at the specified positions from the specified array. All remaining elements are shifted to the left.

      This method returns a new array with the same elements of the input array except those at the specified positions. The component type of the returned array is always the same as that of the input array.

       N.deleteAll([1], 0)             = []
       N.deleteAll([2, 6], 0)          = [6]
       N.deleteAll([2, 6], 0, 1)       = []
       N.deleteAll([2, 6, 3], 1, 2)    = [2]
       N.deleteAll([2, 6, 3], 0, 2)    = [6]
       N.deleteAll([2, 6, 3], 0, 1, 2) = []
       
      Parameters:
      a -
      indices - the positions of the elements to be removed
      Returns:
      A new array containing the existing elements except those at the specified positions.
    • deleteAll

      @SafeVarargs public static int[] deleteAll(int[] a, int... indices)

      Removes the elements at the specified positions from the specified array. All remaining elements are shifted to the left.

      This method returns a new array with the same elements of the input array except those at the specified positions. The component type of the returned array is always the same as that of the input array.

       N.deleteAll([1], 0)             = []
       N.deleteAll([2, 6], 0)          = [6]
       N.deleteAll([2, 6], 0, 1)       = []
       N.deleteAll([2, 6, 3], 1, 2)    = [2]
       N.deleteAll([2, 6, 3], 0, 2)    = [6]
       N.deleteAll([2, 6, 3], 0, 1, 2) = []
       
      Parameters:
      a -
      indices - the positions of the elements to be removed
      Returns:
      A new array containing the existing elements except those at the specified positions.
      Throws:
      IndexOutOfBoundsException - if any index is out of range (index < 0 || index >= array.length), or if the array is null.
    • deleteAll

      @SafeVarargs public static long[] deleteAll(long[] a, int... indices)

      Removes the elements at the specified positions from the specified array. All remaining elements are shifted to the left.

      This method returns a new array with the same elements of the input array except those at the specified positions. The component type of the returned array is always the same as that of the input array.

       N.deleteAll([1], 0)             = []
       N.deleteAll([2, 6], 0)          = [6]
       N.deleteAll([2, 6], 0, 1)       = []
       N.deleteAll([2, 6, 3], 1, 2)    = [2]
       N.deleteAll([2, 6, 3], 0, 2)    = [6]
       N.deleteAll([2, 6, 3], 0, 1, 2) = []
       
      Parameters:
      a - the array to remove the element from, may not be null
      indices - the positions of the elements to be removed
      Returns:
      A new array containing the existing elements except those at the specified positions.
    • deleteAll

      @SafeVarargs public static float[] deleteAll(float[] a, int... indices)

      Removes the elements at the specified positions from the specified array. All remaining elements are shifted to the left.

      This method returns a new array with the same elements of the input array except those at the specified positions. The component type of the returned array is always the same as that of the input array.

       N.deleteAll([1], 0)             = []
       N.deleteAll([2, 6], 0)          = [6]
       N.deleteAll([2, 6], 0, 1)       = []
       N.deleteAll([2, 6, 3], 1, 2)    = [2]
       N.deleteAll([2, 6, 3], 0, 2)    = [6]
       N.deleteAll([2, 6, 3], 0, 1, 2) = []
       
      Parameters:
      a -
      indices - the positions of the elements to be removed
      Returns:
      A new array containing the existing elements except those at the specified positions.
    • deleteAll

      @SafeVarargs public static double[] deleteAll(double[] a, int... indices)

      Removes the elements at the specified positions from the specified array. All remaining elements are shifted to the left.

      This method returns a new array with the same elements of the input array except those at the specified positions. The component type of the returned array is always the same as that of the input array.

       N.deleteAll([1], 0)             = []
       N.deleteAll([2, 6], 0)          = [6]
       N.deleteAll([2, 6], 0, 1)       = []
       N.deleteAll([2, 6, 3], 1, 2)    = [2]
       N.deleteAll([2, 6, 3], 0, 2)    = [6]
       N.deleteAll([2, 6, 3], 0, 1, 2) = []
       
      Parameters:
      a -
      indices - the positions of the elements to be removed
      Returns:
      A new array containing the existing elements except those at the specified positions.
    • deleteAll

      @SafeVarargs public static String[] deleteAll(String[] a, int... indices) throws IllegalArgumentException
      Throws:
      IllegalArgumentException
    • deleteAll

      @SafeVarargs public static <T> T[] deleteAll(T[] a, int... indices) throws IllegalArgumentException

      Removes the elements at the specified positions from the specified array. All remaining elements are shifted to the left.

      This method returns a new array with the same elements of the input array except those at the specified positions. The component type of the returned array is always the same as that of the input array.

       N.deleteAll(["a", "b", "c"], 0, 2) = ["b"]
       N.deleteAll(["a", "b", "c"], 1, 2) = ["a"]
       
      Type Parameters:
      T - the component type of the array
      Parameters:
      a -
      indices - the positions of the elements to be removed
      Returns:
      A new array containing the existing elements except those at the specified positions.
      Throws:
      IllegalArgumentException - if the specified Array is null.
    • deleteAll

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

      public static boolean[] remove(boolean[] a, boolean elementToRemove)

      Removes the first occurrence of the specified elementToRemove from the specified array. All subsequent elementsToRemove are shifted to the left (subtracts one from their indices). If the array doesn't contains such an elementToRemove, no elementsToRemove are removed from the array.

      This method returns a new array with the same elementsToRemove of the input array except the first occurrence of the specified elementToRemove. The component type of the returned array is always the same as that of the input array.

      Parameters:
      a -
      elementToRemove - the elementToRemove to be removed
      Returns:
      A new array containing the existing elementsToRemove except the first occurrence of the specified elementToRemove.
    • remove

      public static char[] remove(char[] a, char elementToRemove)

      Removes the first occurrence of the specified elementToRemove from the specified array. All subsequent elementsToRemove are shifted to the left (subtracts one from their indices). If the array doesn't contains such an elementToRemove, no elementsToRemove are removed from the array.

      This method returns a new array with the same elementsToRemove of the input array except the first occurrence of the specified elementToRemove. The component type of the returned array is always the same as that of the input array.

      Parameters:
      a -
      elementToRemove - the elementToRemove to be removed
      Returns:
      A new array containing the existing elementsToRemove except the first occurrence of the specified elementToRemove.
    • remove

      public static byte[] remove(byte[] a, byte elementToRemove)

      Removes the first occurrence of the specified elementToRemove from the specified array. All subsequent elementsToRemove are shifted to the left (subtracts one from their indices). If the array doesn't contains such an elementToRemove, no elementsToRemove are removed from the array.

      This method returns a new array with the same elementsToRemove of the input array except the first occurrence of the specified elementToRemove. The component type of the returned array is always the same as that of the input array.

      Parameters:
      a -
      elementToRemove - the elementToRemove to be removed
      Returns:
      A new array containing the existing elementsToRemove except the first occurrence of the specified elementToRemove.
    • remove

      public static short[] remove(short[] a, short elementToRemove)

      Removes the first occurrence of the specified elementToRemove from the specified array. All subsequent elementsToRemove are shifted to the left (subtracts one from their indices). If the array doesn't contains such an elementToRemove, no elementsToRemove are removed from the array.

      This method returns a new array with the same elementsToRemove of the input array except the first occurrence of the specified elementToRemove. The component type of the returned array is always the same as that of the input array.

      Parameters:
      a -
      elementToRemove - the elementToRemove to be removed
      Returns:
      A new array containing the existing elementsToRemove except the first occurrence of the specified elementToRemove.
    • remove

      public static int[] remove(int[] a, int elementToRemove)

      Removes the first occurrence of the specified elementToRemove from the specified array. All subsequent elementsToRemove are shifted to the left (subtracts one from their indices). If the array doesn't contains such an elementToRemove, no elementsToRemove are removed from the array.

      This method returns a new array with the same elementsToRemove of the input array except the first occurrence of the specified elementToRemove. The component type of the returned array is always the same as that of the input array.

      Parameters:
      a -
      elementToRemove - the elementToRemove to be removed
      Returns:
      A new array containing the existing elementsToRemove except the first occurrence of the specified elementToRemove.
    • remove

      public static long[] remove(long[] a, long elementToRemove)

      Removes the first occurrence of the specified elementToRemove from the specified array. All subsequent elementsToRemove are shifted to the left (subtracts one from their indices). If the array doesn't contains such an elementToRemove, no elementsToRemove are removed from the array.

      This method returns a new array with the same elementsToRemove of the input array except the first occurrence of the specified elementToRemove. The component type of the returned array is always the same as that of the input array.

      Parameters:
      a -
      elementToRemove - the elementToRemove to be removed
      Returns:
      A new array containing the existing elementsToRemove except the first occurrence of the specified elementToRemove.
    • remove

      public static float[] remove(float[] a, float elementToRemove)

      Removes the first occurrence of the specified elementToRemove from the specified array. All subsequent elementsToRemove are shifted to the left (subtracts one from their indices). If the array doesn't contains such an elementToRemove, no elementsToRemove are removed from the array.

      This method returns a new array with the same elementsToRemove of the input array except the first occurrence of the specified elementToRemove. The component type of the returned array is always the same as that of the input array.

      Parameters:
      a -
      elementToRemove - the elementToRemove to be removed
      Returns:
      A new array containing the existing elementsToRemove except the first occurrence of the specified elementToRemove.
    • remove

      public static double[] remove(double[] a, double elementToRemove)

      Removes the first occurrence of the specified elementToRemove from the specified array. All subsequent elementsToRemove are shifted to the left (subtracts one from their indices). If the array doesn't contains such an elementToRemove, no elementsToRemove are removed from the array.

      This method returns a new array with the same elementsToRemove of the input array except the first occurrence of the specified elementToRemove. The component type of the returned array is always the same as that of the input array.

      Parameters:
      a -
      elementToRemove - the elementToRemove to be removed
      Returns:
      A new array containing the existing elementsToRemove except the first occurrence of the specified elementToRemove.
    • remove

      public static String[] remove(String[] a, String elementToRemove)
    • remove

      public static <T> T[] remove(T[] a, T elementToRemove) throws IllegalArgumentException

      Removes the first occurrence of the specified elementToRemove from the specified array. All subsequent elementsToRemove are shifted to the left (subtracts one from their indices). If the array doesn't contains such an elementToRemove, no elementsToRemove are removed from the array.

      This method returns a new array with the same elementsToRemove of the input array except the first occurrence of the specified elementToRemove. The component type of the returned array is always the same as that of the input array.

      Type Parameters:
      T -
      Parameters:
      a -
      elementToRemove - the elementToRemove to be removed
      Returns:
      A new array containing the existing elementsToRemove except the first occurrence of the specified elementToRemove.
      Throws:
      IllegalArgumentException - if the specified Array is null.
    • remove

      public static <T> boolean remove(Collection<T> c, T elementToRemove)

      Removes the first occurrence of the specified elementToRemove from the specified collection. If the collection doesn't contains such an elementToRemove, no elementsToRemove are removed from the collection.

      Parameters:
      c -
      elementToRemove - the elementToRemove to be removed
      Returns:
      true if this collection changed as a result of the call
    • removeAllOccurrences

      public static boolean[] removeAllOccurrences(boolean[] a, boolean elementToRemove)
      Removes all the occurrences of the specified elementToRemove from the specified array. All subsequent elementsToRemove are shifted to the left (subtracts one from their indices). If the array doesn't contains such an elementToRemove, no elementsToRemove are removed from the array.
      Parameters:
      a -
      elementToRemove -
      Returns:
      A new array containing the existing elementsToRemove except the occurrences of the specified elementToRemove.
    • removeAllOccurrences

      public static char[] removeAllOccurrences(char[] a, char elementToRemove)
      Removes all the occurrences of the specified elementToRemove from the specified array. All subsequent elementsToRemove are shifted to the left (subtracts one from their indices). If the array doesn't contains such an elementToRemove, no elementsToRemove are removed from the array.
      Parameters:
      a -
      elementToRemove -
      Returns:
      A new array containing the existing elementsToRemove except the occurrences of the specified elementToRemove.
    • removeAllOccurrences

      public static byte[] removeAllOccurrences(byte[] a, byte elementToRemove)
      Removes all the occurrences of the specified elementToRemove from the specified array. All subsequent elementsToRemove are shifted to the left (subtracts one from their indices). If the array doesn't contains such an elementToRemove, no elementsToRemove are removed from the array.
      Parameters:
      a -
      elementToRemove -
      Returns:
      A new array containing the existing elementsToRemove except the occurrences of the specified elementToRemove.
    • removeAllOccurrences

      public static short[] removeAllOccurrences(short[] a, short elementToRemove)
      Removes all the occurrences of the specified elementToRemove from the specified array. All subsequent elementsToRemove are shifted to the left (subtracts one from their indices). If the array doesn't contains such an elementToRemove, no elementsToRemove are removed from the array.
      Parameters:
      a -
      elementToRemove -
      Returns:
      A new array containing the existing elementsToRemove except the occurrences of the specified elementToRemove.
    • removeAllOccurrences

      public static int[] removeAllOccurrences(int[] a, int elementToRemove)
      Removes all the occurrences of the specified elementToRemove from the specified array. All subsequent elementsToRemove are shifted to the left (subtracts one from their indices). If the array doesn't contains such an elementToRemove, no elementsToRemove are removed from the array.
      Parameters:
      a -
      elementToRemove -
      Returns:
      A new array containing the existing elementsToRemove except the occurrences of the specified elementToRemove.
    • removeAllOccurrences

      public static long[] removeAllOccurrences(long[] a, long elementToRemove)
      Removes all the occurrences of the specified elementToRemove from the specified array. All subsequent elementsToRemove are shifted to the left (subtracts one from their indices). If the array doesn't contains such an elementToRemove, no elementsToRemove are removed from the array.
      Parameters:
      a -
      elementToRemove -
      Returns:
      A new array containing the existing elementsToRemove except the occurrences of the specified elementToRemove.
    • removeAllOccurrences

      public static float[] removeAllOccurrences(float[] a, float elementToRemove)
      Removes all the occurrences of the specified elementToRemove from the specified array. All subsequent elementsToRemove are shifted to the left (subtracts one from their indices). If the array doesn't contains such an elementToRemove, no elementsToRemove are removed from the array.
      Parameters:
      a -
      elementToRemove -
      Returns:
      A new array containing the existing elementsToRemove except the occurrences of the specified elementToRemove.
    • removeAllOccurrences

      public static double[] removeAllOccurrences(double[] a, double elementToRemove)
      Removes all the occurrences of the specified elementToRemove from the specified array. All subsequent elementsToRemove are shifted to the left (subtracts one from their indices). If the array doesn't contains such an elementToRemove, no elementsToRemove are removed from the array.
      Parameters:
      a -
      elementToRemove -
      Returns:
      A new array containing the existing elementsToRemove except the occurrences of the specified elementToRemove.
    • removeAllOccurrences

      public static String[] removeAllOccurrences(String[] a, String elementToRemove)
    • removeAllOccurrences

      public static <T> T[] removeAllOccurrences(T[] a, T elementToRemove)
      Removes all the occurrences of the specified elementToRemove from the specified array. All subsequent elementsToRemove are shifted to the left (subtracts one from their indices). If the array doesn't contains such an elementToRemove, no elementsToRemove are removed from the array.
      Type Parameters:
      T -
      Parameters:
      a -
      elementToRemove -
      Returns:
      A new array containing the existing elementsToRemove except the occurrences of the specified elementToRemove.
    • removeAllOccurrences

      public static <T> boolean removeAllOccurrences(Collection<T> c, T elementToRemove)
      Removes the all occurrences.
      Parameters:
      c -
      elementToRemove -
      Returns:
    • removeAll

      @SafeVarargs public static boolean[] removeAll(boolean[] a, boolean... elementsToRemove)
      Returns a new array with removes all the occurrences of specified elementsToRemove from a.
      Parameters:
      a -
      elementsToRemove -
      Returns:
      See Also:
    • removeAll

      @SafeVarargs public static char[] removeAll(char[] a, char... elementsToRemove)
      Returns a new array with removes all the occurrences of specified elementsToRemove from a.
      Parameters:
      a -
      elementsToRemove -
      Returns:
      See Also:
    • removeAll

      @SafeVarargs public static byte[] removeAll(byte[] a, byte... elementsToRemove)
      Returns a new array with removes all the occurrences of specified elementsToRemove from a.
      Parameters:
      a -
      elementsToRemove -
      Returns:
      See Also:
    • removeAll

      @SafeVarargs public static short[] removeAll(short[] a, short... elementsToRemove)
      Returns a new array with removes all the occurrences of specified elementsToRemove from a.
      Parameters:
      a -
      elementsToRemove -
      Returns:
      See Also:
    • removeAll

      @SafeVarargs public static int[] removeAll(int[] a, int... elementsToRemove)
      Returns a new array with removes all the occurrences of specified elementsToRemove from a.
      Parameters:
      a -
      elementsToRemove -
      Returns:
      See Also:
    • removeAll

      @SafeVarargs public static long[] removeAll(long[] a, long... elementsToRemove)
      Returns a new array with removes all the occurrences of specified elementsToRemove from a.
      Parameters:
      a -
      elementsToRemove -
      Returns:
      See Also:
    • removeAll

      @SafeVarargs public static float[] removeAll(float[] a, float... elementsToRemove)
      Returns a new array with removes all the occurrences of specified elementsToRemove from a.
      Parameters:
      a -
      elementsToRemove -
      Returns:
      See Also:
    • removeAll

      @SafeVarargs public static double[] removeAll(double[] a, double... elementsToRemove)
      Returns a new array with removes all the occurrences of specified elementsToRemove from a.
      Parameters:
      a -
      elementsToRemove -
      Returns:
      See Also:
    • removeAll

      @SafeVarargs public static String[] removeAll(String[] a, String... elementsToRemove)
      Returns a new array with removes all the occurrences of specified elementsToRemove from a.
      Parameters:
      a -
      elementsToRemove -
      Returns:
      See Also:
    • removeAll

      @SafeVarargs public static <T> T[] removeAll(T[] a, T... elementsToRemove)
      Returns a new array with removes all the occurrences of specified elementsToRemove from a.
      Type Parameters:
      T -
      Parameters:
      a -
      elementsToRemove -
      Returns:
      See Also:
    • removeAll

      @SafeVarargs public static <T> boolean removeAll(Collection<T> c, T... elementsToRemove)
      Removes the all.
      Parameters:
      c -
      elementsToRemove -
      Returns:
      See Also:
    • removeAll

      public static <T> boolean removeAll(Collection<T> c, Collection<?> elementsToRemove)
      Removes the all.
      Parameters:
      c -
      elementsToRemove -
      Returns:
      See Also:
    • removeAll

      public static <T> boolean removeAll(Collection<T> c, Iterator<?> elementsToRemove)
    • deleteRange

      public static boolean[] deleteRange(boolean[] a, int fromIndex, int toIndex)
      Deletes the values from fromIndex to toIndex.
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      a new array
    • deleteRange

      public static char[] deleteRange(char[] a, int fromIndex, int toIndex)
      Deletes the values from fromIndex to toIndex.
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      a new array
    • deleteRange

      public static byte[] deleteRange(byte[] a, int fromIndex, int toIndex)
      Deletes the values from fromIndex to toIndex.
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      a new array
    • deleteRange

      public static short[] deleteRange(short[] a, int fromIndex, int toIndex)
      Deletes the values from fromIndex to toIndex.
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      a new array
    • deleteRange

      public static int[] deleteRange(int[] a, int fromIndex, int toIndex)
      Deletes the values from fromIndex to toIndex.
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      a new array
    • deleteRange

      public static long[] deleteRange(long[] a, int fromIndex, int toIndex)
      Deletes the values from fromIndex to toIndex.
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      a new array
    • deleteRange

      public static float[] deleteRange(float[] a, int fromIndex, int toIndex)
      Deletes the values from fromIndex to toIndex.
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      a new array
    • deleteRange

      public static double[] deleteRange(double[] a, int fromIndex, int toIndex)
      Deletes the values from fromIndex to toIndex.
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      a new array
    • deleteRange

      public static String[] deleteRange(String[] a, int fromIndex, int toIndex) throws IllegalArgumentException
      Throws:
      IllegalArgumentException
    • deleteRange

      public static <T> T[] deleteRange(T[] a, int fromIndex, int toIndex) throws IllegalArgumentException
      Deletes the values from fromIndex to toIndex.
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      a new array
      Throws:
      IllegalArgumentException - if the specified Array is null.
    • deleteRange

      public static <T> boolean deleteRange(List<T> c, int fromIndex, int toIndex)
      Returns true if the List is updated when fromIndex < toIndex, otherwise false is returned when fromIndex == toIndex.
      Type Parameters:
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      Returns:
    • deleteRange

      public static String deleteRange(String str, int fromIndex, int toIndex)
    • moveRange

      public static void moveRange(boolean[] a, int fromIndex, int toIndex, int newPositionStartIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
      newPositionStartIndex - must in the range: [0, array.length - (toIndex - fromIndex)]
    • moveRange

      public static void moveRange(char[] a, int fromIndex, int toIndex, int newPositionStartIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
      newPositionStartIndex - must in the range: [0, array.length - (toIndex - fromIndex)]
    • moveRange

      public static void moveRange(byte[] a, int fromIndex, int toIndex, int newPositionStartIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
      newPositionStartIndex - must in the range: [0, array.length - (toIndex - fromIndex)]
    • moveRange

      public static void moveRange(short[] a, int fromIndex, int toIndex, int newPositionStartIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
      newPositionStartIndex - must in the range: [0, array.length - (toIndex - fromIndex)]
    • moveRange

      public static void moveRange(int[] a, int fromIndex, int toIndex, int newPositionStartIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
      newPositionStartIndex - must in the range: [0, array.length - (toIndex - fromIndex)]
    • moveRange

      public static void moveRange(long[] a, int fromIndex, int toIndex, int newPositionStartIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
      newPositionStartIndex - must in the range: [0, array.length - (toIndex - fromIndex)]
    • moveRange

      public static void moveRange(float[] a, int fromIndex, int toIndex, int newPositionStartIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
      newPositionStartIndex - must in the range: [0, array.length - (toIndex - fromIndex)]
    • moveRange

      public static void moveRange(double[] a, int fromIndex, int toIndex, int newPositionStartIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
      newPositionStartIndex - must in the range: [0, array.length - (toIndex - fromIndex)]
    • moveRange

      public static <T> void moveRange(T[] a, int fromIndex, int toIndex, int newPositionStartIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
      newPositionStartIndex - must in the range: [0, array.length - (toIndex - fromIndex)]
    • moveRange

      public static <T> boolean moveRange(List<T> c, int fromIndex, int toIndex, int newPositionStartIndex)
      Parameters:
      c -
      fromIndex -
      toIndex -
      newPositionStartIndex - must in the range: [0, list.size() - (toIndex - fromIndex)]
      Returns:
      true if the specified List is updated.
    • moveRange

      public static String moveRange(String str, int fromIndex, int toIndex, int newPositionStartIndex)
      Parameters:
      str -
      fromIndex -
      toIndex -
      newPositionStartIndex - must in the range: [0, String.length - (toIndex - fromIndex)]
    • removeDuplicates

      public static boolean[] removeDuplicates(boolean[] a)
      Removes the duplicates.
      Parameters:
      a -
      Returns:
    • removeDuplicates

      public static boolean[] removeDuplicates(boolean[] a, int fromIndex, int toIndex)
      Removes the duplicates.
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
    • removeDuplicates

      public static char[] removeDuplicates(char[] a)
      Removes the duplicates.
      Parameters:
      a -
      Returns:
    • removeDuplicates

      public static char[] removeDuplicates(char[] a, boolean isSorted)
      Removes the duplicates.
      Parameters:
      a -
      isSorted -
      Returns:
    • removeDuplicates

      public static char[] removeDuplicates(char[] a, int fromIndex, int toIndex, boolean isSorted)
      Removes the duplicates.
      Parameters:
      a -
      fromIndex -
      toIndex -
      isSorted -
      Returns:
    • removeDuplicates

      public static byte[] removeDuplicates(byte[] a)
      Removes the duplicates.
      Parameters:
      a -
      Returns:
    • removeDuplicates

      public static byte[] removeDuplicates(byte[] a, boolean isSorted)
      Removes the duplicates.
      Parameters:
      a -
      isSorted -
      Returns:
    • removeDuplicates

      public static byte[] removeDuplicates(byte[] a, int fromIndex, int toIndex, boolean isSorted)
      Removes the duplicates.
      Parameters:
      a -
      fromIndex -
      toIndex -
      isSorted -
      Returns:
    • removeDuplicates

      public static short[] removeDuplicates(short[] a)
      Removes the duplicates.
      Parameters:
      a -
      Returns:
    • removeDuplicates

      public static short[] removeDuplicates(short[] a, boolean isSorted)
      Removes the duplicates.
      Parameters:
      a -
      isSorted -
      Returns:
    • removeDuplicates

      public static short[] removeDuplicates(short[] a, int fromIndex, int toIndex, boolean isSorted)
      Removes the duplicates.
      Parameters:
      a -
      fromIndex -
      toIndex -
      isSorted -
      Returns:
    • removeDuplicates

      public static int[] removeDuplicates(int[] a)
      Removes the duplicates.
      Parameters:
      a -
      Returns:
    • removeDuplicates

      public static int[] removeDuplicates(int[] a, boolean isSorted)
      Removes the duplicates.
      Parameters:
      a -
      isSorted -
      Returns:
    • removeDuplicates

      public static int[] removeDuplicates(int[] a, int fromIndex, int toIndex, boolean isSorted)
      Removes the duplicates.
      Parameters:
      a -
      fromIndex -
      toIndex -
      isSorted -
      Returns:
    • removeDuplicates

      public static long[] removeDuplicates(long[] a)
      Removes the duplicates.
      Parameters:
      a -
      Returns:
    • removeDuplicates

      public static long[] removeDuplicates(long[] a, boolean isSorted)
      Removes the duplicates.
      Parameters:
      a -
      isSorted -
      Returns:
    • removeDuplicates

      public static long[] removeDuplicates(long[] a, int fromIndex, int toIndex, boolean isSorted)
      Removes the duplicates.
      Parameters:
      a -
      fromIndex -
      toIndex -
      isSorted -
      Returns:
    • removeDuplicates

      public static float[] removeDuplicates(float[] a)
      Removes the duplicates.
      Parameters:
      a -
      Returns:
    • removeDuplicates

      public static float[] removeDuplicates(float[] a, boolean isSorted)
      Removes the duplicates.
      Parameters:
      a -
      isSorted -
      Returns:
    • removeDuplicates

      public static float[] removeDuplicates(float[] a, int fromIndex, int toIndex, boolean isSorted)
      Removes the duplicates.
      Parameters:
      a -
      fromIndex -
      toIndex -
      isSorted -
      Returns:
    • removeDuplicates

      public static double[] removeDuplicates(double[] a)
      Removes the duplicates.
      Parameters:
      a -
      Returns:
    • removeDuplicates

      public static double[] removeDuplicates(double[] a, boolean isSorted)
      Removes the duplicates.
      Parameters:
      a -
      isSorted -
      Returns:
    • removeDuplicates

      public static double[] removeDuplicates(double[] a, int fromIndex, int toIndex, boolean isSorted)
      Removes the duplicates.
      Parameters:
      a -
      fromIndex -
      toIndex -
      isSorted -
      Returns:
    • removeDuplicates

      public static String[] removeDuplicates(String[] a)
      Removes the duplicates.
      Parameters:
      a -
      Returns:
    • removeDuplicates

      public static String[] removeDuplicates(String[] a, boolean isSorted)
      Removes the duplicates.
      Parameters:
      a -
      isSorted -
      Returns:
    • removeDuplicates

      public static String[] removeDuplicates(String[] a, int fromIndex, int toIndex, boolean isSorted)
      Removes the duplicates.
      Parameters:
      a -
      fromIndex -
      toIndex -
      isSorted -
      Returns:
    • removeDuplicates

      public static <T> T[] removeDuplicates(T[] a)

      Removes all duplicates elements

       N.removeElements(["a", "b", "a"]) = ["a", "b"]
       
      Type Parameters:
      T - the component type of the array
      Parameters:
      a -
      Returns:
      A new array containing the existing elements except the duplicates
      Throws:
      NullPointerException - if the specified array a is null.
    • removeDuplicates

      public static <T> T[] removeDuplicates(T[] a, boolean isSorted)
      Removes the duplicates.
      Type Parameters:
      T -
      Parameters:
      a -
      isSorted -
      Returns:
    • removeDuplicates

      public static <T> T[] removeDuplicates(T[] a, int fromIndex, int toIndex, boolean isSorted)
      Removes the duplicates.
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      isSorted -
      Returns:
    • removeDuplicates

      public static boolean removeDuplicates(Collection<?> c)
      Removes the duplicates.
      Parameters:
      c -
      Returns:
      true if there is one or more duplicated elements are removed. otherwise false is returned.
    • removeDuplicates

      public static boolean removeDuplicates(Collection<?> c, boolean isSorted)
      Removes the duplicates.
      Parameters:
      c -
      isSorted -
      Returns:
      true if there is one or more duplicated elements are removed. otherwise false is returned.
    • replaceRange

      public static boolean[] replaceRange(boolean[] a, int fromIndex, int toIndex, boolean[] replacement)
      Return a new array.
      Parameters:
      a -
      fromIndex -
      toIndex -
      replacement -
      Returns:
      a new array.
    • replaceRange

      public static char[] replaceRange(char[] a, int fromIndex, int toIndex, char[] replacement)
      Return a new array.
      Parameters:
      a -
      fromIndex -
      toIndex -
      replacement -
      Returns:
      a new array.
    • replaceRange

      public static byte[] replaceRange(byte[] a, int fromIndex, int toIndex, byte[] replacement)
      Return a new array.
      Parameters:
      a -
      fromIndex -
      toIndex -
      replacement -
      Returns:
      a new array.
    • replaceRange

      public static short[] replaceRange(short[] a, int fromIndex, int toIndex, short[] replacement)
      Return a new array.
      Parameters:
      a -
      fromIndex -
      toIndex -
      replacement -
      Returns:
      a new array.
    • replaceRange

      public static int[] replaceRange(int[] a, int fromIndex, int toIndex, int[] replacement)
      Return a new array.
      Parameters:
      a -
      fromIndex -
      toIndex -
      replacement -
      Returns:
      a new array.
    • replaceRange

      public static long[] replaceRange(long[] a, int fromIndex, int toIndex, long[] replacement)
      Return a new array.
      Parameters:
      a -
      fromIndex -
      toIndex -
      replacement -
      Returns:
      a new array.
    • replaceRange

      public static float[] replaceRange(float[] a, int fromIndex, int toIndex, float[] replacement)
      Return a new array.
      Parameters:
      a -
      fromIndex -
      toIndex -
      replacement -
      Returns:
      a new array.
    • replaceRange

      public static double[] replaceRange(double[] a, int fromIndex, int toIndex, double[] replacement)
      Return a new array.
      Parameters:
      a -
      fromIndex -
      toIndex -
      replacement -
      Returns:
      a new array.
    • replaceRange

      public static String[] replaceRange(String[] a, int fromIndex, int toIndex, String[] replacement)
    • replaceRange

      public static <T> T[] replaceRange(T[] a, int fromIndex, int toIndex, T[] replacement) throws IllegalArgumentException
      Return a new array.
      Parameters:
      a -
      fromIndex -
      toIndex -
      replacement -
      Returns:
      a new array.
      Throws:
      IllegalArgumentException - if the specified Array is null.
    • replaceRange

      public static <T> boolean replaceRange(List<T> c, int fromIndex, int toIndex, Collection<? extends T> replacement) throws IllegalArgumentException
      Type Parameters:
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      replacement -
      Returns:
      true if the specified List is updated.
      Throws:
      IllegalArgumentException - if the specified c is null.
    • replaceRange

      public static String replaceRange(String str, int fromIndex, int toIndex, String replacement)
      Returns a new String.
      Parameters:
      str -
      fromIndex -
      toIndex -
      replacement -
      Returns:
    • hasDuplicates

      public static boolean hasDuplicates(char[] a)
      Checks for duplicates.
      Parameters:
      a -
      Returns:
    • hasDuplicates

      public static boolean hasDuplicates(char[] a, boolean isSorted)
      Checks for duplicates.
      Parameters:
      a -
      isSorted -
      Returns:
    • hasDuplicates

      public static boolean hasDuplicates(byte[] a)
      Checks for duplicates.
      Parameters:
      a -
      Returns:
    • hasDuplicates

      public static boolean hasDuplicates(byte[] a, boolean isSorted)
      Checks for duplicates.
      Parameters:
      a -
      isSorted -
      Returns:
    • hasDuplicates

      public static boolean hasDuplicates(short[] a)
      Checks for duplicates.
      Parameters:
      a -
      Returns:
    • hasDuplicates

      public static boolean hasDuplicates(short[] a, boolean isSorted)
      Checks for duplicates.
      Parameters:
      a -
      isSorted -
      Returns:
    • hasDuplicates

      public static boolean hasDuplicates(int[] a)
      Checks for duplicates.
      Parameters:
      a -
      Returns:
    • hasDuplicates

      public static boolean hasDuplicates(int[] a, boolean isSorted)
      Checks for duplicates.
      Parameters:
      a -
      isSorted -
      Returns:
    • hasDuplicates

      public static boolean hasDuplicates(long[] a)
      Checks for duplicates.
      Parameters:
      a -
      Returns:
    • hasDuplicates

      public static boolean hasDuplicates(long[] a, boolean isSorted)
      Checks for duplicates.
      Parameters:
      a -
      isSorted -
      Returns:
    • hasDuplicates

      public static boolean hasDuplicates(float[] a)
      Checks for duplicates.
      Parameters:
      a -
      Returns:
    • hasDuplicates

      public static boolean hasDuplicates(float[] a, boolean isSorted)
      Checks for duplicates.
      Parameters:
      a -
      isSorted -
      Returns:
    • hasDuplicates

      public static boolean hasDuplicates(double[] a)
      Checks for duplicates.
      Parameters:
      a -
      Returns:
    • hasDuplicates

      public static boolean hasDuplicates(double[] a, boolean isSorted)
      Checks for duplicates.
      Parameters:
      a -
      isSorted -
      Returns:
    • hasDuplicates

      public static <T> boolean hasDuplicates(T[] a)
      Checks for duplicates.
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • hasDuplicates

      public static <T> boolean hasDuplicates(T[] a, boolean isSorted)
      Checks for duplicates.
      Type Parameters:
      T -
      Parameters:
      a -
      isSorted -
      Returns:
    • hasDuplicates

      public static boolean hasDuplicates(Collection<?> c)
      Checks for duplicates.
      Parameters:
      c -
      Returns:
    • hasDuplicates

      public static boolean hasDuplicates(Collection<?> c, boolean isSorted)
      Checks for duplicates.
      Parameters:
      c -
      isSorted -
      Returns:
    • retainAll

      public static <T> boolean retainAll(Collection<T> c, Collection<? extends T> objsToKeep)
      Parameters:
      c -
      objsToKeep -
      Returns:
    • sum

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

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

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

      public static int sum(byte[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
    • 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)
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
    • 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:
    • 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)
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
    • sum

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

      public static float sum(float[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
    • 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)
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
    • 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)
      Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
    • 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)
      Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
    • 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)
      Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
    • 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)
      Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
    • 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)
      Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
    • 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)
      Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
    • 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)
      Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
    • sumInt

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

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

      public static <T, E extends Exception> int sumInt(T[] a, Throwables.ToIntFunction<? super T,E> func) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      func -
      Returns:
      Throws:
      E - the e
    • sumInt

      public static <T, E extends Exception> int sumInt(T[] a, int fromIndex, int toIndex, Throwables.ToIntFunction<? super T,E> func) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      fromIndex -
      toIndex -
      func -
      Returns:
      Throws:
      E - the e
    • sumInt

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

      public static <T, E extends Exception> int sumInt(Iterable<? extends T> c, Throwables.ToIntFunction<? super T,E> func) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      func -
      Returns:
      Throws:
      E - the e
    • sumInt

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

      public static <T, E extends Exception> int sumInt(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.ToIntFunction<? super T,E> func) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      fromIndex -
      toIndex -
      func -
      Returns:
      Throws:
      E - the e
    • sumLong

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

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

      public static <T, E extends Exception> long sumLong(T[] a, Throwables.ToLongFunction<? super T,E> func) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      func -
      Returns:
      Throws:
      E - the e
    • sumLong

      public static <T, E extends Exception> long sumLong(T[] a, int fromIndex, int toIndex, Throwables.ToLongFunction<? super T,E> func) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      fromIndex -
      toIndex -
      func -
      Returns:
      Throws:
      E - the e
    • sumLong

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

      public static <T, E extends Exception> long sumLong(Iterable<? extends T> c, Throwables.ToLongFunction<? super T,E> func) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      func -
      Returns:
      Throws:
      E - the e
    • sumLong

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

      public static <T, E extends Exception> long sumLong(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.ToLongFunction<? super T,E> func) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      fromIndex -
      toIndex -
      func -
      Returns:
      Throws:
      E - the e
    • sumDouble

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

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

      public static <T, E extends Exception> double sumDouble(T[] a, Throwables.ToDoubleFunction<? super T,E> func) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      func -
      Returns:
      Throws:
      E - the e
    • sumDouble

      public static <T, E extends Exception> double sumDouble(T[] a, int fromIndex, int toIndex, Throwables.ToDoubleFunction<? super T,E> func) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      fromIndex -
      toIndex -
      func -
      Returns:
      Throws:
      E - the e
    • sumDouble

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

      public static <T, E extends Exception> double sumDouble(Iterable<? extends T> c, Throwables.ToDoubleFunction<? super T,E> func) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      func -
      Returns:
      Throws:
      E - the e
    • sumDouble

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

      public static <T, E extends Exception> double sumDouble(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.ToDoubleFunction<? super T,E> func) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      fromIndex -
      toIndex -
      func -
      Returns:
      Throws:
      E - the e
    • averageInt

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

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

      public static <T, E extends Exception> double averageInt(T[] a, Throwables.ToIntFunction<? super T,E> func) throws E
      Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      func -
      Returns:
      Throws:
      E - the e
    • averageInt

      public static <T, E extends Exception> double averageInt(T[] a, int fromIndex, int toIndex, Throwables.ToIntFunction<? super T,E> func) throws E
      Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      fromIndex -
      toIndex -
      func -
      Returns:
      Throws:
      E - the e
    • averageInt

      public static <T extends Number> double averageInt(Iterable<? extends T> c)
      Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
    • averageInt

      public static <T, E extends Exception> double averageInt(Iterable<? extends T> c, Throwables.ToIntFunction<? super T,E> func) throws E
      Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      func -
      Returns:
      Throws:
      E - the e
    • averageInt

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

      public static <T, E extends Exception> double averageInt(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.ToIntFunction<? super T,E> func) throws E
      Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      fromIndex -
      toIndex -
      func -
      Returns:
      Throws:
      E - the e
    • averageLong

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

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

      public static <T, E extends Exception> double averageLong(T[] a, Throwables.ToLongFunction<? super T,E> func) throws E
      Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      func -
      Returns:
      Throws:
      E - the e
    • averageLong

      public static <T, E extends Exception> double averageLong(T[] a, int fromIndex, int toIndex, Throwables.ToLongFunction<? super T,E> func) throws E
      Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      fromIndex -
      toIndex -
      func -
      Returns:
      Throws:
      E - the e
    • averageLong

      public static <T extends Number> double averageLong(Iterable<? extends T> c)
      Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
    • averageLong

      public static <T, E extends Exception> double averageLong(Iterable<? extends T> c, Throwables.ToLongFunction<? super T,E> func) throws E
      Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      func -
      Returns:
      Throws:
      E - the e
    • averageLong

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

      public static <T, E extends Exception> double averageLong(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.ToLongFunction<? super T,E> func) throws E
      Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      fromIndex -
      toIndex -
      func -
      Returns:
      Throws:
      E - the e
    • averageDouble

      public static <T extends Number> double averageDouble(T[] a)
      Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
      See Also:
      • invalid @see
        Iterables#averageDouble(Object[])
    • averageDouble

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

      public static <T, E extends Exception> double averageDouble(T[] a, Throwables.ToDoubleFunction<? super T,E> func) throws E
      Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      func -
      Returns:
      Throws:
      E - the e
      See Also:
    • averageDouble

      public static <T, E extends Exception> double averageDouble(T[] a, int fromIndex, int toIndex, Throwables.ToDoubleFunction<? super T,E> func) throws E
      Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      fromIndex -
      toIndex -
      func -
      Returns:
      Throws:
      E - the e
      See Also:
    • averageDouble

      public static <T extends Number> double averageDouble(Iterable<? extends T> c)
      Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
      See Also:
      • invalid @see
        Iterables#averageDouble(Collection)
    • averageDouble

      public static <T, E extends Exception> double averageDouble(Iterable<? extends T> c, Throwables.ToDoubleFunction<? super T,E> func) throws E
      Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      func -
      Returns:
      Throws:
      E - the e
      See Also:
      • invalid @see
        Iterables#averageDouble(Collection, com.landawn.abacus.util.Throwables.ToDoubleFunction)
    • averageDouble

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

      public static <T, E extends Exception> double averageDouble(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.ToDoubleFunction<? super T,E> func) throws E
      Returns 0 if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      fromIndex -
      toIndex -
      func -
      Returns:
      Throws:
      E - the e
      See Also:
    • min

      public static char min(char a, char b)

      Gets the minimum of two char values.

      Parameters:
      a -
      b -
      Returns:
    • min

      public static byte min(byte a, byte b)

      Gets the minimum of two byte values.

      Parameters:
      a -
      b -
      Returns:
    • min

      public static short min(short a, short b)

      Gets the minimum of two short values.

      Parameters:
      a -
      b -
      Returns:
    • min

      public static int min(int a, int b)

      Gets the minimum of two int values.

      Parameters:
      a -
      b -
      Returns:
    • min

      public static long min(long a, long b)

      Gets the minimum of two long values.

      Parameters:
      a -
      b -
      Returns:
    • min

      public static float min(float a, float b)

      Gets the minimum of two float values.

      Parameters:
      a -
      b -
      Returns:
    • min

      public static double min(double a, double b)

      Gets the minimum of two double values.

      Parameters:
      a -
      b -
      Returns:
    • min

      public static <T extends Comparable<? super T>> T min(T a, T b)
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      Returns:
    • min

      public static <T> T min(T a, T b, Comparator<? super T> cmp)
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      cmp -
      Returns:
    • min

      public static char min(char a, char b, char c)

      Gets the minimum of three char values.

      Parameters:
      a -
      b -
      c -
      Returns:
    • min

      public static byte min(byte a, byte b, byte c)

      Gets the minimum of three byte values.

      Parameters:
      a -
      b -
      c -
      Returns:
    • min

      public static short min(short a, short b, short c)

      Gets the minimum of three short values.

      Parameters:
      a -
      b -
      c -
      Returns:
    • min

      public static int min(int a, int b, int c)

      Gets the minimum of three int values.

      Parameters:
      a -
      b -
      c -
      Returns:
    • min

      public static long min(long a, long b, long c)

      Gets the minimum of three long values.

      Parameters:
      a -
      b -
      c -
      Returns:
    • min

      public static float min(float a, float b, float c)

      Gets the minimum of three float values.

      Parameters:
      a -
      b -
      c -
      Returns:
    • min

      public static double min(double a, double b, double c)

      Gets the minimum of three double values.

      Parameters:
      a -
      b -
      c -
      Returns:
    • min

      public static <T extends Comparable<? super T>> T min(T a, T b, T c)
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      c -
      Returns:
    • min

      public static <T> T min(T a, T b, T c, Comparator<? super T> cmp)
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      c -
      cmp -
      Returns:
    • min

      @SafeVarargs public static char min(char... a) throws IllegalArgumentException

      Returns the minimum value in an array.

      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
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      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 in an array.

      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
      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 in an array.

      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
      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 in an array.

      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
      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 in an array.

      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
      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 in an array.

      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
      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 in an array.

      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
      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 element in the array.
      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
      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 element in the array.
      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 IllegalArgumentException
      Type Parameters:
      T -
      Parameters:
      a -
      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
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      See Also:
      • invalid @see
        Iterables#min(Collection)
    • min

      public static <T> T min(Iterable<? extends T> c, Comparator<? super T> cmp) throws IllegalArgumentException
      Type Parameters:
      T -
      Parameters:
      c -
      cmp -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      See Also:
      • invalid @see
        Iterables#min(Collection, Comparator)
    • min

      public static <T extends Comparable<? super T>> T min(Collection<? extends T> c, int fromIndex, int toIndex) throws IllegalArgumentException
      Type Parameters:
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      See Also:
      • invalid @see
        Iterables#min(Collection)
    • min

      public static <T> T min(Collection<? extends T> c, int fromIndex, int toIndex, Comparator<? super T> cmp) throws IllegalArgumentException
      Returns the minimum element in the collection.
      Type Parameters:
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      cmp -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
    • minAll

      public static <T extends Comparable<? super T>> List<T> minAll(T[] a)
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • minAll

      public static <T> List<T> minAll(T[] a, Comparator<? super T> cmp)
      Type Parameters:
      T -
      Parameters:
      a -
      cmp -
      Returns:
    • minAll

      public static <T extends Comparable<? super T>> List<T> minAll(Iterable<T> c)
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
    • minAll

      public static <T> List<T> minAll(Iterable<T> c, Comparator<? super T> cmp)
      Type Parameters:
      T -
      Parameters:
      c -
      cmp -
      Returns:
    • minAll

      public static <T extends Comparable<? super T>> List<T> minAll(Iterator<? extends T> iter)
      Type Parameters:
      T -
      Parameters:
      iter -
      Returns:
      See Also:
    • minAll

      public static <T> List<T> minAll(Iterator<? extends T> iter, Comparator<? super T> cmp)
      Type Parameters:
      T -
      Parameters:
      iter -
      cmp -
      Returns:
      See Also:
    • max

      public static char max(char a, char b)

      Gets the maximum of two char values.

      Parameters:
      a -
      b -
      Returns:
    • max

      public static byte max(byte a, byte b)

      Gets the maximum of two byte values.

      Parameters:
      a -
      b -
      Returns:
    • max

      public static short max(short a, short b)

      Gets the maximum of two short values.

      Parameters:
      a -
      b -
      Returns:
    • max

      public static int max(int a, int b)

      Gets the maximum of two int values.

      Parameters:
      a -
      b -
      Returns:
    • max

      public static long max(long a, long b)

      Gets the maximum of two long values.

      Parameters:
      a -
      b -
      Returns:
    • max

      public static float max(float a, float b)

      Gets the maximum of two float values.

      Parameters:
      a -
      b -
      Returns:
    • max

      public static double max(double a, double b)

      Gets the maximum of two double values.

      Parameters:
      a -
      b -
      Returns:
    • max

      public static <T extends Comparable<? super T>> T max(T a, T b)
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      Returns:
    • max

      public static <T> T max(T a, T b, Comparator<? super T> cmp)
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      cmp -
      Returns:
    • max

      public static char max(char a, char b, char c)
      Gets the maximum of three char values.
      Parameters:
      a -
      b -
      c -
      Returns:
    • max

      public static byte max(byte a, byte b, byte c)
      Gets the maximum of three byte values.
      Parameters:
      a -
      b -
      c -
      Returns:
    • max

      public static short max(short a, short b, short c)
      Gets the maximum of three short values.
      Parameters:
      a -
      b -
      c -
      Returns:
    • max

      public static int max(int a, int b, int c)
      Gets the maximum of three int values.
      Parameters:
      a -
      b -
      c -
      Returns:
    • max

      public static long max(long a, long b, long c)
      Gets the maximum of three long values.
      Parameters:
      a -
      b -
      c -
      Returns:
    • max

      public static float max(float a, float b, float c)
      Gets the maximum of three float values.
      Parameters:
      a -
      b -
      c -
      Returns:
    • max

      public static double max(double a, double b, double c)
      Gets the maximum of three double values.
      Parameters:
      a -
      b -
      c -
      Returns:
    • max

      public static <T extends Comparable<? super T>> T max(T a, T b, T c)
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      c -
      Returns:
    • max

      public static <T> T max(T a, T b, T c, Comparator<? super T> cmp)
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      c -
      cmp -
      Returns:
    • max

      @SafeVarargs public static char max(char... a) throws IllegalArgumentException

      Returns the maximum value in an 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.
    • max

      public static char max(char[] a, int fromIndex, int toIndex) throws IllegalArgumentException
      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 in an 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.
    • max

      public static byte max(byte[] a, int fromIndex, int toIndex) throws IllegalArgumentException
      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 in an 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.
    • max

      public static short max(short[] a, int fromIndex, int toIndex) throws IllegalArgumentException
      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 in an 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.
    • max

      public static int max(int[] a, int fromIndex, int toIndex) throws IllegalArgumentException
      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 in an 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.
    • max

      public static long max(long[] a, int fromIndex, int toIndex) throws IllegalArgumentException
      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 in an 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:
    • max

      public static float max(float[] a, int fromIndex, int toIndex) throws IllegalArgumentException
      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 in an 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:
    • max

      public static double max(double[] a, int fromIndex, int toIndex) throws IllegalArgumentException
      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 element in the 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:
    • max

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

      public static <T> T max(T[] a, Comparator<? super T> cmp) throws IllegalArgumentException
      Returns the maximum element in the array.
      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 IllegalArgumentException
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      cmp -
      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(Iterable<? extends T> c) throws IllegalArgumentException
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      See Also:
      • invalid @see
        Iterables#max(Collection)
    • max

      public static <T> T max(Iterable<? extends T> c, Comparator<? super T> cmp) throws IllegalArgumentException
      Type Parameters:
      T -
      Parameters:
      c -
      cmp -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
      See Also:
      • invalid @see
        Iterables#max(Collection, Comparator)
    • max

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

      public static <T> T max(Collection<? extends T> c, int fromIndex, int toIndex, Comparator<? super T> cmp) throws IllegalArgumentException
      Returns the maximum element in the collection.
      Type Parameters:
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      cmp -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
    • maxAll

      public static <T extends Comparable<? super T>> List<T> maxAll(T[] a)
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • maxAll

      public static <T> List<T> maxAll(T[] a, Comparator<? super T> cmp)
      Type Parameters:
      T -
      Parameters:
      a -
      cmp -
      Returns:
    • maxAll

      public static <T extends Comparable<? super T>> List<T> maxAll(Iterable<? extends T> c)
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
    • maxAll

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

      public static <T extends Comparable<? super T>> List<T> maxAll(Iterator<? extends T> iter)
      Type Parameters:
      T -
      Parameters:
      iter -
      Returns:
      See Also:
      • invalid @see
        Iterables#maxAll(Iterator)
    • maxAll

      public static <T> List<T> maxAll(Iterator<? extends T> iter, Comparator<? super T> cmp)
      Type Parameters:
      T -
      Parameters:
      iter -
      cmp -
      Returns:
      See Also:
      • invalid @see
        Iterables#maxAll(Iterator, Comparator)
    • minMax

      public static <T extends Comparable<? super T>> Pair<T,T> minMax(T[] a) throws IllegalArgumentException
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
      Throws:
      IllegalArgumentException - if a is null or empty.
    • minMax

      public static <T> Pair<T,T> minMax(T[] a, Comparator<? super T> cmp) throws IllegalArgumentException
      Type Parameters:
      T -
      Parameters:
      a -
      cmp -
      Returns:
      Throws:
      IllegalArgumentException - if a is null or empty.
    • minMax

      public static <T extends Comparable<? super T>> Pair<T,T> minMax(Iterable<? extends T> c) throws IllegalArgumentException
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
      Throws:
      IllegalArgumentException - if c is null or empty.
    • minMax

      public static <T> Pair<T,T> minMax(Iterable<? extends T> c, Comparator<? super T> cmp) throws IllegalArgumentException
      Type Parameters:
      T -
      Parameters:
      c -
      cmp -
      Returns:
      Throws:
      IllegalArgumentException - if c is null or empty.
    • minMax

      public static <T extends Comparable<? super T>> Pair<T,T> minMax(Iterator<? extends T> iter) throws IllegalArgumentException
      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
      Type Parameters:
      T -
      Parameters:
      iter -
      cmp -
      Returns:
      Throws:
      IllegalArgumentException - if iter is null or empty.
      See Also:
    • median

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

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

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

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

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

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

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

      public static <T extends Comparable<? super T>> T median(T a, T b, T c)
      Gets the median of three 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)
      Gets the median of three values.
      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 IllegalArgumentException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == 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 IllegalArgumentException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      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 IllegalArgumentException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      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 IllegalArgumentException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      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 IllegalArgumentException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      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 IllegalArgumentException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      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 IllegalArgumentException
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      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
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
    • median

      public static <T> T median(T[] a, Comparator<? super T> cmp) 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
      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 IllegalArgumentException
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      cmp -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
    • 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 specified array.
      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
      Type Parameters:
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
    • median

      public static <T> T median(Collection<? extends T> c, Comparator<? super T> cmp) throws IllegalArgumentException
      Returns the length / 2 + 1 largest value in the specified array.
      Type Parameters:
      T -
      Parameters:
      c -
      cmp -
      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, int fromIndex, int toIndex, Comparator<? super T> cmp) throws IllegalArgumentException
      Type Parameters:
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      cmp -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or fromIndex == toIndex.
    • kthLargest

      public static char kthLargest(char[] a, int k) throws IllegalArgumentException
      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 IllegalArgumentException
      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.
    • kthLargest

      public static byte kthLargest(byte[] a, int k) throws IllegalArgumentException
      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 IllegalArgumentException
      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.
    • kthLargest

      public static short kthLargest(short[] a, int k) throws IllegalArgumentException
      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 IllegalArgumentException
      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.
    • kthLargest

      public static int kthLargest(int[] a, int k) throws IllegalArgumentException
      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 IllegalArgumentException
      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.
    • kthLargest

      public static long kthLargest(long[] a, int k) throws IllegalArgumentException
      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 IllegalArgumentException
      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.
    • kthLargest

      public static float kthLargest(float[] a, int k) throws IllegalArgumentException
      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 IllegalArgumentException
      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.
    • kthLargest

      public static double kthLargest(double[] a, int k) throws IllegalArgumentException
      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 IllegalArgumentException
      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.
    • kthLargest

      public static <T extends Comparable<? super T>> T kthLargest(T[] a, int k) throws IllegalArgumentException
      Type Parameters:
      T -
      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 <T extends Comparable<? super T>> T kthLargest(T[] a, int fromIndex, int toIndex, int k) throws IllegalArgumentException
      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.
    • kthLargest

      public static <T> T kthLargest(T[] a, int k, Comparator<? super T> cmp) throws IllegalArgumentException
      Type Parameters:
      T -
      Parameters:
      a -
      k -
      cmp -
      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 <T> T kthLargest(T[] a, int fromIndex, int toIndex, int k, Comparator<? super T> cmp) throws IllegalArgumentException
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      k -
      cmp -
      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 <T extends Comparable<? super T>> T kthLargest(Collection<? extends T> c, int k) throws IllegalArgumentException
      Type Parameters:
      T -
      Parameters:
      c -
      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 <T extends Comparable<? super T>> T kthLargest(Collection<? extends T> c, int fromIndex, int toIndex, int k) throws IllegalArgumentException
      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.
    • kthLargest

      public static <T> T kthLargest(Collection<? extends T> c, int k, Comparator<? super T> cmp) throws IllegalArgumentException
      Type Parameters:
      T -
      Parameters:
      c -
      k -
      cmp -
      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 <T> T kthLargest(Collection<? extends T> c, int fromIndex, int toIndex, int k, Comparator<? super T> cmp) throws IllegalArgumentException
      Type Parameters:
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      k -
      cmp -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array/Collection is null or empty, or its length/size is less than k, or toIndex - fromIndex < k.
    • top

      public static short[] top(short[] a, int n)
      Parameters:
      a -
      n -
      Returns:
    • top

      public static short[] top(short[] a, int n, Comparator<? super Short> cmp)
      Parameters:
      a -
      n -
      cmp -
      Returns:
    • top

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

      public static short[] top(short[] a, int fromIndex, int toIndex, int n, Comparator<? super Short> cmp)
      Parameters:
      a -
      fromIndex -
      toIndex -
      n -
      cmp -
      Returns:
    • top

      public static int[] top(int[] a, int n)
      Parameters:
      a -
      n -
      Returns:
    • top

      public static int[] top(int[] a, int n, Comparator<? super Integer> cmp)
      Parameters:
      a -
      n -
      cmp -
      Returns:
    • top

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

      public static int[] top(int[] a, int fromIndex, int toIndex, int n, Comparator<? super Integer> cmp)
      Parameters:
      a -
      fromIndex -
      toIndex -
      n -
      cmp -
      Returns:
    • top

      public static long[] top(long[] a, int n)
      Parameters:
      a -
      n -
      Returns:
    • top

      public static long[] top(long[] a, int n, Comparator<? super Long> cmp)
      Parameters:
      a -
      n -
      cmp -
      Returns:
    • top

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

      public static long[] top(long[] a, int fromIndex, int toIndex, int n, Comparator<? super Long> cmp)
      Parameters:
      a -
      fromIndex -
      toIndex -
      n -
      cmp -
      Returns:
    • top

      public static float[] top(float[] a, int n)
      Parameters:
      a -
      n -
      Returns:
    • top

      public static float[] top(float[] a, int n, Comparator<? super Float> cmp)
      Parameters:
      a -
      n -
      cmp -
      Returns:
    • top

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

      public static float[] top(float[] a, int fromIndex, int toIndex, int n, Comparator<? super Float> cmp)
      Parameters:
      a -
      fromIndex -
      toIndex -
      n -
      cmp -
      Returns:
    • top

      public static double[] top(double[] a, int n)
      Parameters:
      a -
      n -
      Returns:
    • top

      public static double[] top(double[] a, int n, Comparator<? super Double> cmp)
      Parameters:
      a -
      n -
      cmp -
      Returns:
    • top

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

      public static double[] top(double[] a, int fromIndex, int toIndex, int n, Comparator<? super Double> cmp)
      Parameters:
      a -
      fromIndex -
      toIndex -
      n -
      cmp -
      Returns:
    • top

      public static <T extends Comparable<? super T>> List<T> top(T[] a, int n)
      Type Parameters:
      T -
      Parameters:
      a -
      n -
      Returns:
    • top

      public static <T> List<T> top(T[] a, int n, Comparator<? super T> cmp)
      Type Parameters:
      T -
      Parameters:
      a -
      n -
      cmp -
      Returns:
    • top

      public static <T extends Comparable<? super T>> List<T> top(T[] a, int fromIndex, int toIndex, int n)
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      n -
      Returns:
    • top

      public static <T> List<T> top(T[] a, int fromIndex, int toIndex, int n, Comparator<? super T> cmp)
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      n -
      cmp -
      Returns:
    • top

      public static <T extends Comparable<? super T>> List<T> top(Collection<? extends T> c, int n)
      Type Parameters:
      T -
      Parameters:
      c -
      n -
      Returns:
    • top

      public static <T> List<T> top(Collection<? extends T> c, int n, Comparator<? super T> cmp)
      Type Parameters:
      T -
      Parameters:
      c -
      n -
      cmp -
      Returns:
    • top

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

      public static <T> List<T> top(Collection<? extends T> c, int fromIndex, int toIndex, int n, Comparator<? super T> cmp)
      Type Parameters:
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      n -
      cmp -
      Returns:
    • top

      public static <T extends Comparable<? super T>> List<T> top(T[] a, int n, boolean keepEncounterOrder)
      Type Parameters:
      T -
      Parameters:
      a -
      n -
      keepEncounterOrder -
      Returns:
    • top

      public static <T> List<T> top(T[] a, int n, Comparator<? super T> cmp, boolean keepEncounterOrder)
      Type Parameters:
      T -
      Parameters:
      a -
      n -
      cmp -
      keepEncounterOrder -
      Returns:
    • top

      public static <T extends Comparable<? super T>> List<T> top(T[] a, int fromIndex, int toIndex, int n, boolean keepEncounterOrder)
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      n -
      keepEncounterOrder -
      Returns:
    • top

      public static <T> List<T> top(T[] a, int fromIndex, int toIndex, int n, Comparator<? super T> cmp, boolean keepEncounterOrder)
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      n -
      cmp -
      keepEncounterOrder -
      Returns:
    • top

      public static <T extends Comparable<? super T>> List<T> top(Collection<? extends T> c, int n, boolean keepEncounterOrder)
      Type Parameters:
      T -
      Parameters:
      c -
      n -
      keepEncounterOrder -
      Returns:
    • top

      public static <T> List<T> top(Collection<? extends T> c, int n, Comparator<? super T> cmp, boolean keepEncounterOrder)
      Type Parameters:
      T -
      Parameters:
      c -
      n -
      cmp -
      keepEncounterOrder -
      Returns:
    • top

      public static <T extends Comparable<? super T>> List<T> top(Collection<? extends T> c, int fromIndex, int toIndex, int n, boolean keepEncounterOrder)
      Type Parameters:
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      n -
      Returns:
    • top

      public static <T> List<T> top(Collection<? extends T> c, int fromIndex, int toIndex, int n, Comparator<? super T> cmp, boolean keepEncounterOrder)
      Type Parameters:
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      n -
      cmp -
      keepEncounterOrder -
      Returns:
    • percentiles

      public static Map<Percentage,Character> percentiles(char[] sortedArray) throws IllegalArgumentException
      Returns the elements at: Percentage * length of the specified array.
      Parameters:
      sortedArray -
      Returns:
      Throws:
      IllegalArgumentException - if the specified sortedArray is null or empty.
    • percentiles

      public static Map<Percentage,Byte> percentiles(byte[] sortedArray) throws IllegalArgumentException
      Returns the elements at: Percentage * length of the specified array.
      Parameters:
      sortedArray -
      Returns:
      Throws:
      IllegalArgumentException - if the specified sortedArray is null or empty.
    • percentiles

      public static Map<Percentage,Short> percentiles(short[] sortedArray) throws IllegalArgumentException
      Returns the elements at: Percentage * length of the specified array.
      Parameters:
      sortedArray -
      Returns:
      Throws:
      IllegalArgumentException - if the specified sortedArray is null or empty.
    • percentiles

      public static Map<Percentage,Integer> percentiles(int[] sortedArray) throws IllegalArgumentException
      Returns the elements at: Percentage * length of the specified array.
      Parameters:
      sortedArray -
      Returns:
      Throws:
      IllegalArgumentException - if the specified sortedArray is null or empty.
    • percentiles

      public static Map<Percentage,Long> percentiles(long[] sortedArray) throws IllegalArgumentException
      Returns the elements at: Percentage * length of the specified array.
      Parameters:
      sortedArray -
      Returns:
      Throws:
      IllegalArgumentException - if the specified sortedArray is null or empty.
    • percentiles

      public static Map<Percentage,Float> percentiles(float[] sortedArray) throws IllegalArgumentException
      Returns the elements at: Percentage * length of the specified array.
      Parameters:
      sortedArray -
      Returns:
      Throws:
      IllegalArgumentException - if the specified sortedArray is null or empty.
    • percentiles

      public static Map<Percentage,Double> percentiles(double[] sortedArray) throws IllegalArgumentException
      Returns the elements at: Percentage * length of the specified array.
      Parameters:
      sortedArray -
      Returns:
      Throws:
      IllegalArgumentException - if the specified sortedArray is null or empty.
    • percentiles

      public static <T> Map<Percentage,T> percentiles(T[] sortedArray) throws IllegalArgumentException
      Returns the elements at: Percentage * length of the specified array.
      Type Parameters:
      T -
      Parameters:
      sortedArray -
      Returns:
      Throws:
      IllegalArgumentException - if the specified sortedArray is null or empty.
    • percentiles

      public static <T> Map<Percentage,T> percentiles(List<T> sortedList) throws IllegalArgumentException
      Returns the elements at: Percentage * length of the specified array.
      Type Parameters:
      T -
      Parameters:
      sortedList -
      Returns:
      Throws:
      IllegalArgumentException - if the specified sortedList is null or empty.
    • forEach

      public static <E extends Exception> void forEach(int startInclusive, int endExclusive, Throwables.Runnable<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.Runnable<E> action) throws E
      Type Parameters:
      E -
      Parameters:
      startInclusive -
      endExclusive -
      step -
      action -
      Throws:
      E - the e
    • 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

      @Deprecated public static <T, E extends Exception> void forEach(int startInclusive, int endExclusive, T a, Throwables.ObjIntConsumer<? super T,E> action) throws E
      Deprecated.
      use traditional for-loop
      Type Parameters:
      T -
      E -
      Parameters:
      startInclusive -
      endExclusive -
      a -
      action -
      Throws:
      E - the e
    • forEach

      @Deprecated public static <T, E extends Exception> void forEach(int startInclusive, int endExclusive, int step, T a, Throwables.ObjIntConsumer<? super T,E> action) throws E
      Deprecated.
      use traditional for-loop
      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 E
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      action -
      Throws:
      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 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:
      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
    • forEachIndexed

      public static <T, E extends Exception> void forEachIndexed(T[] a, Throwables.IndexedConsumer<? 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.IndexedConsumer<? super T,E> action) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      fromIndex -
      toIndex -
      action -
      Throws:
      E - the e
    • forEachIndexed

      public static <T, E extends Exception> void forEachIndexed(Iterable<? extends T> c, Throwables.IndexedConsumer<? 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.IndexedConsumer<? 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.IndexedConsumer<? super T,E> action) throws 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:
      E - the e
    • forEachIndexed

      public static <K, V, E extends Exception> void forEachIndexed(Map<K,V> map, Throwables.IndexedConsumer<? super Map.Entry<K,V>,E> action) throws E
      Type Parameters:
      K -
      V -
      E -
      Parameters:
      map -
      action -
      Throws:
      E - the e
    • forEach

      public static <T, U, E extends Exception, E2 extends Exception> void forEach(T[] a, Throwables.Function<? super T,? extends Collection<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<T> c, Throwables.Function<? super T,? extends Collection<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 Collection<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 Collection<T2>,E> flatMapper, Throwables.Function<? super T2,? extends Collection<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<T> c, Throwables.Function<? super T,? extends Collection<T2>,E> flatMapper, Throwables.Function<? super T2,? extends Collection<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 Collection<T2>,E> flatMapper, Throwables.Function<? super T2,? extends Collection<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<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 Collection<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<T> c, Throwables.Function<? super T,? extends Collection<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 Collection<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 Collection<T2>,E> flatMapper, Throwables.Function<? super T2,? extends Collection<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<T> c, Throwables.Function<? super T,? extends Collection<T2>,E> flatMapper, Throwables.Function<? super T2,? extends Collection<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 Collection<T2>,E> flatMapper, Throwables.Function<? super T2,? extends Collection<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
    • 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, Throwables.BiConsumer<? super T,? super T,E> action, int increment) throws E
      For each pair.
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      action -
      increment -
      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, Throwables.BiConsumer<? super T,? super T,E> action, int increment) throws E
      For each pair.
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      action -
      increment -
      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, Throwables.BiConsumer<? super T,? super T,E> action, int increment) throws E
      For each pair.
      Type Parameters:
      T -
      E -
      Parameters:
      iter -
      action -
      increment -
      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, Throwables.TriConsumer<? super T,? super T,? super T,E> action, int increment) throws E
      For each triple.
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      action -
      increment -
      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, Throwables.TriConsumer<? super T,? super T,? super T,E> action, int increment) throws E
      For each triple.
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      action -
      increment -
      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, Throwables.TriConsumer<? super T,? super T,? super T,E> action, int increment) throws E
      For each triple.
      Type Parameters:
      T -
      E -
      Parameters:
      iter -
      action -
      increment -
      Throws:
      E - the e
    • filter

      public static <E extends Exception> boolean[] filter(boolean[] a, Throwables.BooleanPredicate<E> filter) throws E
      Type Parameters:
      E -
      Parameters:
      a -
      filter -
      Returns:
      Throws:
      E - the e
    • filter

      public static <E extends Exception> boolean[] filter(boolean[] a, Throwables.BooleanPredicate<E> filter, int max) throws E
      Type Parameters:
      E -
      Parameters:
      a -
      filter -
      max -
      Returns:
      Throws:
      E - the e
    • filter

      public static <E extends Exception> boolean[] filter(boolean[] a, int fromIndex, int toIndex, Throwables.BooleanPredicate<E> filter) throws E
      Type Parameters:
      E -
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      Returns:
      Throws:
      E - the e
    • filter

      public static <E extends Exception> boolean[] filter(boolean[] a, int fromIndex, int toIndex, Throwables.BooleanPredicate<E> filter, int max) throws 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.
      Type Parameters:
      E -
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      max - maximum return result.
      Returns:
      Throws:
      E - the e
    • filter

      public static <E extends Exception> char[] filter(char[] a, Throwables.CharPredicate<E> filter) throws E
      Type Parameters:
      E -
      Parameters:
      a -
      filter -
      Returns:
      Throws:
      E - the e
    • filter

      public static <E extends Exception> char[] filter(char[] a, Throwables.CharPredicate<E> filter, int max) throws E
      Type Parameters:
      E -
      Parameters:
      a -
      filter -
      max -
      Returns:
      Throws:
      E - the e
    • filter

      public static <E extends Exception> char[] filter(char[] a, int fromIndex, int toIndex, Throwables.CharPredicate<E> filter) throws E
      Type Parameters:
      E -
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      Returns:
      Throws:
      E - the e
    • filter

      public static <E extends Exception> char[] filter(char[] a, int fromIndex, int toIndex, Throwables.CharPredicate<E> filter, int max) throws 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.
      Type Parameters:
      E -
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      max - maximum return result.
      Returns:
      Throws:
      E - the e
    • filter

      public static <E extends Exception> byte[] filter(byte[] a, Throwables.BytePredicate<E> filter) throws E
      Type Parameters:
      E -
      Parameters:
      a -
      filter -
      Returns:
      Throws:
      E - the e
    • filter

      public static <E extends Exception> byte[] filter(byte[] a, Throwables.BytePredicate<E> filter, int max) throws E
      Type Parameters:
      E -
      Parameters:
      a -
      filter -
      max -
      Returns:
      Throws:
      E - the e
    • filter

      public static <E extends Exception> byte[] filter(byte[] a, int fromIndex, int toIndex, Throwables.BytePredicate<E> filter) throws E
      Type Parameters:
      E -
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      Returns:
      Throws:
      E - the e
    • filter

      public static <E extends Exception> byte[] filter(byte[] a, int fromIndex, int toIndex, Throwables.BytePredicate<E> filter, int max) throws 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.
      Type Parameters:
      E -
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      max - maximum return result.
      Returns:
      Throws:
      E - the e
    • filter

      public static <E extends Exception> short[] filter(short[] a, Throwables.ShortPredicate<E> filter) throws E
      Type Parameters:
      E -
      Parameters:
      a -
      filter -
      Returns:
      Throws:
      E - the e
    • filter

      public static <E extends Exception> short[] filter(short[] a, Throwables.ShortPredicate<E> filter, int max) throws E
      Type Parameters:
      E -
      Parameters:
      a -
      filter -
      max -
      Returns:
      Throws:
      E - the e
    • filter

      public static <E extends Exception> short[] filter(short[] a, int fromIndex, int toIndex, Throwables.ShortPredicate<E> filter) throws E
      Type Parameters:
      E -
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      Returns:
      Throws:
      E - the e
    • filter

      public static <E extends Exception> short[] filter(short[] a, int fromIndex, int toIndex, Throwables.ShortPredicate<E> filter, int max) throws 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.
      Type Parameters:
      E -
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      max - maximum return result.
      Returns:
      Throws:
      E - the e
    • filter

      public static <E extends Exception> int[] filter(int[] a, Throwables.IntPredicate<E> filter) throws E
      Type Parameters:
      E -
      Parameters:
      a -
      filter -
      Returns:
      Throws:
      E - the e
    • filter

      public static <E extends Exception> int[] filter(int[] a, Throwables.IntPredicate<E> filter, int max) throws E
      Type Parameters:
      E -
      Parameters:
      a -
      filter -
      max -
      Returns:
      Throws:
      E - the e
    • filter

      public static <E extends Exception> int[] filter(int[] a, int fromIndex, int toIndex, Throwables.IntPredicate<E> filter) throws E
      Type Parameters:
      E -
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      Returns:
      Throws:
      E - the e
    • filter

      public static <E extends Exception> int[] filter(int[] a, int fromIndex, int toIndex, Throwables.IntPredicate<E> filter, int max) throws 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.
      Type Parameters:
      E -
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      max - maximum return result.
      Returns:
      Throws:
      E - the e
    • filter

      public static <E extends Exception> long[] filter(long[] a, Throwables.LongPredicate<E> filter) throws E
      Type Parameters:
      E -
      Parameters:
      a -
      filter -
      Returns:
      Throws:
      E - the e
    • filter

      public static <E extends Exception> long[] filter(long[] a, Throwables.LongPredicate<E> filter, int max) throws E
      Type Parameters:
      E -
      Parameters:
      a -
      filter -
      max -
      Returns:
      Throws:
      E - the e
    • filter

      public static <E extends Exception> long[] filter(long[] a, int fromIndex, int toIndex, Throwables.LongPredicate<E> filter) throws E
      Type Parameters:
      E -
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      Returns:
      Throws:
      E - the e
    • filter

      public static <E extends Exception> long[] filter(long[] a, int fromIndex, int toIndex, Throwables.LongPredicate<E> filter, int max) throws 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.
      Type Parameters:
      E -
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      max - maximum return result.
      Returns:
      Throws:
      E - the e
    • filter

      public static <E extends Exception> float[] filter(float[] a, Throwables.FloatPredicate<E> filter) throws E
      Type Parameters:
      E -
      Parameters:
      a -
      filter -
      Returns:
      Throws:
      E - the e
    • filter

      public static <E extends Exception> float[] filter(float[] a, Throwables.FloatPredicate<E> filter, int max) throws E
      Type Parameters:
      E -
      Parameters:
      a -
      filter -
      max -
      Returns:
      Throws:
      E - the e
    • filter

      public static <E extends Exception> float[] filter(float[] a, int fromIndex, int toIndex, Throwables.FloatPredicate<E> filter) throws E
      Type Parameters:
      E -
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      Returns:
      Throws:
      E - the e
    • filter

      public static <E extends Exception> float[] filter(float[] a, int fromIndex, int toIndex, Throwables.FloatPredicate<E> filter, int max) throws 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.
      Type Parameters:
      E -
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      max - maximum return result.
      Returns:
      Throws:
      E - the e
    • filter

      public static <E extends Exception> double[] filter(double[] a, Throwables.DoublePredicate<E> filter) throws E
      Type Parameters:
      E -
      Parameters:
      a -
      filter -
      Returns:
      Throws:
      E - the e
    • filter

      public static <E extends Exception> double[] filter(double[] a, Throwables.DoublePredicate<E> filter, int max) throws E
      Type Parameters:
      E -
      Parameters:
      a -
      filter -
      max -
      Returns:
      Throws:
      E - the e
    • filter

      public static <E extends Exception> double[] filter(double[] a, int fromIndex, int toIndex, Throwables.DoublePredicate<E> filter) throws E
      Type Parameters:
      E -
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      Returns:
      Throws:
      E - the e
    • filter

      public static <E extends Exception> double[] filter(double[] a, int fromIndex, int toIndex, Throwables.DoublePredicate<E> filter, int max) throws 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.
      Type Parameters:
      E -
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      max - maximum return result.
      Returns:
      Throws:
      E - the e
    • filter

      public static <T, E extends Exception> List<T> filter(T[] a, Throwables.Predicate<? super T,E> filter) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      filter -
      Returns:
      Throws:
      E - the e
    • filter

      public static <T, R extends Collection<T>, E extends Exception> R filter(T[] a, Throwables.Predicate<? super T,E> filter, IntFunction<R> supplier) throws E
      Type Parameters:
      T -
      R -
      E -
      Parameters:
      a -
      filter -
      supplier -
      Returns:
      Throws:
      E - the e
    • filter

      public static <T, E extends Exception> List<T> filter(T[] a, Throwables.Predicate<? super T,E> filter, int max) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      filter -
      max -
      Returns:
      Throws:
      E - the e
    • filter

      public static <T, R extends Collection<T>, E extends Exception> R filter(T[] a, Throwables.Predicate<? super T,E> filter, int max, IntFunction<R> supplier) throws E
      Type Parameters:
      T -
      R -
      E -
      Parameters:
      a -
      filter -
      max -
      supplier -
      Returns:
      Throws:
      E - the e
    • filter

      public static <T, E extends Exception> List<T> filter(T[] a, int fromIndex, int toIndex, Throwables.Predicate<? super T,E> filter) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      Returns:
      Throws:
      E - the e
    • filter

      public static <T, R extends Collection<T>, E extends Exception> R filter(T[] a, int fromIndex, int toIndex, Throwables.Predicate<? super T,E> filter, IntFunction<R> supplier) throws E
      Type Parameters:
      T -
      R -
      E -
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      supplier -
      Returns:
      Throws:
      E - the e
    • filter

      public static <T, E extends Exception> List<T> filter(T[] a, int fromIndex, int toIndex, Throwables.Predicate<? super T,E> filter, int max) throws 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.
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      max -
      Returns:
      Throws:
      E - the e
    • filter

      public static <T, R extends Collection<T>, E extends Exception> R filter(T[] a, int fromIndex, int toIndex, Throwables.Predicate<? super T,E> filter, int max, IntFunction<R> supplier) throws 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.
      Type Parameters:
      T -
      R -
      E -
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      max -
      supplier -
      Returns:
      Throws:
      E - the e
    • filter

      public static <T, E extends Exception> List<T> filter(Iterable<? extends T> c, Throwables.Predicate<? super T,E> filter) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      filter -
      Returns:
      Throws:
      E - the e
    • filter

      public static <T, R extends Collection<T>, E extends Exception> R filter(Iterable<? extends T> c, Throwables.Predicate<? super T,E> filter, IntFunction<R> supplier) throws E
      Type Parameters:
      T -
      R -
      E -
      Parameters:
      c -
      filter -
      supplier -
      Returns:
      Throws:
      E - the e
    • filter

      public static <T, E extends Exception> List<T> filter(Iterable<? extends T> c, Throwables.Predicate<? super T,E> filter, int max) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      filter -
      max -
      Returns:
      Throws:
      E - the e
    • filter

      public static <T, R extends Collection<T>, E extends Exception> R filter(Iterable<? extends T> c, Throwables.Predicate<? super T,E> filter, int max, IntFunction<R> supplier) throws E
      Type Parameters:
      T -
      R -
      E -
      Parameters:
      c -
      filter -
      max -
      supplier -
      Returns:
      Throws:
      E - the e
    • filter

      public static <T, E extends Exception> List<T> filter(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.Predicate<? super T,E> filter) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      fromIndex -
      toIndex -
      filter -
      Returns:
      Throws:
      E - the e
    • filter

      public static <T, R extends Collection<T>, E extends Exception> R filter(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.Predicate<? super T,E> filter, IntFunction<R> supplier) throws E
      Type Parameters:
      T -
      R -
      E -
      Parameters:
      c -
      fromIndex -
      toIndex -
      filter -
      supplier -
      Returns:
      Throws:
      E - the e
    • filter

      public static <T, E extends Exception> List<T> filter(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.Predicate<? super T,E> filter, int max) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      fromIndex -
      toIndex -
      filter -
      max -
      Returns:
      Throws:
      E - the e
    • filter

      public static <T, R extends Collection<T>, E extends Exception> R filter(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.Predicate<? super T,E> filter, int max, IntFunction<R> supplier) throws E
      Type Parameters:
      T -
      R -
      E -
      Parameters:
      c -
      fromIndex -
      toIndex -
      filter -
      max -
      supplier -
      Returns:
      Throws:
      E - the e
    • mapToBoolean

      public static <T, E extends Exception> boolean[] mapToBoolean(T[] a, Throwables.ToBooleanFunction<? super T,E> func) throws E
      Map to boolean.
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      func -
      Returns:
      Throws:
      E - the e
    • mapToBoolean

      public static <T, E extends Exception> boolean[] mapToBoolean(T[] a, int fromIndex, int toIndex, Throwables.ToBooleanFunction<? super T,E> func) throws 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.
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      fromIndex -
      toIndex -
      func -
      Returns:
      Throws:
      E - the e
    • mapToBoolean

      public static <T, E extends Exception> boolean[] mapToBoolean(Collection<? extends T> c, Throwables.ToBooleanFunction<? super T,E> func) throws E
      Map to boolean.
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      func -
      Returns:
      Throws:
      E - the e
    • mapToBoolean

      public static <T, E extends Exception> boolean[] mapToBoolean(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.ToBooleanFunction<? super T,E> func) throws 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.
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      fromIndex -
      toIndex -
      func -
      Returns:
      Throws:
      E - the e
    • mapToChar

      public static <T, E extends Exception> char[] mapToChar(T[] a, Throwables.ToCharFunction<? super T,E> func) throws E
      Map to char.
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      func -
      Returns:
      Throws:
      E - the e
    • mapToChar

      public static <T, E extends Exception> char[] mapToChar(T[] a, int fromIndex, int toIndex, Throwables.ToCharFunction<? super T,E> func) throws 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.
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      fromIndex -
      toIndex -
      func -
      Returns:
      Throws:
      E - the e
    • mapToChar

      public static <T, E extends Exception> char[] mapToChar(Collection<? extends T> c, Throwables.ToCharFunction<? super T,E> func) throws E
      Map to char.
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      func -
      Returns:
      Throws:
      E - the e
    • mapToChar

      public static <T, E extends Exception> char[] mapToChar(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.ToCharFunction<? super T,E> func) throws 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.
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      fromIndex -
      toIndex -
      func -
      Returns:
      Throws:
      E - the e
    • mapToByte

      public static <T, E extends Exception> byte[] mapToByte(T[] a, Throwables.ToByteFunction<? super T,E> func) throws E
      Map to byte.
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      func -
      Returns:
      Throws:
      E - the e
    • mapToByte

      public static <T, E extends Exception> byte[] mapToByte(T[] a, int fromIndex, int toIndex, Throwables.ToByteFunction<? super T,E> func) throws 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.
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      fromIndex -
      toIndex -
      func -
      Returns:
      Throws:
      E - the e
    • mapToByte

      public static <T, E extends Exception> byte[] mapToByte(Collection<? extends T> c, Throwables.ToByteFunction<? super T,E> func) throws E
      Map to byte.
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      func -
      Returns:
      Throws:
      E - the e
    • mapToByte

      public static <T, E extends Exception> byte[] mapToByte(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.ToByteFunction<? super T,E> func) throws 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.
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      fromIndex -
      toIndex -
      func -
      Returns:
      Throws:
      E - the e
    • mapToShort

      public static <T, E extends Exception> short[] mapToShort(T[] a, Throwables.ToShortFunction<? super T,E> func) throws E
      Map to short.
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      func -
      Returns:
      Throws:
      E - the e
    • mapToShort

      public static <T, E extends Exception> short[] mapToShort(T[] a, int fromIndex, int toIndex, Throwables.ToShortFunction<? super T,E> func) throws 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.
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      fromIndex -
      toIndex -
      func -
      Returns:
      Throws:
      E - the e
    • mapToShort

      public static <T, E extends Exception> short[] mapToShort(Collection<? extends T> c, Throwables.ToShortFunction<? super T,E> func) throws E
      Map to short.
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      func -
      Returns:
      Throws:
      E - the e
    • mapToShort

      public static <T, E extends Exception> short[] mapToShort(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.ToShortFunction<? super T,E> func) throws 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.
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      fromIndex -
      toIndex -
      func -
      Returns:
      Throws:
      E - the e
    • mapToInt

      public static <T, E extends Exception> int[] mapToInt(T[] a, Throwables.ToIntFunction<? super T,E> func) throws E
      Map to int.
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      func -
      Returns:
      Throws:
      E - the e
    • mapToInt

      public static <T, E extends Exception> int[] mapToInt(T[] a, int fromIndex, int toIndex, Throwables.ToIntFunction<? super T,E> func) throws 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.
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      fromIndex -
      toIndex -
      func -
      Returns:
      Throws:
      E - the e
    • mapToInt

      public static <T, E extends Exception> int[] mapToInt(Collection<? extends T> c, Throwables.ToIntFunction<? super T,E> func) throws E
      Map to int.
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      func -
      Returns:
      Throws:
      E - the e
    • mapToInt

      public static <T, E extends Exception> int[] mapToInt(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.ToIntFunction<? super T,E> func) throws 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.
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      fromIndex -
      toIndex -
      func -
      Returns:
      Throws:
      E - the e
    • mapToLong

      public static <T, E extends Exception> long[] mapToLong(T[] a, Throwables.ToLongFunction<? super T,E> func) throws E
      Map to long.
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      func -
      Returns:
      Throws:
      E - the e
    • mapToLong

      public static <T, E extends Exception> long[] mapToLong(T[] a, int fromIndex, int toIndex, Throwables.ToLongFunction<? super T,E> func) throws 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.
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      fromIndex -
      toIndex -
      func -
      Returns:
      Throws:
      E - the e
    • mapToLong

      public static <T, E extends Exception> long[] mapToLong(Collection<? extends T> c, Throwables.ToLongFunction<? super T,E> func) throws E
      Map to long.
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      func -
      Returns:
      Throws:
      E - the e
    • mapToLong

      public static <T, E extends Exception> long[] mapToLong(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.ToLongFunction<? super T,E> func) throws 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.
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      fromIndex -
      toIndex -
      func -
      Returns:
      Throws:
      E - the e
    • mapToFloat

      public static <T, E extends Exception> float[] mapToFloat(T[] a, Throwables.ToFloatFunction<? super T,E> func) throws E
      Map to float.
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      func -
      Returns:
      Throws:
      E - the e
    • mapToFloat

      public static <T, E extends Exception> float[] mapToFloat(T[] a, int fromIndex, int toIndex, Throwables.ToFloatFunction<? super T,E> func) throws 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.
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      fromIndex -
      toIndex -
      func -
      Returns:
      Throws:
      E - the e
    • mapToFloat

      public static <T, E extends Exception> float[] mapToFloat(Collection<? extends T> c, Throwables.ToFloatFunction<? super T,E> func) throws E
      Map to float.
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      func -
      Returns:
      Throws:
      E - the e
    • mapToFloat

      public static <T, E extends Exception> float[] mapToFloat(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.ToFloatFunction<? super T,E> func) throws 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.
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      fromIndex -
      toIndex -
      func -
      Returns:
      Throws:
      E - the e
    • mapToDouble

      public static <T, E extends Exception> double[] mapToDouble(T[] a, Throwables.ToDoubleFunction<? super T,E> func) throws E
      Map to double.
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      func -
      Returns:
      Throws:
      E - the e
    • mapToDouble

      public static <T, E extends Exception> double[] mapToDouble(T[] a, int fromIndex, int toIndex, Throwables.ToDoubleFunction<? super T,E> func) throws 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.
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      fromIndex -
      toIndex -
      func -
      Returns:
      Throws:
      E - the e
    • mapToDouble

      public static <T, E extends Exception> double[] mapToDouble(Collection<? extends T> c, Throwables.ToDoubleFunction<? super T,E> func) throws E
      Map to double.
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      func -
      Returns:
      Throws:
      E - the e
    • mapToDouble

      public static <T, E extends Exception> double[] mapToDouble(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.ToDoubleFunction<? super T,E> func) throws 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.
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      fromIndex -
      toIndex -
      func -
      Returns:
      Throws:
      E - the e
    • map

      public static <T, R, E extends Exception> List<R> map(T[] a, Throwables.Function<? super T,? extends R,E> func) throws E
      Type Parameters:
      T -
      R -
      E -
      Parameters:
      a -
      func -
      Returns:
      Throws:
      E - the e
    • map

      public static <T, R, C extends Collection<R>, E extends Exception> C map(T[] a, Throwables.Function<? super T,? extends R,E> func, IntFunction<? extends C> supplier) throws E
      Type Parameters:
      T -
      R -
      C -
      E -
      Parameters:
      a -
      func -
      supplier -
      Returns:
      Throws:
      E - the e
    • map

      public static <T, R, E extends Exception> List<R> map(T[] a, int fromIndex, int toIndex, Throwables.Function<? super T,? extends R,E> func) throws 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.
      Type Parameters:
      T -
      R -
      E -
      Parameters:
      a -
      fromIndex -
      toIndex -
      func -
      Returns:
      Throws:
      E - the e
    • map

      public static <T, R, C extends Collection<R>, E extends Exception> C map(T[] a, int fromIndex, int toIndex, Throwables.Function<? super T,? extends R,E> func, IntFunction<? extends C> supplier) throws 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.
      Type Parameters:
      T -
      R -
      C -
      E -
      Parameters:
      a -
      fromIndex -
      toIndex -
      func -
      supplier -
      Returns:
      Throws:
      E - the e
    • map

      public static <T, R, E extends Exception> List<R> map(Iterable<? extends T> c, Throwables.Function<? super T,? extends R,E> func) throws E
      Type Parameters:
      T -
      R -
      E -
      Parameters:
      c -
      func -
      Returns:
      Throws:
      E - the e
    • map

      public static <T, R, C extends Collection<R>, E extends Exception> C map(Iterable<? extends T> c, Throwables.Function<? super T,? extends R,E> func, IntFunction<? extends C> supplier) throws E
      Type Parameters:
      T -
      R -
      C -
      E -
      Parameters:
      c -
      func -
      supplier -
      Returns:
      Throws:
      E - the e
    • map

      public static <T, R, E extends Exception> List<R> map(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.Function<? super T,? extends R,E> func) throws 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.
      Type Parameters:
      T -
      R -
      E -
      Parameters:
      c -
      fromIndex -
      toIndex -
      func -
      Returns:
      Throws:
      E - the e
    • map

      public static <T, R, C extends Collection<R>, E extends Exception> C map(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.Function<? super T,? extends R,E> func, IntFunction<? extends C> supplier) throws 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.
      Type Parameters:
      T -
      R -
      C -
      E -
      Parameters:
      c -
      fromIndex -
      toIndex -
      func -
      supplier -
      Returns:
      Throws:
      E - the e
    • flatMap

      public static <T, R, E extends Exception> List<R> flatMap(T[] a, Throwables.Function<? super T,? extends Collection<? extends R>,E> func) throws E
      Type Parameters:
      T -
      R -
      E -
      Parameters:
      a -
      func -
      Returns:
      Throws:
      E - the e
    • flatMap

      public static <T, R, C extends Collection<R>, E extends Exception> C flatMap(T[] a, Throwables.Function<? super T,? extends Collection<? extends R>,E> func, IntFunction<? extends C> supplier) throws E
      Type Parameters:
      T -
      R -
      C -
      E -
      Parameters:
      a -
      func -
      supplier -
      Returns:
      Throws:
      E - the e
    • flatMap

      public static <T, R, E extends Exception> List<R> flatMap(T[] a, int fromIndex, int toIndex, Throwables.Function<? super T,? extends Collection<? extends R>,E> func) throws 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.
      Type Parameters:
      T -
      R -
      E -
      Parameters:
      a -
      fromIndex -
      toIndex -
      func -
      Returns:
      Throws:
      E - the e
    • flatMap

      public static <T, R, C extends Collection<R>, E extends Exception> C flatMap(T[] a, int fromIndex, int toIndex, Throwables.Function<? super T,? extends Collection<? extends R>,E> func, IntFunction<? extends C> supplier) throws 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.
      Type Parameters:
      T -
      R -
      C -
      E -
      Parameters:
      a -
      fromIndex -
      toIndex -
      func -
      supplier -
      Returns:
      Throws:
      E - the e
    • flatMap

      public static <T, R, E extends Exception> List<R> flatMap(Iterable<? extends T> c, Throwables.Function<? super T,? extends Collection<? extends R>,E> func) throws E
      Type Parameters:
      T -
      R -
      E -
      Parameters:
      c -
      func -
      Returns:
      Throws:
      E - the e
    • flatMap

      public static <T, R, C extends Collection<R>, E extends Exception> C flatMap(Iterable<? extends T> c, Throwables.Function<? super T,? extends Collection<? extends R>,E> func, IntFunction<? extends C> supplier) throws E
      Type Parameters:
      T -
      R -
      C -
      E -
      Parameters:
      c -
      func -
      supplier -
      Returns:
      Throws:
      E - the e
    • flatMap

      public static <T, R, E extends Exception> List<R> flatMap(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.Function<? super T,? extends Collection<? extends R>,E> func) throws 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.
      Type Parameters:
      T -
      R -
      E -
      Parameters:
      c -
      fromIndex -
      toIndex -
      func -
      Returns:
      Throws:
      E - the e
    • flatMap

      public static <T, R, C extends Collection<R>, E extends Exception> C flatMap(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.Function<? super T,? extends Collection<? extends R>,E> func, IntFunction<? extends C> supplier) throws 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.
      Type Parameters:
      T -
      R -
      C -
      E -
      Parameters:
      c -
      fromIndex -
      toIndex -
      func -
      supplier -
      Returns:
      Throws:
      E - the e
    • flatMap

      public static <T, T2, R, E extends Exception, E2 extends Exception> List<R> flatMap(T[] a, Throwables.Function<? super T,? extends Collection<? extends T2>,E> func, Throwables.Function<? super T2,? extends Collection<? extends R>,E2> func2) throws E, E2
      Type Parameters:
      T -
      T2 -
      R -
      E -
      E2 -
      C -
      Parameters:
      a -
      func -
      func2 -
      Returns:
      Throws:
      E - the e
      E2 - the e2
    • flatMap

      public static <T, T2, R, C extends Collection<R>, E extends Exception, E2 extends Exception> C flatMap(T[] a, Throwables.Function<? super T,? extends Collection<? extends T2>,E> func, Throwables.Function<? super T2,? extends Collection<? extends R>,E2> func2, IntFunction<? extends C> supplier) throws E, E2
      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 -
      T2 -
      R -
      C -
      E -
      E2 -
      Parameters:
      a -
      func -
      func2 -
      supplier -
      Returns:
      Throws:
      E - the e
      E2 - the e2
    • flatMap

      public static <T, T2, R, E extends Exception, E2 extends Exception> List<R> flatMap(Iterable<? extends T> c, Throwables.Function<? super T,? extends Collection<? extends T2>,E> func, Throwables.Function<? super T2,? extends Collection<? extends R>,E2> func2) throws E, E2
      Type Parameters:
      T -
      T2 -
      R -
      E -
      E2 -
      C -
      Parameters:
      c -
      func -
      func2 -
      Returns:
      Throws:
      E - the e
      E2 - the e2
    • flatMap

      public static <T, T2, R, C extends Collection<R>, E extends Exception, E2 extends Exception> C flatMap(Iterable<? extends T> c, Throwables.Function<? super T,? extends Collection<? extends T2>,E> func, Throwables.Function<? super T2,? extends Collection<? extends R>,E2> func2, IntFunction<? extends C> supplier) throws E, E2
      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 -
      T2 -
      R -
      C -
      E -
      E2 -
      Parameters:
      c -
      func -
      func2 -
      supplier -
      Returns:
      Throws:
      E - the e
      E2 - the e2
    • flattMap

      public static <T, R, E extends Exception> List<R> flattMap(T[] a, Throwables.Function<? super T,? extends R[],E> func) throws E
      Type Parameters:
      T -
      R -
      E -
      Parameters:
      a -
      func -
      Returns:
      Throws:
      E - the e
    • flattMap

      public static <T, R, C extends Collection<R>, E extends Exception> C flattMap(T[] a, Throwables.Function<? super T,? extends R[],E> func, IntFunction<? extends C> supplier) throws E
      Type Parameters:
      T -
      R -
      C -
      E -
      Parameters:
      a -
      func -
      supplier -
      Returns:
      Throws:
      E - the e
    • flattMap

      public static <T, R, E extends Exception> List<R> flattMap(T[] a, int fromIndex, int toIndex, Throwables.Function<? super T,? extends R[],E> func) throws 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.
      Type Parameters:
      T -
      R -
      E -
      Parameters:
      a -
      fromIndex -
      toIndex -
      func -
      Returns:
      Throws:
      E - the e
    • flattMap

      public static <T, R, C extends Collection<R>, E extends Exception> C flattMap(T[] a, int fromIndex, int toIndex, Throwables.Function<? super T,? extends R[],E> func, IntFunction<? extends C> supplier) throws 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.
      Type Parameters:
      T -
      R -
      C -
      E -
      Parameters:
      a -
      fromIndex -
      toIndex -
      func -
      supplier -
      Returns:
      Throws:
      E - the e
    • flattMap

      public static <T, R, E extends Exception> List<R> flattMap(Iterable<? extends T> c, Throwables.Function<? super T,? extends R[],E> func) throws E
      Type Parameters:
      T -
      R -
      E -
      Parameters:
      c -
      func -
      Returns:
      Throws:
      E - the e
    • flattMap

      public static <T, R, C extends Collection<R>, E extends Exception> C flattMap(Iterable<? extends T> c, Throwables.Function<? super T,? extends R[],E> func, IntFunction<? extends C> supplier) throws E
      Type Parameters:
      T -
      R -
      C -
      E -
      Parameters:
      c -
      func -
      supplier -
      Returns:
      Throws:
      E - the e
    • flattMap

      public static <T, R, E extends Exception> List<R> flattMap(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.Function<? super T,? extends R[],E> func) throws 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.
      Type Parameters:
      T -
      R -
      E -
      Parameters:
      c -
      fromIndex -
      toIndex -
      func -
      Returns:
      Throws:
      E - the e
    • flattMap

      public static <T, R, C extends Collection<R>, E extends Exception> C flattMap(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.Function<? super T,? extends R[],E> func, IntFunction<? extends C> supplier) throws 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.
      Type Parameters:
      T -
      R -
      C -
      E -
      Parameters:
      c -
      fromIndex -
      toIndex -
      func -
      supplier -
      Returns:
      Throws:
      E - the e
    • takeWhile

      public static <T, E extends Exception> List<T> takeWhile(T[] a, Throwables.Predicate<? super T,E> filter) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      filter -
      Returns:
      the list
      Throws:
      E - the e
    • takeWhile

      public static <T, E extends Exception> List<T> takeWhile(Iterable<? extends T> c, Throwables.Predicate<? super T,E> filter) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      filter -
      Returns:
      the list
      Throws:
      E - the e
    • takeWhileInclusive

      public static <T, E extends Exception> List<T> takeWhileInclusive(T[] a, Throwables.Predicate<? super T,E> filter) throws E
      Take while inclusive.
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      filter -
      Returns:
      the list
      Throws:
      E - the e
    • takeWhileInclusive

      public static <T, E extends Exception> List<T> takeWhileInclusive(Iterable<? extends T> c, Throwables.Predicate<? super T,E> filter) throws E
      Take while inclusive.
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      filter -
      Returns:
      the list
      Throws:
      E - the e
    • dropWhile

      public static <T, E extends Exception> List<T> dropWhile(T[] a, Throwables.Predicate<? super T,E> filter) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      filter -
      Returns:
      the list
      Throws:
      E - the e
    • dropWhile

      public static <T, E extends Exception> List<T> dropWhile(Iterable<? extends T> c, Throwables.Predicate<? super T,E> filter) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      filter -
      Returns:
      the list
      Throws:
      E - the e
    • skipUntil

      public static <T, E extends Exception> List<T> skipUntil(T[] a, Throwables.Predicate<? super T,E> filter) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      filter -
      Returns:
      the list
      Throws:
      E - the e
    • skipUntil

      public static <T, E extends Exception> List<T> skipUntil(Iterable<? extends T> c, Throwables.Predicate<? super T,E> filter) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      filter -
      Returns:
      the list
      Throws:
      E - the e
    • 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)
      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:
    • 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(Collection<? extends T> c, 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.
      Type Parameters:
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      Returns:
    • distinctBy

      public static <T, E extends Exception> List<T> distinctBy(T[] a, Throwables.Function<? super T,?,E> keyMapper) throws E
      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 -
      E -
      Parameters:
      a -
      keyMapper - don't change value of the input parameter.
      Returns:
      Throws:
      E - the e
    • distinctBy

      public static <T, E extends Exception> List<T> distinctBy(T[] a, int fromIndex, int toIndex, Throwables.Function<? super T,?,E> keyMapper) throws E
      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 -
      E -
      Parameters:
      a -
      fromIndex -
      toIndex -
      keyMapper - don't change value of the input parameter.
      Returns:
      Throws:
      E - the e
    • distinctBy

      public static <T, C extends Collection<T>, E extends Exception> C distinctBy(T[] a, Throwables.Function<? super T,?,E> keyMapper, Supplier<C> supplier) throws E
      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 -
      E -
      Parameters:
      a -
      keyMapper - don't change value of the input parameter.
      supplier -
      Returns:
      Throws:
      E - the e
    • distinctBy

      public static <T, E extends Exception> List<T> distinctBy(Iterable<? extends T> c, Throwables.Function<? super T,?,E> keyMapper) throws E
      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 -
      E -
      Parameters:
      c -
      keyMapper - don't change value of the input parameter.
      Returns:
      Throws:
      E - the e
    • distinctBy

      public static <T, C extends Collection<T>, E extends Exception> C distinctBy(Iterable<? extends T> c, Throwables.Function<? super T,?,E> keyMapper, Supplier<C> supplier) throws E
      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 -
      E -
      Parameters:
      c -
      keyMapper - don't change value of the input parameter.
      supplier -
      Returns:
      Throws:
      E - the e
    • distinctBy

      public static <T, E extends Exception> List<T> distinctBy(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.Function<? super T,?,E> keyMapper) throws E
      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 -
      E -
      Parameters:
      c -
      fromIndex -
      toIndex -
      keyMapper - don't change value of the input parameter.
      Returns:
      Throws:
      E - the e
    • allMatch

      public static <T, E extends Exception> boolean allMatch(T[] a, Throwables.Predicate<? super T,E> filter) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      filter -
      Returns:
      Throws:
      E - the e
    • allMatch

      public static <T, E extends Exception> boolean allMatch(Iterable<? extends T> c, Throwables.Predicate<? super T,E> filter) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      filter -
      Returns:
      Throws:
      E - the e
    • allMatch

      public static <T, E extends Exception> boolean allMatch(Iterator<? extends T> iter, Throwables.Predicate<? super T,E> filter) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      iter -
      filter -
      Returns:
      Throws:
      E - the e
    • anyMatch

      public static <T, E extends Exception> boolean anyMatch(T[] a, Throwables.Predicate<? super T,E> filter) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      filter -
      Returns:
      Throws:
      E - the e
    • anyMatch

      public static <T, E extends Exception> boolean anyMatch(Iterable<? extends T> c, Throwables.Predicate<? super T,E> filter) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      filter -
      Returns:
      Throws:
      E - the e
    • anyMatch

      public static <T, E extends Exception> boolean anyMatch(Iterator<? extends T> iter, Throwables.Predicate<? super T,E> filter) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      iter -
      filter -
      Returns:
      Throws:
      E - the e
    • noneMatch

      public static <T, E extends Exception> boolean noneMatch(T[] a, Throwables.Predicate<? super T,E> filter) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      filter -
      Returns:
      Throws:
      E - the e
    • noneMatch

      public static <T, E extends Exception> boolean noneMatch(Iterable<? extends T> c, Throwables.Predicate<? super T,E> filter) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      filter -
      Returns:
      Throws:
      E - the e
    • noneMatch

      public static <T, E extends Exception> boolean noneMatch(Iterator<? extends T> iter, Throwables.Predicate<? super T,E> filter) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      iter -
      filter -
      Returns:
      Throws:
      E - the e
    • nMatch

      public static <T, E extends Exception> boolean nMatch(T[] a, int atLeast, int atMost, Throwables.Predicate<? super T,E> filter) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      atLeast -
      atMost -
      filter -
      Returns:
      Throws:
      E - the e
    • nMatch

      public static <T, E extends Exception> boolean nMatch(Iterable<? extends T> c, int atLeast, int atMost, Throwables.Predicate<? super T,E> filter) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      atLeast -
      atMost -
      filter -
      Returns:
      Throws:
      E - the e
    • nMatch

      public static <T, E extends Exception> boolean nMatch(Iterator<? extends T> iter, int atLeast, int atMost, Throwables.Predicate<? super T,E> filter) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      atLeast -
      atMost -
      filter -
      c -
      Returns:
      Throws:
      E - the e
    • allTrue

      public static boolean allTrue(boolean[] a)
    • allFalse

      public static boolean allFalse(boolean[] a)
    • anyTrue

      public static boolean anyTrue(boolean[] a)
    • anyFalse

      public static boolean anyFalse(boolean[] a)
    • count

      public static <E extends Exception> int count(boolean[] a, Throwables.BooleanPredicate<E> filter) throws 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.
      Type Parameters:
      E -
      Parameters:
      a -
      filter -
      Returns:
      Throws:
      E - the e
    • count

      public static <E extends Exception> int count(boolean[] a, int fromIndex, int toIndex, Throwables.BooleanPredicate<E> filter) throws 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.
      Type Parameters:
      E -
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      Returns:
      Throws:
      E - the e
    • count

      public static <E extends Exception> int count(char[] a, Throwables.CharPredicate<E> filter) throws 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.
      Type Parameters:
      E -
      Parameters:
      a -
      filter -
      Returns:
      Throws:
      E - the e
    • count

      public static <E extends Exception> int count(char[] a, int fromIndex, int toIndex, Throwables.CharPredicate<E> filter) throws 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.
      Type Parameters:
      E -
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      Returns:
      Throws:
      E - the e
    • count

      public static <E extends Exception> int count(byte[] a, Throwables.BytePredicate<E> filter) throws 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.
      Type Parameters:
      E -
      Parameters:
      a -
      filter -
      Returns:
      Throws:
      E - the e
    • count

      public static <E extends Exception> int count(byte[] a, int fromIndex, int toIndex, Throwables.BytePredicate<E> filter) throws 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.
      Type Parameters:
      E -
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      Returns:
      Throws:
      E - the e
    • count

      public static <E extends Exception> int count(short[] a, Throwables.ShortPredicate<E> filter) throws 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.
      Type Parameters:
      E -
      Parameters:
      a -
      filter -
      Returns:
      Throws:
      E - the e
    • count

      public static <E extends Exception> int count(short[] a, int fromIndex, int toIndex, Throwables.ShortPredicate<E> filter) throws 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.
      Type Parameters:
      E -
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      Returns:
      Throws:
      E - the e
    • count

      public static <E extends Exception> int count(int[] a, Throwables.IntPredicate<E> filter) throws 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.
      Type Parameters:
      E -
      Parameters:
      a -
      filter -
      Returns:
      Throws:
      E - the e
    • count

      public static <E extends Exception> int count(int[] a, int fromIndex, int toIndex, Throwables.IntPredicate<E> filter) throws 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.
      Type Parameters:
      E -
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      Returns:
      Throws:
      E - the e
    • count

      public static <E extends Exception> int count(long[] a, Throwables.LongPredicate<E> filter) throws 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.
      Type Parameters:
      E -
      Parameters:
      a -
      filter -
      Returns:
      Throws:
      E - the e
    • count

      public static <E extends Exception> int count(long[] a, int fromIndex, int toIndex, Throwables.LongPredicate<E> filter) throws 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.
      Type Parameters:
      E -
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      Returns:
      Throws:
      E - the e
    • count

      public static <E extends Exception> int count(float[] a, Throwables.FloatPredicate<E> filter) throws 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.
      Type Parameters:
      E -
      Parameters:
      a -
      filter -
      Returns:
      Throws:
      E - the e
    • count

      public static <E extends Exception> int count(float[] a, int fromIndex, int toIndex, Throwables.FloatPredicate<E> filter) throws 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.
      Type Parameters:
      E -
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      Returns:
      Throws:
      E - the e
    • count

      public static <E extends Exception> int count(double[] a, Throwables.DoublePredicate<E> filter) throws 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.
      Type Parameters:
      E -
      Parameters:
      a -
      filter -
      Returns:
      Throws:
      E - the e
    • count

      public static <E extends Exception> int count(double[] a, int fromIndex, int toIndex, Throwables.DoublePredicate<E> filter) throws 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.
      Type Parameters:
      E -
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      Returns:
      Throws:
      E - the e
    • count

      public static <T, E extends Exception> int count(T[] a, Throwables.Predicate<? super T,E> filter) throws 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.
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      filter -
      Returns:
      Throws:
      E - the e
    • count

      public static <T, E extends Exception> int count(T[] a, int fromIndex, int toIndex, Throwables.Predicate<? super T,E> filter) throws 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.
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      fromIndex -
      toIndex -
      filter -
      Returns:
      Throws:
      E - the e
    • count

      public static <T, E extends Exception> int count(Iterable<? extends T> c, Throwables.Predicate<? super T,E> filter) throws 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.
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      filter -
      Returns:
      Throws:
      E - the e
    • count

      public static <T, E extends Exception> int count(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.Predicate<? super T,E> filter) throws 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.
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      fromIndex -
      toIndex -
      filter -
      Returns:
      Throws:
      E - the e
    • count

      public static int count(Iterator<?> iter) throws ArithmeticException
      Parameters:
      iter -
      Returns:
      Throws:
      ArithmeticException - if the total count overflows an int.
    • count

      public static <T, E extends Exception> int count(Iterator<? extends T> iter, Throwables.Predicate<? super T,E> filter) throws ArithmeticException, E
      Type Parameters:
      T -
      Parameters:
      iter -
      filter -
      Returns:
      Throws:
      ArithmeticException - if the total matched count overflows an int.
      E
    • merge

      public static <T, E extends Exception> List<T> merge(T[] a, T[] b, Throwables.BiFunction<? super T,? super T,MergeResult,E> nextSelector) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      b -
      nextSelector -
      Returns:
      Throws:
      E - the e
    • merge

      public static <T, E extends Exception> List<T> merge(Iterable<? extends T> a, Iterable<? extends T> b, Throwables.BiFunction<? super T,? super T,MergeResult,E> nextSelector) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      b -
      nextSelector -
      Returns:
      Throws:
      E - the e
    • merge

      public static <T> List<T> merge(Collection<? extends Iterable<? extends T>> c, BiFunction<? super T,? super T,MergeResult> nextSelector)
    • 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)
    • zip

      public static <A, B, R, E extends Exception> List<R> zip(A[] a, B[] b, Throwables.BiFunction<? super A,? super B,R,E> zipFunction) throws E
      Type Parameters:
      A -
      B -
      R -
      E -
      Parameters:
      a -
      b -
      zipFunction -
      Returns:
      Throws:
      E - the e
    • zip

      public static <A, B, R, E extends Exception> List<R> zip(Iterable<A> a, Iterable<B> b, Throwables.BiFunction<? super A,? super B,R,E> zipFunction) throws E
      Type Parameters:
      A -
      B -
      R -
      E -
      Parameters:
      a -
      b -
      zipFunction -
      Returns:
      Throws:
      E - the e
    • zip

      public static <A, B, C, R, E extends Exception> List<R> zip(A[] a, B[] b, C[] c, Throwables.TriFunction<? super A,? super B,? super C,R,E> zipFunction) throws E
      Type Parameters:
      A -
      B -
      C -
      R -
      E -
      Parameters:
      a -
      b -
      c -
      zipFunction -
      Returns:
      Throws:
      E - the e
    • zip

      public static <A, B, C, R, E extends Exception> List<R> zip(Iterable<A> a, Iterable<B> b, Iterable<C> c, Throwables.TriFunction<? super A,? super B,? super C,R,E> zipFunction) throws E
      Type Parameters:
      A -
      B -
      C -
      R -
      E -
      Parameters:
      a -
      b -
      c -
      zipFunction -
      Returns:
      Throws:
      E - the e
    • zip

      public static <A, B, R, E extends Exception> List<R> zip(A[] a, B[] b, A valueForNoneA, B valueForNoneB, Throwables.BiFunction<? super A,? super B,R,E> zipFunction) throws E
      Type Parameters:
      A -
      B -
      R -
      E -
      Parameters:
      a -
      b -
      valueForNoneA -
      valueForNoneB -
      zipFunction -
      Returns:
      Throws:
      E - the e
    • zip

      public static <A, B, R, E extends Exception> List<R> zip(Iterable<A> a, Iterable<B> b, A valueForNoneA, B valueForNoneB, Throwables.BiFunction<? super A,? super B,R,E> zipFunction) throws E
      Type Parameters:
      A -
      B -
      R -
      E -
      Parameters:
      a -
      b -
      valueForNoneA -
      valueForNoneB -
      zipFunction -
      Returns:
      Throws:
      E - the e
    • zip

      public static <A, B, C, R, E extends Exception> List<R> zip(A[] a, B[] b, C[] c, A valueForNoneA, B valueForNoneB, C valueForNoneC, Throwables.TriFunction<? super A,? super B,? super C,R,E> zipFunction) throws E
      Type Parameters:
      A -
      B -
      C -
      R -
      E -
      Parameters:
      a -
      b -
      c -
      valueForNoneA -
      valueForNoneB -
      valueForNoneC -
      zipFunction -
      Returns:
      Throws:
      E - the e
    • zip

      public static <A, B, C, R, E extends Exception> List<R> zip(Iterable<A> a, Iterable<B> b, Iterable<C> c, A valueForNoneA, B valueForNoneB, C valueForNoneC, Throwables.TriFunction<? super A,? super B,? super C,R,E> zipFunction) throws E
      Type Parameters:
      A -
      B -
      C -
      R -
      E -
      Parameters:
      a -
      b -
      c -
      valueForNoneA -
      valueForNoneB -
      valueForNoneC -
      zipFunction -
      Returns:
      Throws:
      E - the e
    • zip

      public static <A, B, R, E extends Exception> R[] zip(Class<R> targetElementType, A[] a, B[] b, Throwables.BiFunction<? super A,? super B,R,E> zipFunction) throws E
      Type Parameters:
      A -
      B -
      R -
      E -
      Parameters:
      targetElementType -
      a -
      b -
      zipFunction -
      Returns:
      Throws:
      E - the e
    • zip

      public static <A, B, R, E extends Exception> R[] zip(Class<R> targetElementType, A[] a, B[] b, A valueForNoneA, B valueForNoneB, Throwables.BiFunction<? super A,? super B,R,E> zipFunction) throws E
      Type Parameters:
      A -
      B -
      R -
      E -
      Parameters:
      targetElementType -
      a -
      b -
      valueForNoneA -
      valueForNoneB -
      zipFunction -
      Returns:
      Throws:
      E - the e
    • zip

      public static <A, B, C, R, E extends Exception> R[] zip(Class<R> targetElementType, A[] a, B[] b, C[] c, Throwables.TriFunction<? super A,? super B,? super C,R,E> zipFunction) throws E
      Type Parameters:
      A -
      B -
      C -
      R -
      E -
      Parameters:
      targetElementType -
      a -
      b -
      c -
      zipFunction -
      Returns:
      Throws:
      E - the e
    • zip

      public static <A, B, C, R, E extends Exception> R[] zip(Class<R> targetElementType, A[] a, B[] b, C[] c, A valueForNoneA, B valueForNoneB, C valueForNoneC, Throwables.TriFunction<? super A,? super B,? super C,R,E> zipFunction) throws E
      Type Parameters:
      A -
      B -
      C -
      R -
      E -
      Parameters:
      targetElementType -
      a -
      b -
      c -
      valueForNoneA -
      valueForNoneB -
      valueForNoneC -
      zipFunction -
      Returns:
      Throws:
      E - the e
    • unzip

      public static <T, A, B, E extends Exception> Pair<List<A>,List<B>> unzip(Iterable<? extends T> c, Throwables.BiConsumer<? super T,Pair<A,B>,E> unzip) throws E
      Type Parameters:
      T -
      A -
      B -
      E -
      Parameters:
      c -
      unzip - the second parameter is an output parameter.
      Returns:
      Throws:
      E - the e
    • unzip

      public static <T, A, B, LC extends Collection<A>, RC extends Collection<B>, E extends Exception> Pair<LC,RC> unzip(Iterable<? extends T> c, Throwables.BiConsumer<? super T,Pair<A,B>,E> unzip, IntFunction<? extends Collection<?>> supplier) throws E
      Type Parameters:
      T -
      A -
      B -
      LC -
      RC -
      E -
      Parameters:
      c -
      unzip - the second parameter is an output parameter.
      supplier -
      Returns:
      Throws:
      E - the e
    • unzipp

      public static <T, A, B, C, E extends Exception> Triple<List<A>,List<B>,List<C>> unzipp(Iterable<? extends T> c, Throwables.BiConsumer<? super T,Triple<A,B,C>,E> unzip) throws E
      Type Parameters:
      T -
      A -
      B -
      C -
      E -
      Parameters:
      c -
      unzip - the second parameter is an output parameter.
      Returns:
      Throws:
      E - the e
    • unzipp

      public static <T, A, B, C, LC extends Collection<A>, MC extends Collection<B>, RC extends Collection<C>, E extends Exception> Triple<LC,MC,RC> unzipp(Iterable<? extends T> c, Throwables.BiConsumer<? super T,Triple<A,B,C>,E> unzip, IntFunction<? extends Collection<?>> supplier) throws E
      Type Parameters:
      T -
      A -
      B -
      C -
      LC -
      MC -
      RC -
      E -
      Parameters:
      c -
      unzip - the second parameter is an output parameter.
      supplier -
      Returns:
      Throws:
      E - the e
    • iterate

      @Beta public static <T> ObjIterator<T> iterate(T[] a)
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
      See Also:
    • iterate

      @Beta public static <T> ObjIterator<T> iterate(T[] a, int fromIndex, int toIndex)
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      See Also:
    • iterate

      @Beta public static <T> Iterator<T> iterate(Iterable<? extends T> iterable)
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • disjoint

      public static boolean disjoint(Object[] a, Object[] b)
      Parameters:
      a -
      b -
      Returns:
    • disjoint

      public static boolean disjoint(Collection<?> c1, Collection<?> c2)
      Returns true if the two specified arrays 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)
      Parameters:
      obj -
      Returns:
    • toJSON

      public static String toJSON(Object obj, boolean prettyFormat)
      Parameters:
      obj -
      prettyFormat -
      Returns:
    • toJSON

      public static String toJSON(Object obj, JSONSerializationConfig config)
      Parameters:
      obj -
      config -
      Returns:
    • toJSON

      public static void toJSON(File file, Object obj)
      Parameters:
      file -
      obj -
    • toJSON

      public static void toJSON(File file, Object obj, JSONSerializationConfig config)
      Parameters:
      file -
      obj -
      config -
    • toJSON

      public static void toJSON(OutputStream os, Object obj)
      Parameters:
      os -
      obj -
    • toJSON

      public static void toJSON(OutputStream os, Object obj, JSONSerializationConfig config)
      Parameters:
      os -
      obj -
      config -
    • toJSON

      public static void toJSON(Writer writer, Object obj)
      Parameters:
      writer -
      obj -
    • toJSON

      public static void toJSON(Writer writer, Object obj, JSONSerializationConfig config)
      Parameters:
      writer -
      obj -
      config -
    • fromJSON

      public static <T> T fromJSON(Class<? extends T> targetClass, String json)
      Type Parameters:
      T -
      Parameters:
      targetClass -
      json -
      Returns:
      See Also:
    • fromJSON

      public static <T> T fromJSON(Class<? extends T> targetClass, String json, JSONDeserializationConfig config)
      Type Parameters:
      T -
      Parameters:
      targetClass -
      json -
      config -
      Returns:
      See Also:
    • fromJSON

      public static <T> T fromJSON(Class<? extends T> targetClass, File json)
      Type Parameters:
      T -
      Parameters:
      targetClass -
      json -
      Returns:
      See Also:
    • fromJSON

      public static <T> T fromJSON(Class<? extends T> targetClass, File json, JSONDeserializationConfig config)
      Type Parameters:
      T -
      Parameters:
      targetClass -
      json -
      config -
      Returns:
      See Also:
    • fromJSON

      public static <T> T fromJSON(Class<? extends T> targetClass, InputStream json)
      Type Parameters:
      T -
      Parameters:
      targetClass -
      json -
      Returns:
      See Also:
    • fromJSON

      public static <T> T fromJSON(Class<? extends T> targetClass, InputStream json, JSONDeserializationConfig config)
      Type Parameters:
      T -
      Parameters:
      targetClass -
      json -
      config -
      Returns:
      See Also:
    • fromJSON

      public static <T> T fromJSON(Class<? extends T> targetClass, Reader json)
      Type Parameters:
      T -
      Parameters:
      targetClass -
      json -
      Returns:
      See Also:
    • fromJSON

      public static <T> T fromJSON(Class<? extends T> targetClass, Reader json, JSONDeserializationConfig config)
      Type Parameters:
      T -
      Parameters:
      targetClass -
      json -
      config -
      Returns:
      See Also:
    • fromJSON

      public static <T> T fromJSON(Class<? extends T> targetClass, String json, int fromIndex, int toIndex)
      Type Parameters:
      T -
      Parameters:
      targetClass -
      json -
      fromIndex -
      toIndex -
      Returns:
      See Also:
    • fromJSON

      public static <T> T fromJSON(Class<? extends T> targetClass, String json, int fromIndex, int toIndex, JSONDeserializationConfig config)
      Type Parameters:
      T -
      Parameters:
      targetClass -
      json -
      fromIndex -
      toIndex -
      config -
      Returns:
      See Also:
    • fromJSON

      public static <T> T fromJSON(com.landawn.abacus.type.Type<? extends T> targetType, String json)
      Type Parameters:
      T -
      Parameters:
      targetType - can be the Type of Entity/Array/Collection/Map.
      json -
      Returns:
      See Also:
    • fromJSON

      public static <T> T fromJSON(com.landawn.abacus.type.Type<? extends T> targetType, String json, JSONDeserializationConfig config)
      Type Parameters:
      T -
      Parameters:
      targetType - can be the Type of Entity/Array/Collection/Map.
      json -
      config -
      Returns:
      See Also:
    • fromJSON

      public static <T> T fromJSON(com.landawn.abacus.type.Type<? extends T> targetType, File json)
      Type Parameters:
      T -
      Parameters:
      targetType - can be the Type of Entity/Array/Collection/Map.
      json -
      Returns:
      See Also:
    • fromJSON

      public static <T> T fromJSON(com.landawn.abacus.type.Type<? extends T> targetType, File json, JSONDeserializationConfig config)
      Type Parameters:
      T -
      Parameters:
      targetType - can be the Type of Entity/Array/Collection/Map.
      json -
      config -
      Returns:
      See Also:
    • fromJSON

      public static <T> T fromJSON(com.landawn.abacus.type.Type<? extends T> targetType, InputStream json)
      Type Parameters:
      T -
      Parameters:
      targetType - can be the Type of Entity/Array/Collection/Map.
      json -
      Returns:
      See Also:
    • fromJSON

      public static <T> T fromJSON(com.landawn.abacus.type.Type<? extends T> targetType, InputStream json, JSONDeserializationConfig config)
      Type Parameters:
      T -
      Parameters:
      targetType - can be the Type of Entity/Array/Collection/Map.
      json -
      config -
      Returns:
      See Also:
    • fromJSON

      public static <T> T fromJSON(com.landawn.abacus.type.Type<? extends T> targetType, Reader json)
      Type Parameters:
      T -
      Parameters:
      targetType - can be the Type of Entity/Array/Collection/Map.
      json -
      Returns:
      See Also:
    • fromJSON

      public static <T> T fromJSON(com.landawn.abacus.type.Type<? extends T> targetType, Reader json, JSONDeserializationConfig config)
      Type Parameters:
      T -
      Parameters:
      targetType - can be the Type of Entity/Array/Collection/Map.
      json -
      config -
      Returns:
      See Also:
    • fromJSON

      public static <T> T fromJSON(com.landawn.abacus.type.Type<? extends T> targetType, String json, int fromIndex, int toIndex)
      Type Parameters:
      T -
      Parameters:
      targetType - can be the Type of Entity/Array/Collection/Map.
      json -
      fromIndex -
      toIndex -
      Returns:
      See Also:
    • fromJSON

      public static <T> T fromJSON(com.landawn.abacus.type.Type<? extends T> targetType, String json, int fromIndex, int toIndex, JSONDeserializationConfig config)
      Type Parameters:
      T -
      Parameters:
      targetType - can be the Type of Entity/Array/Collection/Map.
      json -
      fromIndex -
      toIndex -
      config -
      Returns:
      See Also:
    • streamJSON

      public static <T> ExceptionalStream<T,IOException> streamJSON(Class<T> elementClass, String source)
      Type Parameters:
      T -
      Parameters:
      elementClass - Only Entity/Map/Collection/Array/DataSet element types are supported at present.
      source -
      Returns:
    • streamJSON

      public static <T> ExceptionalStream<T,IOException> streamJSON(Class<T> elementClass, String source, JSONDeserializationConfig config)
      Type Parameters:
      T -
      Parameters:
      elementClass - Only Entity/Map/Collection/Array/DataSet element types are supported at present.
      source -
      config -
      Returns:
    • streamJSON

      public static <T> ExceptionalStream<T,IOException> streamJSON(Class<T> elementClass, File source)
      Type Parameters:
      T -
      Parameters:
      elementClass - Only Entity/Map/Collection/Array/DataSet element types are supported at present.
      source -
      Returns:
    • streamJSON

      public static <T> ExceptionalStream<T,IOException> streamJSON(Class<T> elementClass, File source, JSONDeserializationConfig config)
      Type Parameters:
      T -
      Parameters:
      elementClass - Only Entity/Map/Collection/Array/DataSet element types are supported at present.
      source -
      config -
      Returns:
    • streamJSON

      public static <T> ExceptionalStream<T,IOException> streamJSON(Class<T> elementClass, InputStream source)
      Type Parameters:
      T -
      Parameters:
      elementClass - Only Entity/Map/Collection/Array/DataSet element types are supported at present.
      source -
      Returns:
    • streamJSON

      public static <T> ExceptionalStream<T,IOException> streamJSON(Class<T> elementClass, InputStream source, JSONDeserializationConfig config)
      Type Parameters:
      T -
      Parameters:
      elementClass - Only Entity/Map/Collection/Array/DataSet element types are supported at present.
      source -
      config -
      Returns:
    • streamJSON

      public static <T> ExceptionalStream<T,IOException> streamJSON(Class<T> elementClass, Reader source)
      Type Parameters:
      T -
      Parameters:
      elementClass - Only Entity/Map/Collection/Array/DataSet element types are supported at present.
      source -
      Returns:
    • streamJSON

      public static <T> ExceptionalStream<T,IOException> streamJSON(Class<T> elementClass, Reader source, JSONDeserializationConfig config)
      Type Parameters:
      T -
      Parameters:
      elementClass - Only Entity/Map/Collection/Array/DataSet element types are supported at present.
      source -
      config -
      Returns:
    • formatJSON

      public static String formatJSON(String json)
      Parameters:
      json -
      Returns:
      See Also:
    • formatJSON

      public static String formatJSON(Class<?> type, String json)
      Parameters:
      type -
      json -
      Returns:
      See Also:
    • formatJSON

      public static String formatJSON(com.landawn.abacus.type.Type<?> type, String json)
      Parameters:
      type -
      json -
      Returns:
      See Also:
    • toXML

      public static String toXML(Object obj)
      Parameters:
      obj -
      Returns:
    • toXML

      public static String toXML(Object obj, boolean prettyFormat)
      Parameters:
      obj -
      prettyFormat -
      Returns:
    • toXML

      public static String toXML(Object obj, XMLSerializationConfig config)
      Parameters:
      obj -
      config -
      Returns:
    • toXML

      public static void toXML(File file, Object obj)
      Parameters:
      file -
      obj -
    • toXML

      public static void toXML(File file, Object obj, XMLSerializationConfig config)
      Parameters:
      file -
      obj -
      config -
    • toXML

      public static void toXML(OutputStream os, Object obj)
      Parameters:
      os -
      obj -
    • toXML

      public static void toXML(OutputStream os, Object obj, XMLSerializationConfig config)
      Parameters:
      os -
      obj -
      config -
    • toXML

      public static void toXML(Writer writer, Object obj)
      Parameters:
      writer -
      obj -
    • toXML

      public static void toXML(Writer writer, Object obj, XMLSerializationConfig config)
      Parameters:
      writer -
      obj -
      config -
    • formatXML

      public static String formatXML(String xml)
      Parameters:
      xml -
      Returns:
      See Also:
    • fromXML

      public static <T> T fromXML(Class<? extends T> targetClass, String xml)
      Type Parameters:
      T -
      Parameters:
      targetClass -
      xml -
      Returns:
      See Also:
    • fromXML

      public static <T> T fromXML(Class<? extends T> targetClass, String xml, XMLDeserializationConfig config)
      Type Parameters:
      T -
      Parameters:
      targetClass -
      xml -
      config -
      Returns:
      See Also:
    • fromXML

      public static <T> T fromXML(Class<? extends T> targetClass, File xml)
      Type Parameters:
      T -
      Parameters:
      targetClass -
      xml -
      Returns:
      See Also:
    • fromXML

      public static <T> T fromXML(Class<? extends T> targetClass, File xml, XMLDeserializationConfig config)
      Type Parameters:
      T -
      Parameters:
      targetClass -
      xml -
      config -
      Returns:
      See Also:
    • fromXML

      public static <T> T fromXML(Class<? extends T> targetClass, InputStream xml)
      Type Parameters:
      T -
      Parameters:
      targetClass -
      xml -
      Returns:
      See Also:
    • fromXML

      public static <T> T fromXML(Class<? extends T> targetClass, InputStream xml, XMLDeserializationConfig config)
      Type Parameters:
      T -
      Parameters:
      targetClass -
      xml -
      config -
      Returns:
      See Also:
    • fromXML

      public static <T> T fromXML(Class<? extends T> targetClass, Reader xml)
      Type Parameters:
      T -
      Parameters:
      targetClass -
      xml -
      Returns:
      See Also:
    • fromXML

      public static <T> T fromXML(Class<? extends T> targetClass, Reader xml, XMLDeserializationConfig config)
      Type Parameters:
      T -
      Parameters:
      targetClass -
      xml -
      config -
      Returns:
      See Also:
    • fromXML

      public static <T> T fromXML(com.landawn.abacus.type.Type<? extends T> targetType, String xml)
      Type Parameters:
      T -
      Parameters:
      targetType - can be the Type of Entity/Array/Collection/Map.
      xml -
      Returns:
      See Also:
    • fromXML

      public static <T> T fromXML(com.landawn.abacus.type.Type<? extends T> targetType, String xml, XMLDeserializationConfig config)
      Type Parameters:
      T -
      Parameters:
      targetType - can be the Type of Entity/Array/Collection/Map.
      xml -
      config -
      Returns:
      See Also:
    • fromXML

      public static <T> T fromXML(com.landawn.abacus.type.Type<? extends T> targetType, File xml)
      Type Parameters:
      T -
      Parameters:
      targetType - can be the Type of Entity/Array/Collection/Map.
      xml -
      Returns:
      See Also:
    • fromXML

      public static <T> T fromXML(com.landawn.abacus.type.Type<? extends T> targetType, File xml, XMLDeserializationConfig config)
      Type Parameters:
      T -
      Parameters:
      targetType - can be the Type of Entity/Array/Collection/Map.
      xml -
      config -
      Returns:
      See Also:
    • fromXML

      public static <T> T fromXML(com.landawn.abacus.type.Type<? extends T> targetType, InputStream xml)
      Type Parameters:
      T -
      Parameters:
      targetType - can be the Type of Entity/Array/Collection/Map.
      xml -
      Returns:
      See Also:
    • fromXML

      public static <T> T fromXML(com.landawn.abacus.type.Type<? extends T> targetType, InputStream xml, XMLDeserializationConfig config)
      Type Parameters:
      T -
      Parameters:
      targetType - can be the Type of Entity/Array/Collection/Map.
      xml -
      config -
      Returns:
      See Also:
    • fromXML

      public static <T> T fromXML(com.landawn.abacus.type.Type<? extends T> targetType, Reader xml)
      Type Parameters:
      T -
      Parameters:
      targetType - can be the Type of Entity/Array/Collection/Map.
      xml -
      Returns:
      See Also:
    • fromXML

      public static <T> T fromXML(com.landawn.abacus.type.Type<? extends T> targetType, Reader xml, XMLDeserializationConfig config)
      Type Parameters:
      T -
      Parameters:
      targetType - can be the Type of Entity/Array/Collection/Map.
      xml -
      config -
      Returns:
      See Also:
    • formatXML

      public static String formatXML(Class<?> type, String xml)
      Parameters:
      type -
      xml -
      Returns:
      See Also:
    • formatXML

      public static String formatXML(com.landawn.abacus.type.Type<?> type, String xml)
      Parameters:
      type -
      xml -
      Returns:
      See Also:
    • xml2JSON

      public static String xml2JSON(String xml)
      Xml 2 JSON.
      Parameters:
      xml -
      Returns:
      See Also:
    • xml2JSON

      public static String xml2JSON(Class<?> cls, String xml)
      Xml 2 JSON.
      Parameters:
      cls -
      xml -
      Returns:
      See Also:
    • json2XML

      public static String json2XML(String json)
      Json 2 XML.
      Parameters:
      json -
      Returns:
      See Also:
    • json2XML

      public static String json2XML(Class<?> cls, String json)
      Json 2 XML.
      Parameters:
      cls -
      json -
      Returns:
      See Also:
    • execute

      public static void execute(Throwables.Runnable<? extends Exception> cmd, int retryTimes, long retryInterval, Predicate<? super Exception> retryCondition)
      Parameters:
      cmd -
      retryTimes -
      retryInterval -
      retryCondition -
    • execute

      public static <R> R execute(Callable<R> cmd, int retryTimes, long retryInterval, BiPredicate<? super R,? super Exception> retryCondition)
      Type Parameters:
      R -
      Parameters:
      cmd -
      retryTimes -
      retryInterval -
      retryCondition -
      Returns:
    • asyncExecute

      public static ContinuableFuture<Void> asyncExecute(Throwables.Runnable<? extends Exception> command)
      Parameters:
      command -
      Returns:
      See Also:
    • asyncExecute

      public static ContinuableFuture<Void> asyncExecute(Throwables.Runnable<? extends Exception> command, long delayInMillis)
      Parameters:
      command -
      delayInMillis -
      Returns:
      See Also:
    • asyncExecute

      @SafeVarargs public static List<ContinuableFuture<Void>> asyncExecute(Throwables.Runnable<? extends Exception>... commands)
      Parameters:
      commands -
      Returns:
      See Also:
    • asyncExecute

      public static List<ContinuableFuture<Void>> asyncExecute(List<? extends Throwables.Runnable<? extends Exception>> commands)
      Parameters:
      commands -
      Returns:
      See Also:
    • asyncExecute

      public static <R> ContinuableFuture<R> asyncExecute(Callable<R> command)
      Type Parameters:
      R -
      Parameters:
      command -
      Returns:
      See Also:
    • asyncExecute

      public static <R> ContinuableFuture<R> asyncExecute(Callable<R> command, long delayInMillis)
      Type Parameters:
      R -
      Parameters:
      command -
      delayInMillis -
      Returns:
      See Also:
    • asyncExecute

      @SafeVarargs public static <R> List<ContinuableFuture<R>> asyncExecute(Callable<R>... commands)
      Type Parameters:
      R -
      Parameters:
      commands -
      Returns:
      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 ContinuableFuture<Void> asyncExecute(Throwables.Runnable<? extends Exception> cmd, int retryTimes, long retryIntervalInMillis, Predicate<? super Exception> retryCondition)
      Parameters:
      cmd -
      retryTimes -
      retryIntervalInMillis -
      retryCondition -
      Returns:
      See Also:
    • asyncExecute

      public static <R> ContinuableFuture<R> asyncExecute(Callable<R> cmd, int retryTimes, long retryIntervalInMillis, BiPredicate<? super R,? super Exception> retryCondition)
      Type Parameters:
      R -
      Parameters:
      cmd -
      retryTimes -
      retryIntervalInMillis -
      retryCondition -
      Returns:
      See Also:
    • asyncExecute

      public static ContinuableFuture<Void> asyncExecute(Throwables.Runnable<? extends Exception> command, Executor executor)
    • asyncExecute

      public static <R> ContinuableFuture<R> asyncExecute(Callable<R> command, Executor executor)
    • runInParallel

      public static void runInParallel(Throwables.Runnable<? extends Exception> command, Throwables.Runnable<? extends Exception> command2)
      Executes and complete the input commands in parallel.
      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.
      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.
      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.
      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:
    • callInParallel

      public static <R, R2> Tuple.Tuple2<R,R2> callInParallel(Callable<R> command, Callable<R2> command2)
      Executes and complete the input commands in parallel.
      Parameters:
      command - to be completed in current thread.
      command2 - to be completed in another thread.
      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.
      Parameters:
      command - to be completed in current thread.
      command2 - to be completed in another thread.
      command3 - to be completed in another thread.
      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.
      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:
    • 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.
      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:
    • runUninterruptibly

      public static void runUninterruptibly(Throwables.Runnable<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.
      Parameters:
      cmd -
    • runUninterruptibly

      public static void runUninterruptibly(long timeoutInMillis, Throwables.LongConsumer<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.
      Parameters:
      timeoutInMillis -
      cmd -
    • runUninterruptibly

      public static void runUninterruptibly(long timeout, TimeUnit unit, 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)
      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:
    • callUninterruptibly

      public static <T> T callUninterruptibly(long timeoutInMillis, Throwables.LongFunction<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.
      Type Parameters:
      T -
      Parameters:
      timeoutInMillis -
      cmd -
      Returns:
    • callUninterruptibly

      public static <T> T callUninterruptibly(long timeout, TimeUnit unit, 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)
      Parameters:
      timeoutInMillis -
    • sleep

      public static void sleep(long timeout, TimeUnit unit) throws IllegalArgumentException
      Parameters:
      timeout -
      unit -
      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, 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.
    • toRuntimeException

      public static RuntimeException toRuntimeException(Throwable e)
      Parameters:
      e -
      Returns:
      See Also:
    • hasCause

      public static boolean hasCause(Throwable e, Class<? extends Throwable> type)
      Parameters:
      e -
      type -
      Returns:
      See Also:
    • firstCause

      public static Throwable firstCause(Throwable e)
      Returns the specified Throwable e if there is no cause found in it (e.getCause() == null).
      Parameters:
      e -
      Returns:
      See Also:
    • println

      public static <T> T println(T obj)
      Type Parameters:
      T -
      Parameters:
      obj -
      Returns:
    • fprintln

      @SafeVarargs public static <T> T[] fprintln(String format, T... args)
      Type Parameters:
      T -
      Parameters:
      format -
      args -
      Returns:
    • toIntExact

      public static int toIntExact(long value)
      Returns the value of the long argument; throwing an exception if the value overflows an int.
      Parameters:
      value - the long value
      Returns:
      Throws:
      ArithmeticException - if the argument overflows an int
    • castIfAssignable

      @Beta public static <T> u.Nullable<T> castIfAssignable(Object val, Class<T> targetType)
      Returns an empty Nullable if val is null while targetType is primitive or can not be assigned to targetType. Please be aware that null can be assigned to any Object type except primitive types: boolean/char/byte/short/int/long/double.
      Type Parameters:
      T -
      Parameters:
      val -
      targetType -
      Returns:
    • tryOrEmptyIfNotSucceed

      @Beta public static <R> u.Nullable<R> tryOrEmptyIfNotSucceed(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:
    • tryOrEmptyIfNotSucceed

      @Beta public static <T, R, E extends Exception> u.Nullable<R> tryOrEmptyIfNotSucceed(T init, Throwables.Function<? super T,R,E> func)
      Returns a Nullable with the value returned by func.apply(init) or an empty Nullable if exception happens.
      Type Parameters:
      T -
      R -
      E -
      Parameters:
      init -
      func -
      Returns:
      See Also:
    • tryOrDefaultIfNotSucceed

      @Beta public static <R> R tryOrDefaultIfNotSucceed(Callable<R> cmd, R defaultIfNotSucceed)
      Returns the value returned by action or defaultIfNotSucceed if exception happens.
      Type Parameters:
      R -
      Parameters:
      cmd -
      defaultIfNotSucceed -
      Returns:
      See Also:
    • tryOrDefaultIfNotSucceed

      @Beta public static <T, R, E extends Exception> R tryOrDefaultIfNotSucceed(T init, Throwables.Function<? super T,R,E> func, R defaultIfNotSucceed)
      Returns the value returned by action or defaultIfNotSucceed if exception happens.
      Type Parameters:
      T -
      R -
      E -
      Parameters:
      init -
      func -
      defaultIfNotSucceed -
      Returns:
      See Also:
    • tryOrDefaultIfNotSucceed

      @Beta public static <R> R tryOrDefaultIfNotSucceed(Callable<R> cmd, Supplier<R> supplierForDefaultIfNotSucceed)
      Returns the value returned by action or {@code supplierForDefaultIfNotSucceed} if exception happens.
      Type Parameters:
      R -
      Parameters:
      cmd -
      supplierForDefaultIfNotSucceed -
      Returns:
      See Also:
    • tryOrDefaultIfNotSucceed

      @Beta public static <T, R, E extends Exception> R tryOrDefaultIfNotSucceed(T init, Throwables.Function<? super T,R,E> func, Supplier<R> supplierForDefaultIfNotSucceed)
      Returns the value returned by action or defaultIfNotSucceed if exception happens.
      Type Parameters:
      T -
      R -
      E -
      Parameters:
      init -
      func -
      supplierForDefaultIfNotSucceed -
      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
    • ifOrEmpty

      @Beta public static <T, R, E extends Exception> u.Nullable<R> ifOrEmpty(boolean b, T init, Throwables.Function<? super T,R,E> func) throws E
      Returns a Nullable with value returned by func.apply(init) if b is true, otherwise returns an empty Nullable if b is false.
      Type Parameters:
      T -
      R -
      E -
      Parameters:
      b -
      init -
      func -
      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
      If or else.
      Type Parameters:
      E1 -
      E2 -
      Parameters:
      b -
      actionForTrue - do nothing if it's null even b is true.
      actionForFalse - do nothing if it's null even b is false.
      Throws:
      E1 - the e1
      E2 - the e2
    • ifOrElse

      @Beta public static <T, E1 extends Exception, E2 extends Exception> void ifOrElse(boolean b, T init, Throwables.Consumer<? super T,E1> actionForTrue, Throwables.Consumer<? super T,E2> actionForFalse) throws E1, E2
      If or else.
      Type Parameters:
      T -
      E1 -
      E2 -
      Parameters:
      b -
      init -
      actionForTrue - do nothing if it's null even b is true.
      actionForFalse - do nothing if it's null even b is false.
      Throws:
      E1 - the e1
      E2 - the e2
    • lazyInit

      @Beta public static <T> LazyInitializer<T> lazyInit(Supplier<T> supplier)
    • lazyInitialize

      @Beta public static <T, E extends Exception> Throwables.LazyInitializer<T,E> lazyInitialize(Throwables.Supplier<T,E> supplier)
    • isPrimitiveType

      public static boolean isPrimitiveType(Class<?> cls)
      Checks if is primitive type.
      Parameters:
      cls -
      Returns:
      true, if is primitive type
    • isWrapperType

      public static boolean isWrapperType(Class<?> cls)
      Checks if is wrapper type.
      Parameters:
      cls -
      Returns:
      true, if is wrapper type
    • isPrimitiveArrayType

      public static boolean isPrimitiveArrayType(Class<?> cls)
      Checks if is primitive array type.
      Parameters:
      cls -
      Returns:
      true, if is primitive array type
    • wrap

      public static Class<?> wrap(Class<?> cls)
      Returns the corresponding wrapper type of type if it is a primitive type; otherwise returns type itself. Idempotent.
           wrap(int.class) == Integer.class
           wrap(Integer.class) == Integer.class
           wrap(String.class) == String.class
       
      Parameters:
      cls -
      Returns:
    • unwrap

      public static Class<?> unwrap(Class<?> cls)
      Returns the corresponding primitive type of type if it is a wrapper type; otherwise returns type itself. Idempotent.
           unwrap(Integer.class) == int.class
           unwrap(int.class) == int.class
           unwrap(String.class) == String.class
       
      Parameters:
      cls -
      Returns:
    • invert

      @Beta public static void invert(boolean[] a)
      Inverts the element from fromIndex to toIndex: set it to true if it's false, or set it to false if it's true.
      Parameters:
      a -
    • invert

      @Beta public static void invert(boolean[] a, int fromIndex, int toIndex)
      Inverts the element from fromIndex to toIndex: set it to true if it's false, or set it to false if it's true.
      Parameters:
      a -
      fromIndex -
      toIndex -
    • applyToEach

      @Beta public static <T, E extends Exception> void applyToEach(T[] a, Throwables.Function<? super T,? extends T,E> converter) throws E
      Updates each element in the specified array a with specified function converter.
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      converter -
      Throws:
      E
    • applyToEach

      @Beta public static <T, E extends Exception> void applyToEach(List<T> c, Throwables.Function<? super T,? extends T,E> converter) throws E
      Throws:
      E extends Exception
    • copyThenApply

      public static <T, E extends Exception> T[] copyThenApply(T[] a, Throwables.Function<? super T,? extends T,E> converter) throws E
      Copy the specified array a first, then call converter on the copy.
      Type Parameters:
      E -
      Parameters:
      a -
      converter -
      Returns:
      updated copy of a.
      Throws:
      E
    • typeOf

      public static <T> com.landawn.abacus.type.Type<T> typeOf(String typeName) throws IllegalArgumentException
      Type Parameters:
      T -
      Parameters:
      typeName -
      Returns:
      Throws:
      IllegalArgumentException - if the specified typeName is null.
    • typeOf

      public static <T> com.landawn.abacus.type.Type<T> typeOf(Class<?> cls) throws IllegalArgumentException
      Type Parameters:
      T -
      Parameters:
      cls -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Class is null.
    • valueOf

      public static <T> T valueOf(Class<? extends T> targetClass, String str)
      Type Parameters:
      T -
      Parameters:
      targetClass -
      str -
      Returns:
    • defaultValueOf

      public static <T> T defaultValueOf(Class<T> cls)
      Default value of.
      Type Parameters:
      T -
      Parameters:
      cls -
      Returns:
    • defaultIfNull

      public static boolean defaultIfNull(Boolean b)
      Default if null.
      Parameters:
      b -
      Returns:
    • defaultIfNull

      public static boolean defaultIfNull(Boolean b, boolean defaultForNull)
      Default if null.
      Parameters:
      b -
      defaultForNull -
      Returns:
    • defaultIfNull

      public static char defaultIfNull(Character c)
      Default if null.
      Parameters:
      c -
      Returns:
    • defaultIfNull

      public static char defaultIfNull(Character c, char defaultForNull)
      Default if null.
      Parameters:
      c -
      defaultForNull -
      Returns:
    • defaultIfNull

      public static byte defaultIfNull(Byte b)
      Default if null.
      Parameters:
      b -
      Returns:
    • defaultIfNull

      public static byte defaultIfNull(Byte b, byte defaultForNull)
      Default if null.
      Parameters:
      b -
      defaultForNull -
      Returns:
    • defaultIfNull

      public static short defaultIfNull(Short b)
      Default if null.
      Parameters:
      b -
      Returns:
    • defaultIfNull

      public static short defaultIfNull(Short b, short defaultForNull)
      Default if null.
      Parameters:
      b -
      defaultForNull -
      Returns:
    • defaultIfNull

      public static int defaultIfNull(Integer b)
      Default if null.
      Parameters:
      b -
      Returns:
    • defaultIfNull

      public static int defaultIfNull(Integer b, int defaultForNull)
      Default if null.
      Parameters:
      b -
      defaultForNull -
      Returns:
    • defaultIfNull

      public static long defaultIfNull(Long b)
      Default if null.
      Parameters:
      b -
      Returns:
    • defaultIfNull

      public static long defaultIfNull(Long b, long defaultForNull)
      Default if null.
      Parameters:
      b -
      defaultForNull -
      Returns:
    • defaultIfNull

      public static float defaultIfNull(Float b)
      Default if null.
      Parameters:
      b -
      Returns:
    • defaultIfNull

      public static float defaultIfNull(Float b, float defaultForNull)
      Default if null.
      Parameters:
      b -
      defaultForNull -
      Returns:
    • defaultIfNull

      public static double defaultIfNull(Double b)
      Default if null.
      Parameters:
      b -
      Returns:
    • defaultIfNull

      public static double defaultIfNull(Double b, double defaultForNull)
      Default if null.
      Parameters:
      b -
      defaultForNull -
      Returns:
    • defaultIfNull

      public static <T> T defaultIfNull(T obj, T defaultForNull)
      Default if null.
      Type Parameters:
      T -
      Parameters:
      obj -
      defaultForNull -
      Returns:
    • defaultIfNullOrEmpty

      public static <T extends CharSequence> T defaultIfNullOrEmpty(T str, T defaultStr)
    • defaultIfNullOrEmptyOrBlank

      public static <T extends CharSequence> T defaultIfNullOrEmptyOrBlank(T str, T defaultStr)
    • stringOf

      public static String stringOf(boolean val)
      Parameters:
      val -
      Returns:
    • stringOf

      public static String stringOf(char val)
      Parameters:
      val -
      Returns:
    • stringOf

      public static String stringOf(byte val)
      Parameters:
      val -
      Returns:
    • stringOf

      public static String stringOf(short val)
      Parameters:
      val -
      Returns:
    • stringOf

      public static String stringOf(int val)
      Parameters:
      val -
      Returns:
    • stringOf

      public static String stringOf(long val)
      Parameters:
      val -
      Returns:
    • stringOf

      public static String stringOf(float val)
      Parameters:
      val -
      Returns:
    • stringOf

      public static String stringOf(double val)
      Parameters:
      val -
      Returns:
    • stringOf

      public static String stringOf(Object obj)
      Parameters:
      obj -
      Returns:
      null if the specified object is null.
    • enumListOf

      public static <E extends Enum<E>> ImmutableList<E> enumListOf(Class<E> enumClass)
      Enum list of.
      Type Parameters:
      E -
      Parameters:
      enumClass -
      Returns:
    • enumSetOf

      public static <E extends Enum<E>> ImmutableSet<E> enumSetOf(Class<E> enumClass)
      Enum set of.
      Type Parameters:
      E -
      Parameters:
      enumClass -
      Returns:
    • enumMapOf

      public static <E extends Enum<E>> ImmutableBiMap<E,String> enumMapOf(Class<E> enumClass)
      Enum map of.
      Type Parameters:
      E -
      Parameters:
      enumClass -
      Returns:
    • newInstance

      public static <T> T newInstance(Class<T> cls)
      Type Parameters:
      T -
      Parameters:
      cls -
      Returns:
      T
    • newProxyInstance

      public static <T> T newProxyInstance(Class<T> interfaceClass, InvocationHandler h)
      New proxy instance.
      Type Parameters:
      T -
      Parameters:
      interfaceClass -
      h -
      Returns:
    • newProxyInstance

      public static <T> T newProxyInstance(Class<?>[] interfaceClasses, InvocationHandler h)
      Refer to java.lang.reflect
      Type Parameters:
      T -
      Parameters:
      interfaceClasses -
      h -
      Returns:
    • newArray

      public static <T> T newArray(Class<?> componentType, int length)
      Type Parameters:
      T -
      Parameters:
      componentType -
      length -
      Returns:
      T[]
    • newEntity

      public static <T> T newEntity(Class<T> cls)
      Type Parameters:
      T -
      Parameters:
      cls -
      Returns:
    • newEntity

      public static <T> T newEntity(Class<T> cls, String entityName)
      Type Parameters:
      T -
      Parameters:
      cls -
      entityName -
      Returns:
    • 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:
    • 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:
    • 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:
    • newLongMultiset

      public static <T> LongMultiset<T> newLongMultiset()
      Type Parameters:
      T -
      Returns:
    • newLongMultiset

      public static <T> LongMultiset<T> newLongMultiset(int initialCapacity)
      Type Parameters:
      T -
      Parameters:
      initialCapacity -
      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 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, E extends Exception> Map<K,V> newHashMap(Collection<? extends V> c, Throwables.Function<? super V,? extends K,E> keyMapper) throws E
      New hash map.
      Type Parameters:
      K - the key type
      V - the value type
      E -
      Parameters:
      c -
      keyMapper -
      Returns:
      Throws:
      E - the e
    • 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, E extends Exception> Map<K,V> newLinkedHashMap(Collection<? extends V> c, Throwables.Function<? super V,? extends K,E> keyMapper) throws E
      New linked hash map.
      Type Parameters:
      K - the key type
      V - the value type
      E -
      Parameters:
      c -
      keyMapper -
      Returns:
      Throws:
      E - the e
    • 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(Map<? extends K,? extends E> m)
      New list multimap.
      Type Parameters:
      K - the key type
      E -
      Parameters:
      m -
      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:
    • newLinkedListMultimap

      public static <K, E> ListMultimap<K,E> newLinkedListMultimap()
      Return 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)
      Return 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)
      Return 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()
      Return 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)
      Return 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(Map<? extends K,? extends E> m)
      New set multimap.
      Type Parameters:
      K - the key type
      E -
      Parameters:
      m -
      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:
    • newLinkedSetMultimap

      public static <K, E> SetMultimap<K,E> newLinkedSetMultimap()
      Return 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)
      Return 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)
      Return 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()
      Return 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)
      Return 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()
      New empty data set.
      Returns:
    • newEmptyDataSet

      public static DataSet newEmptyDataSet(Collection<String> columnNames)
      New empty data set.
      Parameters:
      columnNames -
      Returns:
    • newDataSet

      public static DataSet newDataSet(String keyColumnName, String valueColumnName, Map<?,?> m)
      Convert the specified Map to a two columns DataSet: one column is for keys and one column is for values.
      Parameters:
      keyColumnName -
      valueColumnName -
      m -
      Returns:
    • newDataSet

      public static <T> DataSet newDataSet(Collection<T> rows)
      The first row will be used as column names if its type is array or list, or obtain the column names from first row if its type is entity or map.
      Type Parameters:
      T -
      Parameters:
      rows - list of row which can be: Map/Entity/Array/List
      Returns:
    • newDataSet

      public static <T> DataSet newDataSet(Collection<String> columnNames, Collection<T> rowList)
      If the specified columnNames is null or empty, the first row will be used as column names if its type is array or list, or obtain the column names from first row if its type is entity or map.
      Type Parameters:
      T -
      Parameters:
      columnNames -
      rows - list of row which can be: Map/Entity/Array/List
      Returns:
    • newDataSet

      public static DataSet newDataSet(Collection<String> columnNames, Object[][] rowList)
    • newDataSet

      public static <C extends Collection<?>> DataSet newDataSet(Map<String,C> map)
      New data set.
      Type Parameters:
      C -
      Parameters:
      map - keys are column names, values are columns
      Returns:
    • merge

      public static DataSet merge(DataSet a, DataSet b)
    • merge

      public static DataSet merge(DataSet a, DataSet b, DataSet c)
    • merge

      public static DataSet merge(Collection<? extends DataSet> dss)
    • 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)
      Parameters:
      c -
      fromIndex -
      toIndex -
      Returns:
    • toArray

      public static <A, T extends A> A[] toArray(Collection<T> c, A[] a) throws IllegalArgumentException
      Type Parameters:
      A -
      T -
      Parameters:
      c -
      a -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array is null.
    • toArray

      public static <A, T extends A> A[] toArray(Collection<T> c, int fromIndex, int toIndex, A[] a) throws IllegalArgumentException
      Type Parameters:
      A -
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      a -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Array is null.
    • toArray

      public static <A, T extends A> A[] toArray(Collection<T> c, IntFunction<A[]> arraySupplier)
      Type Parameters:
      A -
      T -
      Parameters:
      c -
      arraySupplier -
      Returns:
    • toArray

      public static <A, T extends A> A[] toArray(Collection<T> c, int fromIndex, int toIndex, IntFunction<A[]> arraySupplier)
      Type Parameters:
      A -
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      arraySupplier -
      Returns:
    • toArray

      public static <A, T extends A> A[] toArray(Class<A[]> targetClass, Collection<T> c) throws IllegalArgumentException
      Type Parameters:
      A -
      T -
      Parameters:
      targetClass -
      c -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Class is null.
    • toArray

      public static <A, T extends A> A[] toArray(Class<A[]> targetClass, Collection<T> c, int fromIndex, int toIndex) throws IllegalArgumentException
      Type Parameters:
      A -
      T -
      Parameters:
      targetClass -
      c -
      fromIndex -
      toIndex -
      Returns:
      Throws:
      IllegalArgumentException - if the specified Class is null.
    • 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)
      To boolean array.
      Parameters:
      c -
      fromIndex -
      toIndex -
      defaultForNull -
      Returns:
    • toBooleanArray

      public static boolean[] toBooleanArray(byte[] a)
    • 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)
      To char array.
      Parameters:
      c -
      fromIndex -
      toIndex -
      defaultForNull -
      Returns:
    • 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)
      To byte array.
      Parameters:
      c -
      fromIndex -
      toIndex -
      defaultForNull -
      Returns:
    • toByteArray

      public static byte[] toByteArray(boolean[] a)
    • 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)
      To short array.
      Parameters:
      c -
      fromIndex -
      toIndex -
      defaultForNull -
      Returns:
    • 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)
      To int array.
      Parameters:
      c -
      fromIndex -
      toIndex -
      defaultForNull -
      Returns:
    • toIntArray

      public static int[] toIntArray(char[] a)
    • 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)
      To long array.
      Parameters:
      c -
      fromIndex -
      toIndex -
      defaultForNull -
      Returns:
    • 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)
      To float array.
      Parameters:
      c -
      fromIndex -
      toIndex -
      defaultForNull -
      Returns:
    • 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)
      To double array.
      Parameters:
      c -
      fromIndex -
      toIndex -
      defaultForNull -
      Returns:
    • toList

      public static List<Boolean> toList(boolean[] a)
      Parameters:
      a -
      Returns:
    • toList

      public static List<Boolean> toList(boolean[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
    • toList

      public static List<Character> toList(char[] a)
      Parameters:
      a -
      Returns:
    • toList

      public static List<Character> toList(char[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
    • toList

      public static List<Byte> toList(byte[] a)
      Parameters:
      a -
      Returns:
    • toList

      public static List<Byte> toList(byte[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
    • toList

      public static List<Short> toList(short[] a)
      Parameters:
      a -
      Returns:
    • toList

      public static List<Short> toList(short[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
    • toList

      public static List<Integer> toList(int[] a)
      Parameters:
      a -
      Returns:
    • toList

      public static List<Integer> toList(int[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
    • toList

      public static List<Long> toList(long[] a)
      Parameters:
      a -
      Returns:
    • toList

      public static List<Long> toList(long[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
    • toList

      public static List<Float> toList(float[] a)
      Parameters:
      a -
      Returns:
    • toList

      public static List<Float> toList(float[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
    • toList

      public static List<Double> toList(double[] a)
      Parameters:
      a -
      Returns:
    • toList

      public static List<Double> toList(double[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
    • 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)
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
    • toList

      public static <T> List<T> toList(Iterator<? extends T> iter)
    • toSet

      public static Set<Boolean> toSet(boolean[] a)
      Parameters:
      a -
      Returns:
    • toSet

      public static Set<Boolean> toSet(boolean[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
    • toSet

      public static Set<Character> toSet(char[] a)
      Parameters:
      a -
      Returns:
    • toSet

      public static Set<Character> toSet(char[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
    • toSet

      public static Set<Byte> toSet(byte[] a)
      Parameters:
      a -
      Returns:
    • toSet

      public static Set<Byte> toSet(byte[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
    • toSet

      public static Set<Short> toSet(short[] a)
      Parameters:
      a -
      Returns:
    • toSet

      public static Set<Short> toSet(short[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
    • toSet

      public static Set<Integer> toSet(int[] a)
      Parameters:
      a -
      Returns:
    • toSet

      public static Set<Integer> toSet(int[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
    • toSet

      public static Set<Long> toSet(long[] a)
      Parameters:
      a -
      Returns:
    • toSet

      public static Set<Long> toSet(long[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
    • toSet

      public static Set<Float> toSet(float[] a)
      Parameters:
      a -
      Returns:
    • toSet

      public static Set<Float> toSet(float[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
    • toSet

      public static Set<Double> toSet(double[] a)
      Parameters:
      a -
      Returns:
    • toSet

      public static Set<Double> toSet(double[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
    • 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)
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
    • toSet

      public static <T> Set<T> toSet(Iterator<? extends T> iter)
    • 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)
      Type Parameters:
      C -
      Parameters:
      a -
      fromIndex -
      toIndex -
      supplier -
      Returns:
    • 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)
      Type Parameters:
      C -
      Parameters:
      a -
      fromIndex -
      toIndex -
      supplier -
      Returns:
    • 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)
      Type Parameters:
      C -
      Parameters:
      a -
      fromIndex -
      toIndex -
      supplier -
      Returns:
    • 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)
      Type Parameters:
      C -
      Parameters:
      a -
      fromIndex -
      toIndex -
      supplier -
      Returns:
    • 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)
      Type Parameters:
      C -
      Parameters:
      a -
      fromIndex -
      toIndex -
      supplier -
      Returns:
    • 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)
      Type Parameters:
      C -
      Parameters:
      a -
      fromIndex -
      toIndex -
      supplier -
      Returns:
    • 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)
      Type Parameters:
      C -
      Parameters:
      a -
      fromIndex -
      toIndex -
      supplier -
      Returns:
    • 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)
      Type Parameters:
      C -
      Parameters:
      a -
      fromIndex -
      toIndex -
      supplier -
      Returns:
    • 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)
      Type Parameters:
      T -
      C -
      Parameters:
      a -
      fromIndex -
      toIndex -
      supplier -
      Returns:
    • toCollection

      public static <T, C extends Collection<T>> C toCollection(Iterator<? extends T> iter, Supplier<? extends C> supplier)
    • 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)
      Type Parameters:
      K - the key type
      V - the value type
      k -
      v -
      Parameters:
      k1 -
      v1 -
      Returns:
    • asMap

      public static <K, V> Map<K,V> asMap(K k1, V v1, K k2, V v2)
      Type Parameters:
      K - the key type
      V - the value type
      k -
      v -
      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)
      Type Parameters:
      K - the key type
      V - the value type
      k -
      v -
      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)
      Type Parameters:
      K - the key type
      V - the value type
      k -
      v -
      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)
      Type Parameters:
      K - the key type
      V - the value type
      k -
      v -
      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)
      Type Parameters:
      K - the key type
      V - the value type
      k -
      v -
      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)
      Type Parameters:
      K - the key type
      V - the value type
      k -
      v -
      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.
      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)
      As linked hash map.
      Type Parameters:
      K - the key type
      V - the value type
      k -
      v -
      Parameters:
      k1 -
      v1 -
      Returns:
    • asLinkedHashMap

      public static <K, V> Map<K,V> asLinkedHashMap(K k1, V v1, K k2, V v2)
      As linked hash map.
      Type Parameters:
      K - the key type
      V - the value type
      k -
      v -
      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)
      As linked hash map.
      Type Parameters:
      K - the key type
      V - the value type
      k -
      v -
      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)
      As linked hash map.
      Type Parameters:
      K - the key type
      V - the value type
      k -
      v -
      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)
      As linked hash map.
      Type Parameters:
      K - the key type
      V - the value type
      k -
      v -
      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)
      As linked hash map.
      Type Parameters:
      K - the key type
      V - the value type
      k -
      v -
      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)
      As linked hash map.
      Type Parameters:
      K - the key type
      V - the value type
      k -
      v -
      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.
      As linked hash map.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      a -
      Returns:
    • asProps

      public static Map<String,Object> asProps(String propName, Object propValue)
    • asProps

      public static Map<String,Object> asProps(String propName1, Object propValue1, String propName2, Object propValue2)
    • asProps

      public static Map<String,Object> asProps(String propName1, Object propValue1, String propName2, Object propValue2, String propName3, Object propValue3)
    • asProps

      public static Map<String,Object> asProps(String propName1, Object propValue1, String propName2, Object propValue2, String propName3, Object propValue3, String propName4, Object propValue4)
    • 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)
    • asProps

      @Deprecated @SafeVarargs public static Map<String,Object> asProps(Object... a)
      Deprecated.
      Parameters:
      a - pairs of property name and value or a Java Entity Object what allows access to properties using getter and setter methods.
      Returns:
    • asList

      public static <T> List<T> asList(T e)
      Type Parameters:
      T -
      Parameters:
      e -
      Returns:
    • asList

      public static <T> List<T> asList(T e1, T e2)
      Type Parameters:
      T -
      Parameters:
      e1 -
      e2 -
      Returns:
    • asList

      public static <T> List<T> asList(T e1, T e2, T e3)
      Type Parameters:
      T -
      Parameters:
      e1 -
      e2 -
      e3 -
      Returns:
    • asList

      public static <T> List<T> asList(T e1, T e2, T e3, T e4)
      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)
      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)
      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)
      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)
      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)
      Type Parameters:
      T -
      Parameters:
      e1 -
      e2 -
      e3 -
      e4 -
      e5 -
      e6 -
      e7 -
      e8 -
      e9 -
      Returns:
    • asList

      @SafeVarargs @NullSafe public static <T> List<T> asList(T... a)
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • asLinkedList

      public static <T> LinkedList<T> asLinkedList(T e)
      As linked list.
      Type Parameters:
      T -
      Parameters:
      e -
      Returns:
    • asLinkedList

      public static <T> LinkedList<T> asLinkedList(T e1, T e2)
      As linked list.
      Type Parameters:
      T -
      Parameters:
      e1 -
      e2 -
      Returns:
    • asLinkedList

      public static <T> LinkedList<T> asLinkedList(T e1, T e2, T e3)
      As linked list.
      Type Parameters:
      T -
      Parameters:
      e1 -
      e2 -
      e3 -
      Returns:
    • asLinkedList

      public static <T> LinkedList<T> asLinkedList(T e1, T e2, T e3, T e4)
      As linked list.
      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)
      As linked list.
      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)
      As linked list.
      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)
      As linked list.
      Type Parameters:
      T -
      Parameters:
      e1 -
      e2 -
      e3 -
      e4 -
      e5 -
      e6 -
      e7 -
      Returns:
    • asLinkedList

      @SafeVarargs @NullSafe public static <T> LinkedList<T> asLinkedList(T... a)
      As linked list.
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • asSet

      public static <T> Set<T> asSet(T e)
      Type Parameters:
      T -
      Parameters:
      e -
      Returns:
    • asSet

      public static <T> Set<T> asSet(T e1, T e2)
      Type Parameters:
      T -
      Parameters:
      e1 -
      e2 -
      Returns:
    • asSet

      public static <T> Set<T> asSet(T e1, T e2, T e3)
      Type Parameters:
      T -
      Parameters:
      e1 -
      e2 -
      e3 -
      Returns:
    • asSet

      public static <T> Set<T> asSet(T e1, T e2, T e3, T e4)
      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)
      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)
      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)
      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)
      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)
      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)
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • asLinkedHashSet

      public static <T> Set<T> asLinkedHashSet(T e)
      As linked linked hash set.
      Type Parameters:
      T -
      Parameters:
      e -
      Returns:
    • asLinkedHashSet

      public static <T> Set<T> asLinkedHashSet(T e1, T e2)
      As linked linked hash set.
      Type Parameters:
      T -
      Parameters:
      e1 -
      e2 -
      Returns:
    • asLinkedHashSet

      public static <T> Set<T> asLinkedHashSet(T e1, T e2, T e3)
      As linked linked hash set.
      Type Parameters:
      T -
      Parameters:
      e1 -
      e2 -
      e3 -
      Returns:
    • asLinkedHashSet

      public static <T> Set<T> asLinkedHashSet(T e1, T e2, T e3, T e4)
      As linked linked hash set.
      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)
      As linked linked hash set.
      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)
      As linked linked hash set.
      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)
      As linked linked hash set.
      Type Parameters:
      T -
      Parameters:
      e1 -
      e2 -
      e3 -
      e4 -
      e5 -
      e6 -
      e7 -
      Returns:
    • asLinkedHashSet

      @SafeVarargs @NullSafe public static <T> Set<T> asLinkedHashSet(T... a)
      As linked hash set.
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • asSortedSet

      @SafeVarargs @NullSafe public static <T> SortedSet<T> asSortedSet(T... a)
      As sorted set.
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • asNavigableSet

      @SafeVarargs public static <T> NavigableSet<T> asNavigableSet(T... a)
      As navigable set.
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • asQueue

      @SafeVarargs public static <T> Queue<T> asQueue(T... a)
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • asArrayBlockingQueue

      @SafeVarargs public static <T> ArrayBlockingQueue<T> asArrayBlockingQueue(T... a)
      As array blocking queue.
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • asLinkedBlockingQueue

      @SafeVarargs public static <T> LinkedBlockingQueue<T> asLinkedBlockingQueue(T... a)
      As linked blocking queue.
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • asConcurrentLinkedQueue

      @SafeVarargs public static <T> ConcurrentLinkedQueue<T> asConcurrentLinkedQueue(T... a)
      As concurrent linked queue.
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • asDelayQueue

      @SafeVarargs public static <T extends Delayed> DelayQueue<T> asDelayQueue(T... a)
      As delay queue.
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • asPriorityQueue

      @SafeVarargs public static <T> PriorityQueue<T> asPriorityQueue(T... a)
      As priority queue.
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • asDeque

      @SafeVarargs public static <T> Deque<T> asDeque(T... a)
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • asArrayDeque

      @SafeVarargs public static <T> ArrayDeque<T> asArrayDeque(T... a)
      As array deque.
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • asLinkedBlockingDeque

      @SafeVarargs public static <T> LinkedBlockingDeque<T> asLinkedBlockingDeque(T... a)
      As linked blocking deque.
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • asConcurrentLinkedDeque

      @SafeVarargs public static <T> ConcurrentLinkedDeque<T> asConcurrentLinkedDeque(T... a)
      As concurrent linked deque.
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • asMultiset

      @SafeVarargs public static <T> Multiset<T> asMultiset(T... a)
      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 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 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 Map
      See Also:
    • convert

      public static <T> T convert(Object obj, Class<? extends T> targetClass)
      Try to convert the specified obj to the specified targetClass. Default value of targetClass is returned if sourceObject is null. An instance of targetClass is returned if convert successfully
      Type Parameters:
      T -
      Parameters:
      obj -
      targetClass -
      Returns:
    • convert

      public static <T> T convert(Object obj, com.landawn.abacus.type.Type<? extends T> targetType)
      Type Parameters:
      T -
      Parameters:
      obj -
      targetType -
      Returns:
    • parseBoolean

      public static boolean parseBoolean(String str)
      Returns a Boolean with a value represented by the specified string. The Boolean returned represents a true value if the string argument is not null and is equal, ignoring case, to the string "true".
      Parameters:
      str - a string.
      Returns:
    • parseChar

      public static char parseChar(String str)
      Parses the char.
      Parameters:
      str -
      Returns:
    • parseByte

      @Deprecated public static byte parseByte(String str) throws NumberFormatException
      Deprecated.
      replaced by Numbers.toByte(String)
      Returns the value by calling Byte.valueOf(String) if str is not null, otherwise, the default value 0 for byte is returned.
      Parameters:
      str -
      Returns:
      Throws:
      NumberFormatException - If the string is not a parsable byte.
      See Also:
    • parseShort

      @Deprecated public static short parseShort(String str) throws NumberFormatException
      Deprecated.
      replaced by Numbers.toShort(String)
      Returns the value by calling Short.valueOf(String) if str is not null, otherwise, the default value 0 for short is returned.
      Parameters:
      str -
      Returns:
      Throws:
      NumberFormatException - If the string is not a parsable short.
      See Also:
    • parseInt

      @Deprecated public static int parseInt(String str) throws NumberFormatException
      Deprecated.
      replaced by Numbers.toInt(String)
      Returns the value by calling Integer.valueOf(String) if str is not null, otherwise, the default value 0 for int is returned.
      Parameters:
      str -
      Returns:
      Throws:
      NumberFormatException - If the string is not a parsable int.
      See Also:
    • parseLong

      @Deprecated public static long parseLong(String str) throws NumberFormatException
      Deprecated.
      replaced by Numbers.toLong(String)
      Returns the value by calling Long.valueOf(String) if str is not null, otherwise, the default value 0 for long is returned.
      Parameters:
      str -
      Returns:
      Throws:
      NumberFormatException - If the string is not a parsable long.
      See Also:
    • parseFloat

      @Deprecated public static float parseFloat(String str) throws NumberFormatException
      Deprecated.
      replaced by Numbers.toFloat(String)
      Returns the value by calling Float.valueOf(String) if str is not null, otherwise, the default value 0f for float is returned.
      Parameters:
      str -
      Returns:
      Throws:
      NumberFormatException - If the string is not a parsable float.
      See Also:
    • parseDouble

      @Deprecated public static double parseDouble(String str) throws NumberFormatException
      Deprecated.
      replaced by Numbers.toDouble(String)
      Returns the value by calling Double.valueOf(String) if str is not null, otherwise, the default value 0d for double is returned.
      Parameters:
      str -
      Returns:
      Throws:
      NumberFormatException - If the string is not a parsable double.
      See Also:
    • base64Encode

      public static String base64Encode(byte[] binaryData)
      Base 64 encode.
      Parameters:
      binaryData -
      Returns:
    • base64EncodeString

      public static String base64EncodeString(String str)
    • base64EncodeUtf8String

      public static String base64EncodeUtf8String(String str)
    • base64EncodeChunked

      public static String base64EncodeChunked(byte[] binaryData)
      Base 64 encode chunked.
      Parameters:
      binaryData -
      Returns:
    • base64Decode

      public static byte[] base64Decode(String base64String)
      Base 64 decode.
      Parameters:
      base64String -
      Returns:
    • base64DecodeToString

      public static String base64DecodeToString(String base64String)
      Base 64 decode to string.
      Parameters:
      base64String -
      Returns:
    • base64DecodeToUtf8String

      public static String base64DecodeToUtf8String(String base64String)
    • base64UrlEncode

      public static String base64UrlEncode(byte[] binaryData)
      Base 64 url encode.
      Parameters:
      binaryData -
      Returns:
    • base64UrlDecode

      public static byte[] base64UrlDecode(String base64String)
      Base 64 url decode.
      Parameters:
      base64String -
      Returns:
    • base64UrlDecodeToString

      public static String base64UrlDecodeToString(String base64String)
      Base 64 url decode to string.
      Parameters:
      base64String -
      Returns:
    • base64UrlDecodeToUtf8String

      public static String base64UrlDecodeToUtf8String(String base64String)
    • urlEncode

      public static String urlEncode(Object parameters)
      Parameters:
      parameters -
      Returns:
    • urlEncode

      public static String urlEncode(Object parameters, Charset charset)
      Parameters:
      parameters -
      charset -
      Returns:
    • urlDecode

      public static Map<String,String> urlDecode(String urlQuery)
      Parameters:
      urlQuery -
      Returns:
    • urlDecode

      public static Map<String,String> urlDecode(String urlQuery, Charset charset)
      Parameters:
      urlQuery -
      charset -
      Returns:
    • urlDecode

      public static <T> T urlDecode(Class<? extends T> targetClass, String urlQuery)
      Type Parameters:
      T -
      Parameters:
      targetClass -
      urlQuery -
      Returns:
    • urlDecode

      public static <T> T urlDecode(Class<? extends T> targetClass, String urlQuery, Charset charset)
      Type Parameters:
      T -
      Parameters:
      targetClass -
      urlQuery -
      charset -
      Returns:
    • guid

      public static String guid()
      Returns the UUID without '-'.
      Returns:
    • uuid

      public static String uuid()
      Returns an UUID.
      Returns:
    • isEntity

      @Deprecated public static boolean isEntity(Class<?> cls)
      Deprecated.
      replaced by ClassUtil.isEntity(Class)
      Checks if is entity.
      Parameters:
      cls -
      Returns:
      true, if is entity
      See Also:
    • clone

      public static <T> T clone(T obj)
      Type Parameters:
      T -
      Parameters:
      obj - a Java object which must be serializable and deserialiable through Kryo or JSON.
      Returns:
      null if entity is null
    • clone

      public static <T> T clone(Class<? extends T> targetClass, Object obj) throws IllegalArgumentException
      Deeply copy by: obj -> serialize -> kryo/Json -> deserialize -> new object.
      Type Parameters:
      T -
      Parameters:
      targetClass -
      obj - a Java object which must be serializable and deserialiable through Kryo or JSON.
      Returns:
      a new instance of targetClass even if entity is null.
      Throws:
      IllegalArgumentException - if targetClass is null.
    • copy

      public static <T> T copy(T entity)
      Returns a new created instance of the same class and set with same properties retrieved by 'getXXX' method in the specified entity.
      Type Parameters:
      T -
      Parameters:
      entity - a Java Object what allows access to properties using getter and setter methods.
      Returns:
      null if entity is null
    • copy

      public static <T> T copy(T entity, Collection<String> selectPropNames)
      Type Parameters:
      T -
      Parameters:
      entity -
      selectPropNames -
      Returns:
      null if entity is null
    • copy

      public static <T> T copy(Class<? extends T> targetClass, Object entity) throws IllegalArgumentException
      Type Parameters:
      T -
      Parameters:
      targetClass -
      entity -
      Returns:
      a new instance of targetClass even if entity is null.
      Throws:
      IllegalArgumentException - if targetClass is null.
    • copy

      public static <T> T copy(Class<? extends T> targetClass, Object entity, Collection<String> selectPropNames) throws IllegalArgumentException
      Returns a new created instance of the specified cls and set with same properties retrieved by 'getXXX' method in the specified entity.
      Type Parameters:
      T -
      Parameters:
      targetClass - a Java Object what allows access to properties using getter and setter methods.
      entity - a Java Object what allows access to properties using getter and setter methods.
      selectPropNames -
      Returns:
      a new instance of targetClass even if entity is null.
      Throws:
      IllegalArgumentException - if targetClass is null.
    • copy

      public static <T> T copy(Class<? extends T> targetClass, Object entity, boolean ignoreUnmatchedProperty, Set<String> ignorePropNames) throws IllegalArgumentException
      Type Parameters:
      T -
      Parameters:
      targetClass -
      entity -
      ignoreUnmatchedProperty -
      ignorePropNames -
      Returns:
      a new instance of targetClass even if entity is null.
      Throws:
      IllegalArgumentException - if targetClass is null.
    • merge

      public static <T> T merge(Object sourceEntity, T targetEntity) throws IllegalArgumentException
      Parameters:
      sourceEntity -
      targetEntity -
      Returns:
      targetEntity
      Throws:
      IllegalArgumentException - if targetEntity is null.
    • merge

      public static <T> T merge(Object sourceEntity, T targetEntity, Collection<String> selectPropNames) throws IllegalArgumentException
      Set all the signed properties(including all primitive type properties) in the specified sourceEntity to the specified targetEntity.
      Parameters:
      sourceEntity - a Java Object what allows access to properties using getter and setter methods.
      targetEntity - a Java Object what allows access to properties using getter and setter methods.
      selectPropNames -
      Returns:
      targetEntity
      Throws:
      IllegalArgumentException - if targetEntity is null.
    • merge

      public static <T> T merge(Object sourceEntity, T targetEntity, BiPredicate<String,?> filter) throws IllegalArgumentException
      Set all the signed properties(including all primitive type properties) in the specified sourceEntity to the specified targetEntity.
      Parameters:
      sourceEntity - a Java Object what allows access to properties using getter and setter methods.
      targetEntity - a Java Object what allows access to properties using getter and setter methods.
      filter -
      Returns:
      targetEntity
      Throws:
      IllegalArgumentException - if targetEntity is null.
    • merge

      public static <T> T merge(Object sourceEntity, T targetEntity, boolean ignoreUnmatchedProperty, Set<String> ignorePropNames) throws IllegalArgumentException
      Parameters:
      sourceEntity -
      targetEntity -
      ignoreUnmatchedProperty -
      ignorePropNames -
      Returns:
      targetEntity
      Throws:
      IllegalArgumentException - if targetEntity is null.
    • merge

      public static <T> T merge(Object sourceEntity, T targetEntity, BinaryOperator<?> mergeFunc) throws IllegalArgumentException
      Parameters:
      sourceEntity -
      targetEntity -
      mergeFunc - the first parameter is source property value, the second parameter is target property value.
      Returns:
      targetEntity
      Throws:
      IllegalArgumentException - if targetEntity is null.
    • merge

      public static <T> T merge(Object sourceEntity, T targetEntity, Collection<String> selectPropNames, BinaryOperator<?> mergeFunc) throws IllegalArgumentException
      Set all the signed properties(including all primitive type properties) in the specified sourceEntity to the specified targetEntity.
      Parameters:
      sourceEntity - a Java Object what allows access to properties using getter and setter methods.
      targetEntity - a Java Object what allows access to properties using getter and setter methods.
      selectPropNames -
      mergeFunc - the first parameter is source property value, the second parameter is target property value.
      Returns:
      targetEntity
      Throws:
      IllegalArgumentException - if targetEntity is null.
    • merge

      public static <T> T merge(Object sourceEntity, T targetEntity, BiPredicate<String,?> filter, BinaryOperator<?> mergeFunc) throws IllegalArgumentException
      Set all the signed properties(including all primitive type properties) in the specified sourceEntity to the specified targetEntity.
      Parameters:
      sourceEntity - a Java Object what allows access to properties using getter and setter methods.
      targetEntity - a Java Object what allows access to properties using getter and setter methods.
      filter -
      mergeFunc - the first parameter is source property value, the second parameter is target property value.
      Returns:
      targetEntity
      Throws:
      IllegalArgumentException - if targetEntity is null.
    • merge

      public static <T> T merge(Object sourceEntity, T targetEntity, boolean ignoreUnmatchedProperty, Set<String> ignorePropNames, BinaryOperator<?> mergeFunc) throws IllegalArgumentException
      Parameters:
      sourceEntity -
      targetEntity -
      ignoreUnmatchedProperty -
      ignorePropNames -
      mergeFunc - the first parameter is source property value, the second parameter is target property value.
      Returns:
      targetEntity
      Throws:
      IllegalArgumentException - if targetEntity is null.
    • erase

      @SafeVarargs public static void erase(Object entity, String... propNames)
      Parameters:
      entity -
      propNames -
    • erase

      public static void erase(Object entity, Collection<String> propNames)
      Parameters:
      entity -
      propNames -
    • eraseAll

      public static void eraseAll(Object entity)
      Parameters:
      entity -
    • emptyList

      @Immutable public static <T> List<T> emptyList()
      Returns an empty immutable List.
      Type Parameters:
      T -
      Returns:
      See Also:
    • emptySet

      @Immutable public static <T> Set<T> emptySet()
      Returns an empty immutable Set.
      Type Parameters:
      T -
      Returns:
      See Also:
    • emptySortedSet

      @Immutable public static <T> SortedSet<T> emptySortedSet()
      Returns an empty immutable SortedSet.
      Type Parameters:
      T -
      Returns:
      See Also:
    • emptyNavigableSet

      @Immutable public static <T> NavigableSet<T> emptyNavigableSet()
      Returns an empty immutable NavigableSet.
      Type Parameters:
      T -
      Returns:
      See Also:
    • emptyMap

      @Immutable public static <K, V> Map<K,V> emptyMap()
      Returns an empty immutable 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 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 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 Iterator.
      Type Parameters:
      T -
      Returns:
      See Also:
    • emptyListIterator

      @Immutable public static <T> ListIterator<T> emptyListIterator()
      Returns an empty immutable ListIterator.
      Type Parameters:
      T -
      Returns:
      See Also:
    • emptyInputStream

      @Immutable public static InputStream emptyInputStream()
      Returns an empty immutable InputStream.
      Returns:
    • anyNull

      public static <T> boolean anyNull(T a, T b)
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      Returns:
    • anyNull

      public static <T> boolean anyNull(T a, T b, T c)
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      c -
      Returns:
    • anyNull

      @SafeVarargs public static <T> boolean anyNull(T... a)
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • anyNull

      public static <T> boolean anyNull(Collection<T> c)
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
    • allNull

      public static <T> boolean allNull(T a, T b)
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      Returns:
    • allNull

      public static <T> boolean allNull(T a, T b, T c)
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      c -
      Returns:
    • allNull

      @SafeVarargs public static <T> boolean allNull(T... a)
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • allNull

      public static <T> boolean allNull(Collection<T> c)
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
    • anyNullOrEmpty

      public static boolean anyNullOrEmpty(CharSequence a, CharSequence b)
      Any null or empty.
      Parameters:
      a -
      b -
      Returns:
    • anyNullOrEmpty

      public static boolean anyNullOrEmpty(CharSequence a, CharSequence b, CharSequence c)
      Any null or empty.
      Parameters:
      a -
      b -
      c -
      Returns:
    • anyNullOrEmpty

      @SafeVarargs public static boolean anyNullOrEmpty(CharSequence... css)
      Any null or empty.
      Parameters:
      css -
      Returns:
    • anyNullOrEmpty

      public static boolean anyNullOrEmpty(Collection<? extends CharSequence> css)
      Any null or empty.
      Parameters:
      css -
      Returns:
    • anyNullOrEmpty

      public static <T> boolean anyNullOrEmpty(T[] a, T[] b)
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      Returns:
    • anyNullOrEmpty

      public static <T> boolean anyNullOrEmpty(T[] a, T[] b, T[] c)
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      c -
      Returns:
    • anyNullOrEmpty

      public static <T extends Collection<?>> boolean anyNullOrEmpty(T a, T b)
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      Returns:
    • anyNullOrEmpty

      public static <T extends Collection<?>> boolean anyNullOrEmpty(T a, T b, T c)
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      c -
      Returns:
    • allNullOrEmpty

      public static boolean allNullOrEmpty(CharSequence cs1, CharSequence cs2)
      All null or empty.
      Parameters:
      cs1 -
      cs2 -
      Returns:
    • allNullOrEmpty

      public static boolean allNullOrEmpty(CharSequence cs1, CharSequence cs2, CharSequence cs3)
      All null or empty.
      Parameters:
      cs1 -
      cs2 -
      cs3 -
      Returns:
    • allNullOrEmpty

      @SafeVarargs public static boolean allNullOrEmpty(CharSequence... css)
      All null or empty.
      Parameters:
      css -
      Returns:
    • allNullOrEmpty

      public static boolean allNullOrEmpty(Collection<? extends CharSequence> css)
      All null or empty.
      Parameters:
      css -
      Returns:
    • allNullOrEmpty

      public static <T> boolean allNullOrEmpty(T[] a, T[] b)
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      Returns:
    • allNullOrEmpty

      public static <T> boolean allNullOrEmpty(T[] a, T[] b, T[] c)
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      c -
      Returns:
    • allNullOrEmpty

      public static <T extends Collection<?>> boolean allNullOrEmpty(T a, T b)
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      Returns:
    • allNullOrEmpty

      public static <T extends Collection<?>> boolean allNullOrEmpty(T a, T b, T c)
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      c -
      Returns:
    • first

      public static <T> u.Nullable<T> first(Collection<T> c)
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
    • first

      public static <T> u.Nullable<T> first(Iterator<T> iter)
      Type Parameters:
      T -
      Parameters:
      iter -
      Returns:
    • last

      public static <T> u.Nullable<T> last(Collection<T> c)
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
    • last

      public static <T> u.Nullable<T> last(Iterator<T> iter)
      Type Parameters:
      T -
      Parameters:
      iter -
      Returns:
    • firstNonNull

      public static <T> u.Optional<T> firstNonNull(T a, T b)
      First non null.
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      Returns:
    • firstNonNull

      public static <T> u.Optional<T> firstNonNull(T a, T b, T c)
      First non null.
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      c -
      Returns:
    • firstNonNull

      @SafeVarargs public static <T> u.Optional<T> firstNonNull(T... a)
      First non null.
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • firstNonNull

      public static <T> u.Optional<T> firstNonNull(Collection<T> c)
      First non null.
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
    • firstNonNull

      public static <T> u.Optional<T> firstNonNull(Iterator<T> iter)
      First non null.
      Type Parameters:
      T -
      Parameters:
      iter -
      Returns:
    • lastNonNull

      public static <T> u.Optional<T> lastNonNull(T a, T b)
      Last non null.
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      Returns:
    • lastNonNull

      public static <T> u.Optional<T> lastNonNull(T a, T b, T c)
      Last non null.
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      c -
      Returns:
    • lastNonNull

      @SafeVarargs public static <T> u.Optional<T> lastNonNull(T... a)
      Last non null.
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • lastNonNull

      public static <T> u.Optional<T> lastNonNull(Collection<T> c)
      Last non null.
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
    • lastNonNull

      public static <T> u.Optional<T> lastNonNull(Iterator<T> iter)
      Last non null.
      Type Parameters:
      T -
      Parameters:
      iter -
      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:
    • 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:
    • 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:
    • 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(Collection<T> c)
      First or null if empty.
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
    • firstOrNullIfEmpty

      public static <T> T firstOrNullIfEmpty(Iterator<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(Collection<T> c, T defaultValueForEmpty)
      First or default if empty.
      Type Parameters:
      T -
      Parameters:
      c -
      defaultValueForEmpty -
      Returns:
    • firstOrDefaultIfEmpty

      public static <T> T firstOrDefaultIfEmpty(Iterator<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(Collection<T> c)
      Last or null if empty.
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
    • lastOrNullIfEmpty

      public static <T> T lastOrNullIfEmpty(Iterator<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(Collection<T> c, T defaultValueForEmpty)
      Last or default if empty.
      Type Parameters:
      T -
      Parameters:
      c -
      defaultValueForEmpty -
      Returns:
    • lastOrDefaultIfEmpty

      public static <T> T lastOrDefaultIfEmpty(Iterator<T> iter, T defaultValueForEmpty)
      Last or default if empty.
      Type Parameters:
      T -
      Parameters:
      iter -
      defaultValueForEmpty -
      Returns:
    • findFirst

      public static <T, E extends Exception> u.Nullable<T> findFirst(T[] a, Throwables.Predicate<? super T,E> predicate) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      predicate -
      Returns:
      the nullable
      Throws:
      E - the e
    • findFirst

      public static <T, E extends Exception> u.Nullable<T> findFirst(Collection<? extends T> c, Throwables.Predicate<? super T,E> predicate) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      predicate -
      Returns:
      the nullable
      Throws:
      E - the e
    • findFirst

      public static <T, E extends Exception> u.Nullable<T> findFirst(Iterator<? extends T> iter, Throwables.Predicate<? super T,E> predicate) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      iter -
      predicate -
      Returns:
      Throws:
      E
    • findLast

      public static <T, E extends Exception> u.Nullable<T> findLast(T[] a, Throwables.Predicate<? super T,E> predicate) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      predicate -
      Returns:
      the nullable
      Throws:
      E - the e
    • findLast

      public static <T, E extends Exception> u.Nullable<T> findLast(Collection<? extends T> c, Throwables.Predicate<? super T,E> predicate) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      predicate -
      Returns:
      the nullable
      Throws:
      E - the e
    • findFirstNonNull

      public static <T, E extends Exception> u.Optional<T> findFirstNonNull(T[] a, Throwables.Predicate<? super T,E> predicate) throws E
      Find first non null.
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      predicate -
      Returns:
      the optional
      Throws:
      E - the e
    • findFirstNonNull

      public static <T, E extends Exception> u.Optional<T> findFirstNonNull(Collection<? extends T> c, Throwables.Predicate<? super T,E> predicate) throws E
      Find first non null.
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      predicate -
      Returns:
      the optional
      Throws:
      E - the e
    • findFirstNonNull

      public static <T, E extends Exception> u.Optional<T> findFirstNonNull(Iterator<? extends T> iter, Throwables.Predicate<? super T,E> predicate) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      iter -
      predicate -
      Returns:
      Throws:
      E
    • findLastNonNull

      public static <T, E extends Exception> u.Optional<T> findLastNonNull(T[] a, Throwables.Predicate<? super T,E> predicate) throws E
      Find last non null.
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      predicate -
      Returns:
      the optional
      Throws:
      E - the e
    • findLastNonNull

      public static <T, E extends Exception> u.Optional<T> findLastNonNull(Collection<? extends T> c, Throwables.Predicate<? super T,E> predicate) throws E
      Find last non null.
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      predicate -
      Returns:
      the optional
      Throws:
      E - the e
    • first

      public static <T> List<T> first(Collection<? extends T> c, int n)
      Return at most first n elements.
      Type Parameters:
      T -
      Parameters:
      c -
      n -
      Returns:
      the list
    • last

      public static <T> List<T> last(Collection<? extends T> c, int n)
      Return at most last n elements.
      Type Parameters:
      T -
      Parameters:
      c -
      n -
      Returns:
      the list
    • slice

      public static <T> ImmutableList<? extends T> slice(T[] a, int fromIndex, int toIndex)
      Returns a read-only Seq.
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
      the immutable collectioninvalid input: '<'? extends t>
    • slice

      public static <T> ImmutableList<? extends T> slice(List<? extends T> c, int fromIndex, int toIndex)
      Returns a read-only ImmutableCollection.
      Type Parameters:
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      Returns:
      the immutable collectioninvalid input: '<'? extends t>
    • slice

      public static <T> ImmutableCollection<? extends T> slice(Collection<? extends T> c, int fromIndex, int toIndex)
      Returns a read-only ImmutableCollection.
      Type Parameters:
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      Returns:
      the immutable collectioninvalid input: '<'? extends t>
    • slice

      public static <T> ObjIterator<T> slice(Iterator<T> iter, long fromIndex, long toIndex)
      Type Parameters:
      T -
      Parameters:
      iter -
      fromIndex -
      toIndex -
      Returns:
    • len

      public static int len(CharSequence s)
      Returns the length/size of the specified Array/Collection/Map/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/CharSequence, 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/CharSequence, 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/CharSequence, 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/CharSequence, 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/CharSequence, 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/CharSequence, 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/CharSequence, 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/CharSequence, 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/CharSequence, 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/CharSequence, 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/CharSequence, or 0 if it's empty or null.
      Parameters:
      m -
      Returns:
    • nullToEmpty

      public static <T> List<T> nullToEmpty(List<T> list)
      Returns an immutable empty list if the specified List is null, otherwise itself is returned.
      Type Parameters:
      T -
      Parameters:
      list -
      Returns:
    • nullToEmpty

      public static <T> Set<T> nullToEmpty(Set<T> set)
      Returns an immutable empty set if the specified Set is null, otherwise itself is returned.
      Type Parameters:
      T -
      Parameters:
      set -
      Returns:
    • nullToEmpty

      public static <T> SortedSet<T> nullToEmpty(SortedSet<T> set)
      Returns an immutable empty SortedSet if the specified SortedSet is null, otherwise itself is returned.
      Type Parameters:
      T -
      Parameters:
      set -
      Returns:
    • nullToEmpty

      public static <T> NavigableSet<T> nullToEmpty(NavigableSet<T> set)
      Returns an immutable empty NavigableSet if the specified NavigableSet is null, otherwise itself is returned.
      Type Parameters:
      T -
      Parameters:
      set -
      Returns:
    • nullToEmpty

      public static <K, V> Map<K,V> nullToEmpty(Map<K,V> map)
      Returns an immutable empty map if the specified Map is null, otherwise itself is returned.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      map -
      Returns:
    • nullToEmpty

      public static <K, V> SortedMap<K,V> nullToEmpty(SortedMap<K,V> map)
      Returns an immutable empty SortedMap if the specified SortedMap is null, otherwise itself is returned.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      map -
      Returns:
    • nullToEmpty

      public static <K, V> NavigableMap<K,V> nullToEmpty(NavigableMap<K,V> map)
      Returns an immutable empty NavigableMap if the specified NavigableMap is null, otherwise itself is returned.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      map -
      Returns:
    • nullToEmpty

      public static <T> Iterator<T> nullToEmpty(Iterator<T> iter)
      Returns an immutable empty Iterator if the specified Iterator is null, otherwise itself is returned.
      Type Parameters:
      T -
      Parameters:
      iter -
      Returns:
    • nullToEmpty

      public static <T> ListIterator<T> nullToEmpty(ListIterator<T> iter)
      Returns an immutable empty ListIterator if the specified ListIterator is null, otherwise itself is returned.
      Type Parameters:
      T -
      Parameters:
      iter -
      Returns:
    • nullToEmpty

      public static String nullToEmpty(String str)
      Null to empty.
      Parameters:
      str -
      Returns:
    • 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 String[] nullToEmpty(String[] a)
      Null to empty.
      Parameters:
      a -
      Returns:
    • nullToEmpty

      @Deprecated public static Object[] nullToEmpty(Object[] a)
      Deprecated.
      replaced by CommonUtil.nullToEmpty(Object[], Class)
      Null to empty.
      Parameters:
      a -
      Returns:
    • nullToEmpty

      @Deprecated public static <T> T[] nullToEmpty(Class<T[]> arrayType, T[] a)
      Deprecated.
      replaced by CommonUtil.nullToEmpty(Object[], Class)
      Null to empty.
      Type Parameters:
      T -
      Parameters:
      arrayType -
      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 immutable empty 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 immutable empty 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 immutable empty 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 immutable empty 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 immutable empty 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 immutable empty 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 immutable empty 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 immutable empty 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 immutable empty map if the specified ImmutableBiMap is null, otherwise itself is returned.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      map -
      Returns:
    • isNullOrEmpty

      public static boolean isNullOrEmpty(CharSequence s)
      Checks if is null or empty.
      Parameters:
      s -
      Returns:
      true, if is null or empty
    • isNullOrEmpty

      public static boolean isNullOrEmpty(boolean[] a)
      Checks if is null or empty.
      Parameters:
      a -
      Returns:
      true, if is null or empty
    • isNullOrEmpty

      public static boolean isNullOrEmpty(char[] a)
      Checks if is null or empty.
      Parameters:
      a -
      Returns:
      true, if is null or empty
    • isNullOrEmpty

      public static boolean isNullOrEmpty(byte[] a)
      Checks if is null or empty.
      Parameters:
      a -
      Returns:
      true, if is null or empty
    • isNullOrEmpty

      public static boolean isNullOrEmpty(short[] a)
      Checks if is null or empty.
      Parameters:
      a -
      Returns:
      true, if is null or empty
    • isNullOrEmpty

      public static boolean isNullOrEmpty(int[] a)
      Checks if is null or empty.
      Parameters:
      a -
      Returns:
      true, if is null or empty
    • isNullOrEmpty

      public static boolean isNullOrEmpty(long[] a)
      Checks if is null or empty.
      Parameters:
      a -
      Returns:
      true, if is null or empty
    • isNullOrEmpty

      public static boolean isNullOrEmpty(float[] a)
      Checks if is null or empty.
      Parameters:
      a -
      Returns:
      true, if is null or empty
    • isNullOrEmpty

      public static boolean isNullOrEmpty(double[] a)
      Checks if is null or empty.
      Parameters:
      a -
      Returns:
      true, if is null or empty
    • isNullOrEmpty

      public static boolean isNullOrEmpty(Object[] a)
      Checks if is null or empty.
      Parameters:
      a -
      Returns:
      true, if is null or empty
    • isNullOrEmpty

      public static boolean isNullOrEmpty(Collection<?> c)
      Checks if is null or empty.
      Parameters:
      c -
      Returns:
      true, if is null or empty
    • isNullOrEmpty

      public static boolean isNullOrEmpty(Map<?,?> m)
      Checks if is null or empty.
      Parameters:
      m -
      Returns:
      true, if is null or empty
    • isNullOrEmpty

      public static boolean isNullOrEmpty(PrimitiveList list)
      Checks if is null or empty.
      Parameters:
      list -
      Returns:
      true, if is null or empty
    • isNullOrEmpty

      public static boolean isNullOrEmpty(Multiset<?> s)
      Checks if is null or empty.
      Parameters:
      s -
      Returns:
      true, if is null or empty
    • isNullOrEmpty

      public static boolean isNullOrEmpty(LongMultiset<?> s)
      Checks if is null or empty.
      Parameters:
      s -
      Returns:
      true, if is null or empty
    • isNullOrEmpty

      public static boolean isNullOrEmpty(Multimap<?,?,?> m)
      Checks if is null or empty.
      Parameters:
      m -
      Returns:
      true, if is null or empty
    • isNullOrEmpty

      public static boolean isNullOrEmpty(DataSet rs)
      Checks if is null or empty.
      Parameters:
      rs -
      Returns:
      true, if is null or empty
    • isNullOrEmptyOrBlank

      public static boolean isNullOrEmptyOrBlank(CharSequence s)
      Checks if is null or empty or blank.
      Parameters:
      s -
      Returns:
      true, if is null or empty or blank
    • notNullOrEmpty

      public static boolean notNullOrEmpty(CharSequence s)
      Not null or empty.
      Parameters:
      s -
      Returns:
    • notNullOrEmpty

      public static boolean notNullOrEmpty(boolean[] a)
      Not null or empty.
      Parameters:
      a -
      Returns:
    • notNullOrEmpty

      public static boolean notNullOrEmpty(char[] a)
      Not null or empty.
      Parameters:
      a -
      Returns:
    • notNullOrEmpty

      public static boolean notNullOrEmpty(byte[] a)
      Not null or empty.
      Parameters:
      a -
      Returns:
    • notNullOrEmpty

      public static boolean notNullOrEmpty(short[] a)
      Not null or empty.
      Parameters:
      a -
      Returns:
    • notNullOrEmpty

      public static boolean notNullOrEmpty(int[] a)
      Not null or empty.
      Parameters:
      a -
      Returns:
    • notNullOrEmpty

      public static boolean notNullOrEmpty(long[] a)
      Not null or empty.
      Parameters:
      a -
      Returns:
    • notNullOrEmpty

      public static boolean notNullOrEmpty(float[] a)
      Not null or empty.
      Parameters:
      a -
      Returns:
    • notNullOrEmpty

      public static boolean notNullOrEmpty(double[] a)
      Not null or empty.
      Parameters:
      a -
      Returns:
    • notNullOrEmpty

      public static boolean notNullOrEmpty(Object[] a)
      Not null or empty.
      Parameters:
      a -
      Returns:
    • notNullOrEmpty

      public static boolean notNullOrEmpty(Collection<?> c)
      Not null or empty.
      Parameters:
      c -
      Returns:
    • notNullOrEmpty

      public static boolean notNullOrEmpty(Map<?,?> m)
      Not null or empty.
      Parameters:
      m -
      Returns:
    • notNullOrEmpty

      public static boolean notNullOrEmpty(PrimitiveList list)
      Not null or empty.
      Parameters:
      list -
      Returns:
    • notNullOrEmpty

      public static boolean notNullOrEmpty(Multiset<?> s)
      Not null or empty.
      Parameters:
      s -
      Returns:
    • notNullOrEmpty

      public static boolean notNullOrEmpty(LongMultiset<?> s)
      Not null or empty.
      Parameters:
      s -
      Returns:
    • notNullOrEmpty

      public static boolean notNullOrEmpty(Multimap<?,?,?> m)
      Not null or empty.
      Parameters:
      m -
      Returns:
    • notNullOrEmpty

      public static boolean notNullOrEmpty(DataSet rs)
      Not null or empty.
      Parameters:
      rs -
      Returns:
    • notNullOrEmptyOrBlank

      public static boolean notNullOrEmptyOrBlank(CharSequence s)
      Not null or empty or blank.
      Parameters:
      s -
      Returns:
    • 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
    • checkArgument

      public static void checkArgument(boolean expression)
      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)
      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)
      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 -
    • checkArgument

      public 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.

      See checkArgument(boolean, String, Object...) for details.

      Parameters:
      b -
      errorMessageTemplate -
      p1 -
      p2 -
    • checkArgument

      public 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.

      See checkArgument(boolean, String, Object...) for details.

      Parameters:
      b -
      errorMessageTemplate -
      p1 -
      p2 -
      p3 -
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, char p)
      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 -
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, byte p)
      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 -
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, short p)
      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 -
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, int p)
      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 -
    • checkArgument

      public 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.

      See checkArgument(boolean, String, Object...) for details.

      Parameters:
      b -
      errorMessageTemplate -
      p1 -
      p2 -
    • checkArgument

      public 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.

      See checkArgument(boolean, String, Object...) for details.

      Parameters:
      b -
      errorMessageTemplate -
      p1 -
      p2 -
      p3 -
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, long p)
      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 -
    • checkArgument

      public 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.

      See checkArgument(boolean, String, Object...) for details.

      Parameters:
      b -
      errorMessageTemplate -
      p1 -
      p2 -
    • checkArgument

      public 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.

      See checkArgument(boolean, String, Object...) for details.

      Parameters:
      b -
      errorMessageTemplate -
      p1 -
      p2 -
      p3 -
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, float p)
      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 -
    • checkArgument

      public 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.

      See checkArgument(boolean, String, Object...) for details.

      Parameters:
      b -
      errorMessageTemplate -
      p1 -
      p2 -
    • checkArgument

      public 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.

      See checkArgument(boolean, String, Object...) for details.

      Parameters:
      b -
      errorMessageTemplate -
      p1 -
      p2 -
      p3 -
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, double p)
      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 -
    • checkArgument

      public 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.

      See checkArgument(boolean, String, Object...) for details.

      Parameters:
      b -
      errorMessageTemplate -
      p1 -
      p2 -
    • checkArgument

      public 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.

      See checkArgument(boolean, String, Object...) for details.

      Parameters:
      b -
      errorMessageTemplate -
      p1 -
      p2 -
      p3 -
    • checkArgument

      public static void checkArgument(boolean b, String errorMessageTemplate, Object p)
      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 -
    • checkArgument

      public 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.

      See checkArgument(boolean, String, Object...) for details.

      Parameters:
      b -
      errorMessageTemplate -
      p1 -
      p2 -
    • checkArgument

      public 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.

      See checkArgument(boolean, String, Object...) for details.

      Parameters:
      b -
      errorMessageTemplate -
      p1 -
      p2 -
      p3 -
    • checkArgument

      public static void checkArgument(boolean b, Supplier<String> errorMessageSupplier)
      Type Parameters:
      E -
      Parameters:
      b -
      errorMessageSupplier -
    • checkArgNotNull

      public static <T> T checkArgNotNull(T obj)
      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)
      Check arg not null.
      Type Parameters:
      T -
      Parameters:
      obj -
      errorMessage -
      Returns:
      Throws:
      IllegalArgumentException - if obj is null
    • checkArgNotNullOrEmpty

      public static <T extends CharSequence> T checkArgNotNullOrEmpty(T arg, String argNameOrErrorMsg)
      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.
    • checkArgNotNullOrEmpty

      public static boolean[] checkArgNotNullOrEmpty(boolean[] arg, String argNameOrErrorMsg)
      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.
    • checkArgNotNullOrEmpty

      public static char[] checkArgNotNullOrEmpty(char[] arg, String argNameOrErrorMsg)
      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.
    • checkArgNotNullOrEmpty

      public static byte[] checkArgNotNullOrEmpty(byte[] arg, String argNameOrErrorMsg)
      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.
    • checkArgNotNullOrEmpty

      public static short[] checkArgNotNullOrEmpty(short[] arg, String argNameOrErrorMsg)
      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.
    • checkArgNotNullOrEmpty

      public static int[] checkArgNotNullOrEmpty(int[] arg, String argNameOrErrorMsg)
      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.
    • checkArgNotNullOrEmpty

      public static long[] checkArgNotNullOrEmpty(long[] arg, String argNameOrErrorMsg)
      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.
    • checkArgNotNullOrEmpty

      public static float[] checkArgNotNullOrEmpty(float[] arg, String argNameOrErrorMsg)
      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.
    • checkArgNotNullOrEmpty

      public static double[] checkArgNotNullOrEmpty(double[] arg, String argNameOrErrorMsg)
      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.
    • checkArgNotNullOrEmpty

      public static <T> T[] checkArgNotNullOrEmpty(T[] arg, String argNameOrErrorMsg)
      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.
    • checkArgNotNullOrEmpty

      public static <T extends Collection<?>> T checkArgNotNullOrEmpty(T arg, String argNameOrErrorMsg)
      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.
    • checkArgNotNullOrEmpty

      public static <T extends Map<?, ?>> T checkArgNotNullOrEmpty(T arg, String argNameOrErrorMsg)
      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.
    • checkArgNotNullOrEmptyOrBlank

      public static <T extends CharSequence> T checkArgNotNullOrEmptyOrBlank(T arg, String msg)
      Check if the specified parameter is null or empty or blank.
      Type Parameters:
      T -
      Parameters:
      arg -
      msg - name of parameter or error message
      Returns:
      Throws:
      IllegalArgumentException - if the specified parameter is null or empty.
    • checkArgNotNegative

      public static int checkArgNotNegative(int arg, String argNameOrErrorMsg)
      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)
      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)
      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 int checkArgPositive(int arg, String argNameOrErrorMsg)
      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)
      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)
      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.
    • 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)
      Type Parameters:
      E -
      Parameters:
      b -
      errorMessageSupplier -
    • 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:
    • compare

      public static int compare(short a, short b)
      Parameters:
      a -
      b -
      Returns:
    • compare

      public static int compare(int a, int b)
      Parameters:
      a -
      b -
      Returns:
    • compare

      public static int compare(long a, long b)
      Parameters:
      a -
      b -
      Returns:
    • 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 Chain.ComparisonChain
      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 Chain.ComparisonChain
      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 Chain.ComparisonChain
      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 Chain.ComparisonChain
      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)
      Parameters:
      a -
      b -
      Returns:
    • compare

      public static int compare(boolean[] a, int fromIndexA, boolean[] b, int fromIndexB, int len)
      Parameters:
      a -
      fromIndexA -
      b -
      fromIndexB -
      len -
      Returns:
    • compare

      public static int compare(char[] a, char[] b)
      Parameters:
      a -
      b -
      Returns:
    • compare

      public static int compare(char[] a, int fromIndexA, char[] b, int fromIndexB, int len)
      Parameters:
      a -
      fromIndexA -
      b -
      fromIndexB -
      len -
      Returns:
    • compare

      public static int compare(byte[] a, byte[] b)
      Parameters:
      a -
      b -
      Returns:
    • compare

      public static int compare(byte[] a, int fromIndexA, byte[] b, int fromIndexB, int len)
      Parameters:
      a -
      fromIndexA -
      b -
      fromIndexB -
      len -
      Returns:
    • compare

      public static int compare(short[] a, short[] b)
      Parameters:
      a -
      b -
      Returns:
    • compare

      public static int compare(short[] a, int fromIndexA, short[] b, int fromIndexB, int len)
      Parameters:
      a -
      fromIndexA -
      b -
      fromIndexB -
      len -
      Returns:
    • compare

      public static int compare(int[] a, int[] b)
      Parameters:
      a -
      b -
      Returns:
    • compare

      public static int compare(int[] a, int fromIndexA, int[] b, int fromIndexB, int len)
      Parameters:
      a -
      fromIndexA -
      b -
      fromIndexB -
      len -
      Returns:
    • compare

      public static int compare(long[] a, long[] b)
      Parameters:
      a -
      b -
      Returns:
    • compare

      public static int compare(long[] a, int fromIndexA, long[] b, int fromIndexB, int len)
      Parameters:
      a -
      fromIndexA -
      b -
      fromIndexB -
      len -
      Returns:
    • compare

      public static int compare(float[] a, float[] b)
      Parameters:
      a -
      b -
      Returns:
    • compare

      public static int compare(float[] a, int fromIndexA, float[] b, int fromIndexB, int len)
      Parameters:
      a -
      fromIndexA -
      b -
      fromIndexB -
      len -
      Returns:
    • compare

      public static int compare(double[] a, double[] b)
      Parameters:
      a -
      b -
      Returns:
    • compare

      public static int compare(double[] a, int fromIndexA, double[] b, int fromIndexB, int len)
      Parameters:
      a -
      fromIndexA -
      b -
      fromIndexB -
      len -
      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 extends Comparable<? super T>> int compare(T[] a, int fromIndexA, T[] b, int fromIndexB, int len)
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndexA -
      b -
      fromIndexB -
      len -
      Returns:
    • compare

      public static <T> int compare(T[] a, T[] b, Comparator<? super T> cmp)
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      cmp -
      Returns:
    • compare

      public static <T> int compare(T[] a, int fromIndexA, T[] b, int fromIndexB, int len, Comparator<? super T> cmp)
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndexA -
      b -
      fromIndexB -
      len -
      cmp -
      Returns:
    • compare

      public static <T extends Comparable<? super T>> int compare(Collection<T> a, Collection<T> b)
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      Returns:
    • compare

      public static <T> int compare(Collection<T> a, int fromIndexA, Collection<T> b, int fromIndexB, int len)
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndexA -
      b -
      fromIndexB -
      len -
      Returns:
    • compare

      public static <T> int compare(Collection<T> a, Collection<T> b, Comparator<? super T> cmp)
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      cmp -
      Returns:
    • compare

      public static <T> int compare(Collection<T> a, int fromIndexA, Collection<T> b, int fromIndexB, int len, Comparator<? super T> cmp)
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndexA -
      b -
      fromIndexB -
      len -
      cmp -
      Returns:
    • compareIgnoreCase

      public static int compareIgnoreCase(String a, String b)
      Compare ignore case.
      Parameters:
      a -
      b -
      Returns:
    • 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:
    • 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:
    • 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:
    • 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:
    • 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:
    • 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:
    • 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:
    • 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:
    • between

      @Deprecated public static <T extends Comparable<? super T>> boolean between(T value, T min, T max)
      Type Parameters:
      T -
      Parameters:
      value -
      min -
      max -
      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
    • 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
    • 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)
      Parameters:
      a -
      fromIndexA -
      b -
      fromIndexB -
      len -
      Returns:
    • 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)
      Parameters:
      a -
      fromIndexA -
      b -
      fromIndexB -
      len -
      Returns:
    • 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)
      Parameters:
      a -
      fromIndexA -
      b -
      fromIndexB -
      len -
      Returns:
    • 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)
      Parameters:
      a -
      fromIndexA -
      b -
      fromIndexB -
      len -
      Returns:
    • 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)
      Parameters:
      a -
      fromIndexA -
      b -
      fromIndexB -
      len -
      Returns:
    • 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)
      Parameters:
      a -
      fromIndexA -
      b -
      fromIndexB -
      len -
      Returns:
    • 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)
      Parameters:
      a -
      fromIndexA -
      b -
      fromIndexB -
      len -
      Returns:
    • 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)
      Parameters:
      a -
      fromIndexA -
      b -
      fromIndexB -
      len -
      Returns:
    • 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)
      Parameters:
      a -
      fromIndexA -
      b -
      fromIndexB -
      len -
      Returns:
    • 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)
      Parameters:
      a -
      fromIndexA -
      b -
      fromIndexB -
      len -
      Returns:
    • 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)
      Equals ignore case.
      Parameters:
      a -
      fromIndexA -
      b -
      fromIndexB -
      len -
      Returns:
    • 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
    • deepHashCode

      public static int deepHashCode(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)
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
    • hashCode

      public static int hashCode(char[] a)
      Parameters:
      a -
      Returns:
      See Also:
    • hashCode

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

      public static int hashCode(byte[] a)
      Parameters:
      a -
      Returns:
      See Also:
    • hashCode

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

      public static int hashCode(short[] a)
      Parameters:
      a -
      Returns:
      See Also:
    • hashCode

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

      public static int hashCode(int[] a)
      Parameters:
      a -
      Returns:
      See Also:
    • hashCode

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

      public static int hashCode(long[] a)
      Parameters:
      a -
      Returns:
      See Also:
    • hashCode

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

      public static int hashCode(float[] a)
      Parameters:
      a -
      Returns:
      See Also:
    • hashCode

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

      public static int hashCode(double[] a)
      Parameters:
      a -
      Returns:
      See Also:
    • hashCode

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

      public static int hashCode(Object[] a)
      Parameters:
      a -
      Returns:
      See Also:
    • hashCode

      public static int hashCode(Object[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
    • 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)
      Deep hash code.
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
    • 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
    • deepToString

      public static String deepToString(Object obj)
      Parameters:
      obj -
      Returns:
      int
    • toString

      public static String toString(boolean[] a)
      Parameters:
      a -
      Returns:
      See Also:
    • toString

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

      public static String toString(char[] a)
      Parameters:
      a -
      Returns:
      See Also:
    • toString

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

      public static String toString(byte[] a)
      Parameters:
      a -
      Returns:
      See Also:
    • toString

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

      public static String toString(short[] a)
      Parameters:
      a -
      Returns:
      See Also:
    • toString

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

      public static String toString(int[] a)
      Parameters:
      a -
      Returns:
      See Also:
    • toString

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

      public static String toString(long[] a)
      Parameters:
      a -
      Returns:
      See Also:
    • toString

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

      public static String toString(float[] a)
      Parameters:
      a -
      Returns:
      See Also:
    • toString

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

      public static String toString(double[] a)
      Parameters:
      a -
      Returns:
      See Also:
    • toString

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

      public static String toString(Object[] a)
      Parameters:
      a -
      Returns:
      See Also:
    • toString

      public static String toString(Object[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
    • toString

      public static String toString(Object a, String defaultIfNull)
      Parameters:
      a -
      defaultIfNull -
      Returns:
    • 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)
      Deep to string.
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
    • 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)

      Reverses the order of the given array in the given range.

      Parameters:
      a -
      fromIndex -
      toIndex -
    • 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)

      Reverses the order of the given array in the given range.

      Parameters:
      a -
      fromIndex -
      toIndex -
    • 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)

      Reverses the order of the given array in the given range.

      Parameters:
      a -
      fromIndex -
      toIndex -
    • 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)

      Reverses the order of the given array in the given range.

      Parameters:
      a -
      fromIndex -
      toIndex -
    • 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)

      Reverses the order of the given array in the given range.

      Parameters:
      a -
      fromIndex -
      toIndex -
    • 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)

      Reverses the order of the given array in the given range.

      Parameters:
      a -
      fromIndex -
      toIndex -
    • 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)

      Reverses the order of the given array in the given range.

      Parameters:
      a -
      fromIndex -
      toIndex -
    • 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)

      Reverses the order of the given array in the given range.

      Parameters:
      a -
      fromIndex -
      toIndex -
    • 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)

      Reverses the order of the given array in the given range.

      Parameters:
      a -
      fromIndex -
      toIndex -
    • reverse

      public static void reverse(List<?> list)
      Parameters:
      list -
    • reverse

      public static void reverse(List<?> list, int fromIndex, int toIndex)
      Parameters:
      list -
      fromIndex -
      toIndex -
    • reverse

      public static void reverse(Collection<?> c)
      Parameters:
      c -
    • 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, E extends Exception> boolean swapIf(Pair<T,T> pair, Throwables.Predicate<? super Pair<T,T>,E> predicate) throws E
      Type Parameters:
      T -
      E -
      Parameters:
      pair -
      predicate -
      Returns:
      Throws:
      E - the e
    • swap

      public static <T, M> void swap(Triple<T,M,T> triple)
      Type Parameters:
      T -
      M -
      Parameters:
      triple -
    • swapIf

      public static <T, M, E extends Exception> boolean swapIf(Triple<T,M,T> triple, Throwables.Predicate<? super Triple<T,M,T>,E> predicate) throws E
      Type Parameters:
      T -
      M -
      E -
      Parameters:
      triple -
      predicate -
      Returns:
      Throws:
      E - the e
    • 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 -
    • fill

      public 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. 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 -
    • fill

      public static void fill(Object entity)
      Fill the properties of the entity with random values.
      Parameters:
      entity - an entity object with getter/setter method
    • fill

      public static <T> T fill(Class<T> entityClass)
      Fill the properties of the entity with random values.
      Type Parameters:
      T -
      Parameters:
      entityClass - entity class with getter/setter methods
      Returns:
    • fill

      public static <T> List<T> fill(Class<T> entityClass, int count)
      Fill the properties of the entity with random values.
      Type Parameters:
      T -
      Parameters:
      entityClass - entity class with getter/setter methods
      count -
      Returns:
    • repeat

      public static <T> List<T> repeat(T value, int n)
      Type Parameters:
      T -
      Parameters:
      value -
      n -
      Returns:
    • repeatEach

      public static <T> List<T> repeatEach(Collection<T> c, int n)
      Repeats the elements in the specified Collection one by one.
       
       repeatEach(N.asList(1, 2, 3), 2) => [1, 1, 2, 2, 3, 3]
       
       
      Type Parameters:
      T -
      Parameters:
      c -
      n -
      Returns:
    • repeatAll

      public static <T> List<T> repeatAll(Collection<T> c, int n)
       
       repeatAll(N.asList(1, 2, 3), 2) => [1, 2, 3, 1, 2, 3]
       
       
      Type Parameters:
      T -
      Parameters:
      c -
      n -
      Returns:
    • repeatEachToSize

      public static <T> List<T> repeatEachToSize(Collection<T> c, int size)
      Repeats the elements in the specified Collection one by one till reach the specified size.
       
       repeatEachToSize(N.asList(1, 2, 3), 5) => [1, 1, 2, 2, 3]
       
       
      Type Parameters:
      T -
      Parameters:
      c -
      size -
      Returns:
    • repeatAllToSize

      public static <T> List<T> repeatAllToSize(Collection<T> c, int size)
       
       repeatAllToSize(N.asList(1, 2, 3), 5) => [1, 2, 3, 1, 2]
       
       
      Type Parameters:
      T -
      Parameters:
      c -
      size -
      Returns:
    • 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)
      Type Parameters:
      T -
      Parameters:
      src -
      srcPos -
      dest -
      destPos -
      length -
    • copy

      public static void copy(boolean[] src, int srcPos, boolean[] dest, int destPos, int length)
      Parameters:
      src -
      srcPos -
      dest -
      destPos -
      length -
    • copy

      public static void copy(char[] src, int srcPos, char[] dest, int destPos, int length)
      Parameters:
      src -
      srcPos -
      dest -
      destPos -
      length -
    • copy

      public static void copy(byte[] src, int srcPos, byte[] dest, int destPos, int length)
      Parameters:
      src -
      srcPos -
      dest -
      destPos -
      length -
    • copy

      public static void copy(short[] src, int srcPos, short[] dest, int destPos, int length)
      Parameters:
      src -
      srcPos -
      dest -
      destPos -
      length -
    • copy

      public static void copy(int[] src, int srcPos, int[] dest, int destPos, int length)
      Parameters:
      src -
      srcPos -
      dest -
      destPos -
      length -
    • copy

      public static void copy(long[] src, int srcPos, long[] dest, int destPos, int length)
      Parameters:
      src -
      srcPos -
      dest -
      destPos -
      length -
    • copy

      public static void copy(float[] src, int srcPos, float[] dest, int destPos, int length)
      Parameters:
      src -
      srcPos -
      dest -
      destPos -
      length -
    • copy

      public static void copy(double[] src, int srcPos, double[] dest, int destPos, int length)
      Parameters:
      src -
      srcPos -
      dest -
      destPos -
      length -
    • copy

      public static void copy(Object[] src, int srcPos, Object[] dest, int destPos, int length)
      Parameters:
      src -
      srcPos -
      dest -
      destPos -
      length -
    • copy

      public static void copy(Object src, int srcPos, Object dest, int destPos, int length)
      Parameters:
      src -
      srcPos -
      dest -
      destPos -
      length -
      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 of range.
      Parameters:
      original -
      fromIndex -
      toIndex -
      Returns:
      See Also:
    • copyOfRange

      public static boolean[] copyOfRange(boolean[] original, int fromIndex, int toIndex, int step)
      Copy all the elements in original, through to-from, by step.
      Parameters:
      original -
      fromIndex -
      toIndex -
      step -
      Returns:
      See Also:
      • CommonUtil.copyOfRange(int[], int, int, int)
    • copyOfRange

      public static char[] copyOfRange(char[] original, int fromIndex, int toIndex)
      Copy of range.
      Parameters:
      original -
      fromIndex -
      toIndex -
      Returns:
      See Also:
    • copyOfRange

      public static char[] copyOfRange(char[] original, int fromIndex, int toIndex, int step)
      Copy all the elements in original, through to-from, by step.
      Parameters:
      original -
      fromIndex -
      toIndex -
      step -
      Returns:
      See Also:
      • CommonUtil.copyOfRange(int[], int, int, int)
    • copyOfRange

      public static byte[] copyOfRange(byte[] original, int fromIndex, int toIndex)
      Copy of range.
      Parameters:
      original -
      fromIndex -
      toIndex -
      Returns:
      See Also:
    • copyOfRange

      public static byte[] copyOfRange(byte[] original, int fromIndex, int toIndex, int step)
      Copy all the elements in original, through to-from, by step.
      Parameters:
      original -
      fromIndex -
      toIndex -
      step -
      Returns:
      See Also:
      • CommonUtil.copyOfRange(int[], int, int, int)
    • copyOfRange

      public static short[] copyOfRange(short[] original, int fromIndex, int toIndex)
      Copy of range.
      Parameters:
      original -
      fromIndex -
      toIndex -
      Returns:
      See Also:
    • copyOfRange

      public static short[] copyOfRange(short[] original, int fromIndex, int toIndex, int step)
      Copy all the elements in original, through to-from, by step.
      Parameters:
      original -
      fromIndex -
      toIndex -
      step -
      Returns:
      See Also:
      • CommonUtil.copyOfRange(int[], int, int, int)
    • copyOfRange

      public static int[] copyOfRange(int[] original, int fromIndex, int toIndex)
      Copy of range.
      Parameters:
      original -
      fromIndex -
      toIndex -
      Returns:
      See Also:
    • copyOfRange

      public static int[] copyOfRange(int[] original, int fromIndex, int toIndex, int step)
      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:
    • copyOfRange

      public static long[] copyOfRange(long[] original, int fromIndex, int toIndex)
      Copy of range.
      Parameters:
      original -
      fromIndex -
      toIndex -
      Returns:
      See Also:
    • copyOfRange

      public static long[] copyOfRange(long[] original, int fromIndex, int toIndex, int step)
      Copy all the elements in original, through to-from, by step.
      Parameters:
      original -
      fromIndex -
      toIndex -
      step -
      Returns:
      See Also:
      • CommonUtil.copyOfRange(int[], int, int, int)
    • copyOfRange

      public static float[] copyOfRange(float[] original, int fromIndex, int toIndex)
      Copy of range.
      Parameters:
      original -
      fromIndex -
      toIndex -
      Returns:
      See Also:
    • copyOfRange

      public static float[] copyOfRange(float[] original, int fromIndex, int toIndex, int step)
      Copy all the elements in original, through to-from, by step.
      Parameters:
      original -
      fromIndex -
      toIndex -
      step -
      Returns:
      See Also:
      • CommonUtil.copyOfRange(int[], int, int, int)
    • copyOfRange

      public static double[] copyOfRange(double[] original, int fromIndex, int toIndex)
      Copy of range.
      Parameters:
      original -
      fromIndex -
      toIndex -
      Returns:
      See Also:
    • copyOfRange

      public static double[] copyOfRange(double[] original, int fromIndex, int toIndex, int step)
      Copy all the elements in original, through to-from, by step.
      Parameters:
      original -
      fromIndex -
      toIndex -
      step -
      Returns:
      See Also:
      • CommonUtil.copyOfRange(int[], int, int, int)
    • copyOfRange

      public static <T> T[] copyOfRange(T[] original, int fromIndex, int toIndex)
      Copy of range.
      Type Parameters:
      T -
      Parameters:
      original -
      fromIndex -
      toIndex -
      Returns:
      See Also:
      • invalid @see
        Arrays#copyOfRange(T[], int, int)
    • 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)
      Copy all the elements in original, through to-from, by step.
      Type Parameters:
      T -
      Parameters:
      original -
      fromIndex -
      toIndex -
      step -
      newType -
      Returns:
      See Also:
      • CommonUtil.copyOfRange(int[], int, int, int)
    • copyOfRange

      public static <T> List<T> copyOfRange(List<T> c, int fromIndex, int toIndex)
      Copy of range.
      Type Parameters:
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      Returns:
      See Also:
      • invalid @see
        Arrays#copyOfRange(T[], int, int)
    • copyOfRange

      public 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.
      Type Parameters:
      T -
      Parameters:
      c -
      fromIndex -
      toIndex -
      step -
      Returns:
    • copyOfRange

      public static String copyOfRange(String str, int fromIndex, int toIndex)
      Copy of range.
      Parameters:
      str -
      fromIndex -
      toIndex -
      Returns:
    • copyOfRange

      public static String copyOfRange(String str, int fromIndex, int toIndex, int step)
      Copy of range.
      Parameters:
      str -
      fromIndex -
      toIndex -
      step -
      Returns:
      See Also:
      • CommonUtil.copyOfRange(int[], int, int, int)
    • clone

      public static boolean[] clone(boolean[] original)
      Clone the original array. null is returned if the input array is null.
      Parameters:
      original -
      Returns:
    • clone

      public static char[] clone(char[] original)
      Clone the original array. null is returned if the input array is null.
      Parameters:
      original -
      Returns:
    • clone

      public static byte[] clone(byte[] original)
      Clone the original array. null is returned if the input array is null.
      Parameters:
      original -
      Returns:
    • clone

      public static short[] clone(short[] original)
      Clone the original array. null is returned if the input array is null.
      Parameters:
      original -
      Returns:
    • clone

      public static int[] clone(int[] original)
      Clone the original array. null is returned if the input array is null.
      Parameters:
      original -
      Returns:
    • clone

      public static long[] clone(long[] original)
      Clone the original array. null is returned if the input array is null.
      Parameters:
      original -
      Returns:
    • clone

      public static float[] clone(float[] original)
      Clone the original array. null is returned if the input array is null.
      Parameters:
      original -
      Returns:
    • clone

      public static double[] clone(double[] original)
      Clone the original array. null is returned if the input array is null.
      Parameters:
      original -
      Returns:
    • clone

      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

      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

      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

      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

      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

      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

      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

      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

      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

      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

      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

      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

      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

      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

      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

      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

      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

      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

      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:
    • copy

      public static <T> T[] copy(Class<T[]> newType, Object[] a)
      Type Parameters:
      T -
      Parameters:
      newType -
      a -
      Returns:
    • copy

      public static <T> T[][] copy(Class<T[][]> newType, Object[][] a)
      Type Parameters:
      T -
      Parameters:
      newType -
      a -
      Returns:
    • copy

      public static <T> T[][][] copy(Class<T[][][]> newType, Object[][][] a)
      Type Parameters:
      T -
      Parameters:
      newType -
      a -
      Returns:
    • isSorted

      public static boolean isSorted(boolean[] a)
    • isSorted

      public static boolean isSorted(boolean[] a, int fromIndex, int toIndex)
    • isSorted

      public static boolean isSorted(char[] a)
    • isSorted

      public static boolean isSorted(char[] a, int fromIndex, int toIndex)
    • isSorted

      public static boolean isSorted(byte[] a)
    • isSorted

      public static boolean isSorted(byte[] a, int fromIndex, int toIndex)
    • isSorted

      public static boolean isSorted(short[] a)
    • isSorted

      public static boolean isSorted(short[] a, int fromIndex, int toIndex)
    • isSorted

      public static boolean isSorted(int[] a)
    • isSorted

      public static boolean isSorted(int[] a, int fromIndex, int toIndex)
    • isSorted

      public static boolean isSorted(long[] a)
    • isSorted

      public static boolean isSorted(long[] a, int fromIndex, int toIndex)
    • isSorted

      public static boolean isSorted(float[] a)
    • isSorted

      public static boolean isSorted(float[] a, int fromIndex, int toIndex)
    • isSorted

      public static boolean isSorted(double[] a)
    • isSorted

      public static boolean isSorted(double[] a, int fromIndex, int toIndex)
    • isSorted

      public static <T extends Comparable<? super T>> boolean isSorted(T[] a)
    • isSorted

      public static <T extends Comparable<? super T>> boolean isSorted(T[] a, int fromIndex, int toIndex)
    • isSorted

      public static <T> boolean isSorted(T[] a, Comparator<? super T> cmp)
    • isSorted

      public static <T> boolean isSorted(T[] a, int fromIndex, int toIndex, Comparator<? super T> cmp)
    • isSorted

      public static <T extends Comparable<? super T>> boolean isSorted(Collection<T> c)
    • isSorted

      public static <T extends Comparable<? super T>> boolean isSorted(Collection<T> c, int fromIndex, int toIndex)
    • isSorted

      public static <T> boolean isSorted(Collection<T> c, Comparator<? super T> cmp)
    • isSorted

      public static <T> boolean isSorted(Collection<T> c, int fromIndex, int toIndex, Comparator<? super T> cmp)
    • 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)
      Parameters:
      a -
      fromIndex -
      toIndex -
    • sort

      public static void sort(byte[] a)
      Parameters:
      a -
    • sort

      public static void sort(byte[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
    • sort

      public static void sort(short[] a)
      Parameters:
      a -
    • sort

      public static void sort(short[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
    • sort

      public static void sort(int[] a)
      Parameters:
      a -
    • sort

      public static void sort(int[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
    • sort

      public static void sort(long[] a)
      Parameters:
      a -
    • sort

      public static void sort(long[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
    • sort

      public static void sort(float[] a)
      Parameters:
      a -
    • sort

      public static void sort(float[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
    • sort

      public static void sort(double[] a)
      Parameters:
      a -
    • sort

      public static void sort(double[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
    • 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)
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      cmp -
    • 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)
      Parameters:
      a -
      fromIndex -
      toIndex -
    • parallelSort

      public static void parallelSort(byte[] a)
      Parameters:
      a -
    • parallelSort

      public static void parallelSort(byte[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
    • parallelSort

      public static void parallelSort(short[] a)
      Parameters:
      a -
    • parallelSort

      public static void parallelSort(short[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
    • parallelSort

      public static void parallelSort(int[] a)
      Parameters:
      a -
    • parallelSort

      public static void parallelSort(int[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
    • parallelSort

      public static void parallelSort(long[] a)
      Parameters:
      a -
    • parallelSort

      public static void parallelSort(long[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
    • parallelSort

      public static void parallelSort(float[] a)
      Parameters:
      a -
    • parallelSort

      public static void parallelSort(float[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
    • parallelSort

      public static void parallelSort(double[] a)
      Parameters:
      a -
    • parallelSort

      public static void parallelSort(double[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
    • parallelSort

      public static <T extends Comparable<? super T>> void parallelSort(T[] a)
      Parameters:
      a -
    • parallelSort

      public static <T extends Comparable<? super T>> void parallelSort(T[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
    • 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)
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      cmp -
    • 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 -
    • bucketSort

      public static void bucketSort(int[] a)
      Parameters:
      a -
    • bucketSort

      public static void bucketSort(int[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
    • bucketSort

      public static void bucketSort(long[] a)
      Parameters:
      a -
    • bucketSort

      public static void bucketSort(long[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
    • bucketSort

      public static void bucketSort(float[] a)
      Parameters:
      a -
    • bucketSort

      public static void bucketSort(float[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
    • bucketSort

      public static void bucketSort(double[] a)
      Parameters:
      a -
    • bucketSort

      public static void bucketSort(double[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
    • bucketSort

      public static void bucketSort(Object[] a)
      Note: All the objects with same value will be replaced by first element with the same value.
      Parameters:
      a -
    • bucketSort

      public static void bucketSort(Object[] a, int fromIndex, int toIndex)
      Note: All the objects with same value will be replaced by first element with the same value.
      Parameters:
      a - the elements in the array must implements the Comparable interface.
      fromIndex -
      toIndex -
    • bucketSort

      public static <T> void bucketSort(T[] a, Comparator<? super T> cmp)
      Type Parameters:
      T -
      Parameters:
      a -
      cmp -
    • bucketSort

      public static <T> void bucketSort(T[] a, int fromIndex, int toIndex, Comparator<? super T> cmp)
      Note: All the objects with same value will be replaced by first element with the same value.
      Type Parameters:
      T -
      Parameters:
      a -
      fromIndex -
      toIndex -
      cmp -
    • bucketSort

      public static <T extends Comparable<? super T>> void bucketSort(List<T> list)
      Note: All the objects with same value will be replaced by first element with the same value.
      Type Parameters:
      T -
      Parameters:
      list -
    • bucketSort

      public static <T extends Comparable<? super T>> void bucketSort(List<T> list, int fromIndex, int toIndex)
      Note: All the objects with same value will be replaced by first element with the same value.
      Type Parameters:
      T -
      Parameters:
      list -
      fromIndex -
      toIndex -
    • bucketSort

      public static <T> void bucketSort(List<? extends T> list, Comparator<? super T> cmp)
      Note: All the objects with same value will be replaced by first element with the same value.
      Type Parameters:
      T -
      Parameters:
      list -
      cmp -
    • bucketSort

      public static <T> void bucketSort(List<? extends T> list, int fromIndex, int toIndex, Comparator<? super T> cmp)
      Note: All the objects with same value will be replaced by first element with the same value.
      Type Parameters:
      T -
      Parameters:
      list -
      fromIndex -
      toIndex -
      cmp -
    • bucketSortBy

      public static <T, U extends Comparable<? super U>> void bucketSortBy(T[] a, Function<? super T,? extends U> keyMapper)
      Bucket sort by.
      Type Parameters:
      T -
      U -
      Parameters:
      a -
      keyMapper -
    • bucketSortBy

      public static <T, U extends Comparable<? super U>> void bucketSortBy(List<? extends T> list, Function<? super T,? extends U> keyMapper)
      Bucket sort by.
      Type Parameters:
      T -
      U -
      Parameters:
      list -
      keyMapper -
    • 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:
    • binarySearchBy

      public static <T, U extends Comparable<? super U>> int binarySearchBy(T[] a, T valueToFind, Function<? super T,? extends U> valueToFindMapper)
      Binary search by.
      Type Parameters:
      T -
      U -
      Parameters:
      a -
      valueToFind -
      valueToFindMapper -
      Returns:
    • binarySearchBy

      public static <T, U extends Comparable<? super U>> int binarySearchBy(List<? extends T> list, T valueToFind, Function<? super T,? extends U> valueToFindMapper)
      Binary search by.
      Type Parameters:
      T -
      U -
      Parameters:
      list -
      valueToFind -
      valueToFindMapper -
      Returns:
    • indexOf

      public static int indexOf(boolean[] a, boolean valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
    • indexOf

      public static int indexOf(boolean[] a, int startIndex, boolean valueToFind)
      Parameters:
      a -
      startIndex - the index from which to start the search.
      valueToFind -
      Returns:
    • indexOf

      public static int indexOf(char[] a, char valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
    • indexOf

      public static int indexOf(char[] a, int startIndex, char valueToFind)
      Parameters:
      a -
      startIndex - the index from which to start the search.
      valueToFind -
      Returns:
    • indexOf

      public static int indexOf(byte[] a, byte valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
    • indexOf

      public static int indexOf(byte[] a, int startIndex, byte valueToFind)
      Parameters:
      a -
      startIndex - the index from which to start the search.
      valueToFind -
      Returns:
    • indexOf

      public static int indexOf(short[] a, short valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
    • indexOf

      public static int indexOf(short[] a, int startIndex, short valueToFind)
      Parameters:
      a -
      startIndex - the index from which to start the search.
      valueToFind -
      Returns:
    • indexOf

      public static int indexOf(int[] a, int valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
    • indexOf

      public static int indexOf(int[] a, int startIndex, int valueToFind)
      Parameters:
      a -
      startIndex - the index from which to start the search.
      valueToFind -
      Returns:
    • indexOf

      public static int indexOf(long[] a, long valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
    • indexOf

      public static int indexOf(long[] a, int startIndex, long valueToFind)
      Parameters:
      a -
      startIndex - the index from which to start the search.
      valueToFind -
      Returns:
    • indexOf

      public static int indexOf(float[] a, float valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
    • indexOf

      public static int indexOf(float[] a, int startIndex, float valueToFind)
      Parameters:
      a -
      startIndex - the index from which to start the search.
      valueToFind -
      Returns:
    • indexOf

      public static int indexOf(double[] a, double valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
    • indexOf

      public static int indexOf(double[] a, int startIndex, double valueToFind)
      Parameters:
      a -
      startIndex - the index from which to start the search.
      valueToFind -
      Returns:
    • 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, int startIndex, double valueToFind, double tolerance)

      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
      startIndex - the index to start searching at
      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(Object[] a, Object valueToFind)
      Parameters:
      a -
      valueToFind -
      Returns:
    • indexOf

      public static int indexOf(Object[] a, int startIndex, Object valueToFind)
      Parameters:
      a -
      startIndex - the index from which to start the search.
      valueToFind -
      Returns:
    • indexOf

      public static int indexOf(Collection<?> c, Object valueToFind)
      Parameters:
      c -
      valueToFind -
      Returns:
    • indexOf

      public static int indexOf(Collection<?> c, int startIndex, Object valueToFind)
      Parameters:
      startIndex - the index from which to start the search.
      valueToFind -
      list -
      Returns:
    • indexOf

      public static int indexOf(Iterator<?> iter, Object valueToFind)
    • indexOf

      public static int indexOf(Iterator<?> iter, int startIndex, Object valueToFind)
    • indexOfSubList

      public static int indexOfSubList(List<?> sourceList, List<?> subListToFind)
      Index of sub list.
      Parameters:
      sourceList -
      subListToFind -
      Returns:
      See Also:
    • lastIndexOf

      public static int lastIndexOf(boolean[] a, boolean valueToFind)
      Last index of.
      Parameters:
      a -
      valueToFind -
      Returns:
    • lastIndexOf

      public static int lastIndexOf(boolean[] a, int startIndexFromBack, boolean valueToFind)
      Last index of.
      Parameters:
      a -
      startIndexFromBack - the start index to traverse backwards from
      valueToFind -
      Returns:
    • lastIndexOf

      public static int lastIndexOf(char[] a, char valueToFind)
      Last index of.
      Parameters:
      a -
      valueToFind -
      Returns:
    • lastIndexOf

      public static int lastIndexOf(char[] a, int startIndexFromBack, char valueToFind)
      Last index of.
      Parameters:
      a -
      startIndexFromBack - the start index to traverse backwards from
      valueToFind -
      Returns:
    • lastIndexOf

      public static int lastIndexOf(byte[] a, byte valueToFind)
      Last index of.
      Parameters:
      a -
      valueToFind -
      Returns:
    • lastIndexOf

      public static int lastIndexOf(byte[] a, int startIndexFromBack, byte valueToFind)
      Last index of.
      Parameters:
      a -
      startIndexFromBack - the start index to traverse backwards from
      valueToFind -
      Returns:
    • lastIndexOf

      public static int lastIndexOf(short[] a, short valueToFind)
      Last index of.
      Parameters:
      a -
      valueToFind -
      Returns:
    • lastIndexOf

      public static int lastIndexOf(short[] a, int startIndexFromBack, short valueToFind)
      Last index of.
      Parameters:
      a -
      startIndexFromBack - the start index to traverse backwards from
      valueToFind -
      Returns:
    • lastIndexOf

      public static int lastIndexOf(int[] a, int valueToFind)
      Last index of.
      Parameters:
      a -
      valueToFind -
      Returns:
    • lastIndexOf

      public static int lastIndexOf(int[] a, int startIndexFromBack, int valueToFind)
      Last index of.
      Parameters:
      a -
      startIndexFromBack - the start index to traverse backwards from
      valueToFind -
      Returns:
    • lastIndexOf

      public static int lastIndexOf(long[] a, long valueToFind)
      Last index of.
      Parameters:
      a -
      valueToFind -
      Returns:
    • lastIndexOf

      public static int lastIndexOf(long[] a, int startIndexFromBack, long valueToFind)
      Last index of.
      Parameters:
      a -
      startIndexFromBack - the start index to traverse backwards from
      valueToFind -
      Returns:
    • lastIndexOf

      public static int lastIndexOf(float[] a, float valueToFind)
      Last index of.
      Parameters:
      a -
      valueToFind -
      Returns:
    • lastIndexOf

      public static int lastIndexOf(float[] a, int startIndexFromBack, float valueToFind)
      Last index of.
      Parameters:
      a -
      startIndexFromBack - the start index to traverse backwards from
      valueToFind -
      Returns:
    • lastIndexOf

      public static int lastIndexOf(double[] a, double valueToFind)
      Last index of.
      Parameters:
      a -
      valueToFind -
      Returns:
    • lastIndexOf

      public static int lastIndexOf(double[] a, int startIndexFromBack, double valueToFind)
      Last index of.
      Parameters:
      a -
      startIndexFromBack - the start index to traverse backwards from
      valueToFind -
      Returns:
    • 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, int startIndexFromBack, double valueToFind, double tolerance)

      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
      startIndexFromBack - the start index to traverse backwards from
      valueToFind -
      tolerance - search for value within plus/minus this amount
      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:
    • lastIndexOf

      public static int lastIndexOf(Object[] a, int startIndexFromBack, Object valueToFind)
      Last index of.
      Parameters:
      a -
      startIndexFromBack - the start index to traverse backwards from
      valueToFind -
      Returns:
    • lastIndexOf

      public static int lastIndexOf(Collection<?> c, Object valueToFind)
      Last index of.
      Parameters:
      c -
      valueToFind -
      Returns:
    • lastIndexOf

      public static int lastIndexOf(Collection<?> c, int startIndexFromBack, Object valueToFind)
      Last index of.
      Parameters:
      c -
      startIndexFromBack - the start index to traverse backwards from
      valueToFind -
      Returns:
    • lastIndexOfSubList

      public static int lastIndexOfSubList(List<?> sourceList, List<?> subListToFind)
      Last index of sub list.
      Parameters:
      sourceList -
      subListToFind -
      Returns:
      See Also:
    • findFirstIndex

      public static <T, E extends Exception> u.OptionalInt findFirstIndex(T[] a, Throwables.Predicate<? super T,E> predicate) throws E
      Find first index.
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      predicate -
      Returns:
      the optional int
      Throws:
      E - the e
    • findFirstIndex

      public static <T, E extends Exception> u.OptionalInt findFirstIndex(Collection<? extends T> c, Throwables.Predicate<? super T,E> predicate) throws E
      Find first index.
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      predicate -
      Returns:
      the optional int
      Throws:
      E - the e
    • findLastIndex

      public static <T, E extends Exception> u.OptionalInt findLastIndex(T[] a, Throwables.Predicate<? super T,E> predicate) throws E
      Find last index.
      Type Parameters:
      T -
      E -
      Parameters:
      a -
      predicate -
      Returns:
      the optional int
      Throws:
      E - the e
    • findLastIndex

      public static <T, E extends Exception> u.OptionalInt findLastIndex(Collection<? extends T> c, Throwables.Predicate<? super T,E> predicate) throws E
      Find last index.
      Type Parameters:
      T -
      E -
      Parameters:
      c -
      predicate -
      Returns:
      the optional int
      Throws:
      E - the e