Class N
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.
ClassN
is a general java utility class. It provides the most daily used operations for Object/primitive types/String/Array/Collection/Map/Bean...:
When to throw exception? It's designed to avoid throwing any unnecessary
exception if the contract defined by method is not broken. for example, if
user tries to reverse a null or empty String. the input String will be
returned. But exception will be thrown if trying to repeat/swap a null or
empty string or operate Array/Collection by adding/removing... -
Field Summary
Modifier and TypeFieldDescriptionstatic final boolean[]
An empty immutableboolean
array.static final Boolean[]
An empty immutableBoolean
array.static final byte[]
An empty immutablebyte
array.static final Byte[]
An empty immutableByte
array.static final Calendar[]
An empty immutableCalendar
array.static final char[]
An empty immutablechar
array.static final Character[]
An empty immutableCharacter
array.static final Date[]
An empty immutableDate
array.static final double[]
An empty immutabledouble
array.static final Double[]
An empty immutableDouble
array.static final float[]
An empty immutablefloat
array.static final Float[]
An empty immutableFloat
array.static final int[]
An empty immutableint
array.static final Integer[]
An empty immutableInteger
array.static final long[]
An empty immutablelong
array.static final Long[]
An empty immutableLong
array.static final Object[]
An empty immutableObject
array.static final short[]
An empty immutableshort
array.static final Short[]
An empty immutableShort
array.static final String[]
An empty immutableString
array.static final int
The index value when an element is not found in a list or array:-1
. -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean[]
add
(boolean[] a, boolean elementToAdd) Copies the given array and adds the given elementToAdd at the end of the new array.static byte[]
add
(byte[] a, byte elementToAdd) Copies the given array and adds the given elementToAdd at the end of the new array.static char[]
add
(char[] a, char elementToAdd) Copies the given array and adds the given elementToAdd at the end of the new array.static double[]
add
(double[] a, double elementToAdd) Copies the given array and adds the given elementToAdd at the end of the new array.static float[]
add
(float[] a, float elementToAdd) Copies the given array and adds the given elementToAdd at the end of the new array.static int[]
add
(int[] a, int elementToAdd) Copies the given array and adds the given elementToAdd at the end of the new array.static long[]
add
(long[] a, long elementToAdd) Copies the given array and adds the given elementToAdd at the end of the new array.static short[]
add
(short[] a, short elementToAdd) Copies the given array and adds the given elementToAdd at the end of the new array.static String[]
Copies the given array and adds the given elementToAdd at the end of the new array.static <T> T[]
add
(T[] a, T elementToAdd) Copies the given array and adds the given elementToAdd at the end of the new array.static boolean[]
addAll
(boolean[] a, boolean... elementsToAdd) Adds all the elementToAdds of the given arrays into a new array.static byte[]
addAll
(byte[] a, byte... elementsToAdd) Adds all the elementToAdds of the given arrays into a new array.static char[]
addAll
(char[] a, char... elementsToAdd) Adds all the elementToAdds of the given arrays into a new array.static double[]
addAll
(double[] a, double... elementsToAdd) Adds all the elementToAdds of the given arrays into a new array.static float[]
addAll
(float[] a, float... elementsToAdd) Adds all the elementToAdds of the given arrays into a new array.static int[]
addAll
(int[] a, int... elementsToAdd) Adds all the elementToAdds of the given arrays into a new array.static long[]
addAll
(long[] a, long... elementsToAdd) Adds all the elementToAdds of the given arrays into a new array.static short[]
addAll
(short[] a, short... elementsToAdd) Adds all the elementToAdds of the given arrays into a new array.static String[]
Adds all the elementToAdds of the given arrays into a new array.static <T> boolean
addAll
(Collection<T> c, Iterator<? extends T> elementsToAdd) static <T> boolean
addAll
(Collection<T> c, T... elementsToAdd) static <T> T[]
addAll
(T[] a, T... elementsToAdd) Adds all the elementToAdds of the given arrays into a new array.static boolean
allBlank
(CharSequence... css) Checks if all of the CharSequences are empty (""), null or whitespace only.static boolean
allBlank
(CharSequence a, CharSequence b) static boolean
allBlank
(CharSequence a, CharSequence b, CharSequence c) static boolean
allBlank
(Collection<? extends CharSequence> css) static <A,
B> boolean allEmpty
(A[] a, B[] b) static <A,
B, C> boolean allEmpty
(A[] a, B[] b, C[] c) static boolean
allEmpty
(CharSequence... css) Checks if all of the CharSequences are empty ("") or null.static boolean
allEmpty
(CharSequence a, CharSequence b) static boolean
allEmpty
(CharSequence a, CharSequence b, CharSequence c) static boolean
allEmpty
(Collection<?> a, Collection<?> b) static boolean
allEmpty
(Collection<?> a, Collection<?> b, Collection<?> c) static boolean
allEmpty
(Collection<? extends CharSequence> css) static boolean
allFalse
(boolean[] a) static <T,
E extends Exception>
booleanallMatch
(Iterable<? extends T> c, Throwables.Predicate<? super T, E> filter) static <T,
E extends Exception>
booleanallMatch
(Iterator<? extends T> iter, Throwables.Predicate<? super T, E> filter) static <T,
E extends Exception>
booleanallMatch
(T[] a, Throwables.Predicate<? super T, E> filter) static <A,
B> boolean allNull
(A a, B b) static <A,
B, C> boolean allNull
(A a, B b, C c) static boolean
allNull
(Collection<?> c) static <T> boolean
allNull
(T... a) static boolean
allTrue
(boolean[] a) static boolean
anyBlank
(CharSequence... css) Checks if any of the CharSequences are empty ("") or null or whitespace only.static boolean
anyBlank
(CharSequence a, CharSequence b) static boolean
anyBlank
(CharSequence a, CharSequence b, CharSequence c) static boolean
anyBlank
(Collection<? extends CharSequence> css) static <A,
B> boolean anyEmpty
(A[] a, B[] b) static <A,
B, C> boolean anyEmpty
(A[] a, B[] b, C[] c) static boolean
anyEmpty
(CharSequence... css) Checks if any of the CharSequences are empty ("") or null.static boolean
anyEmpty
(CharSequence a, CharSequence b) static boolean
anyEmpty
(CharSequence a, CharSequence b, CharSequence c) static boolean
anyEmpty
(Collection<?> a, Collection<?> b) static boolean
anyEmpty
(Collection<?> a, Collection<?> b, Collection<?> c) static boolean
anyEmpty
(Collection<? extends CharSequence> css) static boolean
anyFalse
(boolean[] a) static <T,
E extends Exception>
booleananyMatch
(Iterable<? extends T> c, Throwables.Predicate<? super T, E> filter) static <T,
E extends Exception>
booleananyMatch
(Iterator<? extends T> iter, Throwables.Predicate<? super T, E> filter) static <T,
E extends Exception>
booleananyMatch
(T[] a, Throwables.Predicate<? super T, E> filter) static <A,
B> boolean anyNull
(A a, B b) static <A,
B, C> boolean anyNull
(A a, B b, C c) static boolean
anyNull
(Collection<?> c) static <T> boolean
anyNull
(T... a) static boolean
anyTrue
(boolean[] a) static <T,
E extends Exception>
voidapplyToEach
(List<T> c, Throwables.Function<? super T, ? extends T, E> converter) static <T,
E extends Exception>
voidapplyToEach
(T[] a, Throwables.Function<? super T, ? extends T, E> converter) Updates each element in the specified arraya
with specified functionconverter
.static <T> T[]
asArray
(T... a) The input array is returned.static <T> ArrayBlockingQueue<T>
asArrayBlockingQueue
(T... a) Return a modifiableArrayBlockingQueue
with specified elements.static <T> ArrayDeque<T>
asArrayDeque
(T... a) Return a modifiableArrayDeque
with specified elements.static <T> ConcurrentLinkedDeque<T>
asConcurrentLinkedDeque
(T... a) Return a modifiableConcurrentLinkedDeque
with specified elements.static <T> ConcurrentLinkedQueue<T>
asConcurrentLinkedQueue
(T... a) Return a modifiableConcurrentLinkedQueue
with specified elements.static <T extends Delayed>
DelayQueue<T>asDelayQueue
(T... a) Return a modifiableDelayQueue
with specified elements.static <T> Deque<T>
asDeque
(T... a) Return a modifiableDeque
with specified elements.static <T> LinkedBlockingDeque<T>
asLinkedBlockingDeque
(T... a) Return a modifiableLinkedBlockingDeque
with specified elements.static <T> LinkedBlockingQueue<T>
asLinkedBlockingQueue
(T... a) Return a modifiableLinkedBlockingQueue
with specified elements.static <K,
V> Map<K, V> asLinkedHashMap
(Object... a) Deprecated.static <K,
V> Map<K, V> asLinkedHashMap
(K k1, V v1) Return a modifiableLinkedHashMap
with specified keys/values.static <K,
V> Map<K, V> asLinkedHashMap
(K k1, V v1, K k2, V v2) Return a modifiableLinkedHashMap
with specified keys/values.static <K,
V> Map<K, V> asLinkedHashMap
(K k1, V v1, K k2, V v2, K k3, V v3) Return a modifiableLinkedHashMap
with specified keys/values.static <K,
V> Map<K, V> asLinkedHashMap
(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4) Return a modifiableLinkedHashMap
with specified keys/values.static <K,
V> Map<K, V> asLinkedHashMap
(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5) Return a modifiableLinkedHashMap
with specified keys/values.static <K,
V> Map<K, V> asLinkedHashMap
(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6) Return a modifiableLinkedHashMap
with specified keys/values.static <K,
V> Map<K, V> asLinkedHashMap
(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7) Return a modifiableLinkedHashMap
with specified keys/values.static <T> Set<T>
asLinkedHashSet
(T e) Return a modifiableLinkedHashSet
with specified element.static <T> Set<T>
asLinkedHashSet
(T... a) Return a modifiableLinkedHashSet
with specified elements.static <T> Set<T>
asLinkedHashSet
(T e1, T e2) Return a modifiableLinkedHashSet
with specified elements.static <T> Set<T>
asLinkedHashSet
(T e1, T e2, T e3) Return a modifiableLinkedHashSet
with specified elements.static <T> Set<T>
asLinkedHashSet
(T e1, T e2, T e3, T e4) Return a modifiableLinkedHashSet
with specified elements.static <T> Set<T>
asLinkedHashSet
(T e1, T e2, T e3, T e4, T e5) Return a modifiableLinkedHashSet
with specified elements.static <T> Set<T>
asLinkedHashSet
(T e1, T e2, T e3, T e4, T e5, T e6) Return a modifiableLinkedHashSet
with specified elements.static <T> Set<T>
asLinkedHashSet
(T e1, T e2, T e3, T e4, T e5, T e6, T e7) Return a modifiableLinkedHashSet
with specified elements.static <T> LinkedList<T>
asLinkedList
(T e) Return a modifiableLinkedList
with specified element.static <T> LinkedList<T>
asLinkedList
(T... a) Return a modifiableLinkedList
with specified elements.static <T> LinkedList<T>
asLinkedList
(T e1, T e2) Return a modifiableLinkedList
with specified elements.static <T> LinkedList<T>
asLinkedList
(T e1, T e2, T e3) Return a modifiableLinkedList
with specified elements.static <T> LinkedList<T>
asLinkedList
(T e1, T e2, T e3, T e4) Return a modifiableLinkedList
with specified elements.static <T> LinkedList<T>
asLinkedList
(T e1, T e2, T e3, T e4, T e5) Return a modifiableLinkedList
with specified elements.static <T> LinkedList<T>
asLinkedList
(T e1, T e2, T e3, T e4, T e5, T e6) Return a modifiableLinkedList
with specified elements.static <T> LinkedList<T>
asLinkedList
(T e1, T e2, T e3, T e4, T e5, T e6, T e7) Return a modifiableLinkedList
with specified elements.static <T> List<T>
asList
(T e) Return a modifiableList
with specified element.static <T> List<T>
asList
(T... a) Return a modifiableList
with specified elements.static <T> List<T>
asList
(T e1, T e2) Return a modifiableList
with specified elements.static <T> List<T>
asList
(T e1, T e2, T e3) Return a modifiableList
with specified elements.static <T> List<T>
asList
(T e1, T e2, T e3, T e4) Return a modifiableList
with specified elements.static <T> List<T>
asList
(T e1, T e2, T e3, T e4, T e5) Return a modifiableList
with specified elements.static <T> List<T>
asList
(T e1, T e2, T e3, T e4, T e5, T e6) Return a modifiableList
with specified elements.static <T> List<T>
asList
(T e1, T e2, T e3, T e4, T e5, T e6, T e7) Return a modifiableList
with specified elements.static <T> List<T>
asList
(T e1, T e2, T e3, T e4, T e5, T e6, T e7, T e8) Return a modifiableList
with specified elements.static <T> List<T>
asList
(T e1, T e2, T e3, T e4, T e5, T e6, T e7, T e8, T e9) Return a modifiableList
with specified elements.static <K,
V> Map<K, V> Deprecated.static <K,
V> Map<K, V> asMap
(K k1, V v1) Return a modifiableMap
with specified key/value.static <K,
V> Map<K, V> asMap
(K k1, V v1, K k2, V v2) Return a modifiableMap
with specified keys/values.static <K,
V> Map<K, V> asMap
(K k1, V v1, K k2, V v2, K k3, V v3) Return a modifiableMap
with specified keys/values.static <K,
V> Map<K, V> asMap
(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4) Return a modifiableMap
with specified keys/values.static <K,
V> Map<K, V> asMap
(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5) Return a modifiableMap
with specified keys/values.static <K,
V> Map<K, V> asMap
(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6) Return a modifiableMap
with specified keys/values.static <K,
V> Map<K, V> asMap
(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7) Return a modifiableMap
with specified keys/values.static <T> Multiset<T>
asMultiset
(T... a) Return a modifiableMultiset
with specified elements.static <T> NavigableSet<T>
asNavigableSet
(T... a) Return a modifiableNavigableSet
with specified elements.static <T> PriorityQueue<T>
asPriorityQueue
(T... a) Return a modifiablePriorityQueue
with specified elements.Deprecated.Return a modifiableMap
with specified key/value.Return a modifiableMap
with specified keys/values.asProps
(String propName1, Object propValue1, String propName2, Object propValue2, String propName3, Object propValue3) Return a modifiableMap
with specified keys/values.asProps
(String propName1, Object propValue1, String propName2, Object propValue2, String propName3, Object propValue3, String propName4, Object propValue4) Return a modifiableMap
with specified keys/values.asProps
(String propName1, Object propValue1, String propName2, Object propValue2, String propName3, Object propValue3, String propName4, Object propValue4, String propName5, Object propValue5) Return a modifiableMap
with specified keys/values.static <T> Queue<T>
asQueue
(T... a) Return a modifiableQueue
with specified elements.static <T> Set<T>
asSet
(T e) Return a modifiableSet
with specified element.static <T> Set<T>
asSet
(T... a) Return a modifiableSet
with specified elements.static <T> Set<T>
asSet
(T e1, T e2) Return a modifiableSet
with specified elements.static <T> Set<T>
asSet
(T e1, T e2, T e3) Return a modifiableSet
with specified elements.static <T> Set<T>
asSet
(T e1, T e2, T e3, T e4) Return a modifiableSet
with specified elements.static <T> Set<T>
asSet
(T e1, T e2, T e3, T e4, T e5) Return a modifiableSet
with specified elements.static <T> Set<T>
asSet
(T e1, T e2, T e3, T e4, T e5, T e6) Return a modifiableSet
with specified elements.static <T> Set<T>
asSet
(T e1, T e2, T e3, T e4, T e5, T e6, T e7) Return a modifiableSet
with specified elements.static <T> Set<T>
asSet
(T e1, T e2, T e3, T e4, T e5, T e6, T e7, T e8) Return a modifiableSet
with specified elements.static <T> Set<T>
asSet
(T e1, T e2, T e3, T e4, T e5, T e6, T e7, T e8, T e9) Return a modifiableSet
with specified elements.static <T> List<T>
asSingletonList
(T o) Wrap the specified value with a singleton list.static <K,
V> Map<K, V> asSingletonMap
(K key, V value) Wrap the specified key/value with a singleton map.static <T> Set<T>
asSingletonSet
(T o) Wrap the specified value with a singleton set.static <T> SortedSet<T>
asSortedSet
(T... a) Return a modifiableSortedSet
with specified elements.static <R> ObjIterator<R>
asynCall
(Collection<? extends Callable<? extends R>> commands) Executes the specified commands/tasks asynchronous and immediately returns aniterator
for iterating the result lazily.static <R> ObjIterator<R>
asynCall
(Collection<? extends Callable<? extends R>> commands, Executor executor) Executes the specified commands/tasks asynchronous and immediately returns aniterator
for iterating the result lazily.static ContinuableFuture<Void>
asyncExecute
(Throwables.Runnable<? extends Exception> command) static List<ContinuableFuture<Void>>
asyncExecute
(Throwables.Runnable<? extends Exception>... commands) static ContinuableFuture<Void>
asyncExecute
(Throwables.Runnable<? extends Exception> cmd, int retryTimes, long retryIntervallInMillisInMillis, Predicate<? super Exception> retryCondition) static ContinuableFuture<Void>
asyncExecute
(Throwables.Runnable<? extends Exception> command, long delayInMillis) static ContinuableFuture<Void>
asyncExecute
(Throwables.Runnable<? extends Exception> command, Executor executor) static <R> List<ContinuableFuture<R>>
asyncExecute
(Collection<? extends Callable<R>> commands) static <R> List<ContinuableFuture<R>>
asyncExecute
(Collection<? extends Callable<R>> commands, Executor executor) static <R> ContinuableFuture<R>
asyncExecute
(Callable<R> command) static <R> List<ContinuableFuture<R>>
asyncExecute
(Callable<R>... commands) static <R> ContinuableFuture<R>
asyncExecute
(Callable<R> cmd, int retryTimes, long retryIntervallInMillisInMillis, BiPredicate<? super R, ? super Exception> retryCondition) static <R> ContinuableFuture<R>
asyncExecute
(Callable<R> command, long delayInMillis) static <R> ContinuableFuture<R>
asyncExecute
(Callable<R> command, Executor executor) static List<ContinuableFuture<Void>>
asyncExecute
(List<? extends Throwables.Runnable<? extends Exception>> commands) static List<ContinuableFuture<Void>>
asyncExecute
(List<? extends Throwables.Runnable<? extends Exception>> commands, Executor executor) static ObjIterator<Void>
asynRun
(Collection<? extends Throwables.Runnable<? extends Exception>> commands) Executes the specified commands/tasks asynchronous and immediately returns aniterator
for iterating the result lazily.static ObjIterator<Void>
asynRun
(Collection<? extends Throwables.Runnable<? extends Exception>> commands, Executor executor) Executes the specified commands/tasks asynchronous and immediately returns aniterator
for iterating the result lazily.static double
average
(byte... a) Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.static double
average
(byte[] a, int fromIndex, int toIndex) Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.static double
average
(char... a) Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.static double
average
(char[] a, int fromIndex, int toIndex) Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.static double
average
(double... a) Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.static double
average
(double[] a, int fromIndex, int toIndex) Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.static double
average
(float... a) Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.static double
average
(float[] a, int fromIndex, int toIndex) Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.static double
average
(int... a) Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.static double
average
(int[] a, int fromIndex, int toIndex) Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.static double
average
(long... a) Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.static double
average
(long[] a, int fromIndex, int toIndex) Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.static double
average
(short... a) Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.static double
average
(short[] a, int fromIndex, int toIndex) Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.static BigDecimal
averageBigDecimal
(Iterable<? extends BigDecimal> c) static <T,
E extends Exception>
BigDecimalaverageBigDecimal
(Iterable<? extends T> c, Throwables.Function<? super T, BigDecimal, E> func) static BigDecimal
averageBigInteger
(Iterable<? extends BigInteger> c) static <T,
E extends Exception>
BigDecimalaverageBigInteger
(Iterable<? extends T> c, Throwables.Function<? super T, BigInteger, E> func) static <T extends Number>
doubleaverageDouble
(Iterable<? extends T> c) Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.static <T,
E extends Exception>
doubleaverageDouble
(Iterable<? extends T> c, Throwables.ToDoubleFunction<? super T, E> func) Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.static <T extends Number>
doubleaverageDouble
(Collection<? extends T> c, int fromIndex, int toIndex) Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.static <T,
E extends Exception>
doubleaverageDouble
(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.ToDoubleFunction<? super T, E> func) Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.static <T extends Number>
doubleaverageDouble
(T[] a) Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.static <T extends Number>
doubleaverageDouble
(T[] a, int fromIndex, int toIndex) Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.static <T,
E extends Exception>
doubleaverageDouble
(T[] a, int fromIndex, int toIndex, Throwables.ToDoubleFunction<? super T, E> func) Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.static <T,
E extends Exception>
doubleaverageDouble
(T[] a, Throwables.ToDoubleFunction<? super T, E> func) Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.static <T extends Number>
doubleaverageInt
(Iterable<? extends T> c) Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.static <T,
E extends Exception>
doubleaverageInt
(Iterable<? extends T> c, Throwables.ToIntFunction<? super T, E> func) Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.static <T extends Number>
doubleaverageInt
(Collection<? extends T> c, int fromIndex, int toIndex) Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.static <T,
E extends Exception>
doubleaverageInt
(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.ToIntFunction<? super T, E> func) Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.static <T extends Number>
doubleaverageInt
(T[] a) Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.static <T extends Number>
doubleaverageInt
(T[] a, int fromIndex, int toIndex) Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.static <T,
E extends Exception>
doubleaverageInt
(T[] a, int fromIndex, int toIndex, Throwables.ToIntFunction<? super T, E> func) Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.static <T,
E extends Exception>
doubleaverageInt
(T[] a, Throwables.ToIntFunction<? super T, E> func) Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.static <T extends Number>
doubleaverageLong
(Iterable<? extends T> c) Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.static <T,
E extends Exception>
doubleaverageLong
(Iterable<? extends T> c, Throwables.ToLongFunction<? super T, E> func) Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.static <T extends Number>
doubleaverageLong
(Collection<? extends T> c, int fromIndex, int toIndex) Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.static <T,
E extends Exception>
doubleaverageLong
(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.ToLongFunction<? super T, E> func) Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.static <T extends Number>
doubleaverageLong
(T[] a) Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.static <T extends Number>
doubleaverageLong
(T[] a, int fromIndex, int toIndex) Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.static <T,
E extends Exception>
doubleaverageLong
(T[] a, int fromIndex, int toIndex, Throwables.ToLongFunction<? super T, E> func) Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.static <T,
E extends Exception>
doubleaverageLong
(T[] a, Throwables.ToLongFunction<? super T, E> func) Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.static int
binarySearch
(byte[] a, byte valueToFind) static int
binarySearch
(byte[] a, int fromIndex, int toIndex, byte valueToFind) static int
binarySearch
(char[] a, char valueToFind) static int
binarySearch
(char[] a, int fromIndex, int toIndex, char valueToFind) static int
binarySearch
(double[] a, double valueToFind) static int
binarySearch
(double[] a, int fromIndex, int toIndex, double valueToFind) static int
binarySearch
(float[] a, float valueToFind) static int
binarySearch
(float[] a, int fromIndex, int toIndex, float valueToFind) static int
binarySearch
(int[] a, int valueToFind) static int
binarySearch
(int[] a, int fromIndex, int toIndex, int valueToFind) static int
binarySearch
(long[] a, int fromIndex, int toIndex, long valueToFind) static int
binarySearch
(long[] a, long valueToFind) static int
binarySearch
(short[] a, int fromIndex, int toIndex, short valueToFind) static int
binarySearch
(short[] a, short valueToFind) static int
binarySearch
(Object[] a, int fromIndex, int toIndex, Object valueToFind) static int
binarySearch
(Object[] a, Object valueToFind) static <T extends Comparable<? super T>>
intbinarySearch
(List<? extends T> list, int fromIndex, int toIndex, T valueToFind) static <T> int
binarySearch
(List<? extends T> list, int fromIndex, int toIndex, T valueToFind, Comparator<? super T> cmp) static <T extends Comparable<? super T>>
intbinarySearch
(List<? extends T> list, T valueToFind) static <T> int
binarySearch
(List<? extends T> list, T valueToFind, Comparator<? super T> cmp) static <T> int
binarySearch
(T[] a, int fromIndex, int toIndex, T valueToFind, Comparator<? super T> cmp) static <T> int
binarySearch
(T[] a, T valueToFind, Comparator<? super T> cmp) static <T,
U extends Comparable<? super U>>
intbinarySearchBy
(List<? extends T> list, T valueToFind, Function<? super T, ? extends U> valueToFindMapper) Binary search by.static <T,
U extends Comparable<? super U>>
intbinarySearchBy
(T[] a, T valueToFind, Function<? super T, ? extends U> valueToFindMapper) Binary search by.static void
bucketSort
(double[] a) static void
bucketSort
(double[] a, int fromIndex, int toIndex) static void
bucketSort
(float[] a) static void
bucketSort
(float[] a, int fromIndex, int toIndex) static void
bucketSort
(int[] a) static void
bucketSort
(int[] a, int fromIndex, int toIndex) static void
bucketSort
(long[] a) static void
bucketSort
(long[] a, int fromIndex, int toIndex) static void
bucketSort
(Object[] a) Note: All the objects with same value will be replaced by first element with the same value.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.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.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.static <T extends Comparable<? super T>>
voidbucketSort
(List<T> list) Note: All the objects with same value will be replaced by first element with the same value.static <T extends Comparable<? super T>>
voidbucketSort
(List<T> list, int fromIndex, int toIndex) Note: All the objects with same value will be replaced by first element with the same value.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.static <T> void
bucketSort
(T[] a, Comparator<? super T> cmp) static <T,
U extends Comparable<? super U>>
voidbucketSortBy
(List<? extends T> list, Function<? super T, ? extends U> keyMapper) Bucket sort by.static <T,
U extends Comparable<? super U>>
voidbucketSortBy
(T[] a, Function<? super T, ? extends U> keyMapper) Bucket sort by.callByBatch
(Iterable<? extends T> iter, int batchSize, Throwables.Consumer<? super T, E> elementConsumer, Throwables.Callable<? extends R, E2> batchAction) callByBatch
(Iterable<? extends T> iter, int batchSize, Throwables.Function<? super List<? extends T>, R, E> batchAction) callByBatch
(Iterator<? extends T> iter, int batchSize, Throwables.Consumer<? super T, E> elementConsumer, Throwables.Callable<? extends R, E2> batchAction) callByBatch
(Iterator<? extends T> iter, int batchSize, Throwables.Function<? super List<? extends T>, R, E> batchAction) callByBatch
(T[] a, int batchSize, Throwables.Consumer<? super T, E> elementConsumer, Throwables.Callable<? extends R, E2> batchAction) callByBatch
(T[] a, int batchSize, Throwables.Function<? super List<? extends T>, R, E> batchAction) static <R> List<R>
callInParallel
(Collection<? extends Callable<? extends R>> commands) Executes and complete the input commands in parallel.static <R> List<R>
callInParallel
(Collection<? extends Callable<? extends R>> commands, Executor executor) Executes and complete the input commands in parallel.static <R,
R2> Tuple.Tuple2<R, R2> callInParallel
(Callable<R> command, Callable<R2> command2) Executes and complete the input commands in parallel.static <R,
R2, R3> Tuple.Tuple3<R, R2, R3> callInParallel
(Callable<R> command, Callable<R2> command2, Callable<R3> command3) Executes and complete the input commands in parallel.static <R,
R2, R3, R4>
Tuple.Tuple4<R,R2, R3, R4> callInParallel
(Callable<R> command, Callable<R2> command2, Callable<R3> command3, Callable<R4> command4) Executes and complete the input commands in parallel.static <R,
R2, R3, R4, R5>
Tuple.Tuple5<R,R2, R3, R4, R5> callInParallel
(Callable<R> command, Callable<R2> command2, Callable<R3> command3, Callable<R4> command4, Callable<R5> command5) Executes and complete the input commands in parallel.static <T> T
callUninterruptibly
(long timeoutInMillis, Throwables.LongFunction<T, InterruptedException> cmd) Note: Copied from Google Guava under Apache License v2.0
If a thread is interrupted during such a call, the call continues to block until the result is available or the timeout elapses, and only then re-interrupts the thread.static <T> T
callUninterruptibly
(long timeout, TimeUnit unit, Throwables.BiFunction<Long, TimeUnit, T, InterruptedException> cmd) Note: Copied from Google Guava under Apache License v2.0
If a thread is interrupted during such a call, the call continues to block until the result is available or the timeout elapses, and only then re-interrupts the thread.static <T> T
Note: Copied from Google Guava under Apache License v2.0
If a thread is interrupted during such a call, the call continues to block until the result is available or the timeout elapses, and only then re-interrupts the thread.static <T> u.Nullable<T>
castIfAssignable
(Object val, Class<? extends T> targetType) Returns an emptyNullable
ifval
isnull
whiletargetType
is primitive or can not be assigned totargetType
.static <T extends CharSequence>
TcheckArgNotBlank
(T arg, String msg) Checks if a CharSequence is NOTnull
, empty ("") or whitespace only.static boolean[]
checkArgNotEmpty
(boolean[] arg, String argNameOrErrorMsg) Checks if the specifiedarg
isnull
or empty, and throwsIllegalArgumentException
if it is.static byte[]
checkArgNotEmpty
(byte[] arg, String argNameOrErrorMsg) Checks if the specifiedarg
isnull
or empty, and throwsIllegalArgumentException
if it is.static char[]
checkArgNotEmpty
(char[] arg, String argNameOrErrorMsg) Checks if the specifiedarg
isnull
or empty, and throwsIllegalArgumentException
if it is.static double[]
checkArgNotEmpty
(double[] arg, String argNameOrErrorMsg) Checks if the specifiedarg
isnull
or empty, and throwsIllegalArgumentException
if it is.static float[]
checkArgNotEmpty
(float[] arg, String argNameOrErrorMsg) Checks if the specifiedarg
isnull
or empty, and throwsIllegalArgumentException
if it is.static int[]
checkArgNotEmpty
(int[] arg, String argNameOrErrorMsg) Checks if the specifiedarg
isnull
or empty, and throwsIllegalArgumentException
if it is.static long[]
checkArgNotEmpty
(long[] arg, String argNameOrErrorMsg) Checks if the specifiedarg
isnull
or empty, and throwsIllegalArgumentException
if it is.static short[]
checkArgNotEmpty
(short[] arg, String argNameOrErrorMsg) Checks if the specifiedarg
isnull
or empty, and throwsIllegalArgumentException
if it is.static <T> LongMultiset<T>
checkArgNotEmpty
(LongMultiset<T> arg, String argNameOrErrorMsg) Checks if the specifiedarg
isnull
or empty, and throwsIllegalArgumentException
if it is.static <T> Multiset<T>
checkArgNotEmpty
(Multiset<T> arg, String argNameOrErrorMsg) Checks if the specifiedarg
isnull
or empty, and throwsIllegalArgumentException
if it is.static <T> T[]
checkArgNotEmpty
(T[] arg, String argNameOrErrorMsg) Checks if the specifiedarg
isnull
or empty, and throwsIllegalArgumentException
if it is.static <T extends CharSequence>
TcheckArgNotEmpty
(T arg, String argNameOrErrorMsg) Checks if the specifiedarg
isnull
or empty, and throwsIllegalArgumentException
if it is.static byte
checkArgNotNegative
(byte arg, String argNameOrErrorMsg) Checks if the specifiedarg
is not negative, and throwsIllegalArgumentException
if it is.static double
checkArgNotNegative
(double arg, String argNameOrErrorMsg) Checks if the specifiedarg
is not negative, and throwsIllegalArgumentException
if it is.static float
checkArgNotNegative
(float arg, String argNameOrErrorMsg) Checks if the specifiedarg
is not negative, and throwsIllegalArgumentException
if it is.static int
checkArgNotNegative
(int arg, String argNameOrErrorMsg) Checks if the specifiedarg
is not negative, and throwsIllegalArgumentException
if it is.static long
checkArgNotNegative
(long arg, String argNameOrErrorMsg) Checks if the specifiedarg
is not negative, and throwsIllegalArgumentException
if it is.static short
checkArgNotNegative
(short arg, String argNameOrErrorMsg) Checks if the specifiedarg
is not negative, and throwsIllegalArgumentException
if it is.static <T> T
checkArgNotNull
(T obj) Check arg not null.static <T> T
checkArgNotNull
(T obj, String errorMessage) Check arg not null.static byte
checkArgPositive
(byte arg, String argNameOrErrorMsg) Checks if the specifiedarg
is positive, and throwsIllegalArgumentException
if it is not.static double
checkArgPositive
(double arg, String argNameOrErrorMsg) Checks if the specifiedarg
is positive, and throwsIllegalArgumentException
if it is not.static float
checkArgPositive
(float arg, String argNameOrErrorMsg) Checks if the specifiedarg
is positive, and throwsIllegalArgumentException
if it is not.static int
checkArgPositive
(int arg, String argNameOrErrorMsg) Checks if the specifiedarg
is positive, and throwsIllegalArgumentException
if it is not.static long
checkArgPositive
(long arg, String argNameOrErrorMsg) Checks if the specifiedarg
is positive, and throwsIllegalArgumentException
if it is not.static short
checkArgPositive
(short arg, String argNameOrErrorMsg) Checks if the specifiedarg
is positive, and throwsIllegalArgumentException
if it is not.static void
checkArgument
(boolean expression) Ensures the truth of an expression involving one or more parameters to the calling method.static void
checkArgument
(boolean expression, String errorMessage) Ensures the truth of an expression involving one or more parameters to the calling method.static void
checkArgument
(boolean b, String errorMessageTemplate, boolean p) Ensures the truth of an expression involving one or more parameters to the calling method.static void
checkArgument
(boolean b, String errorMessageTemplate, boolean p1, boolean p2) Ensures the truth of an expression involving one or more parameters to the calling method.static void
checkArgument
(boolean b, String errorMessageTemplate, boolean p1, boolean p2, boolean p3) Ensures the truth of an expression involving one or more parameters to the calling method.static void
checkArgument
(boolean b, String errorMessageTemplate, byte p) Ensures the truth of an expression involving one or more parameters to the calling method.static void
checkArgument
(boolean b, String errorMessageTemplate, char p) Ensures the truth of an expression involving one or more parameters to the calling method.static void
checkArgument
(boolean b, String errorMessageTemplate, double p) Ensures the truth of an expression involving one or more parameters to the calling method.static void
checkArgument
(boolean b, String errorMessageTemplate, double p1, double p2) Ensures the truth of an expression involving one or more parameters to the calling method.static void
checkArgument
(boolean b, String errorMessageTemplate, double p1, double p2, double p3) Ensures the truth of an expression involving one or more parameters to the calling method.static void
checkArgument
(boolean b, String errorMessageTemplate, float p) Ensures the truth of an expression involving one or more parameters to the calling method.static void
checkArgument
(boolean b, String errorMessageTemplate, float p1, float p2) Ensures the truth of an expression involving one or more parameters to the calling method.static void
checkArgument
(boolean b, String errorMessageTemplate, float p1, float p2, float p3) Ensures the truth of an expression involving one or more parameters to the calling method.static void
checkArgument
(boolean b, String errorMessageTemplate, int p) Ensures the truth of an expression involving one or more parameters to the calling method.static void
checkArgument
(boolean b, String errorMessageTemplate, int p1, int p2) Ensures the truth of an expression involving one or more parameters to the calling method.static void
checkArgument
(boolean b, String errorMessageTemplate, int p1, int p2, int p3) Ensures the truth of an expression involving one or more parameters to the calling method.static void
checkArgument
(boolean b, String errorMessageTemplate, long p) Ensures the truth of an expression involving one or more parameters to the calling method.static void
checkArgument
(boolean b, String errorMessageTemplate, long p1, long p2) Ensures the truth of an expression involving one or more parameters to the calling method.static void
checkArgument
(boolean b, String errorMessageTemplate, long p1, long p2, long p3) Ensures the truth of an expression involving one or more parameters to the calling method.static void
checkArgument
(boolean b, String errorMessageTemplate, short p) Ensures the truth of an expression involving one or more parameters to the calling method.static void
checkArgument
(boolean b, String errorMessageTemplate, Object p) Ensures the truth of an expression involving one or more parameters to the calling method.static void
checkArgument
(boolean b, String errorMessageTemplate, Object p1, Object p2) Ensures the truth of an expression involving one or more parameters to the calling method.static void
checkArgument
(boolean b, String errorMessageTemplate, Object p1, Object p2, Object p3) Ensures the truth of an expression involving one or more parameters to the calling method.static void
checkArgument
(boolean b, Supplier<String> errorMessageSupplier) static void
Check if the specifiedArray
contains anynull
element.static void
checkElementNotNull
(Object[] a, String argNameOrErrorMsg) Check if the specifiedArray
contains anynull
element.static void
Check if the specifiedCollection
contains anynull
element.static void
checkElementNotNull
(Collection<?> c, String argNameOrErrorMsg) Check if the specifiedCollection
contains anynull
element.static void
checkFromIndexSize
(int fromIndex, int size, int length) Check from index size.static void
checkFromToIndex
(int fromIndex, int toIndex, int length) Check from to index.static void
checkIndex
(int index, int length) static void
checkKeyNotNull
(Map<?, ?> m) Check if the specifiedMap
contains anynull
key.static void
checkKeyNotNull
(Map<?, ?> m, String argNameOrErrorMsg) Check if the specifiedMap
contains anynull
key.static void
checkState
(boolean expression) Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.static void
checkState
(boolean expression, String errorMessage) Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.static void
checkState
(boolean b, String errorMessageTemplate, double p) Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.static void
checkState
(boolean b, String errorMessageTemplate, double p1, double p2) Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.static void
checkState
(boolean b, String errorMessageTemplate, double p1, double p2, double p3) Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.static void
checkState
(boolean b, String errorMessageTemplate, float p) Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.static void
checkState
(boolean b, String errorMessageTemplate, float p1, float p2) Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.static void
checkState
(boolean b, String errorMessageTemplate, float p1, float p2, float p3) Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.static void
checkState
(boolean b, String errorMessageTemplate, int p) Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.static void
checkState
(boolean b, String errorMessageTemplate, int p1, int p2) Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.static void
checkState
(boolean b, String errorMessageTemplate, int p1, int p2, int p3) Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.static void
checkState
(boolean b, String errorMessageTemplate, long p) Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.static void
checkState
(boolean b, String errorMessageTemplate, long p1, long p2) Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.static void
checkState
(boolean b, String errorMessageTemplate, long p1, long p2, long p3) Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.static void
checkState
(boolean b, String errorMessageTemplate, Object p) Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.static void
checkState
(boolean b, String errorMessageTemplate, Object p1, Object p2) Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.static void
checkState
(boolean b, String errorMessageTemplate, Object p1, Object p2, Object p3) Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.static void
checkState
(boolean b, Supplier<String> errorMessageSupplier) static void
checkValueNotNull
(Map<?, ?> m) Check if the specifiedMap
contains anynull
value.static void
checkValueNotNull
(Map<?, ?> m, String argNameOrErrorMsg) Check if the specifiedMap
contains anynull
value.static boolean[]
clone
(boolean[] original) Clone the original array.static boolean[][]
clone
(boolean[][] original) Clone the original array and its sub arrays.static boolean[][][]
clone
(boolean[][][] original) Clone the original array and its sub arrays.static byte[]
clone
(byte[] original) Clone the original array.static byte[][]
clone
(byte[][] original) Clone the original array and its sub arrays.static byte[][][]
clone
(byte[][][] original) Clone the original array and its sub arrays.static char[]
clone
(char[] original) Clone the original array.static char[][]
clone
(char[][] original) Clone the original array and its sub arrays.static char[][][]
clone
(char[][][] original) Clone the original array and its sub arrays.static double[]
clone
(double[] original) Clone the original array.static double[][]
clone
(double[][] original) Clone the original array and its sub arrays.static double[][][]
clone
(double[][][] original) Clone the original array and its sub arrays.static float[]
clone
(float[] original) Clone the original array.static float[][]
clone
(float[][] original) Clone the original array and its sub arrays.static float[][][]
clone
(float[][][] original) Clone the original array and its sub arrays.static int[]
clone
(int[] original) Clone the original array.static int[][]
clone
(int[][] original) Clone the original array and its sub arrays.static int[][][]
clone
(int[][][] original) Clone the original array and its sub arrays.static long[]
clone
(long[] original) Clone the original array.static long[][]
clone
(long[][] original) Clone the original array and its sub arrays.static long[][][]
clone
(long[][][] original) Clone the original array and its sub arrays.static short[]
clone
(short[] original) Clone the original array.static short[][]
clone
(short[][] original) Clone the original array and its sub arrays.static short[][][]
clone
(short[][][] original) Clone the original array and its sub arrays.static <T> T
Deeply copy by: obj -> serialize -> kryo/Json -> deserialize -> new object.static <T> T
clone
(T obj) static <T> T[]
clone
(T[] original) Clone the original array.static <T> T[][]
clone
(T[][] original) Clone the original array and its sub arrays.static <T> T[][][]
clone
(T[][][] original) Clone the original array and its sub arrays.static <T> Set<T>
commonSet
(Collection<? extends Collection<? extends T>> c) static <T> Set<T>
commonSet
(Collection<? extends T> a, Collection<?> b) static int
compare
(boolean[] a, boolean[] b) static int
compare
(boolean[] a, int fromIndexA, boolean[] b, int fromIndexB, int len) static int
compare
(boolean a, boolean b) static int
compare
(byte[] a, byte[] b) static int
compare
(byte[] a, int fromIndexA, byte[] b, int fromIndexB, int len) static int
compare
(byte a, byte b) static int
compare
(char[] a, char[] b) static int
compare
(char[] a, int fromIndexA, char[] b, int fromIndexB, int len) static int
compare
(double[] a, double[] b) static int
compare
(double[] a, int fromIndexA, double[] b, int fromIndexB, int len) static int
compare
(double a, double b) static int
compare
(float[] a, float[] b) static int
compare
(float[] a, int fromIndexA, float[] b, int fromIndexB, int len) static int
compare
(float a, float b) static int
compare
(int[] a, int[] b) static int
compare
(int[] a, int fromIndexA, int[] b, int fromIndexB, int len) static int
compare
(int a, int b) static int
compare
(long[] a, int fromIndexA, long[] b, int fromIndexB, int len) static int
compare
(long[] a, long[] b) static int
compare
(long a, long b) static int
compare
(short[] a, int fromIndexA, short[] b, int fromIndexB, int len) static int
compare
(short[] a, short[] b) static int
compare
(short a, short b) static <T> int
compare
(Collection<T> a, int fromIndexA, Collection<T> b, int fromIndexB, int len) static <T> int
compare
(Collection<T> a, int fromIndexA, Collection<T> b, int fromIndexB, int len, Comparator<? super T> cmp) static <T extends Comparable<? super T>>
intcompare
(Collection<T> a, Collection<T> b) static <T> int
compare
(Collection<T> a, Collection<T> b, Comparator<? super T> cmp) static <T extends Comparable<? super T>>
intcompare
(T[] a, int fromIndexA, T[] b, int fromIndexB, int len) static <T> int
compare
(T[] a, int fromIndexA, T[] b, int fromIndexB, int len, Comparator<? super T> cmp) static <T extends Comparable<? super T>>
intcompare
(T[] a, T[] b) static <T> int
compare
(T[] a, T[] b, Comparator<? super T> cmp) static <T1 extends Comparable<T1>,
T2 extends Comparable<T2>>
intcompare
(T1 a1, T1 b1, T2 a2, T2 b2) Continue to compare the pairs of values(a1, b1), (a2, b2)
until they're not equal.static <T1 extends Comparable<T1>,
T2 extends Comparable<T2>, T3 extends Comparable<T3>>
intcompare
(T1 a1, T1 b1, T2 a2, T2 b2, T3 a3, T3 b3) Continue to compare the pairs of values(a1, b1), (a2, b2), (a3, b3)
until they're not equal.static <T1 extends Comparable<T1>,
T2 extends Comparable<T2>, T3 extends Comparable<T3>, T4 extends Comparable<T4>>
intcompare
(T1 a1, T1 b1, T2 a2, T2 b2, T3 a3, T3 b3, T4 a4, T4 b4) Deprecated.static <T1 extends Comparable<T1>,
T2 extends Comparable<T2>, T3 extends Comparable<T3>, T4 extends Comparable<T4>, T5 extends Comparable<T5>>
intcompare
(T1 a1, T1 b1, T2 a2, T2 b2, T3 a3, T3 b3, T4 a4, T4 b4, T5 a5, T5 b5) Deprecated.please useBuilder.ComparisonBuilder
static <T1 extends Comparable<T1>,
T2 extends Comparable<T2>, T3 extends Comparable<T3>, T4 extends Comparable<T4>, T5 extends Comparable<T5>, T6 extends Comparable<T6>>
intcompare
(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 useBuilder.ComparisonBuilder
static <T1 extends Comparable<T1>,
T2 extends Comparable<T2>, T3 extends Comparable<T3>, T4 extends Comparable<T4>, T5 extends Comparable<T5>, T6 extends Comparable<T6>, T7 extends Comparable<T7>>
intcompare
(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 useBuilder.ComparisonBuilder
static <T extends Comparable<? super T>>
intcompare
(T a, T b) static <T> int
compare
(T a, T b, Comparator<? super T> cmp) Returns 0 if the arguments are identical andc.compare(a, b)
otherwise.static int
compareIgnoreCase
(String a, String b) Compare ignore case.static boolean[]
concat
(boolean[]... aa) static boolean[]
concat
(boolean[] a, boolean[] b) static byte[]
concat
(byte[]... aa) static byte[]
concat
(byte[] a, byte[] b) static char[]
concat
(char[]... aa) static char[]
concat
(char[] a, char[] b) static double[]
concat
(double[]... aa) static double[]
concat
(double[] a, double[] b) static float[]
concat
(float[]... aa) static float[]
concat
(float[] a, float[] b) static int[]
concat
(int[]... aa) static int[]
concat
(int[] a, int[] b) static long[]
concat
(long[]... aa) static long[]
concat
(long[] a, long[] b) static short[]
concat
(short[]... aa) static short[]
concat
(short[] a, short[] b) static <T> List<T>
static <T> List<T>
static <T> List<T>
concat
(Collection<? extends Iterable<? extends T>> c) static <T,
C extends Collection<T>>
Cconcat
(Collection<? extends Iterable<? extends T>> c, IntFunction<? extends C> supplier) static <T> ObjIterator<T>
static <T> ObjIterator<T>
static <T> T[]
concat
(T[]... aa) static <T> T[]
concat
(T[] a, T[] b) static boolean
contains
(boolean[] a, boolean valueToFind) static boolean
contains
(byte[] a, byte valueToFind) static boolean
contains
(char[] a, char valueToFind) static boolean
contains
(double[] a, double valueToFind) static boolean
contains
(float[] a, float valueToFind) static boolean
contains
(int[] a, int valueToFind) static boolean
contains
(long[] a, long valueToFind) static boolean
contains
(short[] a, short valueToFind) static boolean
static boolean
static boolean
contains
(Collection<?> c, Object valueToFind) static boolean
static boolean
containsAll
(Iterable<?> c, Collection<?> valuesToFind) static boolean
containsAll
(Collection<?> c, Object... valuesToFind) static boolean
containsAll
(Collection<?> c, Collection<?> valuesToFind) static boolean
containsAll
(Iterator<?> iter, Collection<?> valuesToFind) static boolean
containsAny
(Iterable<?> c, Set<?> valuesToFind) static boolean
containsAny
(Collection<?> c, Object... valuesToFind) static boolean
containsAny
(Collection<?> c, Collection<?> valuesToFind) static boolean
containsAny
(Iterator<?> iter, Set<?> valuesToFind) static <T> T
static <T> T
Try to convert the specifiedobj
to the specifiedtargetClass
.static void
copy
(boolean[] src, int srcPos, boolean[] dest, int destPos, int length) static void
copy
(byte[] src, int srcPos, byte[] dest, int destPos, int length) static void
copy
(char[] src, int srcPos, char[] dest, int destPos, int length) static void
copy
(double[] src, int srcPos, double[] dest, int destPos, int length) static void
copy
(float[] src, int srcPos, float[] dest, int destPos, int length) static void
copy
(int[] src, int srcPos, int[] dest, int destPos, int length) static void
copy
(long[] src, int srcPos, long[] dest, int destPos, int length) static void
copy
(short[] src, int srcPos, short[] dest, int destPos, int length) static void
static <T> T
copy
(Object bean, boolean ignoreUnmatchedProperty, Set<String> ignoredPropNames, Class<? extends T> targetClass) static void
static <T> T
static <T> T
copy
(Object bean, Collection<String> selectPropNames, Class<? extends T> targetClass) Returns a new created instance of the specifiedcls
and set with same properties retrieved by 'getXXX' method in the specifiedbean
.static <T> void
static <T> void
Copies all of the elements from one list into another.static <T> T
copy
(T bean) Returns a new created instance of the same class and set with same properties retrieved by 'getXXX' method in the specifiedbean
.static <T> T
copy
(T bean, Collection<String> selectPropNames) static boolean[]
copyOf
(boolean[] original, int newLength) static byte[]
copyOf
(byte[] original, int newLength) static char[]
copyOf
(char[] original, int newLength) static double[]
copyOf
(double[] original, int newLength) static float[]
copyOf
(float[] original, int newLength) static int[]
copyOf
(int[] original, int newLength) static long[]
copyOf
(long[] original, int newLength) static short[]
copyOf
(short[] original, int newLength) static <T> T[]
copyOf
(T[] original, int newLength) static <T,
U> T[] static boolean[]
copyOfRange
(boolean[] original, int fromIndex, int toIndex) Copy of range.static boolean[]
copyOfRange
(boolean[] original, int fromIndex, int toIndex, int step) Copy all the elements inoriginal
, throughto
-from
, bystep
.static byte[]
copyOfRange
(byte[] original, int fromIndex, int toIndex) Copy of range.static byte[]
copyOfRange
(byte[] original, int fromIndex, int toIndex, int step) Copy all the elements inoriginal
, throughto
-from
, bystep
.static char[]
copyOfRange
(char[] original, int fromIndex, int toIndex) Copy of range.static char[]
copyOfRange
(char[] original, int fromIndex, int toIndex, int step) Copy all the elements inoriginal
, throughto
-from
, bystep
.static double[]
copyOfRange
(double[] original, int fromIndex, int toIndex) Copy of range.static double[]
copyOfRange
(double[] original, int fromIndex, int toIndex, int step) Copy all the elements inoriginal
, throughto
-from
, bystep
.static float[]
copyOfRange
(float[] original, int fromIndex, int toIndex) Copy of range.static float[]
copyOfRange
(float[] original, int fromIndex, int toIndex, int step) Copy all the elements inoriginal
, throughto
-from
, bystep
.static int[]
copyOfRange
(int[] original, int fromIndex, int toIndex) Copy of range.static int[]
copyOfRange
(int[] original, int fromIndex, int toIndex, int step) Copy all the elements inoriginal
, throughto
-from
, bystep
.static long[]
copyOfRange
(long[] original, int fromIndex, int toIndex) Copy of range.static long[]
copyOfRange
(long[] original, int fromIndex, int toIndex, int step) Copy all the elements inoriginal
, throughto
-from
, bystep
.static short[]
copyOfRange
(short[] original, int fromIndex, int toIndex) Copy of range.static short[]
copyOfRange
(short[] original, int fromIndex, int toIndex, int step) Copy all the elements inoriginal
, throughto
-from
, bystep
.static String
copyOfRange
(String str, int fromIndex, int toIndex) Copy of range.static String
copyOfRange
(String str, int fromIndex, int toIndex, int step) Copy of range.static <T> List<T>
copyOfRange
(List<T> c, int fromIndex, int toIndex) Copy of range.static <T> List<T>
copyOfRange
(List<T> c, int fromIndex, int toIndex, int step) Copy all the elements inoriginal
, throughto
-from
, bystep
.static <T> T[]
copyOfRange
(T[] original, int fromIndex, int toIndex) Copy of range.static <T> T[]
copyOfRange
(T[] original, int fromIndex, int toIndex, int step) Copy all the elements inoriginal
, throughto
-from
, bystep
.static <T> T[]
copyOfRange
(T[] original, int fromIndex, int toIndex, int step, Class<? extends T[]> newType) Copy all the elements inoriginal
, throughto
-from
, bystep
.static <T,
U> T[] copyOfRange
(U[] original, int fromIndex, int toIndex, Class<? extends T[]> newType) static <T,
E extends Exception>
T[]copyThenApply
(T[] a, Throwables.Function<? super T, ? extends T, E> converter) Copy the specified arraya
first, then callconverter
on the copy.static <E extends Exception>
intcount
(boolean[] a, int fromIndex, int toIndex, Throwables.BooleanPredicate<E> filter) Mostly it's designed for one-step operation to complete the operation in one step.static <E extends Exception>
intcount
(boolean[] a, Throwables.BooleanPredicate<E> filter) Mostly it's designed for one-step operation to complete the operation in one step.static <E extends Exception>
intcount
(byte[] a, int fromIndex, int toIndex, Throwables.BytePredicate<E> filter) Mostly it's designed for one-step operation to complete the operation in one step.static <E extends Exception>
intcount
(byte[] a, Throwables.BytePredicate<E> filter) Mostly it's designed for one-step operation to complete the operation in one step.static <E extends Exception>
intcount
(char[] a, int fromIndex, int toIndex, Throwables.CharPredicate<E> filter) Mostly it's designed for one-step operation to complete the operation in one step.static <E extends Exception>
intcount
(char[] a, Throwables.CharPredicate<E> filter) Mostly it's designed for one-step operation to complete the operation in one step.static <E extends Exception>
intcount
(double[] a, int fromIndex, int toIndex, Throwables.DoublePredicate<E> filter) Mostly it's designed for one-step operation to complete the operation in one step.static <E extends Exception>
intcount
(double[] a, Throwables.DoublePredicate<E> filter) Mostly it's designed for one-step operation to complete the operation in one step.static <E extends Exception>
intcount
(float[] a, int fromIndex, int toIndex, Throwables.FloatPredicate<E> filter) Mostly it's designed for one-step operation to complete the operation in one step.static <E extends Exception>
intcount
(float[] a, Throwables.FloatPredicate<E> filter) Mostly it's designed for one-step operation to complete the operation in one step.static <E extends Exception>
intcount
(int[] a, int fromIndex, int toIndex, Throwables.IntPredicate<E> filter) Mostly it's designed for one-step operation to complete the operation in one step.static <E extends Exception>
intcount
(int[] a, Throwables.IntPredicate<E> filter) Mostly it's designed for one-step operation to complete the operation in one step.static <E extends Exception>
intcount
(long[] a, int fromIndex, int toIndex, Throwables.LongPredicate<E> filter) Mostly it's designed for one-step operation to complete the operation in one step.static <E extends Exception>
intcount
(long[] a, Throwables.LongPredicate<E> filter) Mostly it's designed for one-step operation to complete the operation in one step.static <E extends Exception>
intcount
(short[] a, int fromIndex, int toIndex, Throwables.ShortPredicate<E> filter) Mostly it's designed for one-step operation to complete the operation in one step.static <E extends Exception>
intcount
(short[] a, Throwables.ShortPredicate<E> filter) Mostly it's designed for one-step operation to complete the operation in one step.static <T,
E extends Exception>
intcount
(Iterable<? extends T> c, Throwables.Predicate<? super T, E> filter) Mostly it's designed for one-step operation to complete the operation in one step.static <T,
E extends Exception>
intcount
(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.Predicate<? super T, E> filter) Mostly it's designed for one-step operation to complete the operation in one step.static int
static <T,
E extends Exception>
intcount
(Iterator<? extends T> iter, Throwables.Predicate<? super T, E> filter) static <T,
E extends Exception>
intcount
(T[] a, int fromIndex, int toIndex, Throwables.Predicate<? super T, E> filter) Mostly it's designed for one-step operation to complete the operation in one step.static <T,
E extends Exception>
intcount
(T[] a, Throwables.Predicate<? super T, E> filter) Mostly it's designed for one-step operation to complete the operation in one step.static boolean
deepEquals
(Object[] a, int fromIndexA, Object[] b, int fromIndexB, int len) static boolean
deepEquals
(Object[] a, Object[] b) static boolean
deepEquals
(Object a, Object b) static int
deepHashCode
(Object obj) static int
deepHashCode
(Object[] a) Deep hash code.static int
deepHashCode
(Object[] a, int fromIndex, int toIndex) Deep hash code.static String
deepToString
(Object obj) static String
deepToString
(Object[] a) Deep to string.static String
deepToString
(Object[] a, int fromIndex, int toIndex) Deep to string.static String
deepToString
(Object[] a, String defaultIfNull) Deep to string.static <T extends CharSequence>
TdefaultIfBlank
(T str, Supplier<? extends T> getterForDefaultStr) static <T extends CharSequence>
TdefaultIfBlank
(T str, T defaultStr) Same asStrings.defaultIfBlank(CharSequence, CharSequence)
.static <T extends CharSequence>
TdefaultIfEmpty
(T str, Supplier<? extends T> getterForDefaultStr) static <T extends CharSequence>
TdefaultIfEmpty
(T str, T defaultStr) Same asStrings.defaultIfEmpty(CharSequence, CharSequence)
.static boolean
Default if null.static boolean
defaultIfNull
(Boolean b, boolean defaultForNull) Default if null.static byte
Default if null.static byte
defaultIfNull
(Byte b, byte defaultForNull) Default if null.static char
Default if null.static char
defaultIfNull
(Character c, char defaultForNull) Default if null.static double
Default if null.static double
defaultIfNull
(Double b, double defaultForNull) Default if null.static float
Default if null.static float
defaultIfNull
(Float b, float defaultForNull) Default if null.static int
Default if null.static int
defaultIfNull
(Integer b, int defaultForNull) Default if null.static long
Default if null.static long
defaultIfNull
(Long b, long defaultForNull) Default if null.static short
Default if null.static short
defaultIfNull
(Short b, short defaultForNull) Default if null.static <T> T
defaultIfNull
(T obj, Supplier<? extends T> supplierForDefault) Default if null.static <T> T
defaultIfNull
(T obj, T defaultForNull) Default if null.static <T> T
defaultValueOf
(Class<T> cls) Default value of.static boolean[]
delete
(boolean[] a, int index) Removes the element at the specified position from the specified array.static byte[]
delete
(byte[] a, int index) Removes the element at the specified position from the specified array.static char[]
delete
(char[] a, int index) Removes the element at the specified position from the specified array.static double[]
delete
(double[] a, int index) Removes the element at the specified position from the specified array.static float[]
delete
(float[] a, int index) Removes the element at the specified position from the specified array.static int[]
delete
(int[] a, int index) Removes the element at the specified position from the specified array.static long[]
delete
(long[] a, int index) Removes the element at the specified position from the specified array.static short[]
delete
(short[] a, int index) Removes the element at the specified position from the specified array.static <T> T[]
delete
(T[] a, int index) Removes the element at the specified position from the specified array.static boolean[]
deleteAll
(boolean[] a, int... indices) Removes the elements at the specified positions from the specified array.static byte[]
deleteAll
(byte[] a, int... indices) Removes the elements at the specified positions from the specified array.static char[]
deleteAll
(char[] a, int... indices) Removes the elements at the specified positions from the specified array.static double[]
deleteAll
(double[] a, int... indices) Removes the elements at the specified positions from the specified array.static float[]
deleteAll
(float[] a, int... indices) Removes the elements at the specified positions from the specified array.static int[]
deleteAll
(int[] a, int... indices) Removes the elements at the specified positions from the specified array.static long[]
deleteAll
(long[] a, int... indices) Removes the elements at the specified positions from the specified array.static short[]
deleteAll
(short[] a, int... indices) Removes the elements at the specified positions from the specified array.static String[]
static boolean
Removes the elements at the specified positions from the specified List.static <T> T[]
deleteAll
(T[] a, int... indices) Removes the elements at the specified positions from the specified array.static boolean[]
deleteRange
(boolean[] a, int fromIndex, int toIndex) Deletes the values fromfromIndex
totoIndex
.static byte[]
deleteRange
(byte[] a, int fromIndex, int toIndex) Deletes the values fromfromIndex
totoIndex
.static char[]
deleteRange
(char[] a, int fromIndex, int toIndex) Deletes the values fromfromIndex
totoIndex
.static double[]
deleteRange
(double[] a, int fromIndex, int toIndex) Deletes the values fromfromIndex
totoIndex
.static float[]
deleteRange
(float[] a, int fromIndex, int toIndex) Deletes the values fromfromIndex
totoIndex
.static int[]
deleteRange
(int[] a, int fromIndex, int toIndex) Deletes the values fromfromIndex
totoIndex
.static long[]
deleteRange
(long[] a, int fromIndex, int toIndex) Deletes the values fromfromIndex
totoIndex
.static short[]
deleteRange
(short[] a, int fromIndex, int toIndex) Deletes the values fromfromIndex
totoIndex
.static String[]
deleteRange
(String[] a, int fromIndex, int toIndex) static String
deleteRange
(String str, int fromIndex, int toIndex) static <T> boolean
deleteRange
(List<T> c, int fromIndex, int toIndex) Returnstrue
if theList
is updated whenfromIndex < toIndex
, otherwisefalse
is returned whenfromIndex == toIndex
.static <T> T[]
deleteRange
(T[] a, int fromIndex, int toIndex) Deletes the values fromfromIndex
totoIndex
.static boolean[]
difference
(boolean[] a, boolean[] b) Returns the elements froma
, but exclude the elements inb
by occurrences.static byte[]
difference
(byte[] a, byte[] b) Returns the elements froma
, but exclude the elements inb
by occurrences.static char[]
difference
(char[] a, char[] b) Returns the elements froma
, but exclude the elements inb
by occurrences.static double[]
difference
(double[] a, double[] b) Returns the elements froma
, but exclude the elements inb
by occurrences.static float[]
difference
(float[] a, float[] b) Returns the elements froma
, but exclude the elements inb
by occurrences.static int[]
difference
(int[] a, int[] b) Returns the elements froma
, but exclude the elements inb
by occurrences.static long[]
difference
(long[] a, long[] b) Returns the elements froma
, but exclude the elements inb
by occurrences.static short[]
difference
(short[] a, short[] b) Returns the elements froma
, but exclude the elements inb
by occurrences.static <T> List<T>
difference
(Collection<? extends T> a, Collection<?> b) Returns the elements froma
, but exclude the elements inb
by occurrences.static <T> List<T>
difference
(T[] a, Object[] b) Returns the elements froma
, but exclude the elements inb
by occurrences.static <T> Set<T>
differentSet
(Collection<? extends T> a, Collection<?> b) static boolean
static boolean
disjoint
(Collection<?> c1, Collection<?> c2) Returnstrue
if the two specified arrays have no elements in common.static boolean[]
distinct
(boolean[] a) Mostly it's designed for one-step operation to complete the operation in one step.static boolean[]
distinct
(boolean[] a, int fromIndex, int toIndex) Mostly it's designed for one-step operation to complete the operation in one step.static byte[]
distinct
(byte[] a) Mostly it's designed for one-step operation to complete the operation in one step.static byte[]
distinct
(byte[] a, int fromIndex, int toIndex) Mostly it's designed for one-step operation to complete the operation in one step.static char[]
distinct
(char[] a) Mostly it's designed for one-step operation to complete the operation in one step.static char[]
distinct
(char[] a, int fromIndex, int toIndex) Mostly it's designed for one-step operation to complete the operation in one step.static double[]
distinct
(double[] a) Mostly it's designed for one-step operation to complete the operation in one step.static double[]
distinct
(double[] a, int fromIndex, int toIndex) Mostly it's designed for one-step operation to complete the operation in one step.static float[]
distinct
(float[] a) Mostly it's designed for one-step operation to complete the operation in one step.static float[]
distinct
(float[] a, int fromIndex, int toIndex) Mostly it's designed for one-step operation to complete the operation in one step.static int[]
distinct
(int[] a) Mostly it's designed for one-step operation to complete the operation in one step.static int[]
distinct
(int[] a, int fromIndex, int toIndex) Mostly it's designed for one-step operation to complete the operation in one step.static long[]
distinct
(long[] a) Mostly it's designed for one-step operation to complete the operation in one step.static long[]
distinct
(long[] a, int fromIndex, int toIndex) Mostly it's designed for one-step operation to complete the operation in one step.static short[]
distinct
(short[] a) Mostly it's designed for one-step operation to complete the operation in one step.static short[]
distinct
(short[] a, int fromIndex, int toIndex) Mostly it's designed for one-step operation to complete the operation in one step.static <T> List<T>
Mostly it's designed for one-step operation to complete the operation in one step.static <T> List<T>
distinct
(Collection<? extends T> c, int fromIndex, int toIndex) Mostly it's designed for one-step operation to complete the operation in one step.static <T> List<T>
distinct
(T[] a) Mostly it's designed for one-step operation to complete the operation in one step.static <T> List<T>
distinct
(T[] a, int fromIndex, int toIndex) Mostly it's designed for one-step operation to complete the operation in one step.distinctBy
(Iterable<? extends T> c, Throwables.Function<? super T, ?, E> keyMapper) Distinct by the value mapped fromkeyMapper
.static <T,
C extends Collection<T>, E extends Exception>
CdistinctBy
(Iterable<? extends T> c, Throwables.Function<? super T, ?, E> keyMapper, Supplier<C> supplier) Distinct by the value mapped fromkeyMapper
.distinctBy
(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.Function<? super T, ?, E> keyMapper) Distinct by the value mapped fromkeyMapper
.distinctBy
(T[] a, int fromIndex, int toIndex, Throwables.Function<? super T, ?, E> keyMapper) Distinct by the value mapped fromkeyMapper
.distinctBy
(T[] a, Throwables.Function<? super T, ?, E> keyMapper) Distinct by the value mapped fromkeyMapper
.static <T,
C extends Collection<T>, E extends Exception>
CdistinctBy
(T[] a, Throwables.Function<? super T, ?, E> keyMapper, Supplier<C> supplier) Distinct by the value mapped fromkeyMapper
.dropWhile
(Iterable<? extends T> c, Throwables.Predicate<? super T, E> filter) dropWhile
(T[] a, Throwables.Predicate<? super T, E> filter) static InputStream
Returns an empty immutableInputStream
.static <T> Iterator<T>
Returns an empty immutableIterator
.static <T> List<T>
Returns an empty immutableList
.static <T> ListIterator<T>
Returns an empty immutableListIterator
.static <K,
V> Map<K, V> emptyMap()
Returns an empty immutableMap
.static <K,
V> NavigableMap<K, V> Returns an empty immutableNavigableMap
.static <T> NavigableSet<T>
Returns an empty immutableNavigableSet
.static <T> Set<T>
emptySet()
Returns an empty immutableSet
.static <K,
V> SortedMap<K, V> Returns an empty immutableSortedMap
.static <T> SortedSet<T>
Returns an empty immutableSortedSet
.static <E extends Enum<E>>
ImmutableList<E>enumListOf
(Class<E> enumClass) Enum list of.static <E extends Enum<E>>
ImmutableBiMap<E,String> Enum map of.static <E extends Enum<E>>
ImmutableSet<E>Enum set of.static boolean
equals
(boolean[] a, boolean[] b) static boolean
equals
(boolean[] a, int fromIndexA, boolean[] b, int fromIndexB, int len) static boolean
equals
(boolean a, boolean b) static boolean
equals
(byte[] a, byte[] b) static boolean
equals
(byte[] a, int fromIndexA, byte[] b, int fromIndexB, int len) static boolean
equals
(byte a, byte b) static boolean
equals
(char[] a, char[] b) static boolean
equals
(char[] a, int fromIndexA, char[] b, int fromIndexB, int len) static boolean
equals
(char a, char b) static boolean
equals
(double[] a, double[] b) static boolean
equals
(double[] a, int fromIndexA, double[] b, int fromIndexB, int len) static boolean
equals
(double a, double b) static boolean
equals
(float[] a, float[] b) static boolean
equals
(float[] a, int fromIndexA, float[] b, int fromIndexB, int len) static boolean
equals
(float a, float b) static boolean
equals
(int[] a, int[] b) static boolean
equals
(int[] a, int fromIndexA, int[] b, int fromIndexB, int len) static boolean
equals
(int a, int b) static boolean
equals
(long[] a, int fromIndexA, long[] b, int fromIndexB, int len) static boolean
equals
(long[] a, long[] b) static boolean
equals
(long a, long b) static boolean
equals
(short[] a, int fromIndexA, short[] b, int fromIndexB, int len) static boolean
equals
(short[] a, short[] b) static boolean
equals
(short a, short b) static boolean
static boolean
static boolean
static boolean
static boolean
equalsByCommonProps
(Object bean1, Object bean2) static boolean
equalsByCommonProps
(Object bean1, Object bean2, Collection<String> propNamesToCompare) static boolean
equalsIgnoreCase
(String[] a, int fromIndexA, String[] b, int fromIndexB, int len) Equals ignore case.static boolean
equalsIgnoreCase
(String[] a, String[] b) Equals ignore case.static boolean
equalsIgnoreCase
(String a, String b) Equals ignore case.static void
static void
erase
(Object bean, Collection<String> propNames) static void
static <T> List<T>
exclude
(Collection<? extends T> c, Object objToExclude) Returns a newList
with specifiedobjToExclude
excluded.static <T> List<T>
excludeAll
(Collection<? extends T> c, Collection<?> objsToExclude) Returns a newList
with specifiedobjsToExclude
excluded.static <T> Set<T>
excludeAllToSet
(Collection<? extends T> c, Collection<?> objsToExclude) Returns a newSet
with specifiedobjsToExclude
excluded.static <T> Set<T>
excludeToSet
(Collection<? extends T> c, Object objToExclude) Returns a newSet
with specifiedobjToExclude
excluded.static void
execute
(Throwables.Runnable<? extends Exception> cmd, int retryTimes, long retryIntervallInMillis, Predicate<? super Exception> retryCondition) static <R> R
execute
(Callable<R> cmd, int retryTimes, long retryIntervallInMillis, BiPredicate<? super R, ? super Exception> retryCondition) static void
fill
(boolean[] a, boolean val) static void
fill
(boolean[] a, int fromIndex, int toIndex, boolean val) static void
fill
(byte[] a, byte val) static void
fill
(byte[] a, int fromIndex, int toIndex, byte val) static void
fill
(char[] a, char val) static void
fill
(char[] a, int fromIndex, int toIndex, char val) static void
fill
(double[] a, double val) static void
fill
(double[] a, int fromIndex, int toIndex, double val) static void
fill
(float[] a, float val) static void
fill
(float[] a, int fromIndex, int toIndex, float val) static void
fill
(int[] a, int val) static void
fill
(int[] a, int fromIndex, int toIndex, int val) static void
fill
(long[] a, int fromIndex, int toIndex, long val) static void
fill
(long[] a, long val) static void
fill
(short[] a, int fromIndex, int toIndex, short val) static void
fill
(short[] a, short val) static <T> T
Fill the properties of the bean with random values.static <T> List<T>
Fill the properties of the bean with random values.static void
Fill the properties of the bean with random values.static void
static void
static <T> void
The specified value will be added/inserted into the specified List.static <T> void
static <E extends Exception>
boolean[]filter
(boolean[] a, int fromIndex, int toIndex, Throwables.BooleanPredicate<E> filter) static <E extends Exception>
boolean[]filter
(boolean[] a, int fromIndex, int toIndex, Throwables.BooleanPredicate<E> filter, int max) Mostly it's designed for one-step operation to complete the operation in one step.static <E extends Exception>
boolean[]filter
(boolean[] a, int max, Throwables.BooleanPredicate<E> filter) static <E extends Exception>
boolean[]filter
(boolean[] a, Throwables.BooleanPredicate<E> filter) static <E extends Exception>
byte[]filter
(byte[] a, int fromIndex, int toIndex, Throwables.BytePredicate<E> filter) static <E extends Exception>
byte[]filter
(byte[] a, int fromIndex, int toIndex, Throwables.BytePredicate<E> filter, int max) Mostly it's designed for one-step operation to complete the operation in one step.static <E extends Exception>
byte[]filter
(byte[] a, Throwables.BytePredicate<E> filter) static <E extends Exception>
byte[]filter
(byte[] a, Throwables.BytePredicate<E> filter, int max) static <E extends Exception>
char[]filter
(char[] a, int fromIndex, int toIndex, Throwables.CharPredicate<E> filter) static <E extends Exception>
char[]filter
(char[] a, int fromIndex, int toIndex, Throwables.CharPredicate<E> filter, int max) Mostly it's designed for one-step operation to complete the operation in one step.static <E extends Exception>
char[]filter
(char[] a, Throwables.CharPredicate<E> filter) static <E extends Exception>
char[]filter
(char[] a, Throwables.CharPredicate<E> filter, int max) static <E extends Exception>
double[]filter
(double[] a, int fromIndex, int toIndex, Throwables.DoublePredicate<E> filter) static <E extends Exception>
double[]filter
(double[] a, int fromIndex, int toIndex, Throwables.DoublePredicate<E> filter, int max) Mostly it's designed for one-step operation to complete the operation in one step.static <E extends Exception>
double[]filter
(double[] a, Throwables.DoublePredicate<E> filter) static <E extends Exception>
double[]filter
(double[] a, Throwables.DoublePredicate<E> filter, int max) static <E extends Exception>
float[]filter
(float[] a, int fromIndex, int toIndex, Throwables.FloatPredicate<E> filter) static <E extends Exception>
float[]filter
(float[] a, int fromIndex, int toIndex, Throwables.FloatPredicate<E> filter, int max) Mostly it's designed for one-step operation to complete the operation in one step.static <E extends Exception>
float[]filter
(float[] a, Throwables.FloatPredicate<E> filter) static <E extends Exception>
float[]filter
(float[] a, Throwables.FloatPredicate<E> filter, int max) static <E extends Exception>
int[]filter
(int[] a, int fromIndex, int toIndex, Throwables.IntPredicate<E> filter) static <E extends Exception>
int[]filter
(int[] a, int fromIndex, int toIndex, Throwables.IntPredicate<E> filter, int max) Mostly it's designed for one-step operation to complete the operation in one step.static <E extends Exception>
int[]filter
(int[] a, Throwables.IntPredicate<E> filter) static <E extends Exception>
int[]filter
(int[] a, Throwables.IntPredicate<E> filter, int max) static <E extends Exception>
long[]filter
(long[] a, int fromIndex, int toIndex, Throwables.LongPredicate<E> filter) static <E extends Exception>
long[]filter
(long[] a, int fromIndex, int toIndex, Throwables.LongPredicate<E> filter, int max) Mostly it's designed for one-step operation to complete the operation in one step.static <E extends Exception>
long[]filter
(long[] a, Throwables.LongPredicate<E> filter) static <E extends Exception>
long[]filter
(long[] a, Throwables.LongPredicate<E> filter, int max) static <E extends Exception>
short[]filter
(short[] a, int fromIndex, int toIndex, Throwables.ShortPredicate<E> filter) static <E extends Exception>
short[]filter
(short[] a, int fromIndex, int toIndex, Throwables.ShortPredicate<E> filter, int max) Mostly it's designed for one-step operation to complete the operation in one step.static <E extends Exception>
short[]filter
(short[] a, Throwables.ShortPredicate<E> filter) static <E extends Exception>
short[]filter
(short[] a, Throwables.ShortPredicate<E> filter, int max) filter
(Iterable<? extends T> c, Throwables.Predicate<? super T, E> filter) filter
(Iterable<? extends T> c, Throwables.Predicate<? super T, E> filter, int max) static <T,
R extends Collection<T>, E extends Exception>
Rfilter
(Iterable<? extends T> c, Throwables.Predicate<? super T, E> filter, int max, IntFunction<R> supplier) static <T,
R extends Collection<T>, E extends Exception>
Rfilter
(Iterable<? extends T> c, Throwables.Predicate<? super T, E> filter, IntFunction<R> supplier) filter
(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.Predicate<? super T, E> filter) filter
(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.Predicate<? super T, E> filter, int max) static <T,
R extends Collection<T>, E extends Exception>
Rfilter
(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.Predicate<? super T, E> filter, int max, IntFunction<R> supplier) static <T,
R extends Collection<T>, E extends Exception>
Rfilter
(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.Predicate<? super T, E> filter, IntFunction<R> supplier) filter
(T[] a, int fromIndex, int toIndex, Throwables.Predicate<? super T, E> filter) filter
(T[] a, int fromIndex, int toIndex, Throwables.Predicate<? super T, E> filter, int max) Mostly it's designed for one-step operation to complete the operation in one step.static <T,
R extends Collection<T>, E extends Exception>
Rfilter
(T[] a, int fromIndex, int toIndex, Throwables.Predicate<? super T, E> filter, int max, IntFunction<R> supplier) Mostly it's designed for one-step operation to complete the operation in one step.static <T,
R extends Collection<T>, E extends Exception>
Rfilter
(T[] a, int fromIndex, int toIndex, Throwables.Predicate<? super T, E> filter, IntFunction<R> supplier) filter
(T[] a, Throwables.Predicate<? super T, E> filter) filter
(T[] a, Throwables.Predicate<? super T, E> filter, int max) static <T,
R extends Collection<T>, E extends Exception>
Rfilter
(T[] a, Throwables.Predicate<? super T, E> filter, int max, IntFunction<R> supplier) static <T,
R extends Collection<T>, E extends Exception>
Rfilter
(T[] a, Throwables.Predicate<? super T, E> filter, IntFunction<R> supplier) static <T,
E extends Exception>
u.Nullable<T>findFirst
(Iterable<? extends T> c, Throwables.Predicate<? super T, E> predicate) static <T,
E extends Exception>
u.Nullable<T>findFirst
(Iterator<? extends T> iter, Throwables.Predicate<? super T, E> predicate) static <T,
E extends Exception>
u.Nullable<T>findFirst
(T[] a, Throwables.Predicate<? super T, E> predicate) static <T,
E extends Exception>
u.OptionalIntfindFirstIndex
(Collection<? extends T> c, Throwables.Predicate<? super T, E> predicate) Find first index.static <T,
U, E extends Exception>
u.OptionalIntfindFirstIndex
(Collection<? extends T> c, U valueToFind, Throwables.BiPredicate<? super T, ? super U, E> predicate) Find first index.static <T,
E extends Exception>
u.OptionalIntfindFirstIndex
(T[] a, Throwables.Predicate<? super T, E> predicate) Find first index.static <T,
U, E extends Exception>
u.OptionalIntfindFirstIndex
(T[] a, U valueToFind, Throwables.BiPredicate<? super T, ? super U, E> predicate) Find first index.static <T,
E extends Exception>
u.Optional<T>findFirstNonNull
(Iterable<? extends T> c, Throwables.Predicate<? super T, E> predicate) Find first non null.static <T,
E extends Exception>
u.Optional<T>findFirstNonNull
(Iterator<? extends T> iter, Throwables.Predicate<? super T, E> predicate) static <T,
E extends Exception>
u.Optional<T>findFirstNonNull
(T[] a, Throwables.Predicate<? super T, E> predicate) Find first non null.static <T,
E extends Exception>
u.Nullable<T>findLast
(Iterable<? extends T> c, Throwables.Predicate<? super T, E> predicate) static <T,
E extends Exception>
u.Nullable<T>findLast
(T[] a, Throwables.Predicate<? super T, E> predicate) static <T,
E extends Exception>
u.OptionalIntfindLastIndex
(Collection<? extends T> c, Throwables.Predicate<? super T, E> predicate) Find last index.static <T,
U, E extends Exception>
u.OptionalIntfindLastIndex
(Collection<? extends T> c, U valueToFind, Throwables.BiPredicate<? super T, ? super U, E> predicate) static <T,
E extends Exception>
u.OptionalIntfindLastIndex
(T[] a, Throwables.Predicate<? super T, E> predicate) Find last index.static <T,
U, E extends Exception>
u.OptionalIntfindLastIndex
(T[] a, U valueToFind, Throwables.BiPredicate<? super T, ? super U, E> predicate) Find last index.static <T,
E extends Exception>
u.Optional<T>findLastNonNull
(Iterable<? extends T> c, Throwables.Predicate<? super T, E> predicate) Find last non null.static <T,
E extends Exception>
u.Optional<T>findLastNonNull
(T[] a, Throwables.Predicate<? super T, E> predicate) Find last non null.static <T> u.Nullable<T>
firstElement
(Iterable<? extends T> c) static <T> u.Nullable<T>
firstElement
(Iterator<? extends T> iter) static <T> List<T>
firstElements
(Collection<? extends T> c, int n) Return at most firstn
elements.static <K,
V> u.Optional<Map.Entry<K, V>> firstEntry
(Map<K, V> map) static <T extends CharSequence>
u.Optional<T>firstNonBlank
(T... a) static <T extends CharSequence>
u.Optional<T>firstNonBlank
(T a, T b) static <T extends CharSequence>
u.Optional<T>firstNonBlank
(T a, T b, T c) static <T extends CharSequence>
u.Optional<T>firstNonEmpty
(T... a) static <T> u.Optional<T[]>
firstNonEmpty
(T[] a, T[] b) static <T> u.Optional<T[]>
firstNonEmpty
(T[] a, T[] b, T[] c) static <T extends Collection<?>>
u.Optional<T>firstNonEmpty
(T a, T b) static <T extends Collection<?>>
u.Optional<T>firstNonEmpty
(T a, T b, T c) static <T> u.Optional<T>
firstNonNull
(Iterable<? extends T> c) First non null.static <T> u.Optional<T>
firstNonNull
(Iterator<? extends T> iter) First non null.static <T> u.Optional<T>
firstNonNull
(T... a) First non null.static <T> u.Optional<T>
firstNonNull
(T a, T b) First non null.static <T> u.Optional<T>
firstNonNull
(T a, T b, T c) First non null.static <T> T
firstOrDefaultIfEmpty
(Iterable<? extends T> c, T defaultValueForEmpty) First or default if empty.static <T> T
firstOrDefaultIfEmpty
(Iterator<? extends T> iter, T defaultValueForEmpty) First or default if empty.static <T> T
firstOrDefaultIfEmpty
(T[] a, T defaultValueForEmpty) First or default if empty.static <T> T
firstOrNullIfEmpty
(Iterable<? extends T> c) First or null if empty.static <T> T
firstOrNullIfEmpty
(Iterator<? extends T> iter) First or null if empty.static <T> T
firstOrNullIfEmpty
(T[] a) First or null if empty.flatmap
(Iterable<? extends T> c, Throwables.Function<? super T, ? extends R[], E> mapper) static <T,
R, C extends Collection<R>, E extends Exception>
Cflatmap
(Iterable<? extends T> c, Throwables.Function<? super T, ? extends R[], E> mapper, IntFunction<? extends C> supplier) flatmap
(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.Function<? super T, ? extends R[], E> mapper) Mostly it's designed for one-step operation to complete the operation in one step.static <T,
R, C extends Collection<R>, E extends Exception>
Cflatmap
(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.Function<? super T, ? extends R[], E> mapper, IntFunction<? extends C> supplier) Mostly it's designed for one-step operation to complete the operation in one step.flatmap
(T[] a, int fromIndex, int toIndex, Throwables.Function<? super T, ? extends R[], E> mapper) Mostly it's designed for one-step operation to complete the operation in one step.static <T,
R, C extends Collection<R>, E extends Exception>
Cflatmap
(T[] a, int fromIndex, int toIndex, Throwables.Function<? super T, ? extends R[], E> mapper, IntFunction<? extends C> supplier) Mostly it's designed for one-step operation to complete the operation in one step.flatmap
(T[] a, Throwables.Function<? super T, ? extends R[], E> mapper) static <T,
R, C extends Collection<R>, E extends Exception>
Cflatmap
(T[] a, Throwables.Function<? super T, ? extends R[], E> mapper, IntFunction<? extends C> supplier) flatMap
(Iterable<? extends T> c, Throwables.Function<? super T, ? extends Collection<? extends R>, E> mapper) static <T,
R, C extends Collection<R>, E extends Exception>
CflatMap
(Iterable<? extends T> c, Throwables.Function<? super T, ? extends Collection<? extends R>, E> mapper, IntFunction<? extends C> supplier) flatMap
(Iterable<? extends T> c, Throwables.Function<? super T, ? extends Collection<? extends U>, E> mapper, Throwables.Function<? super U, ? extends Collection<? extends R>, E2> mapper2) static <T,
U, R, C extends Collection<R>, E extends Exception, E2 extends Exception>
CflatMap
(Iterable<? extends T> c, Throwables.Function<? super T, ? extends Collection<? extends U>, E> mapper, Throwables.Function<? super U, ? extends Collection<? extends R>, E2> mapper2, IntFunction<? extends C> supplier) Mostly it's designed for one-step operation to complete the operation in one step.flatMap
(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.Function<? super T, ? extends Collection<? extends R>, E> mapper) Mostly it's designed for one-step operation to complete the operation in one step.static <T,
R, C extends Collection<R>, E extends Exception>
CflatMap
(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.Function<? super T, ? extends Collection<? extends R>, E> mapper, IntFunction<? extends C> supplier) Mostly it's designed for one-step operation to complete the operation in one step.flatMap
(T[] a, int fromIndex, int toIndex, Throwables.Function<? super T, ? extends Collection<? extends R>, E> mapper) Mostly it's designed for one-step operation to complete the operation in one step.static <T,
R, C extends Collection<R>, E extends Exception>
CflatMap
(T[] a, int fromIndex, int toIndex, Throwables.Function<? super T, ? extends Collection<? extends R>, E> mapper, IntFunction<? extends C> supplier) Mostly it's designed for one-step operation to complete the operation in one step.flatMap
(T[] a, Throwables.Function<? super T, ? extends Collection<? extends R>, E> mapper) static <T,
R, C extends Collection<R>, E extends Exception>
CflatMap
(T[] a, Throwables.Function<? super T, ? extends Collection<? extends R>, E> mapper, IntFunction<? extends C> supplier) flatMap
(T[] a, Throwables.Function<? super T, ? extends Collection<? extends U>, E> mapper, Throwables.Function<? super U, ? extends Collection<? extends R>, E2> mapper2) static <T,
U, R, C extends Collection<R>, E extends Exception, E2 extends Exception>
CflatMap
(T[] a, Throwables.Function<? super T, ? extends Collection<? extends U>, E> mapper, Throwables.Function<? super U, ? extends Collection<? extends R>, E2> mapper2, IntFunction<? extends C> supplier) Mostly it's designed for one-step operation to complete the operation in one step.static boolean[]
flatten
(boolean[][] a) static byte[]
flatten
(byte[][] a) static char[]
flatten
(char[][] a) static double[]
flatten
(double[][] a) static float[]
flatten
(float[][] a) static int[]
flatten
(int[][] a) static long[]
flatten
(long[][] a) static short[]
flatten
(short[][] a) static <T> List<T>
static <T,
C extends Collection<T>>
Cstatic <T> List<T>
flatten
(Collection<? extends Iterable<? extends T>> c) static <T,
C extends Collection<T>>
Cflatten
(Collection<? extends Iterable<? extends T>> c, IntFunction<? extends C> supplier) static <T> Iterator<T>
static <T> T[]
flatten
(T[][] a) static <T> T[]
static List<?>
flattenEachElement
(Iterable<?> iter) Flatten each element if it's aIterable
, otherwise just add it to result Collection.static <T,
C extends Collection<T>>
CflattenEachElement
(Iterable<?> iter, IntFunction<? extends C> supplier) Flatten each element if it's aIterable
, otherwise just add it to result Collection.static <E extends Exception>
voidforEach
(int startInclusive, int endExclusive, int step, Throwables.IntConsumer<E> action) static <E extends Exception>
voidforEach
(int startInclusive, int endExclusive, int step, Throwables.Runnable<E> action) static <T,
E extends Exception>
voidforEach
(int startInclusive, int endExclusive, int step, T a, Throwables.ObjIntConsumer<? super T, E> action) Deprecated.use traditional for-loopstatic <E extends Exception>
voidforEach
(int startInclusive, int endExclusive, Throwables.IntConsumer<E> action) static <E extends Exception>
voidforEach
(int startInclusive, int endExclusive, Throwables.Runnable<E> action) static <T,
E extends Exception>
voidforEach
(int startInclusive, int endExclusive, T a, Throwables.ObjIntConsumer<? super T, E> action) Deprecated.use traditional for-loopstatic <A,
B, E extends Exception>
voidforEach
(A[] a, B[] b, A valueForNoneA, B valueForNoneB, Throwables.BiConsumer<? super A, ? super B, E> action) static <A,
B, C, E extends Exception>
voidforEach
(A[] a, B[] b, C[] c, A valueForNoneA, B valueForNoneB, C valueForNoneC, Throwables.TriConsumer<? super A, ? super B, ? super C, E> action) static <A,
B, C, E extends Exception>
voidforEach
(A[] a, B[] b, C[] c, Throwables.TriConsumer<? super A, ? super B, ? super C, E> action) static <A,
B, E extends Exception>
voidforEach
(A[] a, B[] b, Throwables.BiConsumer<? super A, ? super B, E> action) static <T,
E extends Exception>
voidforEach
(Iterable<? extends T> c, Throwables.Consumer<? super T, E> action) forEach
(Iterable<? extends T> c, Throwables.Function<? super T, ? extends Iterable<T2>, E> flatMapper, Throwables.Function<? super T2, ? extends Iterable<T3>, E2> flatMapper2, Throwables.TriConsumer<? super T, ? super T2, ? super T3, E3> action) forEach
(Iterable<? extends T> c, Throwables.Function<? super T, ? extends Iterable<U>, E> flatMapper, Throwables.BiConsumer<? super T, ? super U, E2> action) static <A,
B, E extends Exception>
voidforEach
(Iterable<A> a, Iterable<B> b, A valueForNoneA, B valueForNoneB, Throwables.BiConsumer<? super A, ? super B, E> action) static <A,
B, E extends Exception>
voidforEach
(Iterable<A> a, Iterable<B> b, Throwables.BiConsumer<? super A, ? super B, E> action) static <A,
B, C, E extends Exception>
voidforEach
(Iterable<A> a, Iterable<B> b, Iterable<C> c, A valueForNoneA, B valueForNoneB, C valueForNoneC, Throwables.TriConsumer<? super A, ? super B, ? super C, E> action) static <A,
B, C, E extends Exception>
voidforEach
(Iterable<A> a, Iterable<B> b, Iterable<C> c, Throwables.TriConsumer<? super A, ? super B, ? super C, E> action) static <T,
E extends Exception>
voidforEach
(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.Consumer<? super T, E> action) Mostly it's designed for one-step operation to complete the operation in one step.static <T,
E extends Exception>
voidforEach
(Iterator<? extends T> iter, Throwables.Consumer<? super T, E> action) forEach
(Iterator<? extends T> iter, Throwables.Function<? super T, ? extends Iterable<T2>, E> flatMapper, Throwables.Function<? super T2, ? extends Iterable<T3>, E2> flatMapper2, Throwables.TriConsumer<? super T, ? super T2, ? super T3, E3> action) forEach
(Iterator<? extends T> iter, Throwables.Function<? super T, ? extends Iterable<U>, E> flatMapper, Throwables.BiConsumer<? super T, ? super U, E2> action) static <A,
B, E extends Exception>
voidforEach
(Iterator<A> a, Iterator<B> b, A valueForNoneA, B valueForNoneB, Throwables.BiConsumer<? super A, ? super B, E> action) static <A,
B, E extends Exception>
voidforEach
(Iterator<A> a, Iterator<B> b, Throwables.BiConsumer<? super A, ? super B, E> action) static <A,
B, C, E extends Exception>
voidforEach
(Iterator<A> a, Iterator<B> b, Iterator<C> c, A valueForNoneA, B valueForNoneB, C valueForNoneC, Throwables.TriConsumer<? super A, ? super B, ? super C, E> action) static <A,
B, C, E extends Exception>
voidforEach
(Iterator<A> a, Iterator<B> b, Iterator<C> c, Throwables.TriConsumer<? super A, ? super B, ? super C, E> action) static <K,
V, E extends Exception>
voidforEach
(Map<K, V> map, Throwables.BiConsumer<? super K, ? super V, E> action) static <K,
V, E extends Exception>
voidforEach
(Map<K, V> map, Throwables.Consumer<? super Map.Entry<K, V>, E> action) static <T,
E extends Exception>
voidforEach
(T[] a, int fromIndex, int toIndex, Throwables.Consumer<? super T, E> action) static <T,
E extends Exception>
voidforEach
(T[] a, Throwables.Consumer<? super T, E> action) forEach
(T[] a, Throwables.Function<? super T, ? extends Iterable<T2>, E> flatMapper, Throwables.Function<? super T2, ? extends Iterable<T3>, E2> flatMapper2, Throwables.TriConsumer<? super T, ? super T2, ? super T3, E3> action) forEach
(T[] a, Throwables.Function<? super T, ? extends Iterable<U>, E> flatMapper, Throwables.BiConsumer<? super T, ? super U, E2> action) static <T,
E extends Exception>
voidforEachIndexed
(Iterable<? extends T> c, Throwables.IndexedConsumer<? super T, E> action) static <T,
E extends Exception>
voidforEachIndexed
(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.IndexedConsumer<? super T, E> action) Mostly it's designed for one-step operation to complete the operation in one step.static <T,
E extends Exception>
voidforEachIndexed
(Iterator<? extends T> iter, Throwables.IndexedConsumer<? super T, E> action) static <K,
V, E extends Exception>
voidforEachIndexed
(Map<K, V> map, Throwables.IndexedBiConsumer<? super K, ? super V, E> action) static <K,
V, E extends Exception>
voidforEachIndexed
(Map<K, V> map, Throwables.IndexedConsumer<? super Map.Entry<K, V>, E> action) static <T,
E extends Exception>
voidforEachIndexed
(T[] a, int fromIndex, int toIndex, Throwables.IndexedConsumer<? super T, E> action) static <T,
E extends Exception>
voidforEachIndexed
(T[] a, Throwables.IndexedConsumer<? super T, E> action) static <T,
E extends Exception>
voidforEachNonNull
(Iterable<? extends T> c, Throwables.Consumer<? super T, E> action) For each non null.forEachNonNull
(Iterable<? extends T> c, Throwables.Function<? super T, ? extends Iterable<T2>, E> flatMapper, Throwables.Function<? super T2, ? extends Iterable<T3>, E2> flatMapper2, Throwables.TriConsumer<? super T, ? super T2, ? super T3, E3> action) For each non null.forEachNonNull
(Iterable<? extends T> c, Throwables.Function<? super T, ? extends Iterable<U>, E> flatMapper, Throwables.BiConsumer<? super T, ? super U, E2> action) For each non null.forEachNonNull
(Iterator<? extends T> iter, Throwables.Function<? super T, ? extends Iterable<T2>, E> flatMapper, Throwables.Function<? super T2, ? extends Iterable<T3>, E2> flatMapper2, Throwables.TriConsumer<? super T, ? super T2, ? super T3, E3> action) For each non null.forEachNonNull
(Iterator<? extends T> iter, Throwables.Function<? super T, ? extends Iterable<U>, E> flatMapper, Throwables.BiConsumer<? super T, ? super U, E2> action) For each non null.static <T,
E extends Exception>
voidforEachNonNull
(T[] a, Throwables.Consumer<? super T, E> action) For each non null.forEachNonNull
(T[] a, Throwables.Function<? super T, ? extends Iterable<T2>, E> flatMapper, Throwables.Function<? super T2, ? extends Iterable<T3>, E2> flatMapper2, Throwables.TriConsumer<? super T, ? super T2, ? super T3, E3> action) For each non null.forEachNonNull
(T[] a, Throwables.Function<? super T, ? extends Iterable<U>, E> flatMapper, Throwables.BiConsumer<? super T, ? super U, E2> action) For each non null.static <T,
E extends Exception>
voidforEachPair
(Iterable<? extends T> c, int increment, Throwables.BiConsumer<? super T, ? super T, E> action) For each pair.static <T,
E extends Exception>
voidforEachPair
(Iterable<? extends T> c, Throwables.BiConsumer<? super T, ? super T, E> action) For each pair.static <T,
E extends Exception>
voidforEachPair
(Iterator<? extends T> iter, int increment, Throwables.BiConsumer<? super T, ? super T, E> action) For each pair.static <T,
E extends Exception>
voidforEachPair
(Iterator<? extends T> iter, Throwables.BiConsumer<? super T, ? super T, E> action) For each pair.static <T,
E extends Exception>
voidforEachPair
(T[] a, int increment, Throwables.BiConsumer<? super T, ? super T, E> action) For each pair.static <T,
E extends Exception>
voidforEachPair
(T[] a, Throwables.BiConsumer<? super T, ? super T, E> action) For each pair.static <T,
E extends Exception>
voidforEachTriple
(Iterable<? extends T> c, int increment, Throwables.TriConsumer<? super T, ? super T, ? super T, E> action) For each triple.static <T,
E extends Exception>
voidforEachTriple
(Iterable<? extends T> c, Throwables.TriConsumer<? super T, ? super T, ? super T, E> action) For each triple.static <T,
E extends Exception>
voidforEachTriple
(Iterator<? extends T> iter, int increment, Throwables.TriConsumer<? super T, ? super T, ? super T, E> action) For each triple.static <T,
E extends Exception>
voidforEachTriple
(Iterator<? extends T> iter, Throwables.TriConsumer<? super T, ? super T, ? super T, E> action) For each triple.static <T,
E extends Exception>
voidforEachTriple
(T[] a, int increment, Throwables.TriConsumer<? super T, ? super T, ? super T, E> action) For each triple.static <T,
E extends Exception>
voidforEachTriple
(T[] a, Throwables.TriConsumer<? super T, ? super T, ? super T, E> action) For each triple.static String
formatJSON
(com.landawn.abacus.type.Type<?> type, String json) static String
formatJSON
(com.landawn.abacus.type.Type<?> type, String json, JSONSerializationConfig config) static String
formatJSON
(Class<?> type, String json) static String
formatJSON
(Class<?> type, String json, JSONSerializationConfig config) static String
formatJSON
(String json) static String
formatJSON
(String json, JSONSerializationConfig config) static String
static String
formatXML
(com.landawn.abacus.type.Type<?> type, String xml, XMLSerializationConfig config) static String
static String
formatXML
(Class<?> type, String xml, XMLSerializationConfig config) static String
static String
formatXML
(String xml, XMLSerializationConfig config) static <T> T[]
static <T> T
static <T> T
fromJSON
(com.landawn.abacus.type.Type<? extends T> targetType, File json, JSONDeserializationConfig config) static <T> T
fromJSON
(com.landawn.abacus.type.Type<? extends T> targetType, InputStream json) static <T> T
fromJSON
(com.landawn.abacus.type.Type<? extends T> targetType, InputStream json, JSONDeserializationConfig config) static <T> T
static <T> T
fromJSON
(com.landawn.abacus.type.Type<? extends T> targetType, Reader json, JSONDeserializationConfig config) static <T> T
static <T> T
fromJSON
(com.landawn.abacus.type.Type<? extends T> targetType, String json, int fromIndex, int toIndex) static <T> T
fromJSON
(com.landawn.abacus.type.Type<? extends T> targetType, String json, int fromIndex, int toIndex, JSONDeserializationConfig config) static <T> T
fromJSON
(com.landawn.abacus.type.Type<? extends T> targetType, String json, JSONDeserializationConfig config) static <T> T
static <T> T
fromJSON
(Class<? extends T> targetClass, File json, JSONDeserializationConfig config) static <T> T
fromJSON
(Class<? extends T> targetClass, InputStream json) static <T> T
fromJSON
(Class<? extends T> targetClass, InputStream json, JSONDeserializationConfig config) static <T> T
static <T> T
fromJSON
(Class<? extends T> targetClass, Reader json, JSONDeserializationConfig config) static <T> T
static <T> T
static <T> T
fromJSON
(Class<? extends T> targetClass, String json, int fromIndex, int toIndex, JSONDeserializationConfig config) static <T> T
fromJSON
(Class<? extends T> targetClass, String json, JSONDeserializationConfig config) static <T> T
static <T> T
fromXML
(com.landawn.abacus.type.Type<? extends T> targetType, File xml, XMLDeserializationConfig config) static <T> T
fromXML
(com.landawn.abacus.type.Type<? extends T> targetType, InputStream xml) static <T> T
fromXML
(com.landawn.abacus.type.Type<? extends T> targetType, InputStream xml, XMLDeserializationConfig config) static <T> T
static <T> T
fromXML
(com.landawn.abacus.type.Type<? extends T> targetType, Reader xml, XMLDeserializationConfig config) static <T> T
static <T> T
fromXML
(com.landawn.abacus.type.Type<? extends T> targetType, String xml, XMLDeserializationConfig config) static <T> T
static <T> T
fromXML
(Class<? extends T> targetClass, File xml, XMLDeserializationConfig config) static <T> T
fromXML
(Class<? extends T> targetClass, InputStream xml) static <T> T
fromXML
(Class<? extends T> targetClass, InputStream xml, XMLDeserializationConfig config) static <T> T
static <T> T
fromXML
(Class<? extends T> targetClass, Reader xml, XMLDeserializationConfig config) static <T> T
static <T> T
fromXML
(Class<? extends T> targetClass, String xml, XMLDeserializationConfig config) static <T extends Comparable<? super T>>
booleangeAndLe
(T value, T min, T max) Returnstrue
ismin <= value <= max
, otherwisefalse
is returned.static <T extends Comparable<? super T>>
booleangeAndLt
(T value, T min, T max) Returnstrue
ismin <= value < max
, otherwisefalse
is returned.static <T> T
getElement
(Iterable<? extends T> c, int index) static <T> T
getElement
(Iterator<? extends T> iter, long index) static <T> u.Nullable<T>
getOnlyElement
(Iterable<? extends T> c) Gets the only element.static <T> u.Nullable<T>
getOnlyElement
(Iterator<? extends T> iter) Gets the only element.static <T extends Comparable<? super T>>
booleangreaterEqual
(T a, T b) Returnstrue
isa >= b
, otherwisefalse
is returned.static <T extends Comparable<? super T>>
booleangreaterThan
(T a, T b) Returnstrue
isa > b
, otherwisefalse
is returned.groupBy
(Iterable<? extends T> iter, Throwables.Function<? super T, ? extends K, E> keyExtractor) groupBy
(Iterable<? extends T> iter, Throwables.Function<? super T, ? extends K, E> keyExtractor, Supplier<M> mapSupplier) groupBy
(Iterator<? extends T> iter, Throwables.Function<? super T, ? extends K, E> keyExtractor) groupBy
(Iterator<? extends T> iter, Throwables.Function<? super T, ? extends K, E> keyExtractor, Supplier<M> mapSupplier) groupBy
(T[] a, int fromIndex, int toIndex, Throwables.Function<? super T, ? extends K, E> keyExtractor) groupBy
(T[] a, int fromIndex, int toIndex, Throwables.Function<? super T, ? extends K, E> keyExtractor, Supplier<M> mapSupplier) groupBy
(T[] a, Throwables.Function<? super T, ? extends K, E> keyExtractor) groupBy
(T[] a, Throwables.Function<? super T, ? extends K, E> keyExtractor, Supplier<M> mapSupplier) static <T extends Comparable<? super T>>
booleangtAndLe
(T value, T min, T max) Returnstrue
ismin < value <= max
, otherwisefalse
is returned.static <T extends Comparable<? super T>>
booleangtAndLt
(T value, T min, T max) Returnstrue
ismin < value < max
, otherwisefalse
is returned.static boolean
hasDuplicates
(byte[] a) Checks for duplicates.static boolean
hasDuplicates
(byte[] a, boolean isSorted) Checks for duplicates.static boolean
hasDuplicates
(char[] a) Checks for duplicates.static boolean
hasDuplicates
(char[] a, boolean isSorted) Checks for duplicates.static boolean
hasDuplicates
(double[] a) Checks for duplicates.static boolean
hasDuplicates
(double[] a, boolean isSorted) Checks for duplicates.static boolean
hasDuplicates
(float[] a) Checks for duplicates.static boolean
hasDuplicates
(float[] a, boolean isSorted) Checks for duplicates.static boolean
hasDuplicates
(int[] a) Checks for duplicates.static boolean
hasDuplicates
(int[] a, boolean isSorted) Checks for duplicates.static boolean
hasDuplicates
(long[] a) Checks for duplicates.static boolean
hasDuplicates
(long[] a, boolean isSorted) Checks for duplicates.static boolean
hasDuplicates
(short[] a) Checks for duplicates.static boolean
hasDuplicates
(short[] a, boolean isSorted) Checks for duplicates.static boolean
hasDuplicates
(Collection<?> c) Checks for duplicates.static boolean
hasDuplicates
(Collection<?> c, boolean isSorted) Checks for duplicates.static <T> boolean
hasDuplicates
(T[] a) Checks for duplicates.static <T> boolean
hasDuplicates
(T[] a, boolean isSorted) Checks for duplicates.static int
hashCode
(boolean value) static int
hashCode
(boolean[] a) static int
hashCode
(boolean[] a, int fromIndex, int toIndex) static int
hashCode
(byte value) static int
hashCode
(byte[] a) static int
hashCode
(byte[] a, int fromIndex, int toIndex) static int
hashCode
(char value) static int
hashCode
(char[] a) static int
hashCode
(char[] a, int fromIndex, int toIndex) static int
hashCode
(double value) static int
hashCode
(double[] a) static int
hashCode
(double[] a, int fromIndex, int toIndex) static int
hashCode
(float value) static int
hashCode
(float[] a) static int
hashCode
(float[] a, int fromIndex, int toIndex) static int
hashCode
(int value) static int
hashCode
(int[] a) static int
hashCode
(int[] a, int fromIndex, int toIndex) static int
hashCode
(long value) static int
hashCode
(long[] a) static int
hashCode
(long[] a, int fromIndex, int toIndex) static int
hashCode
(short value) static int
hashCode
(short[] a) static int
hashCode
(short[] a, int fromIndex, int toIndex) static int
static int
static int
ifOrElse
(boolean b, Throwables.Runnable<E1> actionForTrue, Throwables.Runnable<E2> actionForFalse) If or else.ifOrElse
(boolean b, T init, Throwables.Consumer<? super T, E1> actionForTrue, Throwables.Consumer<? super T, E2> actionForFalse) If or else.static <R,
E extends Exception>
u.Nullable<R>ifOrEmpty
(boolean b, Throwables.Supplier<R, E> supplier) Returns aNullable
with value got from the specifiedsupplier
ifb
istrue
, otherwise returns an emptyNullable
ifb
is false.static <T,
R, E extends Exception>
u.Nullable<R>ifOrEmpty
(boolean b, T init, Throwables.Function<? super T, ? extends R, E> func) Returns aNullable
with value returned byfunc.apply(init)
ifb
istrue
, otherwise returns an emptyNullable
ifb
is false.static int
indexOf
(boolean[] a, boolean valueToFind) static int
indexOf
(boolean[] a, int startIndex, boolean valueToFind) static int
indexOf
(byte[] a, byte valueToFind) static int
indexOf
(byte[] a, int startIndex, byte valueToFind) static int
indexOf
(char[] a, char valueToFind) static int
indexOf
(char[] a, int startIndex, char valueToFind) static int
indexOf
(double[] a, double valueToFind) static int
indexOf
(double[] a, double valueToFind, double tolerance) Finds the index of the given value within a given tolerance in the array.static int
indexOf
(double[] a, int startIndex, double valueToFind) 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.static int
indexOf
(float[] a, float valueToFind) static int
indexOf
(float[] a, int startIndex, float valueToFind) static int
indexOf
(int[] a, int valueToFind) static int
indexOf
(int[] a, int startIndex, int valueToFind) static int
indexOf
(long[] a, int startIndex, long valueToFind) static int
indexOf
(long[] a, long valueToFind) static int
indexOf
(short[] a, int startIndex, short valueToFind) static int
indexOf
(short[] a, short valueToFind) static int
static int
static int
indexOf
(Collection<?> c, int startIndex, Object valueToFind) static int
indexOf
(Collection<?> c, Object valueToFind) static int
static int
static int
indexOfIgnoreCase
(String[] a, String valueToFind) static int
indexOfSubList
(List<?> sourceList, List<?> subListToFind) Index of sub list.static boolean[]
insert
(boolean[] a, int index, boolean elementToInsert) Inserts the specified elementToInsert at the specified position in the array.static byte[]
insert
(byte[] a, int index, byte elementToInsert) Inserts the specified elementToInsert at the specified position in the array.static char[]
insert
(char[] a, int index, char elementToInsert) Inserts the specified elementToInsert at the specified position in the array.static double[]
insert
(double[] a, int index, double elementToInsert) Inserts the specified elementToInsert at the specified position in the array.static float[]
insert
(float[] a, int index, float elementToInsert) Inserts the specified elementToInsert at the specified position in the array.static int[]
insert
(int[] a, int index, int elementToInsert) Inserts the specified elementToInsert at the specified position in the array.static long[]
insert
(long[] a, int index, long elementToInsert) Inserts the specified elementToInsert at the specified position in the array.static short[]
insert
(short[] a, int index, short elementToInsert) Inserts the specified elementToInsert at the specified position in the array.static String[]
static String
Returns a new String.static <T> T[]
insert
(T[] a, int index, T elementToInsert) Inserts the specified elementToInsert at the specified position in the array.static boolean[]
insertAll
(boolean[] a, int index, boolean... elementsToInsert) Inserts the specified elementToInserts at the specified position in the array.static byte[]
insertAll
(byte[] a, int index, byte... elementsToInsert) Inserts the specified elementToInserts at the specified position in the array.static char[]
insertAll
(char[] a, int index, char... elementsToInsert) Inserts the specified elementToInserts at the specified position in the array.static double[]
insertAll
(double[] a, int index, double... elementsToInsert) Inserts the specified elementToInserts at the specified position in the array.static float[]
insertAll
(float[] a, int index, float... elementsToInsert) Inserts the specified elementToInserts at the specified position in the array.static int[]
insertAll
(int[] a, int index, int... elementsToInsert) Inserts the specified elementToInserts at the specified position in the array.static long[]
insertAll
(long[] a, int index, long... elementsToInsert) Inserts the specified elementToInserts at the specified position in the array.static short[]
insertAll
(short[] a, int index, short... elementsToInsert) Inserts the specified elementToInserts at the specified position in the array.static String[]
static <T> boolean
static <T> T[]
insertAll
(T[] a, int index, T... elementsToInsert) Inserts the specified elementToInserts at the specified position in the array.static boolean[]
intersection
(boolean[] a, boolean[] b) static byte[]
intersection
(byte[] a, byte[] b) static char[]
intersection
(char[] a, char[] b) static double[]
intersection
(double[] a, double[] b) static float[]
intersection
(float[] a, float[] b) static int[]
intersection
(int[] a, int[] b) Returns a new array with all the elements inb
removed by occurrences.static long[]
intersection
(long[] a, long[] b) static short[]
intersection
(short[] a, short[] b) static <T> List<T>
intersection
(Collection<? extends Collection<? extends T>> c) static <T> List<T>
intersection
(Collection<? extends T> a, Collection<?> b) static <T> List<T>
intersection
(T[] a, Object[] b) static boolean
isBeanClass
(Class<?> cls) Deprecated.replaced byClassUtil.isBeanClass(Class)
static <T extends Comparable<? super T>>
booleanisBetween
(T value, T min, T max) Deprecated.replaced bygtAndLt(Comparable, Comparable, Comparable)
static boolean
isBlank
(CharSequence cs) Checks if the specifiedCharSequence
is null or blank.static boolean
isEmpty
(boolean[] a) Checks if is null or empty.static boolean
isEmpty
(byte[] a) Checks if is null or empty.static boolean
isEmpty
(char[] a) Checks if is null or empty.static boolean
isEmpty
(double[] a) Checks if is null or empty.static boolean
isEmpty
(float[] a) Checks if is null or empty.static boolean
isEmpty
(int[] a) Checks if is null or empty.static boolean
isEmpty
(long[] a) Checks if is null or empty.static boolean
isEmpty
(short[] a) Checks if is null or empty.static boolean
Checks if is null or empty.static boolean
isEmpty
(LongMultiset<?> s) Checks if is null or empty.static boolean
Checks if is null or empty.static boolean
Checks if is null or empty.static boolean
isEmpty
(PrimitiveList list) Checks if is null or empty.static boolean
isEmpty
(CharSequence cs) Checks if the specifiedCharSequence
is null or empty.static boolean
Not null or empty.static boolean
Checks if is null or empty.static boolean
isEmpty
(Collection<?> c) Checks if is null or empty.static boolean
Not null or empty.static boolean
Checks if is null or empty.static boolean
isEqualCollection
(Collection<?> a, Collection<?> b) Returnstrue
if the givenCollection
s contain exactly the same elements with exactly the same cardinalities.static boolean
Returnstrue
if the specifiedboolean
isBoolean.FALSE
, notnull
orBoolean.TRUE
.static boolean
isNotFalse
(Boolean bool) Returnstrue
if the specifiedboolean
isnull
orBoolean.TRUE
.static boolean
Returnstrue
if the specifiedboolean
isnull
orBoolean.FALSE
.static boolean
isPrimitiveArrayType
(Class<?> cls) Checks if is primitive array type.static boolean
isPrimitiveType
(Class<?> cls) Checks if is primitive type.static boolean
isProperSubCollection
(Collection<?> subColl, Collection<?> coll) Returnstrue
if subColl is a proper sub-collection of coll, that is, if the cardinality of e in subColl is less than or equal to the cardinality of e in coll, for each element e in subColl, and there is at least one element f such that the cardinality of f in coll is strictly greater than the cardinality of f in subColl.static boolean
isSorted
(boolean[] a) static boolean
isSorted
(boolean[] a, int fromIndex, int toIndex) static boolean
isSorted
(byte[] a) static boolean
isSorted
(byte[] a, int fromIndex, int toIndex) static boolean
isSorted
(char[] a) static boolean
isSorted
(char[] a, int fromIndex, int toIndex) static boolean
isSorted
(double[] a) static boolean
isSorted
(double[] a, int fromIndex, int toIndex) static boolean
isSorted
(float[] a) static boolean
isSorted
(float[] a, int fromIndex, int toIndex) static boolean
isSorted
(int[] a) static boolean
isSorted
(int[] a, int fromIndex, int toIndex) static boolean
isSorted
(long[] a) static boolean
isSorted
(long[] a, int fromIndex, int toIndex) static boolean
isSorted
(short[] a) static boolean
isSorted
(short[] a, int fromIndex, int toIndex) static <T extends Comparable<? super T>>
booleanisSorted
(Collection<? extends T> c) static <T extends Comparable<? super T>>
booleanisSorted
(Collection<? extends T> c, int fromIndex, int toIndex) static <T> boolean
isSorted
(Collection<? extends T> c, int fromIndex, int toIndex, Comparator<? super T> cmp) static <T> boolean
isSorted
(Collection<? extends T> c, Comparator<? super T> cmp) static <T extends Comparable<? super T>>
booleanisSorted
(T[] a) static <T extends Comparable<? super T>>
booleanisSorted
(T[] a, int fromIndex, int toIndex) static <T> boolean
isSorted
(T[] a, int fromIndex, int toIndex, Comparator<? super T> cmp) static <T> boolean
isSorted
(T[] a, Comparator<? super T> cmp) static boolean
isSubCollection
(Collection<?> subColl, Collection<?> coll) Returnstrue
if subColl is a sub-collection of coll, that is, if the cardinality of e in subColl is less than or equal to the cardinality of e in coll, for each element e in subColl.static boolean
Returnstrue
if the specifiedboolean
isBoolean.TRUE
, notnull
orBoolean.FALSE
.static boolean
isWrapperType
(Class<?> cls) Checks if is wrapper type.static <T> Iterator<T>
static <T> ObjIterator<T>
iterate
(T[] a) static <T> ObjIterator<T>
iterate
(T[] a, int fromIndex, int toIndex) static String
Json 2 XML.static String
Json 2 XML.static byte
kthLargest
(byte[] a, int k) static byte
kthLargest
(byte[] a, int fromIndex, int toIndex, int k) static char
kthLargest
(char[] a, int k) static char
kthLargest
(char[] a, int fromIndex, int toIndex, int k) static double
kthLargest
(double[] a, int k) static double
kthLargest
(double[] a, int fromIndex, int toIndex, int k) static float
kthLargest
(float[] a, int k) static float
kthLargest
(float[] a, int fromIndex, int toIndex, int k) static int
kthLargest
(int[] a, int k) static int
kthLargest
(int[] a, int fromIndex, int toIndex, int k) static long
kthLargest
(long[] a, int k) static long
kthLargest
(long[] a, int fromIndex, int toIndex, int k) static short
kthLargest
(short[] a, int k) static short
kthLargest
(short[] a, int fromIndex, int toIndex, int k) static <T extends Comparable<? super T>>
TkthLargest
(Collection<? extends T> c, int k) static <T extends Comparable<? super T>>
TkthLargest
(Collection<? extends T> c, int fromIndex, int toIndex, int k) static <T> T
kthLargest
(Collection<? extends T> c, int fromIndex, int toIndex, int k, Comparator<? super T> cmp) static <T> T
kthLargest
(Collection<? extends T> c, int k, Comparator<? super T> cmp) static <T extends Comparable<? super T>>
TkthLargest
(T[] a, int k) static <T extends Comparable<? super T>>
TkthLargest
(T[] a, int fromIndex, int toIndex, int k) static <T> T
kthLargest
(T[] a, int fromIndex, int toIndex, int k, Comparator<? super T> cmp) static <T> T
kthLargest
(T[] a, int k, Comparator<? super T> cmp) static <T> u.Nullable<T>
lastElement
(Iterable<? extends T> c) static <T> u.Nullable<T>
lastElement
(Iterator<? extends T> iter) static <T> List<T>
lastElements
(Collection<? extends T> c, int n) Return at most lastn
elements.static <K,
V> u.Optional<Map.Entry<K, V>> static int
lastIndexOf
(boolean[] a, boolean valueToFind) Last index of.static int
lastIndexOf
(boolean[] a, int startIndexFromBack, boolean valueToFind) Last index of.static int
lastIndexOf
(byte[] a, byte valueToFind) Last index of.static int
lastIndexOf
(byte[] a, int startIndexFromBack, byte valueToFind) Last index of.static int
lastIndexOf
(char[] a, char valueToFind) Last index of.static int
lastIndexOf
(char[] a, int startIndexFromBack, char valueToFind) Last index of.static int
lastIndexOf
(double[] a, double valueToFind) Last index of.static int
lastIndexOf
(double[] a, double valueToFind, double tolerance) Finds the last index of the given value within a given tolerance in the array.static int
lastIndexOf
(double[] a, int startIndexFromBack, double valueToFind) Last index of.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.static int
lastIndexOf
(float[] a, float valueToFind) Last index of.static int
lastIndexOf
(float[] a, int startIndexFromBack, float valueToFind) Last index of.static int
lastIndexOf
(int[] a, int valueToFind) Last index of.static int
lastIndexOf
(int[] a, int startIndexFromBack, int valueToFind) Last index of.static int
lastIndexOf
(long[] a, int startIndexFromBack, long valueToFind) Last index of.static int
lastIndexOf
(long[] a, long valueToFind) Last index of.static int
lastIndexOf
(short[] a, int startIndexFromBack, short valueToFind) Last index of.static int
lastIndexOf
(short[] a, short valueToFind) Last index of.static int
lastIndexOf
(Object[] a, int startIndexFromBack, Object valueToFind) Last index of.static int
lastIndexOf
(Object[] a, Object valueToFind) Last index of.static int
lastIndexOf
(Collection<?> c, int startIndexFromBack, Object valueToFind) Last index of.static int
lastIndexOf
(Collection<?> c, Object valueToFind) Last index of.static int
lastIndexOfIgnoreCase
(String[] a, String valueToFind) static int
lastIndexOfSubList
(List<?> sourceList, List<?> subListToFind) Last index of sub list.static <T> u.Optional<T>
lastNonNull
(Iterable<? extends T> c) Last non null.static <T> u.Optional<T>
lastNonNull
(Iterator<? extends T> iter) Last non null.static <T> u.Optional<T>
lastNonNull
(T... a) Last non null.static <T> u.Optional<T>
lastNonNull
(T a, T b) Last non null.static <T> u.Optional<T>
lastNonNull
(T a, T b, T c) Last non null.static <T> T
lastOrDefaultIfEmpty
(Iterable<? extends T> c, T defaultValueForEmpty) Last or default if empty.static <T> T
lastOrDefaultIfEmpty
(Iterator<? extends T> iter, T defaultValueForEmpty) Last or default if empty.static <T> T
lastOrDefaultIfEmpty
(T[] a, T defaultValueForEmpty) Last or default if empty.static <T> T
lastOrNullIfEmpty
(Iterable<? extends T> c) Last or null if empty.static <T> T
lastOrNullIfEmpty
(Iterator<? extends T> iter) Last or null if empty.static <T> T
lastOrNullIfEmpty
(T[] a) Last or null if empty.static <T> LazyInitializer<T>
static <T,
E extends Exception>
Throwables.LazyInitializer<T,E> lazyInitialize
(Throwables.Supplier<T, E> supplier) static int
len
(boolean[] a) Returns the length/size of the specifiedArray/Collection/Map
, or0
if it's empty ornull
.static int
len
(byte[] a) Returns the length/size of the specifiedArray/Collection/Map
, or0
if it's empty ornull
.static int
len
(char[] a) Returns the length/size of the specifiedArray/Collection/Map
, or0
if it's empty ornull
.static int
len
(double[] a) Returns the length/size of the specifiedArray/Collection/Map
, or0
if it's empty ornull
.static int
len
(float[] a) Returns the length/size of the specifiedArray/Collection/Map
, or0
if it's empty ornull
.static int
len
(int[] a) Returns the length/size of the specifiedArray/Collection/Map
, or0
if it's empty ornull
.static int
len
(long[] a) Returns the length/size of the specifiedArray/Collection/Map
, or0
if it's empty ornull
.static int
len
(short[] a) Returns the length/size of the specifiedArray/Collection/Map
, or0
if it's empty ornull
.static int
len
(CharSequence s) Returns the length of the specifiedCharSequence
, or0
if it's empty ornull
.static int
Returns the length/size of the specifiedArray/Collection/Map
, or0
if it's empty ornull
.static <T extends Comparable<? super T>>
booleanlessEqual
(T a, T b) Returnstrue
isa <= b
, otherwisefalse
is returned.static <T extends Comparable<? super T>>
booleanlessThan
(T a, T b) Returnstrue
isa < b
, otherwisefalse
is returned.map
(Iterable<? extends T> c, Throwables.Function<? super T, ? extends R, E> mapper) static <T,
R, C extends Collection<R>, E extends Exception>
Cmap
(Iterable<? extends T> c, Throwables.Function<? super T, ? extends R, E> mapper, IntFunction<? extends C> supplier) map
(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.Function<? super T, ? extends R, E> mapper) Mostly it's designed for one-step operation to complete the operation in one step.static <T,
R, C extends Collection<R>, E extends Exception>
Cmap
(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.Function<? super T, ? extends R, E> mapper, IntFunction<? extends C> supplier) Mostly it's designed for one-step operation to complete the operation in one step.map
(T[] a, int fromIndex, int toIndex, Throwables.Function<? super T, ? extends R, E> mapper) Mostly it's designed for one-step operation to complete the operation in one step.static <T,
R, C extends Collection<R>, E extends Exception>
Cmap
(T[] a, int fromIndex, int toIndex, Throwables.Function<? super T, ? extends R, E> mapper, IntFunction<? extends C> supplier) Mostly it's designed for one-step operation to complete the operation in one step.map
(T[] a, Throwables.Function<? super T, ? extends R, E> mapper) static <T,
R, C extends Collection<R>, E extends Exception>
Cmap
(T[] a, Throwables.Function<? super T, ? extends R, E> mapper, IntFunction<? extends C> supplier) static <T,
E extends Exception>
boolean[]mapToBoolean
(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.ToBooleanFunction<? super T, E> mapper) Mostly it's designed for one-step operation to complete the operation in one step.static <T,
E extends Exception>
boolean[]mapToBoolean
(Collection<? extends T> c, Throwables.ToBooleanFunction<? super T, E> mapper) Map to boolean.static <T,
E extends Exception>
boolean[]mapToBoolean
(T[] a, int fromIndex, int toIndex, Throwables.ToBooleanFunction<? super T, E> mapper) Mostly it's designed for one-step operation to complete the operation in one step.static <T,
E extends Exception>
boolean[]mapToBoolean
(T[] a, Throwables.ToBooleanFunction<? super T, E> mapper) Map to boolean.static <T,
E extends Exception>
byte[]mapToByte
(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.ToByteFunction<? super T, E> mapper) Mostly it's designed for one-step operation to complete the operation in one step.static <T,
E extends Exception>
byte[]mapToByte
(Collection<? extends T> c, Throwables.ToByteFunction<? super T, E> mapper) Map to byte.static <T,
E extends Exception>
byte[]mapToByte
(T[] a, int fromIndex, int toIndex, Throwables.ToByteFunction<? super T, E> mapper) Mostly it's designed for one-step operation to complete the operation in one step.static <T,
E extends Exception>
byte[]mapToByte
(T[] a, Throwables.ToByteFunction<? super T, E> mapper) Map to byte.static <T,
E extends Exception>
char[]mapToChar
(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.ToCharFunction<? super T, E> mapper) Mostly it's designed for one-step operation to complete the operation in one step.static <T,
E extends Exception>
char[]mapToChar
(Collection<? extends T> c, Throwables.ToCharFunction<? super T, E> mapper) Map to char.static <T,
E extends Exception>
char[]mapToChar
(T[] a, int fromIndex, int toIndex, Throwables.ToCharFunction<? super T, E> mapper) Mostly it's designed for one-step operation to complete the operation in one step.static <T,
E extends Exception>
char[]mapToChar
(T[] a, Throwables.ToCharFunction<? super T, E> mapper) Map to char.static <E extends Exception>
double[]mapToDouble
(int[] a, Throwables.IntToDoubleFunction<E> mapper) static <E extends Exception>
double[]mapToDouble
(long[] a, Throwables.LongToDoubleFunction<E> mapper) static <T,
E extends Exception>
double[]mapToDouble
(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.ToDoubleFunction<? super T, E> mapper) Mostly it's designed for one-step operation to complete the operation in one step.static <T,
E extends Exception>
double[]mapToDouble
(Collection<? extends T> c, Throwables.ToDoubleFunction<? super T, E> mapper) Map to double.static <T,
E extends Exception>
double[]mapToDouble
(T[] a, int fromIndex, int toIndex, Throwables.ToDoubleFunction<? super T, E> mapper) Mostly it's designed for one-step operation to complete the operation in one step.static <T,
E extends Exception>
double[]mapToDouble
(T[] a, Throwables.ToDoubleFunction<? super T, E> mapper) Map to double.static <T,
E extends Exception>
float[]mapToFloat
(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.ToFloatFunction<? super T, E> mapper) Mostly it's designed for one-step operation to complete the operation in one step.static <T,
E extends Exception>
float[]mapToFloat
(Collection<? extends T> c, Throwables.ToFloatFunction<? super T, E> mapper) Map to float.static <T,
E extends Exception>
float[]mapToFloat
(T[] a, int fromIndex, int toIndex, Throwables.ToFloatFunction<? super T, E> mapper) Mostly it's designed for one-step operation to complete the operation in one step.static <T,
E extends Exception>
float[]mapToFloat
(T[] a, Throwables.ToFloatFunction<? super T, E> mapper) Map to float.static <E extends Exception>
int[]mapToInt
(double[] a, Throwables.DoubleToIntFunction<E> mapper) static <E extends Exception>
int[]mapToInt
(long[] a, Throwables.LongToIntFunction<E> mapper) static <T,
E extends Exception>
int[]mapToInt
(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.ToIntFunction<? super T, E> mapper) Mostly it's designed for one-step operation to complete the operation in one step.static <T,
E extends Exception>
int[]mapToInt
(Collection<? extends T> c, Throwables.ToIntFunction<? super T, E> mapper) Map to int.static <T,
E extends Exception>
int[]mapToInt
(T[] a, int fromIndex, int toIndex, Throwables.ToIntFunction<? super T, E> mapper) Mostly it's designed for one-step operation to complete the operation in one step.static <T,
E extends Exception>
int[]mapToInt
(T[] a, Throwables.ToIntFunction<? super T, E> mapper) Map to int.static <E extends Exception>
long[]mapToLong
(double[] a, Throwables.DoubleToLongFunction<E> mapper) static <E extends Exception>
long[]mapToLong
(int[] a, Throwables.IntToLongFunction<E> mapper) static <T,
E extends Exception>
long[]mapToLong
(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.ToLongFunction<? super T, E> mapper) Mostly it's designed for one-step operation to complete the operation in one step.static <T,
E extends Exception>
long[]mapToLong
(Collection<? extends T> c, Throwables.ToLongFunction<? super T, E> mapper) Map to long.static <T,
E extends Exception>
long[]mapToLong
(T[] a, int fromIndex, int toIndex, Throwables.ToLongFunction<? super T, E> mapper) Mostly it's designed for one-step operation to complete the operation in one step.static <T,
E extends Exception>
long[]mapToLong
(T[] a, Throwables.ToLongFunction<? super T, E> mapper) Map to long.static <T,
E extends Exception>
short[]mapToShort
(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.ToShortFunction<? super T, E> mapper) Mostly it's designed for one-step operation to complete the operation in one step.static <T,
E extends Exception>
short[]mapToShort
(Collection<? extends T> c, Throwables.ToShortFunction<? super T, E> mapper) Map to short.static <T,
E extends Exception>
short[]mapToShort
(T[] a, int fromIndex, int toIndex, Throwables.ToShortFunction<? super T, E> mapper) Mostly it's designed for one-step operation to complete the operation in one step.static <T,
E extends Exception>
short[]mapToShort
(T[] a, Throwables.ToShortFunction<? super T, E> mapper) Map to short.static byte
max
(byte... a) Returns the maximum value in an array.static byte
max
(byte[] a, int fromIndex, int toIndex) static byte
max
(byte a, byte b) Gets the maximum of twobyte
values.static byte
max
(byte a, byte b, byte c) Gets the maximum of threebyte
values.static char
max
(char... a) Returns the maximum value in an array.static char
max
(char[] a, int fromIndex, int toIndex) static char
max
(char a, char b) Gets the maximum of twochar
values.static char
max
(char a, char b, char c) Gets the maximum of threechar
values.static double
max
(double... a) Returns the maximum value in an array.static double
max
(double[] a, int fromIndex, int toIndex) static double
max
(double a, double b) Gets the maximum of twodouble
values.static double
max
(double a, double b, double c) Gets the maximum of threedouble
values.static float
max
(float... a) Returns the maximum value in an array.static float
max
(float[] a, int fromIndex, int toIndex) static float
max
(float a, float b) Gets the maximum of twofloat
values.static float
max
(float a, float b, float c) Gets the maximum of threefloat
values.static int
max
(int... a) Returns the maximum value in an array.static int
max
(int[] a, int fromIndex, int toIndex) static int
max
(int a, int b) Gets the maximum of twoint
values.static int
max
(int a, int b, int c) Gets the maximum of threeint
values.static long
max
(long... a) Returns the maximum value in an array.static long
max
(long[] a, int fromIndex, int toIndex) static long
max
(long a, long b) Gets the maximum of twolong
values.static long
max
(long a, long b, long c) Gets the maximum of threelong
values.static short
max
(short... a) Returns the maximum value in an array.static short
max
(short[] a, int fromIndex, int toIndex) static short
max
(short a, short b) Gets the maximum of twoshort
values.static short
max
(short a, short b, short c) Gets the maximum of threeshort
values.static <T extends Comparable<? super T>>
Tstatic <T> T
max
(Iterable<? extends T> c, Comparator<? super T> cmp) static <T extends Comparable<? super T>>
Tmax
(Collection<? extends T> c, int fromIndex, int toIndex) static <T> T
max
(Collection<? extends T> c, int fromIndex, int toIndex, Comparator<? super T> cmp) Returns the maximum element in the collection.static <T extends Comparable<? super T>>
Tmax
(T[] a) Returns the maximum element in the array.static <T extends Comparable<? super T>>
Tmax
(T[] a, int fromIndex, int toIndex) static <T> T
max
(T[] a, int fromIndex, int toIndex, Comparator<? super T> cmp) static <T> T
max
(T[] a, Comparator<? super T> cmp) Returns the maximum element in the array.static <T extends Comparable<? super T>>
Tmax
(T a, T b) static <T> T
max
(T a, T b, Comparator<? super T> cmp) static <T extends Comparable<? super T>>
Tmax
(T a, T b, T c) static <T> T
max
(T a, T b, T c, Comparator<? super T> cmp) static <T extends Comparable<? super T>>
List<T>static <T> List<T>
maxAll
(Iterable<? extends T> c, Comparator<? super T> cmp) static <T extends Comparable<? super T>>
List<T>static <T> List<T>
maxAll
(Iterator<? extends T> iter, Comparator<? super T> cmp) static <T extends Comparable<? super T>>
List<T>maxAll
(T[] a) static <T> List<T>
maxAll
(T[] a, Comparator<? super T> cmp) static <T,
E extends Exception>
doublemaxDoubleOrDefaultIfEmpty
(Iterable<? extends T> c, Throwables.ToDoubleFunction<? super T, E> valueExtractor, double defaultValue) Returns the maximumdouble
value extracted from the specified iterablec
byvalueExtractor
, ordefaultValue
ifa
is null or empty.static <T,
E extends Exception>
doublemaxDoubleOrDefaultIfEmpty
(Iterator<? extends T> iter, Throwables.ToDoubleFunction<? super T, E> valueExtractor, double defaultValue) Returns the maximumdouble
value extracted from the specified iteratoriter
byvalueExtractor
, ordefaultValue
ifa
is null or empty.static <T,
E extends Exception>
doublemaxDoubleOrDefaultIfEmpty
(T[] a, Throwables.ToDoubleFunction<? super T, E> valueExtractor, double defaultValue) Returns the maximumdouble
value extracted from the specified arraya
byvalueExtractor
, ordefaultValue
ifa
is null or empty.static <T,
E extends Exception>
intmaxIntOrDefaultIfEmpty
(Iterable<? extends T> c, Throwables.ToIntFunction<? super T, E> valueExtractor, int defaultValue) Returns the maximumint
value extracted from the specified iterablec
byvalueExtractor
, ordefaultValue
ifa
is null or empty.static <T,
E extends Exception>
intmaxIntOrDefaultIfEmpty
(Iterator<? extends T> iter, Throwables.ToIntFunction<? super T, E> valueExtractor, int defaultValue) Returns the maximumint
value extracted from the specified iteratoriter
byvalueExtractor
, ordefaultValue
ifa
is null or empty.static <T,
E extends Exception>
intmaxIntOrDefaultIfEmpty
(T[] a, Throwables.ToIntFunction<? super T, E> valueExtractor, int defaultValue) Returns the maximumint
value extracted from the specified arraya
byvalueExtractor
, ordefaultValue
ifa
is null or empty.static <T,
E extends Exception>
longmaxLongOrDefaultIfEmpty
(Iterable<? extends T> c, Throwables.ToLongFunction<? super T, E> valueExtractor, long defaultValue) Returns the maximumlong
value extracted from the specified iterablec
byvalueExtractor
, ordefaultValue
ifa
is null or empty.static <T,
E extends Exception>
longmaxLongOrDefaultIfEmpty
(Iterator<? extends T> iter, Throwables.ToLongFunction<? super T, E> valueExtractor, long defaultValue) Returns the maximumlong
value extracted from the specified iteratoriter
byvalueExtractor
, ordefaultValue
ifa
is null or empty.static <T,
E extends Exception>
longmaxLongOrDefaultIfEmpty
(T[] a, Throwables.ToLongFunction<? super T, E> valueExtractor, long defaultValue) Returns the maximumlong
value extracted from the specified arraya
byvalueExtractor
, ordefaultValue
ifa
is null or empty.static <T,
R extends Comparable<? super R>, E extends Exception>
RmaxOrDefaultIfEmpty
(Iterable<? extends T> c, Throwables.Function<? super T, ? extends R, E> valueExtractor, R defaultValue) Returns the maximum value extracted from the specified collectionc
byvalueExtractor
, ordefaultValue
ifc
is null or empty.static <T,
R extends Comparable<? super R>, E extends Exception>
RmaxOrDefaultIfEmpty
(Iterator<? extends T> iter, Throwables.Function<? super T, ? extends R, E> valueExtractor, R defaultValue) Returns the maximum value extracted from the specified iteratoriter
byvalueExtractor
, ordefaultValue
ifiter
is null or empty.static <T,
R extends Comparable<? super R>, E extends Exception>
RmaxOrDefaultIfEmpty
(T[] a, Throwables.Function<? super T, ? extends R, E> valueExtractor, R defaultValue) Returns the maximum value extracted from the specified arraya
byvalueExtractor
, ordefaultValue
ifa
is null or empty.static byte
median
(byte... a) Returns thelength / 2 + 1
largest value in the specified array.static byte
median
(byte[] a, int fromIndex, int toIndex) static byte
median
(byte a, byte b, byte c) Gets the median of three values.static char
median
(char... a) Returns thelength / 2 + 1
largest value in the specified array.static char
median
(char[] a, int fromIndex, int toIndex) static char
median
(char a, char b, char c) Gets the median of three values.static double
median
(double... a) Returns thelength / 2 + 1
largest value in the specified array.static double
median
(double[] a, int fromIndex, int toIndex) static double
median
(double a, double b, double c) Gets the median of three values.static float
median
(float... a) Returns thelength / 2 + 1
largest value in the specified array.static float
median
(float[] a, int fromIndex, int toIndex) static float
median
(float a, float b, float c) Gets the median of three values.static int
median
(int... a) Returns thelength / 2 + 1
largest value in the specified array.static int
median
(int[] a, int fromIndex, int toIndex) static int
median
(int a, int b, int c) Gets the median of three values.static long
median
(long... a) Returns thelength / 2 + 1
largest value in the specified array.static long
median
(long[] a, int fromIndex, int toIndex) static long
median
(long a, long b, long c) Gets the median of three values.static short
median
(short... a) Returns thelength / 2 + 1
largest value in the specified array.static short
median
(short[] a, int fromIndex, int toIndex) static short
median
(short a, short b, short c) Gets the median of three values.static <T extends Comparable<? super T>>
Tmedian
(Collection<? extends T> c) Returns thelength / 2 + 1
largest value in the specified array.static <T extends Comparable<? super T>>
Tmedian
(Collection<? extends T> c, int fromIndex, int toIndex) static <T> T
median
(Collection<? extends T> c, int fromIndex, int toIndex, Comparator<? super T> cmp) static <T> T
median
(Collection<? extends T> c, Comparator<? super T> cmp) Returns thelength / 2 + 1
largest value in the specified array.static <T extends Comparable<? super T>>
Tmedian
(T[] a) Returns thelength / 2 + 1
largest value in the specified array.static <T extends Comparable<? super T>>
Tmedian
(T[] a, int fromIndex, int toIndex) static <T> T
median
(T[] a, int fromIndex, int toIndex, Comparator<? super T> cmp) static <T> T
median
(T[] a, Comparator<? super T> cmp) Returns thelength / 2 + 1
largest value in the specified array.static <T extends Comparable<? super T>>
Tmedian
(T a, T b, T c) Gets the median of three values.static <T> T
median
(T a, T b, T c, Comparator<? super T> cmp) Gets the median of three values.static DataSet
static DataSet
merge
(Iterable<? extends T> a, Iterable<? extends T> b, Throwables.BiFunction<? super T, ? super T, MergeResult, E> nextSelector) static <T> T
static <T> T
merge
(Object sourceBean, T targetBean, boolean ignoreUnmatchedProperty, Set<String> ignoredPropNames) static <T> T
merge
(Object sourceBean, T targetBean, boolean ignoreUnmatchedProperty, Set<String> ignoredPropNames, BinaryOperator<?> mergeFunc) static <T> T
merge
(Object sourceBean, T targetBean, Collection<String> selectPropNames) Set all the signed properties(including all primitive type properties) in the specifiedsourceBean
to the specifiedtargetBean
.static <T> T
merge
(Object sourceBean, T targetBean, Collection<String> selectPropNames, BinaryOperator<?> mergeFunc) Set all the signed properties(including all primitive type properties) in the specifiedsourceBean
to the specifiedtargetBean
.static <T> T
merge
(Object sourceBean, T targetBean, BinaryOperator<?> mergeFunc) static <T> T
merge
(Object sourceBean, T targetBean, BiPredicate<String, ?> filter) Set all the signed properties(including all primitive type properties) in the specifiedsourceBean
to the specifiedtargetBean
.static <T> T
merge
(Object sourceBean, T targetBean, BiPredicate<String, ?> filter, BinaryOperator<?> mergeFunc) Set all the signed properties(including all primitive type properties) in the specifiedsourceBean
to the specifiedtargetBean
.static DataSet
merge
(Collection<? extends DataSet> dss) static <T> List<T>
merge
(Collection<? extends Iterable<? extends T>> c, BiFunction<? super T, ? super T, MergeResult> nextSelector) static <T,
C extends Collection<T>>
Cmerge
(Collection<? extends Iterable<? extends T>> c, BiFunction<? super T, ? super T, MergeResult> nextSelector, IntFunction<? extends C> supplier) merge
(T[] a, T[] b, Throwables.BiFunction<? super T, ? super T, MergeResult, E> nextSelector) static byte
min
(byte... a) Returns the minimum value in an array.static byte
min
(byte[] a, int fromIndex, int toIndex) static byte
min
(byte a, byte b) Gets the minimum of twobyte
values.static byte
min
(byte a, byte b, byte c) Gets the minimum of threebyte
values.static char
min
(char... a) Returns the minimum value in an array.static char
min
(char[] a, int fromIndex, int toIndex) static char
min
(char a, char b) Gets the minimum of twochar
values.static char
min
(char a, char b, char c) Gets the minimum of threechar
values.static double
min
(double... a) Returns the minimum value in an array.static double
min
(double[] a, int fromIndex, int toIndex) static double
min
(double a, double b) Gets the minimum of twodouble
values.static double
min
(double a, double b, double c) Gets the minimum of threedouble
values.static float
min
(float... a) Returns the minimum value in an array.static float
min
(float[] a, int fromIndex, int toIndex) static float
min
(float a, float b) Gets the minimum of twofloat
values.static float
min
(float a, float b, float c) Gets the minimum of threefloat
values.static int
min
(int... a) Returns the minimum value in an array.static int
min
(int[] a, int fromIndex, int toIndex) static int
min
(int a, int b) Gets the minimum of twoint
values.static int
min
(int a, int b, int c) Gets the minimum of threeint
values.static long
min
(long... a) Returns the minimum value in an array.static long
min
(long[] a, int fromIndex, int toIndex) static long
min
(long a, long b) Gets the minimum of twolong
values.static long
min
(long a, long b, long c) Gets the minimum of threelong
values.static short
min
(short... a) Returns the minimum value in an array.static short
min
(short[] a, int fromIndex, int toIndex) static short
min
(short a, short b) Gets the minimum of twoshort
values.static short
min
(short a, short b, short c) Gets the minimum of threeshort
values.static <T extends Comparable<? super T>>
Tstatic <T> T
min
(Iterable<? extends T> c, Comparator<? super T> cmp) static <T extends Comparable<? super T>>
Tmin
(Collection<? extends T> c, int fromIndex, int toIndex) static <T> T
min
(Collection<? extends T> c, int fromIndex, int toIndex, Comparator<? super T> cmp) Returns the minimum element in the collection.static <T extends Comparable<? super T>>
Tmin
(T[] a) Returns the minimum element in the array.static <T extends Comparable<? super T>>
Tmin
(T[] a, int fromIndex, int toIndex) static <T> T
min
(T[] a, int fromIndex, int toIndex, Comparator<? super T> cmp) static <T> T
min
(T[] a, Comparator<? super T> cmp) Returns the minimum element in the array.static <T extends Comparable<? super T>>
Tmin
(T a, T b) static <T> T
min
(T a, T b, Comparator<? super T> cmp) static <T extends Comparable<? super T>>
Tmin
(T a, T b, T c) static <T> T
min
(T a, T b, T c, Comparator<? super T> cmp) static <T extends Comparable<? super T>>
List<T>static <T> List<T>
minAll
(Iterable<? extends T> c, Comparator<? super T> cmp) static <T extends Comparable<? super T>>
List<T>static <T> List<T>
minAll
(Iterator<? extends T> iter, Comparator<? super T> cmp) static <T extends Comparable<? super T>>
List<T>minAll
(T[] a) static <T> List<T>
minAll
(T[] a, Comparator<? super T> cmp) static <T,
E extends Exception>
doubleminDoubleOrDefaultIfEmpty
(Iterable<? extends T> c, Throwables.ToDoubleFunction<? super T, E> valueExtractor, double defaultValue) Returns the minimumdouble
value extracted from the specified iterablec
byvalueExtractor
, ordefaultValue
ifa
is null or empty.static <T,
E extends Exception>
doubleminDoubleOrDefaultIfEmpty
(Iterator<? extends T> iter, Throwables.ToDoubleFunction<? super T, E> valueExtractor, double defaultValue) Returns the minimumdouble
value extracted from the specified iteratoriter
byvalueExtractor
, ordefaultValue
ifa
is null or empty.static <T,
E extends Exception>
doubleminDoubleOrDefaultIfEmpty
(T[] a, Throwables.ToDoubleFunction<? super T, E> valueExtractor, double defaultValue) Returns the minimumdouble
value extracted from the specified arraya
byvalueExtractor
, ordefaultValue
ifa
is null or empty.static <T,
E extends Exception>
intminIntOrDefaultIfEmpty
(Iterable<? extends T> c, Throwables.ToIntFunction<? super T, E> valueExtractor, int defaultValue) Returns the minimumint
value extracted from the specified iterablec
byvalueExtractor
, ordefaultValue
ifa
is null or empty.static <T,
E extends Exception>
intminIntOrDefaultIfEmpty
(Iterator<? extends T> iter, Throwables.ToIntFunction<? super T, E> valueExtractor, int defaultValue) Returns the minimumint
value extracted from the specified iteratoriter
byvalueExtractor
, ordefaultValue
ifa
is null or empty.static <T,
E extends Exception>
intminIntOrDefaultIfEmpty
(T[] a, Throwables.ToIntFunction<? super T, E> valueExtractor, int defaultValue) Returns the minimumint
value extracted from the specified arraya
byvalueExtractor
, ordefaultValue
ifa
is null or empty.static <T,
E extends Exception>
longminLongOrDefaultIfEmpty
(Iterable<? extends T> c, Throwables.ToLongFunction<? super T, E> valueExtractor, long defaultValue) Returns the minimumlong
value extracted from the specified iterablec
byvalueExtractor
, ordefaultValue
ifa
is null or empty.static <T,
E extends Exception>
longminLongOrDefaultIfEmpty
(Iterator<? extends T> iter, Throwables.ToLongFunction<? super T, E> valueExtractor, long defaultValue) Returns the minimumlong
value extracted from the specified iteratoriter
byvalueExtractor
, ordefaultValue
ifa
is null or empty.static <T,
E extends Exception>
longminLongOrDefaultIfEmpty
(T[] a, Throwables.ToLongFunction<? super T, E> valueExtractor, long defaultValue) Returns the minimumlong
value extracted from the specified arraya
byvalueExtractor
, ordefaultValue
ifa
is null or empty.static <T extends Comparable<? super T>>
Pair<T,T> static <T> Pair<T,
T> minMax
(Iterable<? extends T> c, Comparator<? super T> cmp) static <T extends Comparable<? super T>>
Pair<T,T> static <T> Pair<T,
T> minMax
(Iterator<? extends T> iter, Comparator<? super T> cmp) static <T extends Comparable<? super T>>
Pair<T,T> minMax
(T[] a) static <T> Pair<T,
T> minMax
(T[] a, Comparator<? super T> cmp) static <T,
R extends Comparable<? super R>, E extends Exception>
RminOrDefaultIfEmpty
(Iterable<? extends T> c, Throwables.Function<? super T, ? extends R, E> valueExtractor, R defaultValue) Returns the minimum value extracted from the specified collectionc
byvalueExtractor
, ordefaultValue
ifc
is null or empty.static <T,
R extends Comparable<? super R>, E extends Exception>
RminOrDefaultIfEmpty
(Iterator<? extends T> iter, Throwables.Function<? super T, ? extends R, E> valueExtractor, R defaultValue) Returns the minimum value extracted from the specified iteratoriter
byvalueExtractor
, ordefaultValue
ifiter
is null or empty.static <T,
R extends Comparable<? super R>, E extends Exception>
RminOrDefaultIfEmpty
(T[] a, Throwables.Function<? super T, ? extends R, E> valueExtractor, R defaultValue) Returns the minimum value extracted from the specified arraya
byvalueExtractor
, ordefaultValue
ifa
is null or empty.static void
moveRange
(boolean[] a, int fromIndex, int toIndex, int newPositionStartIndex) static void
moveRange
(byte[] a, int fromIndex, int toIndex, int newPositionStartIndex) static void
moveRange
(char[] a, int fromIndex, int toIndex, int newPositionStartIndex) static void
moveRange
(double[] a, int fromIndex, int toIndex, int newPositionStartIndex) static void
moveRange
(float[] a, int fromIndex, int toIndex, int newPositionStartIndex) static void
moveRange
(int[] a, int fromIndex, int toIndex, int newPositionStartIndex) static void
moveRange
(long[] a, int fromIndex, int toIndex, int newPositionStartIndex) static void
moveRange
(short[] a, int fromIndex, int toIndex, int newPositionStartIndex) static String
static <T> boolean
static <T> void
moveRange
(T[] a, int fromIndex, int toIndex, int newPositionStartIndex) static void
negate
(boolean[] a) Negates boolean values in the specified boolean arraystatic void
negate
(boolean[] a, int fromIndex, int toIndex) Negates boolean valuesfromIndex
totoIndex
in the specified boolean arraystatic Boolean
Note: copied from Apache commons Lang under Apache license v2.0static <T> T
static <T> ArrayDeque<T>
New array deque.static <T> ArrayDeque<T>
newArrayDeque
(int numElements) Constructs an empty array deque with an initial capacity sufficient to hold the specified number of elements.static <E> ArrayDeque<E>
newArrayDeque
(Collection<? extends E> c) Constructs a deque containing the elements of the specified collection, in the order they are returned by the collection's iterator.static <T> ArrayList<T>
New array list.static <T> ArrayList<T>
newArrayList
(int initialCapacity) New array list.static <T> ArrayList<T>
newArrayList
(Collection<? extends T> c) New array list.static <T> T
static <T> T
static <K,
V> BiMap<K, V> newBiMap()
New bi map.static <K,
V> BiMap<K, V> newBiMap
(int initialCapacity) New bi map.static <K,
V> BiMap<K, V> newBiMap
(int initialCapacity, float loadFactor) New bi map.static <K,
V> BiMap<K, V> New bi map.static <K,
V> BiMap<K, V> newBiMap
(Supplier<? extends Map<K, V>> keyMapSupplier, Supplier<? extends Map<V, K>> valueMapSupplier) New bi map.static <T> Collection<T>
newCollection
(Class<? extends Collection> targetClass) static <T> Collection<T>
newCollection
(Class<? extends Collection> targetClass, int size) static <K,
V> ConcurrentHashMap<K, V> New concurrent hash map.static <K,
V> ConcurrentHashMap<K, V> newConcurrentHashMap
(int initialCapacity) New concurrent hash map.static <K,
V> ConcurrentHashMap<K, V> newConcurrentHashMap
(Map<? extends K, ? extends V> m) New concurrent hash map.static DataSet
newDataSet
(String keyColumnName, String valueColumnName, Map<?, ?> m) Convert the specified Map to a two columnsDataSet
: one column is for keys and one column is for values.static DataSet
newDataSet
(Collection<?> rowList) 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 bean or map.static DataSet
newDataSet
(Collection<String> columnNames, Object[][] rowList) static DataSet
newDataSet
(Collection<String> columnNames, Collection<?> rowList) If the specifiedcolumnNames
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 bean or map.static <C extends Collection<?>>
DataSetnewDataSet
(Map<String, C> map) New data set.static DataSet
New empty data set.static DataSet
newEmptyDataSet
(Collection<String> columnNames) New empty data set.static <K,
V> Map.Entry<K, V> newEntry
(K key, V value) static <K,
V> Map<K, V> New hash map.static <K,
V> Map<K, V> newHashMap
(int initialCapacity) New hash map.newHashMap
(Collection<? extends V> c, Throwables.Function<? super V, ? extends K, E> keyMapper) New hash map.static <K,
V> Map<K, V> newHashMap
(Map<? extends K, ? extends V> m) New hash map.static <T> Set<T>
New hash set.static <T> Set<T>
newHashSet
(int initialCapacity) New hash set.static <T> Set<T>
newHashSet
(Collection<? extends T> c) New hash set.static <K,
V> IdentityHashMap<K, V> New identity hash map.static <K,
V> IdentityHashMap<K, V> newIdentityHashMap
(int initialCapacity) New identity hash map.static <K,
V> IdentityHashMap<K, V> newIdentityHashMap
(Map<? extends K, ? extends V> m) New identity hash map.static <K,
V> ImmutableEntry<K, V> newImmutableEntry
(K key, V value) New immutable entry.static <T> T
newInstance
(Class<T> cls) static <K,
V> Map<K, V> New linked hash map.static <K,
V> Map<K, V> newLinkedHashMap
(int initialCapacity) New linked hash map.newLinkedHashMap
(Collection<? extends V> c, Throwables.Function<? super V, ? extends K, E> keyMapper) New linked hash map.static <K,
V> Map<K, V> newLinkedHashMap
(Map<? extends K, ? extends V> m) New linked hash map.static <T> Set<T>
New linked hash set.static <T> Set<T>
newLinkedHashSet
(int initialCapacity) New linked hash set.static <T> Set<T>
newLinkedHashSet
(Collection<? extends T> c) New linked hash set.static <T> LinkedList<T>
New linked list.static <T> LinkedList<T>
newLinkedList
(Collection<? extends T> c) New linked list.static <K,
E> ListMultimap<K, E> Return aListMultimap
backed byLinkedHashMap
.static <K,
E> ListMultimap<K, E> newLinkedListMultimap
(int initialCapacity) Return aListMultimap
backed byLinkedHashMap
.static <K,
E> ListMultimap<K, E> newLinkedListMultimap
(Map<? extends K, ? extends E> m) Return aListMultimap
backed byLinkedHashMap
.static <K,
E> SetMultimap<K, E> Return aSetMultimap
backed byLinkedHashMap
.static <K,
E> SetMultimap<K, E> newLinkedSetMultimap
(int initialCapacity) Return aSetMultimap
backed byLinkedHashMap
.static <K,
E> SetMultimap<K, E> newLinkedSetMultimap
(Map<? extends K, ? extends E> m) Return aSetMultimap
backed byLinkedHashMap
.static <K,
E> ListMultimap<K, E> New list multimap.static <K,
E> ListMultimap<K, E> newListMultimap
(int initialCapacity) New list multimap.static <K,
E> ListMultimap<K, E> newListMultimap
(Class<? extends Map> mapType) New list multimap.static <K,
E> ListMultimap<K, E> newListMultimap
(Class<? extends Map> mapType, Class<? extends List> valueType) New list multimap.static <K,
E> ListMultimap<K, E> newListMultimap
(Supplier<? extends Map<K, List<E>>> mapSupplier, Supplier<? extends List<E>> valueSupplier) New list multimap.static <K,
E> ListMultimap<K, E> newListMultimap
(Map<? extends K, ? extends E> m) New list multimap.static <T> LongMultiset<T>
static <T> LongMultiset<T>
newLongMultiset
(int initialCapacity) static <T> LongMultiset<T>
newLongMultiset
(Class<? extends Map> valueMapType) static <T> LongMultiset<T>
newLongMultiset
(Collection<? extends T> c) static <T> LongMultiset<T>
newLongMultiset
(Supplier<? extends Map<T, ?>> mapSupplier) static <K,
V> Map<K, V> static <K,
V> Map<K, V> static <K,
E, V extends Collection<E>>
Multimap<K,E, V> newMultimap
(Supplier<? extends Map<K, V>> mapSupplier, Supplier<? extends V> valueSupplier) static <T> Multiset<T>
static <T> Multiset<T>
newMultiset
(int initialCapacity) static <T> Multiset<T>
newMultiset
(Class<? extends Map> valueMapType) static <T> Multiset<T>
newMultiset
(Collection<? extends T> c) static <T> Multiset<T>
newMultiset
(Supplier<? extends Map<T, ?>> mapSupplier) static <T> T
newProxyInstance
(Class<?>[] interfaceClasses, InvocationHandler h) Refer tojava.lang.reflect
static <T> T
newProxyInstance
(Class<T> interfaceClass, InvocationHandler h) New proxy instance.static <E> Set<E>
newSetFromMap
(Map<E, Boolean> map) Returns a set backed by the specified map.static <K,
E> SetMultimap<K, E> New set multimap.static <K,
E> SetMultimap<K, E> newSetMultimap
(int initialCapacity) New set multimap.static <K,
E> SetMultimap<K, E> newSetMultimap
(Class<? extends Map> mapType) New set multimap.static <K,
E> SetMultimap<K, E> newSetMultimap
(Class<? extends Map> mapType, Class<? extends Set> valueType) New set multimap.static <K,
E> SetMultimap<K, E> newSetMultimap
(Supplier<? extends Map<K, Set<E>>> mapSupplier, Supplier<? extends Set<E>> valueSupplier) New set multimap.static <K,
E> SetMultimap<K, E> newSetMultimap
(Map<? extends K, ? extends E> m) New set multimap.static <K extends Comparable<? super K>,
E>
ListMultimap<K,E> Return aListMultimap
backed bySortedMap
.static <K extends Comparable<? super K>,
E>
ListMultimap<K,E> newSortedListMultimap
(Map<? extends K, ? extends E> m) Return aListMultimap
backed bySortedMap
.static <K extends Comparable<? super K>,
E>
SetMultimap<K,E> Return aSetMultimap
backed bySortedMap
.static <K extends Comparable<? super K>,
E>
SetMultimap<K,E> newSortedSetMultimap
(Map<? extends K, ? extends E> m) Return aSetMultimap
backed bySortedMap
.static <K extends Comparable<? super K>,
V>
TreeMap<K,V> New tree map.static <C,
K extends C, V>
TreeMap<K,V> newTreeMap
(Comparator<C> comparator) New tree map.static <K extends Comparable<? super K>,
V>
TreeMap<K,V> newTreeMap
(Map<? extends K, ? extends V> m) New tree map.static <K,
V> TreeMap<K, V> newTreeMap
(SortedMap<K, ? extends V> m) New tree map.static <T extends Comparable<? super T>>
TreeSet<T>New tree set.static <T extends Comparable<? super T>>
TreeSet<T>newTreeSet
(Collection<? extends T> c) New tree set.static <T> TreeSet<T>
newTreeSet
(Comparator<? super T> comparator) New tree set.static <T> TreeSet<T>
newTreeSet
(SortedSet<T> c) New tree set.static <T,
E extends Exception>
booleannMatch
(Iterable<? extends T> c, int atLeast, int atMost, Throwables.Predicate<? super T, E> filter) static <T,
E extends Exception>
booleannMatch
(Iterator<? extends T> iter, int atLeast, int atMost, Throwables.Predicate<? super T, E> filter) static <T,
E extends Exception>
booleannMatch
(T[] a, int atLeast, int atMost, Throwables.Predicate<? super T, E> filter) static <T,
E extends Exception>
booleannoneMatch
(Iterable<? extends T> c, Throwables.Predicate<? super T, E> filter) static <T,
E extends Exception>
booleannoneMatch
(Iterator<? extends T> iter, Throwables.Predicate<? super T, E> filter) static <T,
E extends Exception>
booleannoneMatch
(T[] a, Throwables.Predicate<? super T, E> filter) static boolean
notBlank
(CharSequence cs) static boolean
notEmpty
(boolean[] a) Not null or empty.static boolean
notEmpty
(byte[] a) Not null or empty.static boolean
notEmpty
(char[] a) Not null or empty.static boolean
notEmpty
(double[] a) Not null or empty.static boolean
notEmpty
(float[] a) Not null or empty.static boolean
notEmpty
(int[] a) Not null or empty.static boolean
notEmpty
(long[] a) Not null or empty.static boolean
notEmpty
(short[] a) Not null or empty.static boolean
Not null or empty.static boolean
notEmpty
(LongMultiset<?> s) Not null or empty.static boolean
Not null or empty.static boolean
Not null or empty.static boolean
notEmpty
(PrimitiveList list) Not null or empty.static boolean
notEmpty
(CharSequence cs) static boolean
Not null or empty.static boolean
Not null or empty.static boolean
notEmpty
(Collection<?> c) Not null or empty.static boolean
Not null or empty.static boolean
Not null or empty.static boolean[]
nullToEmpty
(boolean[] a) Null to empty.static byte[]
nullToEmpty
(byte[] a) Null to empty.static char[]
nullToEmpty
(char[] a) Null to empty.static double[]
nullToEmpty
(double[] a) Null to empty.static float[]
nullToEmpty
(float[] a) Null to empty.static int[]
nullToEmpty
(int[] a) Null to empty.static long[]
nullToEmpty
(long[] a) Null to empty.static short[]
nullToEmpty
(short[] a) Null to empty.static <K,
V> ImmutableBiMap<K, V> nullToEmpty
(ImmutableBiMap<K, V> map) Returns an immutable empty map if the specified ImmutableBiMap isnull
, otherwise itself is returned.static <T> ImmutableCollection<T>
Returns an immutable empty Collection if the specified ImmutableCollection isnull
, otherwise itself is returned.static <T> ImmutableList<T>
nullToEmpty
(ImmutableList<T> list) Returns an immutable empty list if the specified ImmutableList isnull
, otherwise itself is returned.static <K,
V> ImmutableMap<K, V> nullToEmpty
(ImmutableMap<K, V> map) Returns an immutable empty map if the specified ImmutableMap isnull
, otherwise itself is returned.static <K,
V> ImmutableNavigableMap<K, V> nullToEmpty
(ImmutableNavigableMap<K, V> map) Returns an immutable empty map if the specified ImmutableNavigableMap isnull
, otherwise itself is returned.static <T> ImmutableNavigableSet<T>
nullToEmpty
(ImmutableNavigableSet<T> set) Returns an immutable empty list if the specified ImmutableNavigableSet isnull
, otherwise itself is returned.static <T> ImmutableSet<T>
nullToEmpty
(ImmutableSet<T> set) Returns an immutable empty list if the specified ImmutableSet isnull
, otherwise itself is returned.static <K,
V> ImmutableSortedMap<K, V> nullToEmpty
(ImmutableSortedMap<K, V> map) Returns an immutable empty map if the specified ImmutableSortedMap isnull
, otherwise itself is returned.static <T> ImmutableSortedSet<T>
nullToEmpty
(ImmutableSortedSet<T> set) Returns an immutable empty list if the specified ImmutableSortedSet isnull
, otherwise itself is returned.static Object[]
nullToEmpty
(Object[] a) Deprecated.replaced byCommonUtil.<T>nullToEmpty(T[],java.lang.Class<T[]>)
static String
nullToEmpty
(String str) static String[]
nullToEmpty
(String[] a) Null to empty.static <T> Iterator<T>
nullToEmpty
(Iterator<T> iter) Returns an immutable emptyIterator
if the specified Iterator isnull
, otherwise itself is returned.static <T> List<T>
nullToEmpty
(List<T> list) Returns an immutable empty list if the specified List isnull
, otherwise itself is returned.static <T> ListIterator<T>
nullToEmpty
(ListIterator<T> iter) Returns an immutable emptyListIterator
if the specified ListIterator isnull
, otherwise itself is returned.static <K,
V> Map<K, V> nullToEmpty
(Map<K, V> map) Returns an immutable empty map if the specified Map isnull
, otherwise itself is returned.static <K,
V> NavigableMap<K, V> nullToEmpty
(NavigableMap<K, V> map) Returns an immutable emptyNavigableMap
if the specified NavigableMap isnull
, otherwise itself is returned.static <T> NavigableSet<T>
nullToEmpty
(NavigableSet<T> set) Returns an immutable emptyNavigableSet
if the specified NavigableSet isnull
, otherwise itself is returned.static <T> Set<T>
nullToEmpty
(Set<T> set) Returns an immutable empty set if the specified Set isnull
, otherwise itself is returned.static <K,
V> SortedMap<K, V> nullToEmpty
(SortedMap<K, V> map) Returns an immutable emptySortedMap
if the specified SortedMap isnull
, otherwise itself is returned.static <T> SortedSet<T>
nullToEmpty
(SortedSet<T> set) Returns an immutable emptySortedSet
if the specified SortedSet isnull
, otherwise itself is returned.static <T> T[]
nullToEmpty
(T[] a, Class<T[]> arrayType) Null to empty.static String[]
nullToEmptyForEach
(String[] a) Converts the specified String array to an emptyString[0]
if it'snull
and eachnull
element String to empty String""
.occurrencesMap
(Iterable<? extends T> c) occurrencesMap
(Iterable<? extends T> c, Supplier<Map<T, Integer>> mapSupplier) occurrencesMap
(Iterator<? extends T> iter) occurrencesMap
(Iterator<? extends T> iter, Supplier<Map<T, Integer>> mapSupplier) occurrencesMap
(T[] a) occurrencesMap
(T[] a, Supplier<Map<T, Integer>> mapSupplier) static int
occurrencesOf
(boolean[] a, boolean valueToFind) static int
occurrencesOf
(byte[] a, byte valueToFind) static int
occurrencesOf
(char[] a, char valueToFind) static int
occurrencesOf
(double[] a, double valueToFind) static int
occurrencesOf
(float[] a, float valueToFind) static int
occurrencesOf
(int[] a, int valueToFind) static int
occurrencesOf
(long[] a, long valueToFind) static int
occurrencesOf
(short[] a, short valueToFind) static int
occurrencesOf
(Iterable<?> c, Object valueToFind) static int
occurrencesOf
(Object[] a, Object valueToFind) static int
occurrencesOf
(String str, char ch) static int
occurrencesOf
(String str, String substr) static int
occurrencesOf
(Iterator<?> iter, Object valueToFind) static <T> boolean
static <T> boolean
padRight
(Collection<T> c, int minSize, T objToAdd) static void
parallelSort
(byte[] a) static void
parallelSort
(byte[] a, int fromIndex, int toIndex) static void
parallelSort
(char[] a) static void
parallelSort
(char[] a, int fromIndex, int toIndex) static void
parallelSort
(double[] a) static void
parallelSort
(double[] a, int fromIndex, int toIndex) static void
parallelSort
(float[] a) static void
parallelSort
(float[] a, int fromIndex, int toIndex) static void
parallelSort
(int[] a) static void
parallelSort
(int[] a, int fromIndex, int toIndex) static void
parallelSort
(long[] a) static void
parallelSort
(long[] a, int fromIndex, int toIndex) static void
parallelSort
(short[] a) static void
parallelSort
(short[] a, int fromIndex, int toIndex) static <T extends Comparable<? super T>>
voidparallelSort
(List<? extends T> list) static <T extends Comparable<? super T>>
voidparallelSort
(List<? extends T> list, int fromIndex, int toIndex) static <T> void
parallelSort
(List<? extends T> list, int fromIndex, int toIndex, Comparator<? super T> cmp) static <T> void
parallelSort
(List<? extends T> list, Comparator<? super T> cmp) static <T extends Comparable<? super T>>
voidparallelSort
(T[] a) static <T extends Comparable<? super T>>
voidparallelSort
(T[] a, int fromIndex, int toIndex) static <T> void
parallelSort
(T[] a, int fromIndex, int toIndex, Comparator<? super T> cmp) static <T> void
parallelSort
(T[] a, Comparator<? super T> cmp) static <T,
U extends Comparable<? super U>>
voidparallelSortBy
(List<? extends T> list, Function<? super T, ? extends U> keyMapper) Parallel sort by.static <T,
U extends Comparable<? super U>>
voidparallelSortBy
(T[] a, Function<? super T, ? extends U> keyMapper) Parallel sort by.static <T> void
parallelSortByDouble
(List<? extends T> list, ToDoubleFunction<? super T> keyMapper) Parallel sort by double.static <T> void
parallelSortByDouble
(T[] a, ToDoubleFunction<? super T> keyMapper) Parallel sort by double.static <T> void
parallelSortByFloat
(List<? extends T> list, ToFloatFunction<? super T> keyMapper) Parallel sort by float.static <T> void
parallelSortByFloat
(T[] a, ToFloatFunction<? super T> keyMapper) Parallel sort by float.static <T> void
parallelSortByInt
(List<? extends T> list, ToIntFunction<? super T> keyMapper) Parallel sort by int.static <T> void
parallelSortByInt
(T[] a, ToIntFunction<? super T> keyMapper) Parallel sort by int.static <T> void
parallelSortByLong
(List<? extends T> list, ToLongFunction<? super T> keyMapper) Parallel sort by long.static <T> void
parallelSortByLong
(T[] a, ToLongFunction<? super T> keyMapper) Parallel sort by long.static Map<Percentage,
Byte> percentiles
(byte[] sortedArray) Returns the elements at:Percentage
* length of the specified array.static Map<Percentage,
Character> percentiles
(char[] sortedArray) Returns the elements at:Percentage
* length of the specified array.static Map<Percentage,
Double> percentiles
(double[] sortedArray) Returns the elements at:Percentage
* length of the specified array.static Map<Percentage,
Float> percentiles
(float[] sortedArray) Returns the elements at:Percentage
* length of the specified array.static Map<Percentage,
Integer> percentiles
(int[] sortedArray) Returns the elements at:Percentage
* length of the specified array.static Map<Percentage,
Long> percentiles
(long[] sortedArray) Returns the elements at:Percentage
* length of the specified array.static Map<Percentage,
Short> percentiles
(short[] sortedArray) Returns the elements at:Percentage
* length of the specified array.static <T> Map<Percentage,
T> percentiles
(List<T> sortedList) Returns the elements at:Percentage
* length of the specified array.static <T> Map<Percentage,
T> percentiles
(T[] sortedArray) Returns the elements at:Percentage
* length of the specified array.static <T> T
println
(T obj) static boolean
registerConverter
(Class<?> srcClass, BiFunction<?, Class<?>, ?> converter) static boolean[]
remove
(boolean[] a, boolean elementToRemove) Removes the first occurrence of the specified elementToRemove from the specified array.static byte[]
remove
(byte[] a, byte elementToRemove) Removes the first occurrence of the specified elementToRemove from the specified array.static char[]
remove
(char[] a, char elementToRemove) Removes the first occurrence of the specified elementToRemove from the specified array.static double[]
remove
(double[] a, double elementToRemove) Removes the first occurrence of the specified elementToRemove from the specified array.static float[]
remove
(float[] a, float elementToRemove) Removes the first occurrence of the specified elementToRemove from the specified array.static int[]
remove
(int[] a, int elementToRemove) Removes the first occurrence of the specified elementToRemove from the specified array.static long[]
remove
(long[] a, long elementToRemove) Removes the first occurrence of the specified elementToRemove from the specified array.static short[]
remove
(short[] a, short elementToRemove) Removes the first occurrence of the specified elementToRemove from the specified array.static String[]
static <T> boolean
remove
(Collection<T> c, T elementToRemove) Removes the first occurrence of the specified elementToRemove from the specified collection.static <T> T[]
remove
(T[] a, T elementToRemove) Removes the first occurrence of the specified elementToRemove from the specified array.static boolean[]
removeAll
(boolean[] a, boolean... elementsToRemove) Returns a new array with removes all the occurrences of specified elementsToRemove froma
.static byte[]
removeAll
(byte[] a, byte... elementsToRemove) Returns a new array with removes all the occurrences of specified elementsToRemove froma
.static char[]
removeAll
(char[] a, char... elementsToRemove) Returns a new array with removes all the occurrences of specified elementsToRemove froma
.static double[]
removeAll
(double[] a, double... elementsToRemove) Returns a new array with removes all the occurrences of specified elementsToRemove froma
.static float[]
removeAll
(float[] a, float... elementsToRemove) Returns a new array with removes all the occurrences of specified elementsToRemove froma
.static int[]
removeAll
(int[] a, int... elementsToRemove) Returns a new array with removes all the occurrences of specified elementsToRemove froma
.static long[]
removeAll
(long[] a, long... elementsToRemove) Returns a new array with removes all the occurrences of specified elementsToRemove froma
.static short[]
removeAll
(short[] a, short... elementsToRemove) Returns a new array with removes all the occurrences of specified elementsToRemove froma
.static String[]
Returns a new array with removes all the occurrences of specified elementsToRemove froma
.static <T> boolean
removeAll
(Collection<T> c, Collection<?> elementsToRemove) Removes the all.static <T> boolean
removeAll
(Collection<T> c, Iterator<?> elementsToRemove) static <T> boolean
removeAll
(Collection<T> c, T... elementsToRemove) Removes the all.static <T> T[]
removeAll
(T[] a, T... elementsToRemove) Returns a new array with removes all the occurrences of specified elementsToRemove froma
.static boolean[]
removeAllOccurrences
(boolean[] a, boolean elementToRemove) Removes all the occurrences of the specified elementToRemove from the specified array.static byte[]
removeAllOccurrences
(byte[] a, byte elementToRemove) Removes all the occurrences of the specified elementToRemove from the specified array.static char[]
removeAllOccurrences
(char[] a, char elementToRemove) Removes all the occurrences of the specified elementToRemove from the specified array.static double[]
removeAllOccurrences
(double[] a, double elementToRemove) Removes all the occurrences of the specified elementToRemove from the specified array.static float[]
removeAllOccurrences
(float[] a, float elementToRemove) Removes all the occurrences of the specified elementToRemove from the specified array.static int[]
removeAllOccurrences
(int[] a, int elementToRemove) Removes all the occurrences of the specified elementToRemove from the specified array.static long[]
removeAllOccurrences
(long[] a, long elementToRemove) Removes all the occurrences of the specified elementToRemove from the specified array.static short[]
removeAllOccurrences
(short[] a, short elementToRemove) Removes all the occurrences of the specified elementToRemove from the specified array.static String[]
removeAllOccurrences
(String[] a, String elementToRemove) static <T> boolean
removeAllOccurrences
(Collection<T> c, T elementToRemove) Removes the all occurrences.static <T> T[]
removeAllOccurrences
(T[] a, T elementToRemove) Removes all the occurrences of the specified elementToRemove from the specified array.static boolean[]
removeDuplicates
(boolean[] a) Removes the duplicates.static boolean[]
removeDuplicates
(boolean[] a, int fromIndex, int toIndex) Removes the duplicates.static byte[]
removeDuplicates
(byte[] a) Removes the duplicates.static byte[]
removeDuplicates
(byte[] a, boolean isSorted) Removes the duplicates.static byte[]
removeDuplicates
(byte[] a, int fromIndex, int toIndex, boolean isSorted) Removes the duplicates.static char[]
removeDuplicates
(char[] a) Removes the duplicates.static char[]
removeDuplicates
(char[] a, boolean isSorted) Removes the duplicates.static char[]
removeDuplicates
(char[] a, int fromIndex, int toIndex, boolean isSorted) Removes the duplicates.static double[]
removeDuplicates
(double[] a) Removes the duplicates.static double[]
removeDuplicates
(double[] a, boolean isSorted) Removes the duplicates.static double[]
removeDuplicates
(double[] a, int fromIndex, int toIndex, boolean isSorted) Removes the duplicates.static float[]
removeDuplicates
(float[] a) Removes the duplicates.static float[]
removeDuplicates
(float[] a, boolean isSorted) Removes the duplicates.static float[]
removeDuplicates
(float[] a, int fromIndex, int toIndex, boolean isSorted) Removes the duplicates.static int[]
removeDuplicates
(int[] a) Removes the duplicates.static int[]
removeDuplicates
(int[] a, boolean isSorted) Removes the duplicates.static int[]
removeDuplicates
(int[] a, int fromIndex, int toIndex, boolean isSorted) Removes the duplicates.static long[]
removeDuplicates
(long[] a) Removes the duplicates.static long[]
removeDuplicates
(long[] a, boolean isSorted) Removes the duplicates.static long[]
removeDuplicates
(long[] a, int fromIndex, int toIndex, boolean isSorted) Removes the duplicates.static short[]
removeDuplicates
(short[] a) Removes the duplicates.static short[]
removeDuplicates
(short[] a, boolean isSorted) Removes the duplicates.static short[]
removeDuplicates
(short[] a, int fromIndex, int toIndex, boolean isSorted) Removes the duplicates.static String[]
removeDuplicates
(String[] a) Removes the duplicates.static String[]
removeDuplicates
(String[] a, boolean isSorted) Removes the duplicates.static String[]
removeDuplicates
(String[] a, int fromIndex, int toIndex, boolean isSorted) Removes the duplicates.static boolean
removeDuplicates
(Collection<?> c) Removes the duplicates.static boolean
removeDuplicates
(Collection<?> c, boolean isSorted) Removes the duplicates.static <T> T[]
removeDuplicates
(T[] a) Removes all duplicates elementsstatic <T> T[]
removeDuplicates
(T[] a, boolean isSorted) Removes the duplicates.static <T> T[]
removeDuplicates
(T[] a, int fromIndex, int toIndex, boolean isSorted) Removes the duplicates.static <T> List<T>
repeat
(T value, int n) static <T> List<T>
repeatCollection
(Collection<T> c, int n) repeatAll(N.asList(1, 2, 3), 2) => [1, 2, 3, 1, 2, 3]
static <T> List<T>
repeatCollectionToSize
(Collection<? extends T> c, int size) repeatAllToSize(N.asList(1, 2, 3), 5) => [1, 2, 3, 1, 2]
static <T> List<T>
repeatElements
(Collection<? extends T> c, int n) Repeats the elements in the specified Collection one by one.static <T> List<T>
repeatElementsToSize
(Collection<T> c, int size) Repeats the elements in the specified Collection one by one till reach the specified size.static int
replaceAll
(boolean[] a, boolean oldVal, boolean newVal) static <E extends Exception>
voidreplaceAll
(boolean[] a, Throwables.BooleanUnaryOperator<E> operator) static int
replaceAll
(byte[] a, byte oldVal, byte newVal) static <E extends Exception>
voidreplaceAll
(byte[] a, Throwables.ByteUnaryOperator<E> operator) static int
replaceAll
(char[] a, char oldVal, char newVal) static <E extends Exception>
voidreplaceAll
(char[] a, Throwables.CharUnaryOperator<E> operator) static int
replaceAll
(double[] a, double oldVal, double newVal) static <E extends Exception>
voidreplaceAll
(double[] a, Throwables.DoubleUnaryOperator<E> operator) static int
replaceAll
(float[] a, float oldVal, float newVal) static <E extends Exception>
voidreplaceAll
(float[] a, Throwables.FloatUnaryOperator<E> operator) static int
replaceAll
(int[] a, int oldVal, int newVal) static <E extends Exception>
voidreplaceAll
(int[] a, Throwables.IntUnaryOperator<E> operator) static int
replaceAll
(long[] a, long oldVal, long newVal) static <E extends Exception>
voidreplaceAll
(long[] a, Throwables.LongUnaryOperator<E> operator) static int
replaceAll
(short[] a, short oldVal, short newVal) static <E extends Exception>
voidreplaceAll
(short[] a, Throwables.ShortUnaryOperator<E> operator) static <T,
E extends Exception>
voidreplaceAll
(List<T> list, Throwables.UnaryOperator<T, E> operator) static <T> int
replaceAll
(List<T> list, Object oldVal, T newVal) static <T,
E extends Exception>
voidreplaceAll
(T[] a, Throwables.UnaryOperator<T, E> operator) static <T> int
replaceAll
(T[] a, Object oldVal, T newVal) static <E extends Exception>
intreplaceIf
(boolean[] a, Throwables.BooleanPredicate<E> predicate, boolean newValue) static <E extends Exception>
intreplaceIf
(byte[] a, Throwables.BytePredicate<E> predicate, byte newValue) static <E extends Exception>
intreplaceIf
(char[] a, Throwables.CharPredicate<E> predicate, char newValue) static <E extends Exception>
intreplaceIf
(double[] a, Throwables.DoublePredicate<E> predicate, double newValue) static <E extends Exception>
intreplaceIf
(float[] a, Throwables.FloatPredicate<E> predicate, float newValue) static <E extends Exception>
intreplaceIf
(int[] a, Throwables.IntPredicate<E> predicate, int newValue) static <E extends Exception>
intreplaceIf
(long[] a, Throwables.LongPredicate<E> predicate, long newValue) static <E extends Exception>
intreplaceIf
(short[] a, Throwables.ShortPredicate<E> predicate, short newValue) static <T,
E extends Exception>
intreplaceIf
(List<T> c, Throwables.Predicate<? super T, E> predicate, T newValue) static <T,
E extends Exception>
intreplaceIf
(T[] a, Throwables.Predicate<? super T, E> predicate, T newValue) static boolean[]
replaceRange
(boolean[] a, int fromIndex, int toIndex, boolean[] replacement) Return a new array.static byte[]
replaceRange
(byte[] a, int fromIndex, int toIndex, byte[] replacement) Return a new array.static char[]
replaceRange
(char[] a, int fromIndex, int toIndex, char[] replacement) Return a new array.static double[]
replaceRange
(double[] a, int fromIndex, int toIndex, double[] replacement) Return a new array.static float[]
replaceRange
(float[] a, int fromIndex, int toIndex, float[] replacement) Return a new array.static int[]
replaceRange
(int[] a, int fromIndex, int toIndex, int[] replacement) Return a new array.static long[]
replaceRange
(long[] a, int fromIndex, int toIndex, long[] replacement) Return a new array.static short[]
replaceRange
(short[] a, int fromIndex, int toIndex, short[] replacement) Return a new array.static String[]
replaceRange
(String[] a, int fromIndex, int toIndex, String[] replacement) static String
replaceRange
(String str, int fromIndex, int toIndex, String replacement) Returns a new String.static <T> boolean
replaceRange
(List<T> c, int fromIndex, int toIndex, Collection<? extends T> replacement) static <T> T[]
replaceRange
(T[] a, int fromIndex, int toIndex, T[] replacement) Return a new array.static <T> boolean
retainAll
(Collection<T> c, Collection<? extends T> objsToKeep) static void
reverse
(boolean[] a) Reverses the order of the given array.static void
reverse
(boolean[] a, int fromIndex, int toIndex) Reverses the order of the given array in the given range.static void
reverse
(byte[] a) Reverses the order of the given array.static void
reverse
(byte[] a, int fromIndex, int toIndex) Reverses the order of the given array in the given range.static void
reverse
(char[] a) Reverses the order of the given array.static void
reverse
(char[] a, int fromIndex, int toIndex) Reverses the order of the given array in the given range.static void
reverse
(double[] a) Reverses the order of the given array.static void
reverse
(double[] a, int fromIndex, int toIndex) Reverses the order of the given array in the given range.static void
reverse
(float[] a) Reverses the order of the given array.static void
reverse
(float[] a, int fromIndex, int toIndex) Reverses the order of the given array in the given range.static void
reverse
(int[] a) Reverses the order of the given array.static void
reverse
(int[] a, int fromIndex, int toIndex) Reverses the order of the given array in the given range.static void
reverse
(long[] a) Reverses the order of the given array.static void
reverse
(long[] a, int fromIndex, int toIndex) Reverses the order of the given array in the given range.static void
reverse
(short[] a) Reverses the order of the given array.static void
reverse
(short[] a, int fromIndex, int toIndex) Reverses the order of the given array in the given range.static void
Reverses the order of the given array.static void
Reverses the order of the given array in the given range.static void
reverse
(Collection<?> c) static void
static void
static <T> Comparator<T>
reverseOrder
(Comparator<T> cmp) Add it becauseComparator.reversed()
doesn't work well in some scenarios.static void
reverseSort
(boolean[] a) static void
reverseSort
(byte[] a) static void
reverseSort
(byte[] a, int fromIndex, int toIndex) static void
reverseSort
(char[] a) static void
reverseSort
(char[] a, int fromIndex, int toIndex) static void
reverseSort
(double[] a) static void
reverseSort
(double[] a, int fromIndex, int toIndex) static void
reverseSort
(float[] a) static void
reverseSort
(float[] a, int fromIndex, int toIndex) static void
reverseSort
(int[] a) static void
reverseSort
(int[] a, int fromIndex, int toIndex) static void
reverseSort
(long[] a) static void
reverseSort
(long[] a, int fromIndex, int toIndex) static void
reverseSort
(short[] a) static void
reverseSort
(short[] a, int fromIndex, int toIndex) static void
reverseSort
(Object[] a) static void
reverseSort
(Object[] a, int fromIndex, int toIndex) static <T extends Comparable<? super T>>
voidreverseSort
(List<? extends T> list) static <T extends Comparable<? super T>>
voidreverseSort
(List<? extends T> list, int fromIndex, int toIndex) static <T,
U extends Comparable<? super U>>
voidreverseSortBy
(List<? extends T> list, Function<? super T, ? extends U> keyMapper) Reverse sort by.static <T,
U extends Comparable<? super U>>
voidreverseSortBy
(T[] a, Function<? super T, ? extends U> keyMapper) Reverse sort by.static void
rotate
(boolean[] a, int distance) static void
rotate
(byte[] a, int distance) static void
rotate
(char[] a, int distance) static void
rotate
(double[] a, int distance) static void
rotate
(float[] a, int distance) static void
rotate
(int[] a, int distance) static void
rotate
(long[] a, int distance) static void
rotate
(short[] a, int distance) static void
static void
rotate
(Collection<?> c, int distance) static void
static <T,
E extends Exception>
voidrunByBatch
(Iterable<? extends T> iter, int batchSize, Throwables.Consumer<? super List<? extends T>, E> batchAction) runByBatch
(Iterable<? extends T> iter, int batchSize, Throwables.Consumer<? super T, E> elementConsumer, Throwables.Runnable<E2> batchAction) static <T,
E extends Exception>
voidrunByBatch
(Iterator<? extends T> iter, int batchSize, Throwables.Consumer<? super List<? extends T>, E> batchAction) runByBatch
(Iterator<? extends T> iter, int batchSize, Throwables.Consumer<? super T, E> elementConsumer, Throwables.Runnable<E2> batchAction) static <T,
E extends Exception>
voidrunByBatch
(T[] a, int batchSize, Throwables.Consumer<? super List<? extends T>, E> batchAction) runByBatch
(T[] a, int batchSize, Throwables.Consumer<? super T, E> elementConsumer, Throwables.Runnable<E2> batchAction) static void
runInParallel
(Throwables.Runnable<? extends Exception> command, Throwables.Runnable<? extends Exception> command2) Executes and complete the input commands in parallel.static void
runInParallel
(Throwables.Runnable<? extends Exception> command, Throwables.Runnable<? extends Exception> command2, Throwables.Runnable<? extends Exception> command3) Executes and complete the input commands in parallel.static void
runInParallel
(Throwables.Runnable<? extends Exception> command, Throwables.Runnable<? extends Exception> command2, Throwables.Runnable<? extends Exception> command3, Throwables.Runnable<? extends Exception> command4) Executes and complete the input commands in parallel.static void
runInParallel
(Throwables.Runnable<? extends Exception> command, Throwables.Runnable<? extends Exception> command2, Throwables.Runnable<? extends Exception> command3, Throwables.Runnable<? extends Exception> command4, Throwables.Runnable<? extends Exception> command5) Executes and complete the input commands in parallel.static void
runInParallel
(Collection<? extends Throwables.Runnable<? extends Exception>> commands) Executes and complete the input commands in parallel.static void
runInParallel
(Collection<? extends Throwables.Runnable<? extends Exception>> commands, Executor executor) Executes and complete the input commands in parallel.static void
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.static void
runUninterruptibly
(long timeout, TimeUnit unit, Throwables.BiConsumer<Long, TimeUnit, InterruptedException> cmd) Note: Copied from Google Guava under Apache License v2.0
If a thread is interrupted during such a call, the call continues to block until the result is available or the timeout elapses, and only then re-interrupts the thread.static void
Note: Copied from Google Guava under Apache License v2.0
If a thread is interrupted during such a call, the call continues to block until the result is available or the timeout elapses, and only then re-interrupts the thread.static void
shuffle
(boolean[] a) static void
static void
shuffle
(byte[] a) static void
static void
shuffle
(char[] a) static void
static void
shuffle
(double[] a) static void
static void
shuffle
(float[] a) static void
static void
shuffle
(int[] a) static void
static void
shuffle
(long[] a) static void
static void
shuffle
(short[] a) static void
static void
shuffle
(Collection<?> c) static void
shuffle
(Collection<?> c, Random rnd) static void
static void
static <T> void
shuffle
(T[] a) static <T> void
static int
Returns the length/size of the specifiedArray/Collection/Map
, or0
if it's empty ornull
.static int
size
(Collection<?> c) Returns the length/size of the specifiedArray/Collection/Map
, or0
if it's empty ornull
.static int
Returns the length/size of the specifiedArray/Collection/Map
, or0
if it's empty ornull
.static <T> List<T>
skipRange
(Collection<? extends T> c, int startInclusive, int endExclusive) static <T,
C extends Collection<T>>
CskipRange
(Collection<? extends T> c, int startInclusive, int endExclusive, IntFunction<C> supplier) skipUntil
(Iterable<? extends T> c, Throwables.Predicate<? super T, E> filter) skipUntil
(T[] a, Throwables.Predicate<? super T, E> filter) static void
sleep
(long timeoutInMillis) static void
static void
sleepUninterruptibly
(long timeoutInMillis) Note: Copied from Google Guava under Apache License v2.0
If a thread is interrupted during such a call, the call continues to block until the result is available or the timeout elapses, and only then re-interrupts the thread.static void
sleepUninterruptibly
(long timeout, TimeUnit unit) Note: Copied from Google Guava under Apache License v2.0
If a thread is interrupted during such a call, the call continues to block until the result is available or the timeout elapses, and only then re-interrupts the thread.static <T> ImmutableCollection<T>
slice
(Collection<? extends T> c, int fromIndex, int toIndex) Returns a read-onlyImmutableCollection
.static <T> ObjIterator<T>
static <T> ImmutableList<T>
Returns a read-onlyImmutableCollection
.static <T> ImmutableList<T>
slice
(T[] a, int fromIndex, int toIndex) Returns a read-onlySeq
.static void
sort
(boolean[] a) static void
sort
(byte[] a) static void
sort
(byte[] a, int fromIndex, int toIndex) static void
sort
(char[] a) static void
sort
(char[] a, int fromIndex, int toIndex) static void
sort
(double[] a) static void
sort
(double[] a, int fromIndex, int toIndex) static void
sort
(float[] a) static void
sort
(float[] a, int fromIndex, int toIndex) static void
sort
(int[] a) static void
sort
(int[] a, int fromIndex, int toIndex) static void
sort
(long[] a) static void
sort
(long[] a, int fromIndex, int toIndex) static void
sort
(short[] a) static void
sort
(short[] a, int fromIndex, int toIndex) static void
static void
static <T extends Comparable<? super T>>
voidstatic <T extends Comparable<? super T>>
voidstatic <T> void
sort
(List<? extends T> list, int fromIndex, int toIndex, Comparator<? super T> cmp) static <T> void
sort
(List<? extends T> list, Comparator<? super T> cmp) static <T> void
sort
(T[] a, int fromIndex, int toIndex, Comparator<? super T> cmp) static <T> void
sort
(T[] a, Comparator<? super T> cmp) static <T,
U extends Comparable<? super U>>
voidstatic <T,
U extends Comparable<? super U>>
voidstatic <T> void
sortByDouble
(List<? extends T> list, ToDoubleFunction<? super T> keyMapper) Sort by double.static <T> void
sortByDouble
(T[] a, ToDoubleFunction<? super T> keyMapper) Sort by double.static <T> void
sortByFloat
(List<? extends T> list, ToFloatFunction<? super T> keyMapper) Sort by float.static <T> void
sortByFloat
(T[] a, ToFloatFunction<? super T> keyMapper) Sort by float.static <T> void
sortByInt
(List<? extends T> list, ToIntFunction<? super T> keyMapper) Sort by int.static <T> void
sortByInt
(T[] a, ToIntFunction<? super T> keyMapper) Sort by int.static <T> void
sortByLong
(List<? extends T> list, ToLongFunction<? super T> keyMapper) Sort by long.static <T> void
sortByLong
(T[] a, ToLongFunction<? super T> keyMapper) Sort by long.static List<boolean[]>
split
(boolean[] a, int chunkSize) 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 isnull
or empty.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 isnull
or empty.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 isnull
or empty.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 isnull
or empty.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 isnull
or empty.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 isnull
or empty.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 isnull
or empty.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 isnull
or empty.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 isnull
or empty.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 isnull
or empty.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 isnull
or empty.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 isnull
or empty.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 isnull
or empty.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 isnull
or empty.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 isnull
or empty.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 isnull
or empty.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 isnull
or empty.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 isnull
or empty.Returns consecutive sub lists of a collection, each of the same chunkSize (the final list may be smaller).split
(Collection<? extends T> c, int chunkSize) 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).static <T> ObjIterator<List<T>>
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 isnull
or empty.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 isnull
or empty.static <T> Stream<T>
splitByCount
(int maxCount, int totalSize, boolean sizeSmallerFirst, IntBiFunction<? extends T> func) final int[] a = Array.rangeClosed(1, 7); splitByCount(5, 7, true, (fromIndex, toIndex) -> copyOfRange(a, fromIndex, toIndex)).forEach(Fn.println()); // [[1], [2], [3], [4, 5], [6, 7]] splitByCount(5, 7, false, (fromIndex, toIndex) -> copyOfRange(a, fromIndex, toIndex)).forEach(Fn.println()); // [[1, 2], [3, 4], [5], [6], [7]]
static <T> CheckedStream<T,
IOException> streamJSON
(Class<? extends T> elementClass, File source) static <T> CheckedStream<T,
IOException> streamJSON
(Class<? extends T> elementClass, File source, JSONDeserializationConfig config) static <T> CheckedStream<T,
IOException> streamJSON
(Class<? extends T> elementClass, InputStream source) static <T> CheckedStream<T,
IOException> streamJSON
(Class<? extends T> elementClass, InputStream source, boolean closeInputStreamWhenStreamIsClosed) static <T> CheckedStream<T,
IOException> streamJSON
(Class<? extends T> elementClass, InputStream source, boolean closeInputStreamWhenStreamIsClosed, JSONDeserializationConfig config) static <T> CheckedStream<T,
IOException> streamJSON
(Class<? extends T> elementClass, Reader source) static <T> CheckedStream<T,
IOException> streamJSON
(Class<? extends T> elementClass, Reader source, boolean closeReaderWhenStreamIsClosed) static <T> CheckedStream<T,
IOException> streamJSON
(Class<? extends T> elementClass, Reader source, boolean closeReaderWhenStreamIsClosed, JSONDeserializationConfig config) static <T> CheckedStream<T,
IOException> streamJSON
(Class<? extends T> elementClass, String source) static <T> CheckedStream<T,
IOException> streamJSON
(Class<? extends T> elementClass, String source, JSONDeserializationConfig config) static String
stringOf
(boolean val) static String
stringOf
(byte val) static String
stringOf
(char val) static String
stringOf
(double val) static String
stringOf
(float val) static String
stringOf
(int val) static String
stringOf
(long val) static String
stringOf
(short val) static String
static int
sum
(byte... a) static int
sum
(byte[] a, int fromIndex, int toIndex) static int
sum
(char... a) static int
sum
(char[] a, int fromIndex, int toIndex) static double
sum
(double... a) static double
sum
(double[] a, int fromIndex, int toIndex) static float
sum
(float... a) static float
sum
(float[] a, int fromIndex, int toIndex) static int
sum
(int... a) static int
sum
(int[] a, int fromIndex, int toIndex) static long
sum
(long... a) static long
sum
(long[] a, int fromIndex, int toIndex) static int
sum
(short... a) static int
sum
(short[] a, int fromIndex, int toIndex) static BigDecimal
sumBigDecimal
(Iterable<? extends BigDecimal> c) static <T,
E extends Exception>
BigDecimalsumBigDecimal
(Iterable<? extends T> c, Throwables.Function<? super T, BigDecimal, E> func) static BigInteger
sumBigInteger
(Iterable<? extends BigInteger> c) static <T,
E extends Exception>
BigIntegersumBigInteger
(Iterable<? extends T> c, Throwables.Function<? super T, BigInteger, E> func) static <T extends Number>
doublestatic <T,
E extends Exception>
doublesumDouble
(Iterable<? extends T> c, Throwables.ToDoubleFunction<? super T, E> func) static <T extends Number>
doublesumDouble
(Collection<? extends T> c, int fromIndex, int toIndex) static <T,
E extends Exception>
doublesumDouble
(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.ToDoubleFunction<? super T, E> func) static <T extends Number>
doublesumDouble
(T[] a) static <T extends Number>
doublesumDouble
(T[] a, int fromIndex, int toIndex) static <T,
E extends Exception>
doublesumDouble
(T[] a, int fromIndex, int toIndex, Throwables.ToDoubleFunction<? super T, E> func) static <T,
E extends Exception>
doublesumDouble
(T[] a, Throwables.ToDoubleFunction<? super T, E> func) static <T extends Number>
intstatic <T,
E extends Exception>
intsumInt
(Iterable<? extends T> c, Throwables.ToIntFunction<? super T, E> func) static <T extends Number>
intsumInt
(Collection<? extends T> c, int fromIndex, int toIndex) static <T,
E extends Exception>
intsumInt
(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.ToIntFunction<? super T, E> func) static <T extends Number>
intsumInt
(T[] a) static <T extends Number>
intsumInt
(T[] a, int fromIndex, int toIndex) static <T,
E extends Exception>
intsumInt
(T[] a, int fromIndex, int toIndex, Throwables.ToIntFunction<? super T, E> func) static <T,
E extends Exception>
intsumInt
(T[] a, Throwables.ToIntFunction<? super T, E> func) static <T extends Number>
longsumIntToLong
(Iterable<? extends T> c) static <T,
E extends Exception>
longsumIntToLong
(Iterable<? extends T> c, Throwables.ToIntFunction<? super T, E> func) static <T extends Number>
longstatic <T,
E extends Exception>
longsumLong
(Iterable<? extends T> c, Throwables.ToLongFunction<? super T, E> func) static <T extends Number>
longsumLong
(Collection<? extends T> c, int fromIndex, int toIndex) static <T,
E extends Exception>
longsumLong
(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.ToLongFunction<? super T, E> func) static <T extends Number>
longsumLong
(T[] a) static <T extends Number>
longsumLong
(T[] a, int fromIndex, int toIndex) static <T,
E extends Exception>
longsumLong
(T[] a, int fromIndex, int toIndex, Throwables.ToLongFunction<? super T, E> func) static <T,
E extends Exception>
longsumLong
(T[] a, Throwables.ToLongFunction<? super T, E> func) static long
sumToLong
(int... a) static long
sumToLong
(int[] a, int fromIndex, int toIndex) static void
swap
(boolean[] a, int i, int j) static void
swap
(byte[] a, int i, int j) static void
swap
(char[] a, int i, int j) static void
swap
(double[] a, int i, int j) static void
swap
(float[] a, int i, int j) static void
swap
(int[] a, int i, int j) static void
swap
(long[] a, int i, int j) static void
swap
(short[] a, int i, int j) static <T> void
static <T,
M> void static void
static void
static <T,
E extends Exception>
booleanswapIf
(Pair<T, T> pair, Throwables.Predicate<? super Pair<T, T>, E> predicate) static <T,
M, E extends Exception>
booleanswapIf
(Triple<T, M, T> triple, Throwables.Predicate<? super Triple<T, M, T>, E> predicate) static boolean[]
symmetricDifference
(boolean[] a, boolean[] b) static byte[]
symmetricDifference
(byte[] a, byte[] b) static char[]
symmetricDifference
(char[] a, char[] b) static double[]
symmetricDifference
(double[] a, double[] b) static float[]
symmetricDifference
(float[] a, float[] b) 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].static long[]
symmetricDifference
(long[] a, long[] b) static short[]
symmetricDifference
(short[] a, short[] b) static <T> List<T>
symmetricDifference
(Collection<? extends T> a, Collection<? extends T> b) static <T> List<T>
symmetricDifference
(T[] a, T[] b) static <T> Set<T>
symmetricDifferentSet
(Collection<? extends T> a, Collection<? extends T> b) Symmetric different set.takeWhile
(Iterable<? extends T> c, Throwables.Predicate<? super T, E> filter) takeWhile
(T[] a, Throwables.Predicate<? super T, E> filter) takeWhileInclusive
(Iterable<? extends T> c, Throwables.Predicate<? super T, E> filter) Take while inclusive.takeWhileInclusive
(T[] a, Throwables.Predicate<? super T, E> filter) Take while inclusive.static Object[]
toArray
(Collection<?> c) Returns an empty array if the specified collection is null or empty.static Object[]
toArray
(Collection<?> c, int fromIndex, int toIndex) static <A,
T extends A>
A[]toArray
(Collection<? extends T> c, int fromIndex, int toIndex, A[] a) static <A,
T extends A>
A[]toArray
(Collection<? extends T> c, int fromIndex, int toIndex, Class<A[]> targetClass) static <A,
T extends A>
A[]toArray
(Collection<? extends T> c, int fromIndex, int toIndex, IntFunction<A[]> arraySupplier) static <A,
T extends A>
A[]toArray
(Collection<? extends T> c, A[] a) static <A,
T extends A>
A[]toArray
(Collection<? extends T> c, Class<A[]> targetClass) static <A,
T extends A>
A[]toArray
(Collection<? extends T> c, IntFunction<A[]> arraySupplier) static boolean[]
toBooleanArray
(byte[] a) static boolean[]
To boolean array.static boolean[]
toBooleanArray
(Collection<Boolean> c, boolean defaultForNull) To boolean array.static boolean[]
toBooleanArray
(Collection<Boolean> c, int fromIndex, int toIndex) To boolean array.static boolean[]
toBooleanArray
(Collection<Boolean> c, int fromIndex, int toIndex, boolean defaultForNull) To boolean array.static byte[]
toByteArray
(boolean[] a) static byte[]
toByteArray
(Collection<? extends Number> c) To byte array.static byte[]
toByteArray
(Collection<? extends Number> c, byte defaultForNull) To byte array.static byte[]
toByteArray
(Collection<? extends Number> c, int fromIndex, int toIndex) To byte array.static byte[]
toByteArray
(Collection<? extends Number> c, int fromIndex, int toIndex, byte defaultForNull) To byte array.static char[]
To char array.static char[]
toCharArray
(Collection<Character> c, char defaultForNull) To char array.static char[]
toCharArray
(Collection<Character> c, int fromIndex, int toIndex) To char array.static char[]
toCharArray
(Collection<Character> c, int fromIndex, int toIndex, char defaultForNull) To char array.static <C extends Collection<Boolean>>
CtoCollection
(boolean[] a, int fromIndex, int toIndex, IntFunction<? extends C> supplier) static <C extends Collection<Boolean>>
CtoCollection
(boolean[] a, IntFunction<? extends C> supplier) static <C extends Collection<Byte>>
CtoCollection
(byte[] a, int fromIndex, int toIndex, IntFunction<? extends C> supplier) static <C extends Collection<Byte>>
CtoCollection
(byte[] a, IntFunction<? extends C> supplier) static <C extends Collection<Character>>
CtoCollection
(char[] a, int fromIndex, int toIndex, IntFunction<? extends C> supplier) static <C extends Collection<Character>>
CtoCollection
(char[] a, IntFunction<? extends C> supplier) static <C extends Collection<Double>>
CtoCollection
(double[] a, int fromIndex, int toIndex, IntFunction<? extends C> supplier) static <C extends Collection<Double>>
CtoCollection
(double[] a, IntFunction<? extends C> supplier) static <C extends Collection<Float>>
CtoCollection
(float[] a, int fromIndex, int toIndex, IntFunction<? extends C> supplier) static <C extends Collection<Float>>
CtoCollection
(float[] a, IntFunction<? extends C> supplier) static <C extends Collection<Integer>>
CtoCollection
(int[] a, int fromIndex, int toIndex, IntFunction<? extends C> supplier) static <C extends Collection<Integer>>
CtoCollection
(int[] a, IntFunction<? extends C> supplier) static <C extends Collection<Long>>
CtoCollection
(long[] a, int fromIndex, int toIndex, IntFunction<? extends C> supplier) static <C extends Collection<Long>>
CtoCollection
(long[] a, IntFunction<? extends C> supplier) static <C extends Collection<Short>>
CtoCollection
(short[] a, int fromIndex, int toIndex, IntFunction<? extends C> supplier) static <C extends Collection<Short>>
CtoCollection
(short[] a, IntFunction<? extends C> supplier) static <T,
C extends Collection<T>>
CtoCollection
(Iterable<? extends T> iter, Supplier<? extends C> supplier) static <T,
C extends Collection<T>>
CtoCollection
(Iterator<? extends T> iter, Supplier<? extends C> supplier) static <T,
C extends Collection<T>>
CtoCollection
(T[] a, int fromIndex, int toIndex, IntFunction<? extends C> supplier) static <T,
C extends Collection<T>>
CtoCollection
(T[] a, IntFunction<? extends C> supplier) static double[]
toDoubleArray
(Collection<? extends Number> c) To double array.static double[]
toDoubleArray
(Collection<? extends Number> c, double defaultForNull) To double array.static double[]
toDoubleArray
(Collection<? extends Number> c, int fromIndex, int toIndex) To double array.static double[]
toDoubleArray
(Collection<? extends Number> c, int fromIndex, int toIndex, double defaultForNull) To double array.static float[]
toFloatArray
(Collection<? extends Number> c) To float array.static float[]
toFloatArray
(Collection<? extends Number> c, float defaultForNull) To float array.static float[]
toFloatArray
(Collection<? extends Number> c, int fromIndex, int toIndex) To float array.static float[]
toFloatArray
(Collection<? extends Number> c, int fromIndex, int toIndex, float defaultForNull) To float array.static int[]
toIntArray
(char[] a) static int[]
toIntArray
(Collection<? extends Number> c) To int array.static int[]
toIntArray
(Collection<? extends Number> c, int defaultForNull) To int array.static int[]
toIntArray
(Collection<? extends Number> c, int fromIndex, int toIndex) To int array.static int[]
toIntArray
(Collection<? extends Number> c, int fromIndex, int toIndex, int defaultForNull) To int array.static void
static void
toJSON
(File file, Object obj, JSONSerializationConfig config) static void
toJSON
(OutputStream os, Object obj) static void
toJSON
(OutputStream os, Object obj, JSONSerializationConfig config) static void
static void
toJSON
(Writer writer, Object obj, JSONSerializationConfig config) static String
static String
static String
toJSON
(Object obj, JSONSerializationConfig config) toList
(boolean[] a) toList
(boolean[] a, int fromIndex, int toIndex) toList
(byte[] a) toList
(byte[] a, int fromIndex, int toIndex) toList
(char[] a) toList
(char[] a, int fromIndex, int toIndex) toList
(double[] a) toList
(double[] a, int fromIndex, int toIndex) toList
(float[] a) toList
(float[] a, int fromIndex, int toIndex) toList
(int[] a) toList
(int[] a, int fromIndex, int toIndex) toList
(long[] a) toList
(long[] a, int fromIndex, int toIndex) toList
(short[] a) toList
(short[] a, int fromIndex, int toIndex) static <T> List<T>
static <T> List<T>
toList
(T[] a) static <T> List<T>
toList
(T[] a, int fromIndex, int toIndex) static long[]
toLongArray
(Collection<? extends Number> c) To long array.static long[]
toLongArray
(Collection<? extends Number> c, int fromIndex, int toIndex) To long array.static long[]
toLongArray
(Collection<? extends Number> c, int fromIndex, int toIndex, long defaultForNull) To long array.static long[]
toLongArray
(Collection<? extends Number> c, long defaultForNull) To long array.static double[]
top
(double[] a, int n) static double[]
top
(double[] a, int fromIndex, int toIndex, int n) static double[]
top
(double[] a, int fromIndex, int toIndex, int n, Comparator<? super Double> cmp) static double[]
top
(double[] a, int n, Comparator<? super Double> cmp) static float[]
top
(float[] a, int n) static float[]
top
(float[] a, int fromIndex, int toIndex, int n) static float[]
top
(float[] a, int fromIndex, int toIndex, int n, Comparator<? super Float> cmp) static float[]
top
(float[] a, int n, Comparator<? super Float> cmp) static int[]
top
(int[] a, int n) static int[]
top
(int[] a, int fromIndex, int toIndex, int n) static int[]
top
(int[] a, int fromIndex, int toIndex, int n, Comparator<? super Integer> cmp) static int[]
top
(int[] a, int n, Comparator<? super Integer> cmp) static long[]
top
(long[] a, int n) static long[]
top
(long[] a, int fromIndex, int toIndex, int n) static long[]
top
(long[] a, int fromIndex, int toIndex, int n, Comparator<? super Long> cmp) static long[]
top
(long[] a, int n, Comparator<? super Long> cmp) static short[]
top
(short[] a, int n) static short[]
top
(short[] a, int fromIndex, int toIndex, int n) static short[]
top
(short[] a, int fromIndex, int toIndex, int n, Comparator<? super Short> cmp) static short[]
top
(short[] a, int n, Comparator<? super Short> cmp) static <T extends Comparable<? super T>>
List<T>top
(Collection<? extends T> c, int n) static <T extends Comparable<? super T>>
List<T>top
(Collection<? extends T> c, int n, boolean keepEncounterOrder) static <T extends Comparable<? super T>>
List<T>top
(Collection<? extends T> c, int fromIndex, int toIndex, int n) static <T extends Comparable<? super T>>
List<T>top
(Collection<? extends T> c, int fromIndex, int toIndex, int n, boolean keepEncounterOrder) static <T> List<T>
top
(Collection<? extends T> c, int fromIndex, int toIndex, int n, Comparator<? super T> cmp) static <T> List<T>
top
(Collection<? extends T> c, int fromIndex, int toIndex, int n, Comparator<? super T> cmp, boolean keepEncounterOrder) static <T> List<T>
top
(Collection<? extends T> c, int n, Comparator<? super T> cmp) static <T> List<T>
top
(Collection<? extends T> c, int n, Comparator<? super T> cmp, boolean keepEncounterOrder) static <T extends Comparable<? super T>>
List<T>top
(T[] a, int n) static <T extends Comparable<? super T>>
List<T>top
(T[] a, int n, boolean keepEncounterOrder) static <T extends Comparable<? super T>>
List<T>top
(T[] a, int fromIndex, int toIndex, int n) static <T extends Comparable<? super T>>
List<T>top
(T[] a, int fromIndex, int toIndex, int n, boolean keepEncounterOrder) static <T> List<T>
top
(T[] a, int fromIndex, int toIndex, int n, Comparator<? super T> cmp) static <T> List<T>
top
(T[] a, int fromIndex, int toIndex, int n, Comparator<? super T> cmp, boolean keepEncounterOrder) static <T> List<T>
top
(T[] a, int n, Comparator<? super T> cmp) static <T> List<T>
top
(T[] a, int n, Comparator<? super T> cmp, boolean keepEncounterOrder) static RuntimeException
static RuntimeException
Converts the specifiedThrowable
to aRuntimeException
if it's a checkedexception
or anError
, otherwise returns itself.static RuntimeException
toRuntimeException
(Throwable e, boolean throwIfItIsError) Converts the specifiedThrowable
to aRuntimeException
if it's a checkedexception
, or throw it if it's anError
.toSet
(boolean[] a) toSet
(boolean[] a, int fromIndex, int toIndex) toSet
(byte[] a) toSet
(byte[] a, int fromIndex, int toIndex) toSet
(char[] a) toSet
(char[] a, int fromIndex, int toIndex) toSet
(double[] a) toSet
(double[] a, int fromIndex, int toIndex) toSet
(float[] a) toSet
(float[] a, int fromIndex, int toIndex) toSet
(int[] a) toSet
(int[] a, int fromIndex, int toIndex) toSet
(long[] a) toSet
(long[] a, int fromIndex, int toIndex) toSet
(short[] a) toSet
(short[] a, int fromIndex, int toIndex) static <T> Set<T>
static <T> Set<T>
toSet
(T[] a) static <T> Set<T>
toSet
(T[] a, int fromIndex, int toIndex) static short[]
toShortArray
(Collection<? extends Number> c) To short array.static short[]
toShortArray
(Collection<? extends Number> c, int fromIndex, int toIndex) To short array.static short[]
toShortArray
(Collection<? extends Number> c, int fromIndex, int toIndex, short defaultForNull) To short array.static short[]
toShortArray
(Collection<? extends Number> c, short defaultForNull) To short array.static String
toString
(boolean value) static String
toString
(boolean[] a) static String
toString
(boolean[] a, int fromIndex, int toIndex) static String
toString
(byte value) static String
toString
(byte[] a) static String
toString
(byte[] a, int fromIndex, int toIndex) static String
toString
(char value) static String
toString
(char[] a) static String
toString
(char[] a, int fromIndex, int toIndex) static String
toString
(double value) static String
toString
(double[] a) static String
toString
(double[] a, int fromIndex, int toIndex) static String
toString
(float value) static String
toString
(float[] a) static String
toString
(float[] a, int fromIndex, int toIndex) static String
toString
(int value) static String
toString
(int[] a) static String
toString
(int[] a, int fromIndex, int toIndex) static String
toString
(long value) static String
toString
(long[] a) static String
toString
(long[] a, int fromIndex, int toIndex) static String
toString
(short value) static String
toString
(short[] a) static String
toString
(short[] a, int fromIndex, int toIndex) static String
static String
static String
static String
static void
static void
toXML
(File file, Object obj, XMLSerializationConfig config) static void
toXML
(OutputStream os, Object obj) static void
toXML
(OutputStream os, Object obj, XMLSerializationConfig config) static void
static void
toXML
(Writer writer, Object obj, XMLSerializationConfig config) static String
static String
static String
toXML
(Object obj, XMLSerializationConfig config) static <R> R
tryOrDefaultIfExceptionOccurred
(Callable<R> cmd, Supplier<R> supplierForDefaultIfExceptionOccurred) Returns the value returned byaction
or{@code supplierForDefaultIfExceptionOccurred}
if exception happens.static <R> R
tryOrDefaultIfExceptionOccurred
(Callable<R> cmd, R defaultIfExceptionOccurred) Returns the value returned byaction
ordefaultIfExceptionOccurred
if exception happens.static <T,
R> R tryOrDefaultIfExceptionOccurred
(T init, Throwables.Function<? super T, ? extends R, ? extends Exception> func, Supplier<R> supplierForDefaultIfExceptionOccurred) Returns the value returned byaction
ordefaultIfExceptionOccurred
if exception happens.static <T,
R> R tryOrDefaultIfExceptionOccurred
(T init, Throwables.Function<? super T, ? extends R, ? extends Exception> func, R defaultIfExceptionOccurred) Returns the value returned byaction
ordefaultIfExceptionOccurred
if exception happens.static <R> u.Nullable<R>
Returns aNullable
with the value returned byaction
or an emptyNullable
if exception happens.static <T,
R> u.Nullable<R> tryOrEmptyIfExceptionOccurred
(T init, Throwables.Function<? super T, ? extends R, ? extends Exception> func) Returns aNullable
with the value returned byfunc.apply(init)
or an emptyNullable
if exception happens.static <T> com.landawn.abacus.type.Type<T>
static <T> com.landawn.abacus.type.Type<T>
static <T> Collection<T>
unmodifiableCollection
(Collection<? extends T> c) Returns anunmodifiable view
of the specifiedCollection
.static <T> List<T>
unmodifiableList
(List<? extends T> list) Returns anunmodifiable view
of the specifiedList
.static <K,
V> Map<K, V> unmodifiableMap
(Map<? extends K, ? extends V> m) Returns anunmodifiable view
of the specifiedMap
.static <K,
V> NavigableMap<K, V> unmodifiableNavigableMap
(NavigableMap<K, ? extends V> m) Returns anunmodifiable view
of the specifiedNavigableMap
.static <T> NavigableSet<T>
Returns anunmodifiable view
of the specifiedNavigableSet
.static <T> Set<T>
unmodifiableSet
(Set<? extends T> s) Returns anunmodifiable view
of the specifiedSet
.static <K,
V> SortedMap<K, V> unmodifiableSortedMap
(SortedMap<K, ? extends V> m) Returns anunmodifiable view
of the specifiedSortedMap
.static <T> SortedSet<T>
Returns anunmodifiable view
of the specifiedSortedSet
.static Class<?>
Returns the corresponding primitive type oftype
if it is a wrapper type; otherwise returnstype
itself.unzip
(Iterable<? extends T> c, Throwables.BiConsumer<? super T, Pair<A, B>, E> unzip) 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) unzipp
(Iterable<? extends T> c, Throwables.BiConsumer<? super T, Triple<A, B, C>, E> unzip) 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) static void
Deprecated.usereplaceAll
static void
Deprecated.usereplaceIf
static <T> T
static Class<?>
Returns the corresponding wrapper type oftype
if it is a primitive type; otherwise returnstype
itself.static String
Xml 2 JSO.static String
Xml 2 JSO.zip
(A[] a, B[] b, A valueForNoneA, B valueForNoneB, Throwables.BiFunction<? super A, ? super B, ? extends R, E> zipFunction) zip
(A[] a, B[] b, C[] c, A valueForNoneA, B valueForNoneB, C valueForNoneC, Throwables.TriFunction<? super A, ? super B, ? super C, ? extends R, E> zipFunction) zip
(A[] a, B[] b, C[] c, Throwables.TriFunction<? super A, ? super B, ? super C, ? extends R, E> zipFunction) zip
(A[] a, B[] b, Throwables.BiFunction<? super A, ? super B, ? extends R, E> zipFunction) 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, ? extends R, E> zipFunction) 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, ? extends R, E> zipFunction) 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, ? extends R, E> zipFunction) static <A,
B, R, E extends Exception>
R[]zip
(Class<R> targetElementType, A[] a, B[] b, Throwables.BiFunction<? super A, ? super B, ? extends R, E> zipFunction) zip
(Iterable<A> a, Iterable<B> b, A valueForNoneA, B valueForNoneB, Throwables.BiFunction<? super A, ? super B, ? extends R, E> zipFunction) zip
(Iterable<A> a, Iterable<B> b, Throwables.BiFunction<? super A, ? super B, ? extends R, E> zipFunction) zip
(Iterable<A> a, Iterable<B> b, Iterable<C> c, A valueForNoneA, B valueForNoneB, C valueForNoneC, Throwables.TriFunction<? super A, ? super B, ? super C, ? extends R, E> zipFunction) zip
(Iterable<A> a, Iterable<B> b, Iterable<C> c, Throwables.TriFunction<? super A, ? super B, ? super C, ? extends R, E> zipFunction)
-
Field Details
-
INDEX_NOT_FOUND
public static final int INDEX_NOT_FOUNDThe 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 fromList
.- See Also:
-
EMPTY_BOOLEAN_ARRAY
public static final boolean[] EMPTY_BOOLEAN_ARRAYAn empty immutableboolean
array. -
EMPTY_CHAR_ARRAY
public static final char[] EMPTY_CHAR_ARRAYAn empty immutablechar
array. -
EMPTY_BYTE_ARRAY
public static final byte[] EMPTY_BYTE_ARRAYAn empty immutablebyte
array. -
EMPTY_SHORT_ARRAY
public static final short[] EMPTY_SHORT_ARRAYAn empty immutableshort
array. -
EMPTY_INT_ARRAY
public static final int[] EMPTY_INT_ARRAYAn empty immutableint
array. -
EMPTY_LONG_ARRAY
public static final long[] EMPTY_LONG_ARRAYAn empty immutablelong
array. -
EMPTY_FLOAT_ARRAY
public static final float[] EMPTY_FLOAT_ARRAYAn empty immutablefloat
array. -
EMPTY_DOUBLE_ARRAY
public static final double[] EMPTY_DOUBLE_ARRAYAn empty immutabledouble
array. -
EMPTY_BOOLEAN_OBJ_ARRAY
An empty immutableBoolean
array. -
EMPTY_CHAR_OBJ_ARRAY
An empty immutableCharacter
array. -
EMPTY_BYTE_OBJ_ARRAY
An empty immutableByte
array. -
EMPTY_SHORT_OBJ_ARRAY
An empty immutableShort
array. -
EMPTY_INT_OBJ_ARRAY
An empty immutableInteger
array. -
EMPTY_LONG_OBJ_ARRAY
An empty immutableLong
array. -
EMPTY_FLOAT_OBJ_ARRAY
An empty immutableFloat
array. -
EMPTY_DOUBLE_OBJ_ARRAY
An empty immutableDouble
array. -
EMPTY_STRING_ARRAY
An empty immutableString
array. -
EMPTY_DATE_ARRAY
An empty immutableDate
array. -
EMPTY_CALENDAR_ARRAY
An empty immutableCalendar
array. -
EMPTY_OBJECT_ARRAY
An empty immutableObject
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
- Parameters:
a
-valueToFind
-- Returns:
-
occurrencesOf
- Parameters:
c
-valueToFind
-- Returns:
- See Also:
-
occurrencesOf
- Parameters:
iter
-valueToFind
-- Returns:
- Throws:
ArithmeticException
- if theoccurrences
is bigger thanInteger.MAX_VALUE
- See Also:
-
occurrencesOf
- Parameters:
str
-ch
-- Returns:
- See Also:
-
occurrencesOf
- Parameters:
str
-substr
-- Returns:
- See Also:
-
occurrencesMap
- Type Parameters:
T
-- Parameters:
a
-- Returns:
- See Also:
-
occurrencesMap
- Type Parameters:
T
-- Parameters:
a
-mapSupplier
-- Returns:
- See Also:
-
occurrencesMap
- Type Parameters:
T
-- Parameters:
c
-- Returns:
- See Also:
-
occurrencesMap
public static <T> Map<T,Integer> occurrencesMap(Iterable<? extends T> c, Supplier<Map<T, Integer>> mapSupplier) - Type Parameters:
T
-- Parameters:
c
-mapSupplier
-- Returns:
- See Also:
-
occurrencesMap
- Type Parameters:
T
-- Parameters:
iter
-- Returns:
- See Also:
-
occurrencesMap
public static <T> Map<T,Integer> occurrencesMap(Iterator<? extends 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
- Parameters:
a
-valueToFind
-- Returns:
-
contains
- Parameters:
c
-valueToFind
-- Returns:
-
contains
- Parameters:
c
-valueToFind
-- Returns:
-
contains
- Parameters:
iter
-valueToFind
-- Returns:
-
containsAll
- Parameters:
c
-valuesToFind
- the objs to find- Returns:
-
containsAll
- Parameters:
c
-valuesToFind
- the objs to find- Returns:
-
containsAll
- Parameters:
c
-valuesToFind
-- Returns:
-
containsAll
- Parameters:
iter
-valuesToFind
-- Returns:
-
containsAny
- Parameters:
c
-valuesToFind
- the objs to find- Returns:
-
containsAny
- Parameters:
c
-valuesToFind
- the objs to find- Returns:
-
containsAny
- Parameters:
c
-valuesToFind
-- Returns:
-
containsAny
- Parameters:
iter
-valuesToFind
-- Returns:
-
slice
Returns a read-onlySeq
.- Type Parameters:
T
-- Parameters:
a
-fromIndex
-toIndex
-- Returns:
- the immutable collection<? extends t>
-
slice
Returns a read-onlyImmutableCollection
.- Type Parameters:
T
-- Parameters:
c
-fromIndex
-toIndex
-- Returns:
- the immutable collection<? extends t>
-
slice
public static <T> ImmutableCollection<T> slice(Collection<? extends T> c, int fromIndex, int toIndex) Returns a read-onlyImmutableCollection
.- Type Parameters:
T
-- Parameters:
c
-fromIndex
-toIndex
-- Returns:
- the immutable collection<? extends t>
-
slice
- Type Parameters:
T
-- Parameters:
iter
-fromIndex
-toIndex
-- Returns:
-
split
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 isnull
or empty.- Parameters:
a
-chunkSize
- the desired size of each sub array (the last may be smaller).- Returns:
-
split
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 isnull
or empty.- Parameters:
a
-fromIndex
-toIndex
-chunkSize
- the desired size of each sub array (the last may be smaller).- Returns:
-
split
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 isnull
or empty.- Parameters:
a
-chunkSize
- the desired size of each sub array (the last may be smaller).- Returns:
-
split
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 isnull
or empty.- Parameters:
a
-fromIndex
-toIndex
-chunkSize
- the desired size of each sub array (the last may be smaller).- Returns:
-
split
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 isnull
or empty.- Parameters:
a
-chunkSize
- the desired size of each sub array (the last may be smaller).- Returns:
-
split
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 isnull
or empty.- Parameters:
a
-fromIndex
-toIndex
-chunkSize
- the desired size of each sub array (the last may be smaller).- Returns:
-
split
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 isnull
or empty.- Parameters:
a
-chunkSize
- the desired size of each sub array (the last may be smaller).- Returns:
-
split
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 isnull
or empty.- Parameters:
a
-fromIndex
-toIndex
-chunkSize
- the desired size of each sub array (the last may be smaller).- Returns:
-
split
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 isnull
or empty.- Parameters:
a
-chunkSize
- the desired size of each sub array (the last may be smaller).- Returns:
-
split
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 isnull
or empty.- Parameters:
a
-fromIndex
-toIndex
-chunkSize
- the desired size of each sub array (the last may be smaller).- Returns:
-
split
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 isnull
or empty.- Parameters:
a
-chunkSize
- the desired size of each sub array (the last may be smaller).- Returns:
-
split
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 isnull
or empty.- Parameters:
a
-fromIndex
-toIndex
-chunkSize
- the desired size of each sub array (the last may be smaller).- Returns:
-
split
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 isnull
or empty.- Parameters:
a
-chunkSize
- the desired size of each sub array (the last may be smaller).- Returns:
-
split
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 isnull
or empty.- Parameters:
a
-fromIndex
-toIndex
-chunkSize
- the desired size of each sub array (the last may be smaller).- Returns:
-
split
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 isnull
or empty.- Parameters:
a
-chunkSize
- the desired size of each sub array (the last may be smaller).- Returns:
-
split
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 isnull
or empty.- Parameters:
a
-fromIndex
-toIndex
-chunkSize
- the desired size of each sub array (the last may be smaller).- Returns:
-
split
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 isnull
or empty.- Type Parameters:
T
-- Parameters:
a
-chunkSize
- the desired size of each sub array (the last may be smaller).- Returns:
-
split
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 isnull
or empty.- Type Parameters:
T
-- Parameters:
a
-fromIndex
-toIndex
-chunkSize
- the desired size of each sub array (the last may be smaller).- Returns:
-
split
- Type Parameters:
T
-- Parameters:
c
-chunkSize
-- 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 isnull
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
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 isnull
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
- Type Parameters:
T
-- Parameters:
iter
-chunkSize
-- Returns:
-
split
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 isnull
or empty.- Parameters:
str
-chunkSize
- the desired size of each sub String (the last may be smaller).- Returns:
-
split
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 isnull
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 sizeSmallerFirst, IntBiFunction<? extends T> func) final int[] a = Array.rangeClosed(1, 7); splitByCount(5, 7, true, (fromIndex, toIndex) -> copyOfRange(a, fromIndex, toIndex)).forEach(Fn.println()); // [[1], [2], [3], [4, 5], [6, 7]] splitByCount(5, 7, false, (fromIndex, toIndex) -> 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 splittotalSize
into.totalSize
-sizeSmallerFirst
-func
-- Returns:
- the stream
-
concat
public static boolean[] concat(boolean[] a, boolean[] b) - Parameters:
a
-b
-- Returns:
-
concat
- Parameters:
aa
-- Returns:
-
concat
public static char[] concat(char[] a, char[] b) - Parameters:
a
-b
-- Returns:
-
concat
- Parameters:
aa
-- Returns:
-
concat
public static byte[] concat(byte[] a, byte[] b) - Parameters:
a
-b
-- Returns:
-
concat
- Parameters:
aa
-- Returns:
-
concat
public static short[] concat(short[] a, short[] b) - Parameters:
a
-b
-- Returns:
-
concat
- Parameters:
aa
-- Returns:
-
concat
public static int[] concat(int[] a, int[] b) - Parameters:
a
-b
-- Returns:
-
concat
- Parameters:
aa
-- Returns:
-
concat
public static long[] concat(long[] a, long[] b) - Parameters:
a
-b
-- Returns:
-
concat
- Parameters:
aa
-- Returns:
-
concat
public static float[] concat(float[] a, float[] b) - Parameters:
a
-b
-- Returns:
-
concat
- Parameters:
aa
-- Returns:
-
concat
public static double[] concat(double[] a, double[] b) - Parameters:
a
-b
-- Returns:
-
concat
- Parameters:
aa
-- Returns:
-
concat
public static <T> T[] concat(T[] a, T[] b) - Type Parameters:
T
-- Parameters:
a
-b
-- Returns:
-
concat
- Type Parameters:
T
-- Parameters:
aa
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray
isnull
.
-
concat
- Type Parameters:
T
-- Parameters:
a
-b
-- Returns:
-
concat
- Type Parameters:
T
-- Parameters:
a
-- Returns:
-
concat
- 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
- Type Parameters:
T
-- Parameters:
a
-b
-- Returns:
- See Also:
-
concat
- Type Parameters:
T
-- Parameters:
a
-- Returns:
- See Also:
-
flatten
public static boolean[] flatten(boolean[][] a) - Parameters:
a
-- Returns:
- an empty
boolean[]
ifa
is null.
-
flatten
public static char[] flatten(char[][] a) - Parameters:
a
-- Returns:
- an empty
char[]
ifa
is null.
-
flatten
public static byte[] flatten(byte[][] a) - Parameters:
a
-- Returns:
- an empty
byte[]
ifa
is null.
-
flatten
public static short[] flatten(short[][] a) - Parameters:
a
-- Returns:
- an empty
short[]
ifa
is null.
-
flatten
public static int[] flatten(int[][] a) - Parameters:
a
-- Returns:
- an empty
int[]
ifa
is null.
-
flatten
public static long[] flatten(long[][] a) - Parameters:
a
-- Returns:
- an empty
long[]
ifa
is null.
-
flatten
public static float[] flatten(float[][] a) - Parameters:
a
-- Returns:
- an empty
float[]
ifa
is null.
-
flatten
public static double[] flatten(double[][] a) - Parameters:
a
-- Returns:
- an empty
double[]
ifa
is null.
-
flatten
public static <T> T[] flatten(T[][] a) - Type Parameters:
T
-- Parameters:
a
-- Returns:
null
ifa
is null.
-
flatten
- Type Parameters:
T
-- Parameters:
a
-componentType
-- Returns:
- an empty
T[]
ifa
is null.
-
flatten
- Type Parameters:
T
-- Parameters:
c
-- Returns:
-
flatten
public static <T,C extends Collection<T>> C flatten(Collection<? extends Iterable<? extends T>> c, IntFunction<? extends C> supplier) - Type Parameters:
T
-C
-- Parameters:
c
-supplier
-- Returns:
-
flatten
- Type Parameters:
T
-- Parameters:
c
-- Returns:
-
flatten
public static <T,C extends Collection<T>> C flatten(Iterable<? extends Iterable<? extends T>> c, Supplier<? extends C> supplier) - Type Parameters:
T
-C
-- Parameters:
c
-supplier
-- Returns:
-
flatten
- Type Parameters:
T
-- Parameters:
iters
-- Returns:
-
flattenEachElement
Flatten each element if it's aIterable
, otherwise just add it to result Collection.- Parameters:
iter
-- Returns:
-
flattenEachElement
@Beta public static <T,C extends Collection<T>> C flattenEachElement(Iterable<?> iter, IntFunction<? extends C> supplier) Flatten each element if it's aIterable
, otherwise just add it to result Collection.- Type Parameters:
T
-C
-- Parameters:
iter
-supplier
-- Returns:
-
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 inb
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
- Type Parameters:
T
-- Parameters:
a
-b
-- Returns:
- See Also:
-
intersection
- Type Parameters:
T
-- Parameters:
a
-b
-- Returns:
- See Also:
-
intersection
- Type Parameters:
T
-- Parameters:
c
-- Returns:
- See Also:
-
difference
public static boolean[] difference(boolean[] a, boolean[] b) Returns the elements froma
, but exclude the elements inb
by occurrences.- Parameters:
a
-b
-- Returns:
- See Also:
-
difference
public static char[] difference(char[] a, char[] b) Returns the elements froma
, but exclude the elements inb
by occurrences.- Parameters:
a
-b
-- Returns:
- See Also:
-
difference
public static byte[] difference(byte[] a, byte[] b) Returns the elements froma
, but exclude the elements inb
by occurrences.- Parameters:
a
-b
-- Returns:
- See Also:
-
difference
public static short[] difference(short[] a, short[] b) Returns the elements froma
, but exclude the elements inb
by occurrences.- Parameters:
a
-b
-- Returns:
- See Also:
-
difference
public static int[] difference(int[] a, int[] b) Returns the elements froma
, but exclude the elements inb
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 froma
, but exclude the elements inb
by occurrences.- Parameters:
a
-b
-- Returns:
- See Also:
-
difference
public static float[] difference(float[] a, float[] b) Returns the elements froma
, but exclude the elements inb
by occurrences.- Parameters:
a
-b
-- Returns:
- See Also:
-
difference
public static double[] difference(double[] a, double[] b) Returns the elements froma
, but exclude the elements inb
by occurrences.- Parameters:
a
-b
-- Returns:
- See Also:
-
difference
Returns the elements froma
, but exclude the elements inb
by occurrences.- Type Parameters:
T
-- Parameters:
a
-b
-- Returns:
- See Also:
-
difference
Returns the elements froma
, but exclude the elements inb
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:
-
IntList.symmetricDifference(IntList)
CommonUtil#difference(int[], int[])
-
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
- Type Parameters:
T
-- Parameters:
a
-b
-- Returns:
- See Also:
-
symmetricDifference
- Type Parameters:
T
-- Parameters:
a
-b
-- Returns:
- See Also:
-
differentSet
- 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
- Type Parameters:
T
-- Parameters:
a
-b
-- Returns:
- the sets the
- See Also:
-
commonSet
- Type Parameters:
T
-- Parameters:
c
-- Returns:
- the sets the
- See Also:
-
exclude
Returns a newList
with specifiedobjToExclude
excluded. That's to say no moreobjToExclude
will present in the returnedList
.- Type Parameters:
T
-- Parameters:
c
-objToExclude
-- Returns:
- a new
List
- See Also:
-
excludeToSet
Returns a newSet
with specifiedobjToExclude
excluded. That's to say no moreobjToExclude
will present in the returnedSet
.- Type Parameters:
T
-- Parameters:
c
-objToExclude
-- Returns:
- a new
Set
- See Also:
-
excludeAll
Returns a newList
with specifiedobjsToExclude
excluded. That's to say no moreobjsToExclude
will present in the returnedList
.- Type Parameters:
T
-- Parameters:
c
-objsToExclude
-- Returns:
- a new
List
- See Also:
-
excludeAllToSet
Returns a newSet
with specifiedobjsToExclude
excluded. That's to say no moreobjsToExclude
will present in the returnedSet
.- Type Parameters:
T
-- Parameters:
c
-objsToExclude
-- Returns:
- a new
Set
- See Also:
-
isSubCollection
Returnstrue
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 nullcoll
- the second (super?) collection, must not be null- Returns:
true
if subColl is a sub-collection of coll- See Also:
-
isProperSubCollection
Returnstrue
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()
andcoll.size()
represent the total cardinality of a and b, resp.subColl.size() < Integer.MAXVALUE
- Parameters:
subColl
- the first (sub?) collection, must not be nullcoll
- the second (super?) collection, must not be null- Returns:
true
if subColl is a proper sub-collection of coll- See Also:
-
isEqualCollection
Returnstrue
if the givenCollection
s 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 collectionb
- 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
- Type Parameters:
T
-- Parameters:
a
-oldVal
-newVal
-- Returns:
-
replaceAll
- Type Parameters:
T
-- Parameters:
list
-oldVal
-newVal
-- Returns:
-
replaceAll
public static <E extends Exception> void replaceAll(boolean[] a, Throwables.BooleanUnaryOperator<E> operator) throws E - Type Parameters:
E
-- Parameters:
a
-operator
-- Throws:
E
-
replaceAll
public static <E extends Exception> void replaceAll(char[] a, Throwables.CharUnaryOperator<E> operator) throws E - Type Parameters:
E
-- Parameters:
a
-operator
-- Throws:
E
-
replaceAll
public static <E extends Exception> void replaceAll(byte[] a, Throwables.ByteUnaryOperator<E> operator) throws E - Type Parameters:
E
-- Parameters:
a
-operator
-- Throws:
E
-
replaceAll
public static <E extends Exception> void replaceAll(short[] a, Throwables.ShortUnaryOperator<E> operator) throws E - Type Parameters:
E
-- Parameters:
a
-operator
-- Throws:
E
-
replaceAll
public static <E extends Exception> void replaceAll(int[] a, Throwables.IntUnaryOperator<E> operator) throws E - Type Parameters:
E
-- Parameters:
a
-operator
-- Throws:
E
-
replaceAll
public static <E extends Exception> void replaceAll(long[] a, Throwables.LongUnaryOperator<E> operator) throws E - Type Parameters:
E
-- Parameters:
a
-operator
-- Throws:
E
-
replaceAll
public static <E extends Exception> void replaceAll(float[] a, Throwables.FloatUnaryOperator<E> operator) throws E - Type Parameters:
E
-- Parameters:
a
-operator
-- Throws:
E
-
replaceAll
public static <E extends Exception> void replaceAll(double[] a, Throwables.DoubleUnaryOperator<E> operator) throws E - Type Parameters:
E
-- Parameters:
a
-operator
-- Throws:
E
-
replaceAll
public static <T,E extends Exception> void replaceAll(T[] a, Throwables.UnaryOperator<T, E> operator) throws E- Type Parameters:
T
-E
-- Parameters:
a
-operator
-- Throws:
E
-
replaceAll
public static <T,E extends Exception> void replaceAll(List<T> list, Throwables.UnaryOperator<T, E> operator) throws E- Type Parameters:
T
-E
-- Parameters:
list
-operator
-- Throws:
E
-
replaceIf
public static <E extends Exception> int replaceIf(boolean[] a, Throwables.BooleanPredicate<E> predicate, boolean newValue) throws E - Type Parameters:
E
-- Parameters:
a
-predicate
-newValue
-- Returns:
- Throws:
E
-
replaceIf
public static <E extends Exception> int replaceIf(char[] a, Throwables.CharPredicate<E> predicate, char newValue) throws E - Type Parameters:
E
-- Parameters:
a
-predicate
-newValue
-- Returns:
- Throws:
E
-
replaceIf
public static <E extends Exception> int replaceIf(byte[] a, Throwables.BytePredicate<E> predicate, byte newValue) throws E - Type Parameters:
E
-- Parameters:
a
-predicate
-newValue
-- Returns:
- Throws:
E
-
replaceIf
public static <E extends Exception> int replaceIf(short[] a, Throwables.ShortPredicate<E> predicate, short newValue) throws E - Type Parameters:
E
-- Parameters:
a
-predicate
-newValue
-- Returns:
- Throws:
E
-
replaceIf
public static <E extends Exception> int replaceIf(int[] a, Throwables.IntPredicate<E> predicate, int newValue) throws E - Type Parameters:
E
-- Parameters:
a
-predicate
-newValue
-- Returns:
- Throws:
E
-
replaceIf
public static <E extends Exception> int replaceIf(long[] a, Throwables.LongPredicate<E> predicate, long newValue) throws E - Type Parameters:
E
-- Parameters:
a
-predicate
-newValue
-- Returns:
- Throws:
E
-
replaceIf
public static <E extends Exception> int replaceIf(float[] a, Throwables.FloatPredicate<E> predicate, float newValue) throws E - Type Parameters:
E
-- Parameters:
a
-predicate
-newValue
-- Returns:
- Throws:
E
-
replaceIf
public static <E extends Exception> int replaceIf(double[] a, Throwables.DoublePredicate<E> predicate, double newValue) throws E - Type Parameters:
E
-- Parameters:
a
-predicate
-newValue
-- Returns:
- Throws:
E
-
replaceIf
public static <T,E extends Exception> int replaceIf(T[] a, Throwables.Predicate<? super T, E> predicate, T newValue) throws E- Type Parameters:
T
-E
-- Parameters:
a
-predicate
-newValue
-- Returns:
- Throws:
E
-
replaceIf
public static <T,E extends Exception> int replaceIf(List<T> c, Throwables.Predicate<? super T, E> predicate, T newValue) throws E- Type Parameters:
T
-E
-- Parameters:
c
-predicate
-newValue
-- Returns:
- Throws:
E
-
updateAllUsingReplaceAllInstead
@Deprecated public static void updateAllUsingReplaceAllInstead() throws UnsupportedOperationExceptionDeprecated.usereplaceAll
A fake method defined to remind user to usereplaceAll
whenupdate/updateAll/updateIf
is searched. -
updateIfUsingReplaceIfInstead
Deprecated.usereplaceIf
A fake method defined to remind user to usereplaceIf
whenupdate/updateAll/updateIf
is searched. -
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
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
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 specifiedArray
isnull
.
-
addAll
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
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
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
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
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
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
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
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
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 specifiedArray
isnull
.
-
addAll
public static <T> boolean addAll(Collection<T> c, T... elementsToAdd) throws IllegalArgumentException - Type Parameters:
T
-- Parameters:
c
-elementsToAdd
-- Returns:
- Throws:
IllegalArgumentException
-
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 Collectionc
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 objectelementToInsert
- 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 objectelementToInsert
- 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 objectelementToInsert
- 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 objectelementToInsert
- 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 objectelementToInsert
- 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 objectelementToInsert
- 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 objectelementToInsert
- 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 objectelementToInsert
- the object to add- Returns:
- A new array containing the existing elementToInserts and the new elementToInsert
-
insert
- Parameters:
a
-index
-elementToInsert
-- Returns:
-
insert
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 objectelementToInsert
- the object to add- Returns:
- A new array containing the existing elementToInserts and the new elementToInsert
- Throws:
IllegalArgumentException
- if the specifiedArray
isnull
.
-
insert
Returns a new String.- Parameters:
str
-index
-strToInsert
-- Returns:
- a new String
-
insertAll
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 fromelementsToInsert
- the second array whose elementToInserts are added to the new array.- Returns:
- A new array containing the elementToInserts from a and b
-
insertAll
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 fromelementsToInsert
- the second array whose elementToInserts are added to the new array.- Returns:
- A new array containing the elementToInserts from a and b
-
insertAll
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 fromelementsToInsert
- the second array whose elementToInserts are added to the new array.- Returns:
- A new array containing the elementToInserts from a and b
-
insertAll
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 fromelementsToInsert
- the second array whose elementToInserts are added to the new array.- Returns:
- A new array containing the elementToInserts from a and b
-
insertAll
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 fromelementsToInsert
- the second array whose elementToInserts are added to the new array.- Returns:
- A new array containing the elementToInserts from a and b
-
insertAll
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 fromelementsToInsert
- the second array whose elementToInserts are added to the new array.- Returns:
- A new array containing the elementToInserts from a and b
-
insertAll
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 fromelementsToInsert
- the second array whose elementToInserts are added to the new array.- Returns:
- A new array containing the elementToInserts from a and b
-
insertAll
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 fromelementsToInsert
- the second array whose elementToInserts are added to the new array.- Returns:
- A new array containing the elementToInserts from a and b
-
insertAll
- 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 fromelementsToInsert
- 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 specifiedArray
isnull
.
-
insertAll
@SafeVarargs public static <T> boolean insertAll(List<T> list, int index, T... elementsToInsert) throws IllegalArgumentException - Type Parameters:
T
-- Parameters:
list
-index
-elementsToInsert
-- Returns:
- Throws:
IllegalArgumentException
-
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
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 specifiedArray
isnull
.
-
deleteAll
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.deleteAll([true, false, true], 0, 2) = [false] removeAll([true, false, true], 1, 2) = [true]
- Parameters:
a
- the array to remove the element from, may not benull
indices
- the positions of the elements to be removed- Returns:
- A new array containing the existing elements except those at the specified positions.
-
deleteAll
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.
deleteAll([1], 0) = [] deleteAll([2, 6], 0) = [6] deleteAll([2, 6], 0, 1) = [] deleteAll([2, 6, 3], 1, 2) = [2] deleteAll([2, 6, 3], 0, 2) = [6] 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
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.
deleteAll([1], 0) = [] deleteAll([2, 6], 0) = [6] deleteAll([2, 6], 0, 1) = [] deleteAll([2, 6, 3], 1, 2) = [2] deleteAll([2, 6, 3], 0, 2) = [6] 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
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.
deleteAll([1], 0) = [] deleteAll([2, 6], 0) = [6] deleteAll([2, 6], 0, 1) = [] deleteAll([2, 6, 3], 1, 2) = [2] deleteAll([2, 6, 3], 0, 2) = [6] 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
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.
deleteAll([1], 0) = [] deleteAll([2, 6], 0) = [6] deleteAll([2, 6], 0, 1) = [] deleteAll([2, 6, 3], 1, 2) = [2] deleteAll([2, 6, 3], 0, 2) = [6] 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 isnull
.
-
deleteAll
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.
deleteAll([1], 0) = [] deleteAll([2, 6], 0) = [6] deleteAll([2, 6], 0, 1) = [] deleteAll([2, 6, 3], 1, 2) = [2] deleteAll([2, 6, 3], 0, 2) = [6] deleteAll([2, 6, 3], 0, 1, 2) = []
- Parameters:
a
- the array to remove the element from, may not benull
indices
- the positions of the elements to be removed- Returns:
- A new array containing the existing elements except those at the specified positions.
-
deleteAll
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.
deleteAll([1], 0) = [] deleteAll([2, 6], 0) = [6] deleteAll([2, 6], 0, 1) = [] deleteAll([2, 6, 3], 1, 2) = [2] deleteAll([2, 6, 3], 0, 2) = [6] 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
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.
deleteAll([1], 0) = [] deleteAll([2, 6], 0) = [6] deleteAll([2, 6], 0, 1) = [] deleteAll([2, 6, 3], 1, 2) = [2] deleteAll([2, 6, 3], 0, 2) = [6] 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 - Parameters:
a
-indices
-- Returns:
- Throws:
IllegalArgumentException
-
deleteAll
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.
deleteAll(["a", "b", "c"], 0, 2) = ["b"] 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 specifiedArray
isnull
.
-
deleteAll
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
- Parameters:
a
-elementToRemove
-- Returns:
-
remove
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 specifiedArray
isnull
.
-
remove
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.
- Type Parameters:
T
-- Parameters:
c
-elementToRemove
- the elementToRemove to be removed- Returns:
- true if this collection changed as a result of the call
-
removeAll
Returns a new array with removes all the occurrences of specified elementsToRemove froma
.- Parameters:
a
-elementsToRemove
-- Returns:
- See Also:
-
removeAll
Returns a new array with removes all the occurrences of specified elementsToRemove froma
.- Parameters:
a
-elementsToRemove
-- Returns:
- See Also:
-
removeAll
Returns a new array with removes all the occurrences of specified elementsToRemove froma
.- Parameters:
a
-elementsToRemove
-- Returns:
- See Also:
-
removeAll
Returns a new array with removes all the occurrences of specified elementsToRemove froma
.- Parameters:
a
-elementsToRemove
-- Returns:
- See Also:
-
removeAll
Returns a new array with removes all the occurrences of specified elementsToRemove froma
.- Parameters:
a
-elementsToRemove
-- Returns:
- See Also:
-
removeAll
Returns a new array with removes all the occurrences of specified elementsToRemove froma
.- Parameters:
a
-elementsToRemove
-- Returns:
- See Also:
-
removeAll
Returns a new array with removes all the occurrences of specified elementsToRemove froma
.- Parameters:
a
-elementsToRemove
-- Returns:
- See Also:
-
removeAll
Returns a new array with removes all the occurrences of specified elementsToRemove froma
.- Parameters:
a
-elementsToRemove
-- Returns:
- See Also:
-
removeAll
Returns a new array with removes all the occurrences of specified elementsToRemove froma
.- Parameters:
a
-elementsToRemove
-- Returns:
- See Also:
-
removeAll
Returns a new array with removes all the occurrences of specified elementsToRemove froma
.- Type Parameters:
T
-- Parameters:
a
-elementsToRemove
-- Returns:
- See Also:
-
removeAll
Removes the all.- Type Parameters:
T
-- Parameters:
c
-elementsToRemove
-- Returns:
- See Also:
-
removeAll
Removes the all.- Type Parameters:
T
-- Parameters:
c
-elementsToRemove
-- Returns:
- See Also:
-
removeAll
- Type Parameters:
T
-- Parameters:
c
-elementsToRemove
-- Returns:
-
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
- Parameters:
a
-elementToRemove
-- Returns:
-
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
Removes the all occurrences.- Type Parameters:
T
-- Parameters:
c
-elementToRemove
-- Returns:
-
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
Removes the duplicates.- Parameters:
a
-- Returns:
-
removeDuplicates
Removes the duplicates.- Parameters:
a
-isSorted
-- Returns:
-
removeDuplicates
Removes the duplicates.- Parameters:
a
-fromIndex
-toIndex
-isSorted
-- Returns:
-
removeDuplicates
public static <T> T[] removeDuplicates(T[] a) Removes all duplicates elements
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 arraya
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
Removes the duplicates.- Parameters:
c
-- Returns:
true
if there is one or more duplicated elements are removed. otherwisefalse
is returned.
-
removeDuplicates
Removes the duplicates.- Parameters:
c
-isSorted
-- Returns:
true
if there is one or more duplicated elements are removed. otherwisefalse
is returned.
-
deleteRange
public static boolean[] deleteRange(boolean[] a, int fromIndex, int toIndex) Deletes the values fromfromIndex
totoIndex
.- Parameters:
a
-fromIndex
-toIndex
-- Returns:
- a new array
-
deleteRange
public static char[] deleteRange(char[] a, int fromIndex, int toIndex) Deletes the values fromfromIndex
totoIndex
.- Parameters:
a
-fromIndex
-toIndex
-- Returns:
- a new array
-
deleteRange
public static byte[] deleteRange(byte[] a, int fromIndex, int toIndex) Deletes the values fromfromIndex
totoIndex
.- Parameters:
a
-fromIndex
-toIndex
-- Returns:
- a new array
-
deleteRange
public static short[] deleteRange(short[] a, int fromIndex, int toIndex) Deletes the values fromfromIndex
totoIndex
.- Parameters:
a
-fromIndex
-toIndex
-- Returns:
- a new array
-
deleteRange
public static int[] deleteRange(int[] a, int fromIndex, int toIndex) Deletes the values fromfromIndex
totoIndex
.- Parameters:
a
-fromIndex
-toIndex
-- Returns:
- a new array
-
deleteRange
public static long[] deleteRange(long[] a, int fromIndex, int toIndex) Deletes the values fromfromIndex
totoIndex
.- Parameters:
a
-fromIndex
-toIndex
-- Returns:
- a new array
-
deleteRange
public static float[] deleteRange(float[] a, int fromIndex, int toIndex) Deletes the values fromfromIndex
totoIndex
.- Parameters:
a
-fromIndex
-toIndex
-- Returns:
- a new array
-
deleteRange
public static double[] deleteRange(double[] a, int fromIndex, int toIndex) Deletes the values fromfromIndex
totoIndex
.- Parameters:
a
-fromIndex
-toIndex
-- Returns:
- a new array
-
deleteRange
public static String[] deleteRange(String[] a, int fromIndex, int toIndex) throws IllegalArgumentException - Parameters:
a
-fromIndex
-toIndex
-- Returns:
- Throws:
IllegalArgumentException
-
deleteRange
public static <T> T[] deleteRange(T[] a, int fromIndex, int toIndex) throws IllegalArgumentException Deletes the values fromfromIndex
totoIndex
.- Type Parameters:
T
-- Parameters:
a
-fromIndex
-toIndex
-- Returns:
- a new array
- Throws:
IllegalArgumentException
- if the specifiedArray
isnull
.
-
deleteRange
Returnstrue
if theList
is updated whenfromIndex < toIndex
, otherwisefalse
is returned whenfromIndex == toIndex
.- Type Parameters:
T
-- Parameters:
c
-fromIndex
-toIndex
-- Returns:
-
deleteRange
- Parameters:
str
-fromIndex
-toIndex
-- Returns:
-
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
- Parameters:
a
-fromIndex
-toIndex
-replacement
-- Returns:
-
replaceRange
public static <T> T[] replaceRange(T[] a, int fromIndex, int toIndex, T[] replacement) throws IllegalArgumentException Return a new array.- Type Parameters:
T
-- Parameters:
a
-fromIndex
-toIndex
-replacement
-- Returns:
- a new array.
- Throws:
IllegalArgumentException
- if the specifiedArray
isnull
.
-
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 specifiedList
is updated.- Throws:
IllegalArgumentException
- if the specifiedc
isnull
.
-
replaceRange
Returns a new String.- Parameters:
str
-fromIndex
-toIndex
-replacement
-- Returns:
-
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) - Type Parameters:
T
-- 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) - Type Parameters:
T
-- Parameters:
c
-fromIndex
-toIndex
-newPositionStartIndex
- must in the range: [0, list.size() - (toIndex - fromIndex)]- Returns:
true
if the specifiedList
is updated.
-
moveRange
- Parameters:
str
-fromIndex
-toIndex
-newPositionStartIndex
- must in the range: [0, String.length - (toIndex - fromIndex)]- Returns:
-
skipRange
public static <T> List<T> skipRange(Collection<? extends T> c, int startInclusive, int endExclusive) - Type Parameters:
T
-- Parameters:
c
-startInclusive
-endExclusive
-- Returns:
-
skipRange
public static <T,C extends Collection<T>> C skipRange(Collection<? extends T> c, int startInclusive, int endExclusive, IntFunction<C> supplier) - Type Parameters:
T
-C
-- Parameters:
c
-startInclusive
-endExclusive
-supplier
-- 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
Checks for duplicates.- Parameters:
c
-- Returns:
-
hasDuplicates
Checks for duplicates.- Parameters:
c
-isSorted
-- Returns:
-
retainAll
- Type Parameters:
T
-- Parameters:
c
-objsToKeep
-- Returns:
-
sum
- Parameters:
a
-- Returns:
- a long number
-
sum
public static int sum(char[] a, int fromIndex, int toIndex) - Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
sum
- Parameters:
a
-- Returns:
- a long number
-
sum
public static int sum(byte[] a, int fromIndex, int toIndex) - Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
sum
- Parameters:
a
-- Returns:
- a long number
-
sum
public static int sum(short[] a, int fromIndex, int toIndex) - Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
sum
- Parameters:
a
-- Returns:
- a long number
-
sum
public static int sum(int[] a, int fromIndex, int toIndex) - Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
sumToLong
- Parameters:
a
-- Returns:
- a long number
-
sumToLong
public static long sumToLong(int[] a, int fromIndex, int toIndex) - Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
sum
- Parameters:
a
-- Returns:
- a long number
-
sum
public static long sum(long[] a, int fromIndex, int toIndex) - Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
sum
- Parameters:
a
-- Returns:
- a double number
-
sum
public static float sum(float[] a, int fromIndex, int toIndex) - Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
sum
- Parameters:
a
-- Returns:
- a double number
-
sum
public static double sum(double[] a, int fromIndex, int toIndex) - Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
average
Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.- Parameters:
a
-- Returns:
- a double number
-
average
public static double average(char[] a, int fromIndex, int toIndex) Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.- Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
average
Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.- Parameters:
a
-- Returns:
- a double number
-
average
public static double average(byte[] a, int fromIndex, int toIndex) Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.- Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
average
Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.- Parameters:
a
-- Returns:
- a double number
-
average
public static double average(short[] a, int fromIndex, int toIndex) Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.- Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
average
Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.- Parameters:
a
-- Returns:
- a double number
-
average
public static double average(int[] a, int fromIndex, int toIndex) Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.- Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
average
Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.- Parameters:
a
-- Returns:
- a double number
-
average
public static double average(long[] a, int fromIndex, int toIndex) Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.- Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
average
Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.- Parameters:
a
-- Returns:
- a double number
-
average
public static double average(float[] a, int fromIndex, int toIndex) Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.- Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
average
Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.- Parameters:
a
-- Returns:
- a double number
-
average
public static double average(double[] a, int fromIndex, int toIndex) Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.- Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
sumInt
- Type Parameters:
T
-- Parameters:
a
-- Returns:
-
sumInt
- 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
- 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
-
sumInt
- 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
-
sumIntToLong
- Type Parameters:
T
-- Parameters:
c
-- Returns:
-
sumIntToLong
public static <T,E extends Exception> long sumIntToLong(Iterable<? extends T> c, Throwables.ToIntFunction<? super T, E> func) throws E- Type Parameters:
T
-E
-- Parameters:
c
-func
-- Returns:
- Throws:
E
- the e
-
sumLong
- Type Parameters:
T
-- Parameters:
a
-- Returns:
-
sumLong
- 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(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
-
sumLong
- 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
-
sumDouble
- Type Parameters:
T
-- Parameters:
a
-- Returns:
-
sumDouble
- 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(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
-
sumDouble
- 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
-
sumBigInteger
- Parameters:
c
-- Returns:
-
sumBigInteger
public static <T,E extends Exception> BigInteger sumBigInteger(Iterable<? extends T> c, Throwables.Function<? super T, BigInteger, throws EE> func) - Type Parameters:
T
-E
-- Parameters:
c
-func
-- Returns:
- Throws:
E
- the e
-
sumBigDecimal
- Parameters:
c
-- Returns:
-
sumBigDecimal
public static <T,E extends Exception> BigDecimal sumBigDecimal(Iterable<? extends T> c, Throwables.Function<? super T, BigDecimal, throws EE> func) - Type Parameters:
T
-E
-- Parameters:
c
-func
-- Returns:
- Throws:
E
- the e
-
averageInt
Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.- Type Parameters:
T
-- Parameters:
a
-- Returns:
-
averageInt
Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == 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 EReturns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == 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 EReturns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.- Type Parameters:
T
-E
-- Parameters:
a
-fromIndex
-toIndex
-func
-- Returns:
- Throws:
E
- the e
-
averageInt
public static <T extends Number> double averageInt(Collection<? extends T> c, int fromIndex, int toIndex) Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == 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 EReturns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.- Type Parameters:
T
-E
-- Parameters:
c
-fromIndex
-toIndex
-func
-- Returns:
- Throws:
E
- the e
-
averageInt
Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == 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 EReturns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.- Type Parameters:
T
-E
-- Parameters:
c
-func
-- Returns:
- Throws:
E
- the e
-
averageLong
Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.- Type Parameters:
T
-- Parameters:
a
-- Returns:
-
averageLong
Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == 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 EReturns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == 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 EReturns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.- Type Parameters:
T
-E
-- Parameters:
a
-fromIndex
-toIndex
-func
-- Returns:
- Throws:
E
- the e
-
averageLong
public static <T extends Number> double averageLong(Collection<? extends T> c, int fromIndex, int toIndex) Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == 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 EReturns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.- Type Parameters:
T
-E
-- Parameters:
c
-fromIndex
-toIndex
-func
-- Returns:
- Throws:
E
- the e
-
averageLong
Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == 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 EReturns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.- Type Parameters:
T
-E
-- Parameters:
c
-func
-- Returns:
- Throws:
E
- the e
-
averageDouble
Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.- Type Parameters:
T
-- Parameters:
a
-- Returns:
- See Also:
-
Iterables#averageDouble(Object[])
-
averageDouble
Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == 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 EReturns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == 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 EReturns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == 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(Collection<? extends T> c, int fromIndex, int toIndex) Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == 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 EReturns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.- Type Parameters:
T
-E
-- Parameters:
c
-fromIndex
-toIndex
-func
-- Returns:
- Throws:
E
- the e- See Also:
-
averageDouble
Returns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.- Type Parameters:
T
-- Parameters:
c
-- Returns:
- See Also:
-
Iterables#averageDouble(Collection)
-
averageDouble
public static <T,E extends Exception> double averageDouble(Iterable<? extends T> c, Throwables.ToDoubleFunction<? super T, E> func) throws EReturns0
if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.- Type Parameters:
T
-E
-- Parameters:
c
-func
-- Returns:
- Throws:
E
- the e- See Also:
-
Iterables#averageDouble(Collection, Throwables.ToDoubleFunction)
-
averageBigInteger
- Parameters:
c
-- Returns:
-
averageBigInteger
public static <T,E extends Exception> BigDecimal averageBigInteger(Iterable<? extends T> c, Throwables.Function<? super T, BigInteger, throws EE> func) - Type Parameters:
T
-E
-- Parameters:
c
-func
-- Returns:
- Throws:
E
- the e
-
averageBigDecimal
- Parameters:
c
-- Returns:
-
averageBigDecimal
public static <T,E extends Exception> BigDecimal averageBigDecimal(Iterable<? extends T> c, Throwables.Function<? super T, BigDecimal, throws EE> func) - Type Parameters:
T
-E
-- Parameters:
c
-func
-- Returns:
- Throws:
E
- the e
-
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
- Type Parameters:
T
-- Parameters:
a
-b
-- Returns:
-
min
- 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
- Type Parameters:
T
-- Parameters:
a
-b
-c
-- Returns:
-
min
- Type Parameters:
T
-- Parameters:
a
-b
-c
-cmp
-- Returns:
-
min
Returns the minimum value in an array.
- Parameters:
a
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.
-
min
- Parameters:
a
-fromIndex
-toIndex
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.
-
min
Returns the minimum value in an array.
- Parameters:
a
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.
-
min
- Parameters:
a
-fromIndex
-toIndex
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.
-
min
Returns the minimum value in an array.
- Parameters:
a
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.
-
min
- Parameters:
a
-fromIndex
-toIndex
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.
-
min
Returns the minimum value in an array.
- Parameters:
a
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.
-
min
- Parameters:
a
-fromIndex
-toIndex
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.
-
min
Returns the minimum value in an array.
- Parameters:
a
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.
-
min
- Parameters:
a
-fromIndex
-toIndex
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.
-
min
Returns the minimum value in an array.
- Parameters:
a
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.- See Also:
-
min
- Parameters:
a
-fromIndex
-toIndex
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.
-
min
Returns the minimum value in an array.
- Parameters:
a
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.- See Also:
-
min
- Parameters:
a
-fromIndex
-toIndex
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.
-
min
Returns the minimum element in the array.- Type Parameters:
T
-- Parameters:
a
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, orfromIndex == 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 specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.
-
min
Returns the minimum element in the array.- Type Parameters:
T
-- Parameters:
a
- anArray
which must not be null or emptycmp
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, orfromIndex == 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 specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.
-
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 specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.- See Also:
-
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 specifiedArray/Collection
isnull
or empty, orfromIndex == 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 specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.- See Also:
-
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 specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.- See Also:
-
Iterables#min(Collection, Comparator)
-
minAll
- Type Parameters:
T
-- Parameters:
a
-- Returns:
-
minAll
- Type Parameters:
T
-- Parameters:
a
-cmp
-- Returns:
-
minAll
- Type Parameters:
T
-- Parameters:
c
-- Returns:
-
minAll
- Type Parameters:
T
-- Parameters:
c
-cmp
-- Returns:
-
minAll
- Type Parameters:
T
-- Parameters:
iter
-- Returns:
- See Also:
-
minAll
- Type Parameters:
T
-- Parameters:
iter
-cmp
-- Returns:
- See Also:
-
minOrDefaultIfEmpty
@Beta public static <T,R extends Comparable<? super R>, R minOrDefaultIfEmptyE extends Exception> (T[] a, Throwables.Function<? super T, ? extends R, throws EE> valueExtractor, R defaultValue) Returns the minimum value extracted from the specified arraya
byvalueExtractor
, ordefaultValue
ifa
is null or empty.- Type Parameters:
T
-R
-E
-- Parameters:
a
-defaultValue
-- Returns:
- Throws:
E
-
minOrDefaultIfEmpty
public static <T,R extends Comparable<? super R>, R minOrDefaultIfEmptyE extends Exception> (Iterable<? extends T> c, Throwables.Function<? super T, ? extends R, throws EE> valueExtractor, R defaultValue) Returns the minimum value extracted from the specified collectionc
byvalueExtractor
, ordefaultValue
ifc
is null or empty.- Type Parameters:
T
-R
-E
-- Parameters:
c
-defaultValue
-- Returns:
- Throws:
E
-
minOrDefaultIfEmpty
public static <T,R extends Comparable<? super R>, R minOrDefaultIfEmptyE extends Exception> (Iterator<? extends T> iter, Throwables.Function<? super T, ? extends R, throws EE> valueExtractor, R defaultValue) Returns the minimum value extracted from the specified iteratoriter
byvalueExtractor
, ordefaultValue
ifiter
is null or empty.- Type Parameters:
T
-R
-E
-- Parameters:
iter
-defaultValue
-- Returns:
- Throws:
E
-
minIntOrDefaultIfEmpty
@Beta public static <T,E extends Exception> int minIntOrDefaultIfEmpty(T[] a, Throwables.ToIntFunction<? super T, E> valueExtractor, int defaultValue) throws EReturns the minimumint
value extracted from the specified arraya
byvalueExtractor
, ordefaultValue
ifa
is null or empty.- Type Parameters:
T
-E
-- Parameters:
a
-defaultValue
-- Returns:
- Throws:
E
-
minIntOrDefaultIfEmpty
@Beta public static <T,E extends Exception> int minIntOrDefaultIfEmpty(Iterable<? extends T> c, Throwables.ToIntFunction<? super T, E> valueExtractor, int defaultValue) throws EReturns the minimumint
value extracted from the specified iterablec
byvalueExtractor
, ordefaultValue
ifa
is null or empty.- Type Parameters:
T
-E
-- Parameters:
c
-defaultValue
-- Returns:
- Throws:
E
-
minIntOrDefaultIfEmpty
@Beta public static <T,E extends Exception> int minIntOrDefaultIfEmpty(Iterator<? extends T> iter, Throwables.ToIntFunction<? super T, E> valueExtractor, int defaultValue) throws EReturns the minimumint
value extracted from the specified iteratoriter
byvalueExtractor
, ordefaultValue
ifa
is null or empty.- Type Parameters:
T
-E
-- Parameters:
iter
-defaultValue
-- Returns:
- Throws:
E
-
minLongOrDefaultIfEmpty
@Beta public static <T,E extends Exception> long minLongOrDefaultIfEmpty(T[] a, Throwables.ToLongFunction<? super T, E> valueExtractor, long defaultValue) throws EReturns the minimumlong
value extracted from the specified arraya
byvalueExtractor
, ordefaultValue
ifa
is null or empty.- Type Parameters:
T
-E
-- Parameters:
a
-defaultValue
-- Returns:
- Throws:
E
-
minLongOrDefaultIfEmpty
@Beta public static <T,E extends Exception> long minLongOrDefaultIfEmpty(Iterable<? extends T> c, Throwables.ToLongFunction<? super T, E> valueExtractor, long defaultValue) throws EReturns the minimumlong
value extracted from the specified iterablec
byvalueExtractor
, ordefaultValue
ifa
is null or empty.- Type Parameters:
T
-E
-- Parameters:
c
-defaultValue
-- Returns:
- Throws:
E
-
minLongOrDefaultIfEmpty
@Beta public static <T,E extends Exception> long minLongOrDefaultIfEmpty(Iterator<? extends T> iter, Throwables.ToLongFunction<? super T, E> valueExtractor, long defaultValue) throws EReturns the minimumlong
value extracted from the specified iteratoriter
byvalueExtractor
, ordefaultValue
ifa
is null or empty.- Type Parameters:
T
-E
-- Parameters:
iter
-defaultValue
-- Returns:
- Throws:
E
-
minDoubleOrDefaultIfEmpty
@Beta public static <T,E extends Exception> double minDoubleOrDefaultIfEmpty(T[] a, Throwables.ToDoubleFunction<? super T, E> valueExtractor, double defaultValue) throws EReturns the minimumdouble
value extracted from the specified arraya
byvalueExtractor
, ordefaultValue
ifa
is null or empty.- Type Parameters:
T
-E
-- Parameters:
a
-defaultValue
-- Returns:
- Throws:
E
-
minDoubleOrDefaultIfEmpty
@Beta public static <T,E extends Exception> double minDoubleOrDefaultIfEmpty(Iterable<? extends T> c, Throwables.ToDoubleFunction<? super T, E> valueExtractor, double defaultValue) throws EReturns the minimumdouble
value extracted from the specified iterablec
byvalueExtractor
, ordefaultValue
ifa
is null or empty.- Type Parameters:
T
-E
-- Parameters:
c
-defaultValue
-- Returns:
- Throws:
E
-
minDoubleOrDefaultIfEmpty
@Beta public static <T,E extends Exception> double minDoubleOrDefaultIfEmpty(Iterator<? extends T> iter, Throwables.ToDoubleFunction<? super T, E> valueExtractor, double defaultValue) throws EReturns the minimumdouble
value extracted from the specified iteratoriter
byvalueExtractor
, ordefaultValue
ifa
is null or empty.- Type Parameters:
T
-E
-- Parameters:
iter
-defaultValue
-- Returns:
- Throws:
E
-
minMax
public static <T extends Comparable<? super T>> Pair<T,T> minMax(T[] a) throws IllegalArgumentException - Type Parameters:
T
-- Parameters:
a
-- Returns:
- Throws:
IllegalArgumentException
- ifa
is null or empty.- See Also:
-
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
- ifa
is null or empty.- See Also:
-
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
- ifc
is null or empty.- See Also:
-
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
- ifc
is null or empty.- See Also:
-
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
- ifiter
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
- ifiter
is null or empty.- 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
- Type Parameters:
T
-- Parameters:
a
-b
-- Returns:
-
max
- Type Parameters:
T
-- Parameters:
a
-b
-cmp
-- Returns:
-
max
public static char max(char a, char b, char c) Gets the maximum of threechar
values.- Parameters:
a
-b
-c
-- Returns:
-
max
public static byte max(byte a, byte b, byte c) Gets the maximum of threebyte
values.- Parameters:
a
-b
-c
-- Returns:
-
max
public static short max(short a, short b, short c) Gets the maximum of threeshort
values.- Parameters:
a
-b
-c
-- Returns:
-
max
public static int max(int a, int b, int c) Gets the maximum of threeint
values.- Parameters:
a
-b
-c
-- Returns:
-
max
public static long max(long a, long b, long c) Gets the maximum of threelong
values.- Parameters:
a
-b
-c
-- Returns:
-
max
public static float max(float a, float b, float c) Gets the maximum of threefloat
values.- Parameters:
a
-b
-c
-- Returns:
-
max
public static double max(double a, double b, double c) Gets the maximum of threedouble
values.- Parameters:
a
-b
-c
-- Returns:
-
max
- Type Parameters:
T
-- Parameters:
a
-b
-c
-- Returns:
-
max
- Type Parameters:
T
-- Parameters:
a
-b
-c
-cmp
-- Returns:
-
max
Returns the maximum value in an array.
- Parameters:
a
- anArray
which must not be null or empty- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.
-
max
- Parameters:
a
-fromIndex
-toIndex
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.
-
max
Returns the maximum value in an array.
- Parameters:
a
- anArray
which must not be null or empty- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.
-
max
- Parameters:
a
-fromIndex
-toIndex
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.
-
max
Returns the maximum value in an array.
- Parameters:
a
- anArray
which must not be null or empty- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.
-
max
- Parameters:
a
-fromIndex
-toIndex
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.
-
max
Returns the maximum value in an array.
- Parameters:
a
- anArray
which must not be null or empty- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.
-
max
- Parameters:
a
-fromIndex
-toIndex
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.
-
max
Returns the maximum value in an array.
- Parameters:
a
- anArray
which must not be null or empty- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.
-
max
- Parameters:
a
-fromIndex
-toIndex
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.
-
max
Returns the maximum value in an array.
- Parameters:
a
- anArray
which must not be null or empty- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.- See Also:
-
max
- Parameters:
a
-fromIndex
-toIndex
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.
-
max
Returns the maximum value in an array.
- Parameters:
a
- anArray
which must not be null or empty- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.- See Also:
-
max
- Parameters:
a
-fromIndex
-toIndex
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.
-
max
Returns the maximum element in the array.- Type Parameters:
T
-- Parameters:
a
- anArray
which must not be null or empty- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, orfromIndex == 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 specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.
-
max
Returns the maximum element in the array.- Type Parameters:
T
-- Parameters:
a
- anArray
which must not be null or emptycmp
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, orfromIndex == 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 specifiedArray/Collection
isnull
or empty, orfromIndex == 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 specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.- See Also:
-
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 specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.- See Also:
-
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 specifiedArray/Collection
isnull
or empty, orfromIndex == 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 specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.
-
maxAll
- Type Parameters:
T
-- Parameters:
a
-- Returns:
-
maxAll
- Type Parameters:
T
-- Parameters:
a
-cmp
-- Returns:
-
maxAll
- Type Parameters:
T
-- Parameters:
c
-- Returns:
-
maxAll
- Type Parameters:
T
-- Parameters:
c
-cmp
-- Returns:
-
maxAll
- Type Parameters:
T
-- Parameters:
iter
-- Returns:
- See Also:
-
Iterables#maxAll(Iterator)
-
maxAll
- Type Parameters:
T
-- Parameters:
iter
-cmp
-- Returns:
- See Also:
-
Iterables#maxAll(Iterator, Comparator)
-
maxOrDefaultIfEmpty
@Beta public static <T,R extends Comparable<? super R>, R maxOrDefaultIfEmptyE extends Exception> (T[] a, Throwables.Function<? super T, ? extends R, throws EE> valueExtractor, R defaultValue) Returns the maximum value extracted from the specified arraya
byvalueExtractor
, ordefaultValue
ifa
is null or empty.- Type Parameters:
T
-R
-E
-- Parameters:
a
-defaultValue
-- Returns:
- Throws:
E
-
maxOrDefaultIfEmpty
public static <T,R extends Comparable<? super R>, R maxOrDefaultIfEmptyE extends Exception> (Iterable<? extends T> c, Throwables.Function<? super T, ? extends R, throws EE> valueExtractor, R defaultValue) Returns the maximum value extracted from the specified collectionc
byvalueExtractor
, ordefaultValue
ifc
is null or empty.- Type Parameters:
T
-R
-E
-- Parameters:
c
-defaultValue
-- Returns:
- Throws:
E
-
maxOrDefaultIfEmpty
public static <T,R extends Comparable<? super R>, R maxOrDefaultIfEmptyE extends Exception> (Iterator<? extends T> iter, Throwables.Function<? super T, ? extends R, throws EE> valueExtractor, R defaultValue) Returns the maximum value extracted from the specified iteratoriter
byvalueExtractor
, ordefaultValue
ifiter
is null or empty.- Type Parameters:
T
-R
-E
-- Parameters:
iter
-defaultValue
-- Returns:
- Throws:
E
-
maxIntOrDefaultIfEmpty
@Beta public static <T,E extends Exception> int maxIntOrDefaultIfEmpty(T[] a, Throwables.ToIntFunction<? super T, E> valueExtractor, int defaultValue) throws EReturns the maximumint
value extracted from the specified arraya
byvalueExtractor
, ordefaultValue
ifa
is null or empty.- Type Parameters:
T
-E
-- Parameters:
a
-defaultValue
-- Returns:
- Throws:
E
-
maxIntOrDefaultIfEmpty
@Beta public static <T,E extends Exception> int maxIntOrDefaultIfEmpty(Iterable<? extends T> c, Throwables.ToIntFunction<? super T, E> valueExtractor, int defaultValue) throws EReturns the maximumint
value extracted from the specified iterablec
byvalueExtractor
, ordefaultValue
ifa
is null or empty.- Type Parameters:
T
-E
-- Parameters:
c
-defaultValue
-- Returns:
- Throws:
E
-
maxIntOrDefaultIfEmpty
@Beta public static <T,E extends Exception> int maxIntOrDefaultIfEmpty(Iterator<? extends T> iter, Throwables.ToIntFunction<? super T, E> valueExtractor, int defaultValue) throws EReturns the maximumint
value extracted from the specified iteratoriter
byvalueExtractor
, ordefaultValue
ifa
is null or empty.- Type Parameters:
T
-E
-- Parameters:
iter
-defaultValue
-- Returns:
- Throws:
E
-
maxLongOrDefaultIfEmpty
@Beta public static <T,E extends Exception> long maxLongOrDefaultIfEmpty(T[] a, Throwables.ToLongFunction<? super T, E> valueExtractor, long defaultValue) throws EReturns the maximumlong
value extracted from the specified arraya
byvalueExtractor
, ordefaultValue
ifa
is null or empty.- Type Parameters:
T
-E
-- Parameters:
a
-defaultValue
-- Returns:
- Throws:
E
-
maxLongOrDefaultIfEmpty
@Beta public static <T,E extends Exception> long maxLongOrDefaultIfEmpty(Iterable<? extends T> c, Throwables.ToLongFunction<? super T, E> valueExtractor, long defaultValue) throws EReturns the maximumlong
value extracted from the specified iterablec
byvalueExtractor
, ordefaultValue
ifa
is null or empty.- Type Parameters:
T
-E
-- Parameters:
c
-defaultValue
-- Returns:
- Throws:
E
-
maxLongOrDefaultIfEmpty
@Beta public static <T,E extends Exception> long maxLongOrDefaultIfEmpty(Iterator<? extends T> iter, Throwables.ToLongFunction<? super T, E> valueExtractor, long defaultValue) throws EReturns the maximumlong
value extracted from the specified iteratoriter
byvalueExtractor
, ordefaultValue
ifa
is null or empty.- Type Parameters:
T
-E
-- Parameters:
iter
-defaultValue
-- Returns:
- Throws:
E
-
maxDoubleOrDefaultIfEmpty
@Beta public static <T,E extends Exception> double maxDoubleOrDefaultIfEmpty(T[] a, Throwables.ToDoubleFunction<? super T, E> valueExtractor, double defaultValue) throws EReturns the maximumdouble
value extracted from the specified arraya
byvalueExtractor
, ordefaultValue
ifa
is null or empty.- Type Parameters:
T
-E
-- Parameters:
a
-defaultValue
-- Returns:
- Throws:
E
-
maxDoubleOrDefaultIfEmpty
@Beta public static <T,E extends Exception> double maxDoubleOrDefaultIfEmpty(Iterable<? extends T> c, Throwables.ToDoubleFunction<? super T, E> valueExtractor, double defaultValue) throws EReturns the maximumdouble
value extracted from the specified iterablec
byvalueExtractor
, ordefaultValue
ifa
is null or empty.- Type Parameters:
T
-E
-- Parameters:
c
-defaultValue
-- Returns:
- Throws:
E
-
maxDoubleOrDefaultIfEmpty
@Beta public static <T,E extends Exception> double maxDoubleOrDefaultIfEmpty(Iterator<? extends T> iter, Throwables.ToDoubleFunction<? super T, E> valueExtractor, double defaultValue) throws EReturns the maximumdouble
value extracted from the specified iteratoriter
byvalueExtractor
, ordefaultValue
ifa
is null or empty.- Type Parameters:
T
-E
-- Parameters:
iter
-defaultValue
-- Returns:
- Throws:
E
-
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
Gets the median of three values.- Type Parameters:
T
-- Parameters:
a
-b
-c
-- Returns:
- See Also:
-
median
Gets the median of three values.- Type Parameters:
T
-- Parameters:
a
-b
-c
-cmp
-- Returns:
- See Also:
-
median
Returns thelength / 2 + 1
largest value in the specified array.- Parameters:
a
- anArray
which must not be null or empty- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.- See Also:
-
median
- Parameters:
a
-fromIndex
-toIndex
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.
-
median
Returns thelength / 2 + 1
largest value in the specified array.- Parameters:
a
- anArray
which must not be null or empty- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.- See Also:
-
median
- Parameters:
a
-fromIndex
-toIndex
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.
-
median
Returns thelength / 2 + 1
largest value in the specified array.- Parameters:
a
- anArray
which must not be null or empty- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.- See Also:
-
median
- Parameters:
a
-fromIndex
-toIndex
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.
-
median
Returns thelength / 2 + 1
largest value in the specified array.- Parameters:
a
- anArray
which must not be null or empty- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.- See Also:
-
median
- Parameters:
a
-fromIndex
-toIndex
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.
-
median
Returns thelength / 2 + 1
largest value in the specified array.- Parameters:
a
- anArray
which must not be null or empty- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.- See Also:
-
median
- Parameters:
a
-fromIndex
-toIndex
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.
-
median
Returns thelength / 2 + 1
largest value in the specified array.- Parameters:
a
- anArray
which must not be null or empty- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.- See Also:
-
median
- Parameters:
a
-fromIndex
-toIndex
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.
-
median
Returns thelength / 2 + 1
largest value in the specified array.- Parameters:
a
- anArray
which must not be null or empty- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.- See Also:
-
median
- Parameters:
a
-fromIndex
-toIndex
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.
-
median
Returns thelength / 2 + 1
largest value in the specified array.- Type Parameters:
T
-- Parameters:
a
- anArray
which must not be null or empty- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, orfromIndex == 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 specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.
-
median
Returns thelength / 2 + 1
largest value in the specified array.- Type Parameters:
T
-- Parameters:
a
- anArray
which must not be null or emptycmp
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, orfromIndex == 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 specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.
-
median
public static <T extends Comparable<? super T>> T median(Collection<? extends T> c) throws IllegalArgumentException Returns thelength / 2 + 1
largest value in the specified array.- Type Parameters:
T
-- Parameters:
c
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, orfromIndex == 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 specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.
-
median
public static <T> T median(Collection<? extends T> c, Comparator<? super T> cmp) throws IllegalArgumentException Returns thelength / 2 + 1
largest value in the specified array.- Type Parameters:
T
-- Parameters:
c
-cmp
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, orfromIndex == 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 specifiedArray/Collection
isnull
or empty, orfromIndex == toIndex
.
-
kthLargest
- Parameters:
a
-k
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, or its length/size is less thank
, ortoIndex - 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 specifiedArray/Collection
isnull
or empty, or its length/size is less thank
, ortoIndex - fromIndex < k
.
-
kthLargest
- Parameters:
a
-k
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, or its length/size is less thank
, ortoIndex - 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 specifiedArray/Collection
isnull
or empty, or its length/size is less thank
, ortoIndex - fromIndex < k
.
-
kthLargest
- Parameters:
a
-k
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, or its length/size is less thank
, ortoIndex - 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 specifiedArray/Collection
isnull
or empty, or its length/size is less thank
, ortoIndex - fromIndex < k
.
-
kthLargest
- Parameters:
a
-k
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, or its length/size is less thank
, ortoIndex - 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 specifiedArray/Collection
isnull
or empty, or its length/size is less thank
, ortoIndex - fromIndex < k
.
-
kthLargest
- Parameters:
a
-k
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, or its length/size is less thank
, ortoIndex - 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 specifiedArray/Collection
isnull
or empty, or its length/size is less thank
, ortoIndex - fromIndex < k
.
-
kthLargest
- Parameters:
a
-k
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, or its length/size is less thank
, ortoIndex - 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 specifiedArray/Collection
isnull
or empty, or its length/size is less thank
, ortoIndex - fromIndex < k
.
-
kthLargest
- Parameters:
a
-k
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray/Collection
isnull
or empty, or its length/size is less thank
, ortoIndex - 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 specifiedArray/Collection
isnull
or empty, or its length/size is less thank
, ortoIndex - 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 specifiedArray/Collection
isnull
or empty, or its length/size is less thank
, ortoIndex - 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 specifiedArray/Collection
isnull
or empty, or its length/size is less thank
, ortoIndex - 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 specifiedArray/Collection
isnull
or empty, or its length/size is less thank
, ortoIndex - 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 specifiedArray/Collection
isnull
or empty, or its length/size is less thank
, ortoIndex - 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 specifiedArray/Collection
isnull
or empty, or its length/size is less thank
, ortoIndex - 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 specifiedArray/Collection
isnull
or empty, or its length/size is less thank
, ortoIndex - 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 specifiedArray/Collection
isnull
or empty, or its length/size is less thank
, ortoIndex - 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 specifiedArray/Collection
isnull
or empty, or its length/size is less thank
, ortoIndex - fromIndex < k
.
-
top
public static short[] top(short[] a, int n) - Parameters:
a
-n
-- Returns:
-
top
- 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
- 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
- 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
- Parameters:
a
-fromIndex
-toIndex
-n
-cmp
-- Returns:
-
top
public static float[] top(float[] a, int n) - Parameters:
a
-n
-- Returns:
-
top
- 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
- 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
- Type Parameters:
T
-- Parameters:
a
-n
-- Returns:
-
top
- 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
- Type Parameters:
T
-- Parameters:
a
-fromIndex
-toIndex
-n
-cmp
-- Returns:
-
top
- Type Parameters:
T
-- Parameters:
c
-n
-- Returns:
-
top
- 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
- 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
-keepEncounterOrder
-- 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 specifiedsortedArray
isnull
or empty.
-
percentiles
Returns the elements at:Percentage
* length of the specified array.- Parameters:
sortedArray
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedsortedArray
isnull
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 specifiedsortedArray
isnull
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 specifiedsortedArray
isnull
or empty.
-
percentiles
Returns the elements at:Percentage
* length of the specified array.- Parameters:
sortedArray
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedsortedArray
isnull
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 specifiedsortedArray
isnull
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 specifiedsortedArray
isnull
or empty.
-
percentiles
Returns the elements at:Percentage
* length of the specified array.- Type Parameters:
T
-- Parameters:
sortedArray
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedsortedArray
isnull
or empty.
-
percentiles
Returns the elements at:Percentage
* length of the specified array.- Type Parameters:
T
-- Parameters:
sortedList
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedsortedList
isnull
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 EDeprecated.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 EDeprecated.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 EMostly 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, void forEachE extends Exception> (Map<K, V> map, Throwables.Consumer<? super Map.Entry<K, throws EV>, E> action) - Type Parameters:
K
-V
-E
-- Parameters:
map
-action
-- Throws:
E
- the e
-
forEach
public static <K,V, void forEachE extends Exception> (Map<K, V> map, Throwables.BiConsumer<? super K, throws E? super V, E> action) - 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 EMostly 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, void forEachIndexedE extends Exception> (Map<K, V> map, Throwables.IndexedConsumer<? super Map.Entry<K, throws EV>, E> action) - Type Parameters:
K
-V
-E
-- Parameters:
map
-action
-- Throws:
E
- the e
-
forEachIndexed
public static <K,V, void forEachIndexedE extends Exception> (Map<K, V> map, Throwables.IndexedBiConsumer<? super K, throws E? super V, E> action) - Type Parameters:
K
-V
-E
-- Parameters:
map
-action
-- Throws:
E
- the e
-
forEach
public static <T,U, void forEachE extends Exception, E2 extends Exception> (T[] a, Throwables.Function<? super T, ? extends Iterable<U>, throws E, E2E> flatMapper, Throwables.BiConsumer<? super T, ? super U, E2> action) - Type Parameters:
T
-U
-E
-E2
-- Parameters:
a
-flatMapper
-action
-- Throws:
E
- the eE2
- the e2
-
forEach
public static <T,U, void forEachE extends Exception, E2 extends Exception> (Iterable<? extends T> c, Throwables.Function<? super T, ? extends Iterable<U>, throws E, E2E> flatMapper, Throwables.BiConsumer<? super T, ? super U, E2> action) - Type Parameters:
T
-U
-E
-E2
-- Parameters:
c
-flatMapper
-action
-- Throws:
E
- the eE2
- the e2
-
forEach
public static <T,U, void forEachE extends Exception, E2 extends Exception> (Iterator<? extends T> iter, Throwables.Function<? super T, ? extends Iterable<U>, throws E, E2E> flatMapper, Throwables.BiConsumer<? super T, ? super U, E2> action) - Type Parameters:
T
-U
-E
-E2
-- Parameters:
iter
-flatMapper
-action
-- Throws:
E
- the eE2
- the e2
-
forEach
public static <T,T2, void forEachT3, E extends Exception, E2 extends Exception, E3 extends Exception> (T[] a, Throwables.Function<? super T, ? extends Iterable<T2>, throws E, E2, E3E> flatMapper, Throwables.Function<? super T2, ? extends Iterable<T3>, E2> flatMapper2, Throwables.TriConsumer<? super T, ? super T2, ? super T3, E3> action) - Type Parameters:
T
-T2
-T3
-E
-E2
-E3
-- Parameters:
a
-flatMapper
-flatMapper2
-action
-- Throws:
E
- the eE2
- the e2E3
- the e3
-
forEach
public static <T,T2, void forEachT3, E extends Exception, E2 extends Exception, E3 extends Exception> (Iterable<? extends T> c, Throwables.Function<? super T, ? extends Iterable<T2>, throws E, E2, E3E> flatMapper, Throwables.Function<? super T2, ? extends Iterable<T3>, E2> flatMapper2, Throwables.TriConsumer<? super T, ? super T2, ? super T3, E3> action) - Type Parameters:
T
-T2
-T3
-E
-E2
-E3
-- Parameters:
c
-flatMapper
-flatMapper2
-action
-- Throws:
E
- the eE2
- the e2E3
- the e3
-
forEach
public static <T,T2, void forEachT3, E extends Exception, E2 extends Exception, E3 extends Exception> (Iterator<? extends T> iter, Throwables.Function<? super T, ? extends Iterable<T2>, throws E, E2, E3E> flatMapper, Throwables.Function<? super T2, ? extends Iterable<T3>, E2> flatMapper2, Throwables.TriConsumer<? super T, ? super T2, ? super T3, E3> action) - Type Parameters:
T
-T2
-T3
-E
-E2
-E3
-- Parameters:
iter
-flatMapper
-flatMapper2
-action
-- Throws:
E
- the eE2
- the e2E3
- the e3
-
forEach
public static <A,B, void forEachE extends Exception> (A[] a, B[] b, Throwables.BiConsumer<? super A, ? super B, throws EE> action) - Type Parameters:
A
-B
-E
-- Parameters:
a
-b
-action
-- Throws:
E
- the e
-
forEach
public static <A,B, void forEachE extends Exception> (Iterable<A> a, Iterable<B> b, Throwables.BiConsumer<? super A, ? super B, throws EE> action) - Type Parameters:
A
-B
-E
-- Parameters:
a
-b
-action
-- Throws:
E
- the e
-
forEach
public static <A,B, void forEachE extends Exception> (Iterator<A> a, Iterator<B> b, Throwables.BiConsumer<? super A, ? super B, throws EE> action) - Type Parameters:
A
-B
-E
-- Parameters:
a
-b
-action
-- Throws:
E
- the e
-
forEach
public static <A,B, void forEachC, E extends Exception> (A[] a, B[] b, C[] c, Throwables.TriConsumer<? super A, ? super B, throws E? super C, E> action) - Type Parameters:
A
-B
-C
-E
-- Parameters:
a
-b
-c
-action
-- Throws:
E
- the e
-
forEach
public static <A,B, void forEachC, E extends Exception> (Iterable<A> a, Iterable<B> b, Iterable<C> c, Throwables.TriConsumer<? super A, ? super B, throws E? super C, E> action) - Type Parameters:
A
-B
-C
-E
-- Parameters:
a
-b
-c
-action
-- Throws:
E
- the e
-
forEach
public static <A,B, void forEachC, E extends Exception> (Iterator<A> a, Iterator<B> b, Iterator<C> c, Throwables.TriConsumer<? super A, ? super B, throws E? super C, E> action) - Type Parameters:
A
-B
-C
-E
-- Parameters:
a
-b
-c
-action
-- Throws:
E
- the e
-
forEach
public static <A,B, void forEachE extends Exception> (A[] a, B[] b, A valueForNoneA, B valueForNoneB, Throwables.BiConsumer<? super A, ? super B, throws EE> action) - Type Parameters:
A
-B
-E
-- Parameters:
a
-b
-valueForNoneA
-valueForNoneB
-action
-- Throws:
E
- the e
-
forEach
public static <A,B, void forEachE extends Exception> (Iterable<A> a, Iterable<B> b, A valueForNoneA, B valueForNoneB, Throwables.BiConsumer<? super A, ? super B, throws EE> action) - Type Parameters:
A
-B
-E
-- Parameters:
a
-b
-valueForNoneA
-valueForNoneB
-action
-- Throws:
E
- the e
-
forEach
public static <A,B, void forEachE extends Exception> (Iterator<A> a, Iterator<B> b, A valueForNoneA, B valueForNoneB, Throwables.BiConsumer<? super A, ? super B, throws EE> action) - Type Parameters:
A
-B
-E
-- Parameters:
a
-b
-valueForNoneA
-valueForNoneB
-action
-- Throws:
E
- the e
-
forEach
public static <A,B, void forEachC, E extends Exception> (A[] a, B[] b, C[] c, A valueForNoneA, B valueForNoneB, C valueForNoneC, Throwables.TriConsumer<? super A, ? super B, throws E? super C, E> action) - Type Parameters:
A
-B
-C
-E
-- Parameters:
a
-b
-c
-valueForNoneA
-valueForNoneB
-valueForNoneC
-action
-- Throws:
E
- the e
-
forEach
public static <A,B, void forEachC, E extends Exception> (Iterable<A> a, Iterable<B> b, Iterable<C> c, A valueForNoneA, B valueForNoneB, C valueForNoneC, Throwables.TriConsumer<? super A, ? super B, throws E? super C, E> action) - Type Parameters:
A
-B
-C
-E
-- Parameters:
a
-b
-c
-valueForNoneA
-valueForNoneB
-valueForNoneC
-action
-- Throws:
E
- the e
-
forEach
public static <A,B, void forEachC, E extends Exception> (Iterator<A> a, Iterator<B> b, Iterator<C> c, A valueForNoneA, B valueForNoneB, C valueForNoneC, Throwables.TriConsumer<? super A, ? super B, throws E? super C, E> action) - 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 EFor each non null.- Type Parameters:
T
-E
-- Parameters:
a
-action
-- Throws:
E
- the e
-
forEachNonNull
public static <T,E extends Exception> void forEachNonNull(Iterable<? extends T> c, Throwables.Consumer<? super T, E> action) throws EFor each non null.- Type Parameters:
T
-E
-- Parameters:
c
-action
-- Throws:
E
- the e
-
forEachNonNull
public static <T,U, void forEachNonNullE extends Exception, E2 extends Exception> (T[] a, Throwables.Function<? super T, ? extends Iterable<U>, throws E, E2E> flatMapper, Throwables.BiConsumer<? super T, ? super U, E2> action) For each non null.- Type Parameters:
T
-U
-E
-E2
-- Parameters:
a
-flatMapper
-action
-- Throws:
E
- the eE2
- the e2
-
forEachNonNull
public static <T,U, void forEachNonNullE extends Exception, E2 extends Exception> (Iterable<? extends T> c, Throwables.Function<? super T, ? extends Iterable<U>, throws E, E2E> flatMapper, Throwables.BiConsumer<? super T, ? super U, E2> action) For each non null.- Type Parameters:
T
-U
-E
-E2
-- Parameters:
c
-flatMapper
-action
-- Throws:
E
- the eE2
- the e2
-
forEachNonNull
public static <T,U, void forEachNonNullE extends Exception, E2 extends Exception> (Iterator<? extends T> iter, Throwables.Function<? super T, ? extends Iterable<U>, throws E, E2E> flatMapper, Throwables.BiConsumer<? super T, ? super U, E2> action) For each non null.- Type Parameters:
T
-U
-E
-E2
-- Parameters:
iter
-flatMapper
-action
-- Throws:
E
- the eE2
- the e2
-
forEachNonNull
public static <T,T2, void forEachNonNullT3, E extends Exception, E2 extends Exception, E3 extends Exception> (T[] a, Throwables.Function<? super T, ? extends Iterable<T2>, throws E, E2, E3E> flatMapper, Throwables.Function<? super T2, ? extends Iterable<T3>, E2> flatMapper2, Throwables.TriConsumer<? super T, ? super T2, ? super T3, E3> action) For each non null.- Type Parameters:
T
-T2
-T3
-E
-E2
-E3
-- Parameters:
a
-flatMapper
-flatMapper2
-action
-- Throws:
E
- the eE2
- the e2E3
- the e3
-
forEachNonNull
public static <T,T2, void forEachNonNullT3, E extends Exception, E2 extends Exception, E3 extends Exception> (Iterable<? extends T> c, Throwables.Function<? super T, ? extends Iterable<T2>, throws E, E2, E3E> flatMapper, Throwables.Function<? super T2, ? extends Iterable<T3>, E2> flatMapper2, Throwables.TriConsumer<? super T, ? super T2, ? super T3, E3> action) For each non null.- Type Parameters:
T
-T2
-T3
-E
-E2
-E3
-- Parameters:
c
-flatMapper
-flatMapper2
-action
-- Throws:
E
- the eE2
- the e2E3
- the e3
-
forEachNonNull
public static <T,T2, void forEachNonNullT3, E extends Exception, E2 extends Exception, E3 extends Exception> (Iterator<? extends T> iter, Throwables.Function<? super T, ? extends Iterable<T2>, throws E, E2, E3E> flatMapper, Throwables.Function<? super T2, ? extends Iterable<T3>, E2> flatMapper2, Throwables.TriConsumer<? super T, ? super T2, ? super T3, E3> action) For each non null.- Type Parameters:
T
-T2
-T3
-E
-E2
-E3
-- Parameters:
iter
-flatMapper
-flatMapper2
-action
-- Throws:
E
- the eE2
- the e2E3
- the e3
-
forEachPair
public static <T,E extends Exception> void forEachPair(T[] a, Throwables.BiConsumer<? super T, ? super T, throws EE> action) For each pair.- Type Parameters:
T
-E
-- Parameters:
a
-action
-- Throws:
E
- the e
-
forEachPair
public static <T,E extends Exception> void forEachPair(T[] a, int increment, Throwables.BiConsumer<? super T, ? super T, throws EE> action) For each pair.- Type Parameters:
T
-E
-- Parameters:
a
-increment
-action
-- Throws:
E
- the e
-
forEachPair
public static <T,E extends Exception> void forEachPair(Iterable<? extends T> c, Throwables.BiConsumer<? super T, ? super T, throws EE> action) For each pair.- Type Parameters:
T
-E
-- Parameters:
c
-action
-- Throws:
E
- the e
-
forEachPair
public static <T,E extends Exception> void forEachPair(Iterable<? extends T> c, int increment, Throwables.BiConsumer<? super T, ? super T, throws EE> action) For each pair.- Type Parameters:
T
-E
-- Parameters:
c
-increment
-action
-- Throws:
E
- the e
-
forEachPair
public static <T,E extends Exception> void forEachPair(Iterator<? extends T> iter, Throwables.BiConsumer<? super T, ? super T, throws EE> action) For each pair.- Type Parameters:
T
-E
-- Parameters:
iter
-action
-- Throws:
E
- the e
-
forEachPair
public static <T,E extends Exception> void forEachPair(Iterator<? extends T> iter, int increment, Throwables.BiConsumer<? super T, ? super T, throws EE> action) For each pair.- Type Parameters:
T
-E
-- Parameters:
iter
-increment
-action
-- Throws:
E
- the e
-
forEachTriple
public static <T,E extends Exception> void forEachTriple(T[] a, Throwables.TriConsumer<? super T, ? super T, throws E? super T, E> action) For each triple.- Type Parameters:
T
-E
-- Parameters:
a
-action
-- Throws:
E
- the e
-
forEachTriple
public static <T,E extends Exception> void forEachTriple(T[] a, int increment, Throwables.TriConsumer<? super T, ? super T, throws E? super T, E> action) For each triple.- Type Parameters:
T
-E
-- Parameters:
a
-increment
-action
-- Throws:
E
- the e
-
forEachTriple
public static <T,E extends Exception> void forEachTriple(Iterable<? extends T> c, Throwables.TriConsumer<? super T, ? super T, throws E? super T, E> action) For each triple.- Type Parameters:
T
-E
-- Parameters:
c
-action
-- Throws:
E
- the e
-
forEachTriple
public static <T,E extends Exception> void forEachTriple(Iterable<? extends T> c, int increment, Throwables.TriConsumer<? super T, ? super T, throws E? super T, E> action) For each triple.- Type Parameters:
T
-E
-- Parameters:
c
-increment
-action
-- Throws:
E
- the e
-
forEachTriple
public static <T,E extends Exception> void forEachTriple(Iterator<? extends T> iter, Throwables.TriConsumer<? super T, ? super T, throws E? super T, E> action) For each triple.- Type Parameters:
T
-E
-- Parameters:
iter
-action
-- Throws:
E
- the e
-
forEachTriple
public static <T,E extends Exception> void forEachTriple(Iterator<? extends T> iter, int increment, Throwables.TriConsumer<? super T, ? super T, throws E? super T, E> action) For each triple.- Type Parameters:
T
-E
-- Parameters:
iter
-increment
-action
-- 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, int max, Throwables.BooleanPredicate<E> filter) throws E - Type Parameters:
E
-- Parameters:
a
-max
-filter
-- 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>, R filterE extends Exception> (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>, R filterE extends Exception> (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>, R filterE extends Exception> (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 EMostly 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>, R filterE extends Exception> (T[] a, int fromIndex, int toIndex, Throwables.Predicate<? super T, E> filter, int max, IntFunction<R> supplier) throws EMostly 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>, R filterE extends Exception> (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>, R filterE extends Exception> (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>, R filterE extends Exception> (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>, R filterE extends Exception> (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> mapper) throws EMap to boolean.- Type Parameters:
T
-E
-- Parameters:
a
-mapper
-- 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> mapper) throws EMostly 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
-mapper
-- Returns:
- Throws:
E
- the e
-
mapToBoolean
public static <T,E extends Exception> boolean[] mapToBoolean(Collection<? extends T> c, Throwables.ToBooleanFunction<? super T, E> mapper) throws EMap to boolean.- Type Parameters:
T
-E
-- Parameters:
c
-mapper
-- 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> mapper) throws EMostly 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
-mapper
-- Returns:
- Throws:
E
- the e
-
mapToChar
public static <T,E extends Exception> char[] mapToChar(T[] a, Throwables.ToCharFunction<? super T, E> mapper) throws EMap to char.- Type Parameters:
T
-E
-- Parameters:
a
-mapper
-- 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> mapper) throws EMostly 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
-mapper
-- Returns:
- Throws:
E
- the e
-
mapToChar
public static <T,E extends Exception> char[] mapToChar(Collection<? extends T> c, Throwables.ToCharFunction<? super T, E> mapper) throws EMap to char.- Type Parameters:
T
-E
-- Parameters:
c
-mapper
-- 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> mapper) throws EMostly 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
-mapper
-- Returns:
- Throws:
E
- the e
-
mapToByte
public static <T,E extends Exception> byte[] mapToByte(T[] a, Throwables.ToByteFunction<? super T, E> mapper) throws EMap to byte.- Type Parameters:
T
-E
-- Parameters:
a
-mapper
-- 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> mapper) throws EMostly 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
-mapper
-- Returns:
- Throws:
E
- the e
-
mapToByte
public static <T,E extends Exception> byte[] mapToByte(Collection<? extends T> c, Throwables.ToByteFunction<? super T, E> mapper) throws EMap to byte.- Type Parameters:
T
-E
-- Parameters:
c
-mapper
-- 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> mapper) throws EMostly 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
-mapper
-- Returns:
- Throws:
E
- the e
-
mapToShort
public static <T,E extends Exception> short[] mapToShort(T[] a, Throwables.ToShortFunction<? super T, E> mapper) throws EMap to short.- Type Parameters:
T
-E
-- Parameters:
a
-mapper
-- 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> mapper) throws EMostly 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
-mapper
-- Returns:
- Throws:
E
- the e
-
mapToShort
public static <T,E extends Exception> short[] mapToShort(Collection<? extends T> c, Throwables.ToShortFunction<? super T, E> mapper) throws EMap to short.- Type Parameters:
T
-E
-- Parameters:
c
-mapper
-- 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> mapper) throws EMostly 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
-mapper
-- Returns:
- Throws:
E
- the e
-
mapToInt
public static <T,E extends Exception> int[] mapToInt(T[] a, Throwables.ToIntFunction<? super T, E> mapper) throws EMap to int.- Type Parameters:
T
-E
-- Parameters:
a
-mapper
-- 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> mapper) throws EMostly 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
-mapper
-- Returns:
- Throws:
E
- the e
-
mapToInt
public static <T,E extends Exception> int[] mapToInt(Collection<? extends T> c, Throwables.ToIntFunction<? super T, E> mapper) throws EMap to int.- Type Parameters:
T
-E
-- Parameters:
c
-mapper
-- 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> mapper) throws EMostly 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
-mapper
-- Returns:
- Throws:
E
- the e
-
mapToInt
@Beta public static <E extends Exception> int[] mapToInt(long[] a, Throwables.LongToIntFunction<E> mapper) throws E - Type Parameters:
E
-- Parameters:
a
-mapper
-- Returns:
- Throws:
E
- the e
-
mapToInt
@Beta public static <E extends Exception> int[] mapToInt(double[] a, Throwables.DoubleToIntFunction<E> mapper) throws E - Type Parameters:
E
-- Parameters:
a
-mapper
-- Returns:
- Throws:
E
- the e
-
mapToLong
public static <T,E extends Exception> long[] mapToLong(T[] a, Throwables.ToLongFunction<? super T, E> mapper) throws EMap to long.- Type Parameters:
T
-E
-- Parameters:
a
-mapper
-- 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> mapper) throws EMostly 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
-mapper
-- Returns:
- Throws:
E
- the e
-
mapToLong
public static <T,E extends Exception> long[] mapToLong(Collection<? extends T> c, Throwables.ToLongFunction<? super T, E> mapper) throws EMap to long.- Type Parameters:
T
-E
-- Parameters:
c
-mapper
-- 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> mapper) throws EMostly 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
-mapper
-- Returns:
- Throws:
E
- the e
-
mapToLong
@Beta public static <E extends Exception> long[] mapToLong(int[] a, Throwables.IntToLongFunction<E> mapper) throws E - Type Parameters:
E
-- Parameters:
a
-mapper
-- Returns:
- Throws:
E
- the e
-
mapToLong
@Beta public static <E extends Exception> long[] mapToLong(double[] a, Throwables.DoubleToLongFunction<E> mapper) throws E - Type Parameters:
E
-- Parameters:
a
-mapper
-- Returns:
- Throws:
E
- the e
-
mapToFloat
public static <T,E extends Exception> float[] mapToFloat(T[] a, Throwables.ToFloatFunction<? super T, E> mapper) throws EMap to float.- Type Parameters:
T
-E
-- Parameters:
a
-mapper
-- 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> mapper) throws EMostly 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
-mapper
-- Returns:
- Throws:
E
- the e
-
mapToFloat
public static <T,E extends Exception> float[] mapToFloat(Collection<? extends T> c, Throwables.ToFloatFunction<? super T, E> mapper) throws EMap to float.- Type Parameters:
T
-E
-- Parameters:
c
-mapper
-- 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> mapper) throws EMostly 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
-mapper
-- Returns:
- Throws:
E
- the e
-
mapToDouble
public static <T,E extends Exception> double[] mapToDouble(T[] a, Throwables.ToDoubleFunction<? super T, E> mapper) throws EMap to double.- Type Parameters:
T
-E
-- Parameters:
a
-mapper
-- 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> mapper) throws EMostly 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
-mapper
-- Returns:
- Throws:
E
- the e
-
mapToDouble
public static <T,E extends Exception> double[] mapToDouble(Collection<? extends T> c, Throwables.ToDoubleFunction<? super T, E> mapper) throws EMap to double.- Type Parameters:
T
-E
-- Parameters:
c
-mapper
-- 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> mapper) throws EMostly 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
-mapper
-- Returns:
- Throws:
E
- the e
-
mapToDouble
@Beta public static <E extends Exception> double[] mapToDouble(int[] a, Throwables.IntToDoubleFunction<E> mapper) throws E - Type Parameters:
E
-- Parameters:
a
-mapper
-- Returns:
- Throws:
E
- the e
-
mapToDouble
@Beta public static <E extends Exception> double[] mapToDouble(long[] a, Throwables.LongToDoubleFunction<E> mapper) throws E - Type Parameters:
E
-- Parameters:
a
-mapper
-- Returns:
- Throws:
E
- the e
-
map
public static <T,R, List<R> mapE extends Exception> (T[] a, Throwables.Function<? super T, ? extends R, throws EE> mapper) - Type Parameters:
T
-R
-E
-- Parameters:
a
-mapper
-- Returns:
- Throws:
E
- the e
-
map
public static <T,R, C mapC extends Collection<R>, E extends Exception> (T[] a, Throwables.Function<? super T, ? extends R, throws EE> mapper, IntFunction<? extends C> supplier) - Type Parameters:
T
-R
-C
-E
-- Parameters:
a
-mapper
-supplier
-- Returns:
- Throws:
E
- the e
-
map
public static <T,R, List<R> mapE extends Exception> (T[] a, int fromIndex, int toIndex, Throwables.Function<? super T, ? extends R, throws EE> mapper) Mostly it's designed for one-step operation to complete the operation in one step.java.util.stream.Stream
is preferred for multiple phases operation.- Type Parameters:
T
-R
-E
-- Parameters:
a
-fromIndex
-toIndex
-mapper
-- Returns:
- Throws:
E
- the e
-
map
public static <T,R, C mapC extends Collection<R>, E extends Exception> (T[] a, int fromIndex, int toIndex, Throwables.Function<? super T, ? extends R, throws EE> mapper, IntFunction<? extends C> supplier) Mostly it's designed for one-step operation to complete the operation in one step.java.util.stream.Stream
is preferred for multiple phases operation.- Type Parameters:
T
-R
-C
-E
-- Parameters:
a
-fromIndex
-toIndex
-mapper
-supplier
-- Returns:
- Throws:
E
- the e
-
map
public static <T,R, List<R> mapE extends Exception> (Iterable<? extends T> c, Throwables.Function<? super T, ? extends R, throws EE> mapper) - Type Parameters:
T
-R
-E
-- Parameters:
c
-mapper
-- Returns:
- Throws:
E
- the e
-
map
public static <T,R, C mapC extends Collection<R>, E extends Exception> (Iterable<? extends T> c, Throwables.Function<? super T, ? extends R, throws EE> mapper, IntFunction<? extends C> supplier) - Type Parameters:
T
-R
-C
-E
-- Parameters:
c
-mapper
-supplier
-- Returns:
- Throws:
E
- the e
-
map
public static <T,R, List<R> mapE extends Exception> (Collection<? extends T> c, int fromIndex, int toIndex, Throwables.Function<? super T, ? extends R, throws EE> mapper) Mostly it's designed for one-step operation to complete the operation in one step.java.util.stream.Stream
is preferred for multiple phases operation.- Type Parameters:
T
-R
-E
-- Parameters:
c
-fromIndex
-toIndex
-mapper
-- Returns:
- Throws:
E
- the e
-
map
public static <T,R, C mapC extends Collection<R>, E extends Exception> (Collection<? extends T> c, int fromIndex, int toIndex, Throwables.Function<? super T, ? extends R, throws EE> mapper, IntFunction<? extends C> supplier) Mostly it's designed for one-step operation to complete the operation in one step.java.util.stream.Stream
is preferred for multiple phases operation.- Type Parameters:
T
-R
-C
-E
-- Parameters:
c
-fromIndex
-toIndex
-mapper
-supplier
-- Returns:
- Throws:
E
- the e
-
flatMap
public static <T,R, List<R> flatMapE extends Exception> (T[] a, Throwables.Function<? super T, ? extends Collection<? extends R>, throws EE> mapper) - Type Parameters:
T
-R
-E
-- Parameters:
a
-mapper
-- Returns:
- Throws:
E
- the e
-
flatMap
public static <T,R, C flatMapC extends Collection<R>, E extends Exception> (T[] a, Throwables.Function<? super T, ? extends Collection<? extends R>, throws EE> mapper, IntFunction<? extends C> supplier) - Type Parameters:
T
-R
-C
-E
-- Parameters:
a
-mapper
-supplier
-- Returns:
- Throws:
E
- the e
-
flatMap
public static <T,R, List<R> flatMapE extends Exception> (T[] a, int fromIndex, int toIndex, Throwables.Function<? super T, ? extends Collection<? extends R>, throws EE> mapper) Mostly it's designed for one-step operation to complete the operation in one step.java.util.stream.Stream
is preferred for multiple phases operation.- Type Parameters:
T
-R
-E
-- Parameters:
a
-fromIndex
-toIndex
-mapper
-- Returns:
- Throws:
E
- the e
-
flatMap
public static <T,R, C flatMapC extends Collection<R>, E extends Exception> (T[] a, int fromIndex, int toIndex, Throwables.Function<? super T, ? extends Collection<? extends R>, throws EE> mapper, IntFunction<? extends C> supplier) Mostly it's designed for one-step operation to complete the operation in one step.java.util.stream.Stream
is preferred for multiple phases operation.- Type Parameters:
T
-R
-C
-E
-- Parameters:
a
-fromIndex
-toIndex
-mapper
-supplier
-- Returns:
- Throws:
E
- the e
-
flatMap
public static <T,R, List<R> flatMapE extends Exception> (Collection<? extends T> c, int fromIndex, int toIndex, Throwables.Function<? super T, ? extends Collection<? extends R>, throws EE> mapper) Mostly it's designed for one-step operation to complete the operation in one step.java.util.stream.Stream
is preferred for multiple phases operation.- Type Parameters:
T
-R
-E
-- Parameters:
c
-fromIndex
-toIndex
-mapper
-- Returns:
- Throws:
E
- the e
-
flatMap
public static <T,R, C flatMapC extends Collection<R>, E extends Exception> (Collection<? extends T> c, int fromIndex, int toIndex, Throwables.Function<? super T, ? extends Collection<? extends R>, throws EE> mapper, IntFunction<? extends C> supplier) Mostly it's designed for one-step operation to complete the operation in one step.java.util.stream.Stream
is preferred for multiple phases operation.- Type Parameters:
T
-R
-C
-E
-- Parameters:
c
-fromIndex
-toIndex
-mapper
-supplier
-- Returns:
- Throws:
E
- the e
-
flatMap
public static <T,R, List<R> flatMapE extends Exception> (Iterable<? extends T> c, Throwables.Function<? super T, ? extends Collection<? extends R>, throws EE> mapper) - Type Parameters:
T
-R
-E
-- Parameters:
c
-mapper
-- Returns:
- Throws:
E
- the e
-
flatMap
public static <T,R, C flatMapC extends Collection<R>, E extends Exception> (Iterable<? extends T> c, Throwables.Function<? super T, ? extends Collection<? extends R>, throws EE> mapper, IntFunction<? extends C> supplier) - Type Parameters:
T
-R
-C
-E
-- Parameters:
c
-mapper
-supplier
-- Returns:
- Throws:
E
- the e
-
flatMap
public static <T,U, List<R> flatMapR, E extends Exception, E2 extends Exception> (T[] a, Throwables.Function<? super T, ? extends Collection<? extends U>, throws E, E2E> mapper, Throwables.Function<? super U, ? extends Collection<? extends R>, E2> mapper2) - Type Parameters:
T
-U
-R
-E
-E2
-- Parameters:
a
-mapper
-mapper2
-- Returns:
- Throws:
E
- the eE2
- the e2
-
flatMap
public static <T,U, C flatMapR, C extends Collection<R>, E extends Exception, E2 extends Exception> (T[] a, Throwables.Function<? super T, ? extends Collection<? extends U>, throws E, E2E> mapper, Throwables.Function<? super U, ? extends Collection<? extends R>, E2> mapper2, IntFunction<? extends C> supplier) Mostly it's designed for one-step operation to complete the operation in one step.java.util.stream.Stream
is preferred for multiple phases operation.- Type Parameters:
T
-U
-R
-C
-E
-E2
-- Parameters:
a
-mapper
-mapper2
-supplier
-- Returns:
- Throws:
E
- the eE2
- the e2
-
flatMap
public static <T,U, List<R> flatMapR, E extends Exception, E2 extends Exception> (Iterable<? extends T> c, Throwables.Function<? super T, ? extends Collection<? extends U>, throws E, E2E> mapper, Throwables.Function<? super U, ? extends Collection<? extends R>, E2> mapper2) - Type Parameters:
T
-U
-R
-E
-E2
-- Parameters:
c
-mapper
-mapper2
-- Returns:
- Throws:
E
- the eE2
- the e2
-
flatMap
public static <T,U, C flatMapR, C extends Collection<R>, E extends Exception, E2 extends Exception> (Iterable<? extends T> c, Throwables.Function<? super T, ? extends Collection<? extends U>, throws E, E2E> mapper, Throwables.Function<? super U, ? extends Collection<? extends R>, E2> mapper2, IntFunction<? extends C> supplier) Mostly it's designed for one-step operation to complete the operation in one step.java.util.stream.Stream
is preferred for multiple phases operation.- Type Parameters:
T
-U
-R
-C
-E
-E2
-- Parameters:
c
-mapper
-mapper2
-supplier
-- Returns:
- Throws:
E
- the eE2
- the e2
-
flatmap
public static <T,R, List<R> flatmapE extends Exception> (T[] a, Throwables.Function<? super T, ? extends R[], throws EE> mapper) - Type Parameters:
T
-R
-E
-- Parameters:
a
-mapper
-- Returns:
- Throws:
E
- the e
-
flatmap
public static <T,R, C flatmapC extends Collection<R>, E extends Exception> (T[] a, Throwables.Function<? super T, ? extends R[], throws EE> mapper, IntFunction<? extends C> supplier) - Type Parameters:
T
-R
-C
-E
-- Parameters:
a
-mapper
-supplier
-- Returns:
- Throws:
E
- the e
-
flatmap
public static <T,R, List<R> flatmapE extends Exception> (T[] a, int fromIndex, int toIndex, Throwables.Function<? super T, ? extends R[], throws EE> mapper) Mostly it's designed for one-step operation to complete the operation in one step.java.util.stream.Stream
is preferred for multiple phases operation.- Type Parameters:
T
-R
-E
-- Parameters:
a
-fromIndex
-toIndex
-mapper
-- Returns:
- Throws:
E
- the e
-
flatmap
public static <T,R, C flatmapC extends Collection<R>, E extends Exception> (T[] a, int fromIndex, int toIndex, Throwables.Function<? super T, ? extends R[], throws EE> mapper, IntFunction<? extends C> supplier) Mostly it's designed for one-step operation to complete the operation in one step.java.util.stream.Stream
is preferred for multiple phases operation.- Type Parameters:
T
-R
-C
-E
-- Parameters:
a
-fromIndex
-toIndex
-mapper
-supplier
-- Returns:
- Throws:
E
- the e
-
flatmap
public static <T,R, List<R> flatmapE extends Exception> (Collection<? extends T> c, int fromIndex, int toIndex, Throwables.Function<? super T, ? extends R[], throws EE> mapper) Mostly it's designed for one-step operation to complete the operation in one step.java.util.stream.Stream
is preferred for multiple phases operation.- Type Parameters:
T
-R
-E
-- Parameters:
c
-fromIndex
-toIndex
-mapper
-- Returns:
- Throws:
E
- the e
-
flatmap
public static <T,R, C flatmapC extends Collection<R>, E extends Exception> (Collection<? extends T> c, int fromIndex, int toIndex, Throwables.Function<? super T, ? extends R[], throws EE> mapper, IntFunction<? extends C> supplier) Mostly it's designed for one-step operation to complete the operation in one step.java.util.stream.Stream
is preferred for multiple phases operation.- Type Parameters:
T
-R
-C
-E
-- Parameters:
c
-fromIndex
-toIndex
-mapper
-supplier
-- Returns:
- Throws:
E
- the e
-
flatmap
public static <T,R, List<R> flatmapE extends Exception> (Iterable<? extends T> c, Throwables.Function<? super T, ? extends R[], throws EE> mapper) - Type Parameters:
T
-R
-E
-- Parameters:
c
-mapper
-- Returns:
- Throws:
E
- the e
-
flatmap
public static <T,R, C flatmapC extends Collection<R>, E extends Exception> (Iterable<? extends T> c, Throwables.Function<? super T, ? extends R[], throws EE> mapper, IntFunction<? extends C> supplier) - Type Parameters:
T
-R
-C
-E
-- Parameters:
c
-mapper
-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 ETake 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 ETake 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
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
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
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
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, ?, throws EE> keyMapper) Distinct by the value mapped fromkeyMapper
. 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, ?, throws EE> keyMapper) Distinct by the value mapped fromkeyMapper
. 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>, C distinctByE extends Exception> (T[] a, Throwables.Function<? super T, ?, throws EE> keyMapper, Supplier<C> supplier) Distinct by the value mapped fromkeyMapper
. Mostly it's designed for one-step operation to complete the operation in one step.java.util.stream.Stream
is preferred for multiple phases operation.- Type Parameters:
T
-C
-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(Collection<? extends T> c, int fromIndex, int toIndex, Throwables.Function<? super T, ?, throws EE> keyMapper) Distinct by the value mapped fromkeyMapper
. 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
-
distinctBy
public static <T,E extends Exception> List<T> distinctBy(Iterable<? extends T> c, Throwables.Function<? super T, ?, throws EE> keyMapper) Distinct by the value mapped fromkeyMapper
. 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>, C distinctByE extends Exception> (Iterable<? extends T> c, Throwables.Function<? super T, ?, throws EE> keyMapper, Supplier<C> supplier) Distinct by the value mapped fromkeyMapper
. Mostly it's designed for one-step operation to complete the operation in one step.java.util.stream.Stream
is preferred for multiple phases operation.- Type Parameters:
T
-C
-E
-- Parameters:
c
-keyMapper
- don't change value of the input parameter.supplier
-- 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:
iter
-atLeast
-atMost
-filter
-- Returns:
- Throws:
E
- the e
-
allTrue
public static boolean allTrue(boolean[] a) - Parameters:
a
-- Returns:
-
allFalse
public static boolean allFalse(boolean[] a) - Parameters:
a
-- Returns:
-
anyTrue
public static boolean anyTrue(boolean[] a) - Parameters:
a
-- Returns:
-
anyFalse
public static boolean anyFalse(boolean[] a) - Parameters:
a
-- Returns:
-
count
public static <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
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 EMostly 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 EMostly 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 EMostly 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 EMostly 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
- Parameters:
iter
-- Returns:
- Throws:
ArithmeticException
- if the totalcount
overflows anint
.
-
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
-E
-- Parameters:
iter
-filter
-- Returns:
- Throws:
ArithmeticException
- if the total matchedcount
overflows anint
.E
-
merge
public static <T,E extends Exception> List<T> merge(T[] a, T[] b, Throwables.BiFunction<? super T, ? super T, throws EMergeResult, E> nextSelector) - 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, throws EMergeResult, E> nextSelector) - 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) - Type Parameters:
T
-- Parameters:
c
-nextSelector
-- Returns:
-
merge
public static <T,C extends Collection<T>> C merge(Collection<? extends Iterable<? extends T>> c, BiFunction<? super T, ? super T, MergeResult> nextSelector, IntFunction<? extends C> supplier) - Type Parameters:
T
-C
-- Parameters:
c
-nextSelector
-supplier
-- Returns:
-
zip
public static <A,B, List<R> zipR, E extends Exception> (A[] a, B[] b, Throwables.BiFunction<? super A, ? super B, throws E? extends R, E> zipFunction) - Type Parameters:
A
-B
-R
-E
-- Parameters:
a
-b
-zipFunction
-- Returns:
- Throws:
E
- the e
-
zip
public static <A,B, List<R> zipR, E extends Exception> (Iterable<A> a, Iterable<B> b, Throwables.BiFunction<? super A, ? super B, throws E? extends R, E> zipFunction) - Type Parameters:
A
-B
-R
-E
-- Parameters:
a
-b
-zipFunction
-- Returns:
- Throws:
E
- the e
-
zip
public static <A,B, List<R> zipC, R, E extends Exception> (A[] a, B[] b, C[] c, Throwables.TriFunction<? super A, ? super B, throws E? super C, ? extends R, E> zipFunction) - Type Parameters:
A
-B
-C
-R
-E
-- Parameters:
a
-b
-c
-zipFunction
-- Returns:
- Throws:
E
- the e
-
zip
public static <A,B, List<R> zipC, R, E extends Exception> (Iterable<A> a, Iterable<B> b, Iterable<C> c, Throwables.TriFunction<? super A, ? super B, throws E? super C, ? extends R, E> zipFunction) - Type Parameters:
A
-B
-C
-R
-E
-- Parameters:
a
-b
-c
-zipFunction
-- Returns:
- Throws:
E
- the e
-
zip
public static <A,B, List<R> zipR, E extends Exception> (A[] a, B[] b, A valueForNoneA, B valueForNoneB, Throwables.BiFunction<? super A, ? super B, throws E? extends R, E> zipFunction) - Type Parameters:
A
-B
-R
-E
-- Parameters:
a
-b
-valueForNoneA
-valueForNoneB
-zipFunction
-- Returns:
- Throws:
E
- the e
-
zip
public static <A,B, List<R> zipR, E extends Exception> (Iterable<A> a, Iterable<B> b, A valueForNoneA, B valueForNoneB, Throwables.BiFunction<? super A, ? super B, throws E? extends R, E> zipFunction) - Type Parameters:
A
-B
-R
-E
-- Parameters:
a
-b
-valueForNoneA
-valueForNoneB
-zipFunction
-- Returns:
- Throws:
E
- the e
-
zip
public static <A,B, List<R> zipC, R, E extends Exception> (A[] a, B[] b, C[] c, A valueForNoneA, B valueForNoneB, C valueForNoneC, Throwables.TriFunction<? super A, ? super B, throws E? super C, ? extends R, E> zipFunction) - 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, List<R> zipC, R, E extends Exception> (Iterable<A> a, Iterable<B> b, Iterable<C> c, A valueForNoneA, B valueForNoneB, C valueForNoneC, Throwables.TriFunction<? super A, ? super B, throws E? super C, ? extends R, E> zipFunction) - 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[] zipR, E extends Exception> (Class<R> targetElementType, A[] a, B[] b, Throwables.BiFunction<? super A, ? super B, throws E? extends R, E> zipFunction) - Type Parameters:
A
-B
-R
-E
-- Parameters:
targetElementType
-a
-b
-zipFunction
-- Returns:
- Throws:
E
- the e
-
zip
public static <A,B, R[] zipR, E extends Exception> (Class<R> targetElementType, A[] a, B[] b, A valueForNoneA, B valueForNoneB, Throwables.BiFunction<? super A, ? super B, throws E? extends R, E> zipFunction) - Type Parameters:
A
-B
-R
-E
-- Parameters:
targetElementType
-a
-b
-valueForNoneA
-valueForNoneB
-zipFunction
-- Returns:
- Throws:
E
- the e
-
zip
public static <A,B, R[] zipC, R, E extends Exception> (Class<R> targetElementType, A[] a, B[] b, C[] c, Throwables.TriFunction<? super A, ? super B, throws E? super C, ? extends R, E> zipFunction) - Type Parameters:
A
-B
-C
-R
-E
-- Parameters:
targetElementType
-a
-b
-c
-zipFunction
-- Returns:
- Throws:
E
- the e
-
zip
public static <A,B, R[] zipC, R, E extends Exception> (Class<R> targetElementType, A[] a, B[] b, C[] c, A valueForNoneA, B valueForNoneB, C valueForNoneC, Throwables.TriFunction<? super A, ? super B, throws E? super C, ? extends R, E> zipFunction) - 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, Pair<List<A>,B, E extends Exception> List<B>> unzip(Iterable<? extends T> c, Throwables.BiConsumer<? super T, Pair<A, throws EB>, E> unzip) - 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, Pair<LC,B, LC extends Collection<A>, RC extends Collection<B>, E extends Exception> RC> unzip(Iterable<? extends T> c, Throwables.BiConsumer<? super T, Pair<A, throws EB>, E> unzip, IntFunction<? extends Collection<?>> supplier) - 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, Triple<List<A>,B, C, E extends Exception> List<B>, unzippList<C>> (Iterable<? extends T> c, Throwables.BiConsumer<? super T, Triple<A, throws EB, C>, E> unzip) - 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, Triple<LC,B, C, LC extends Collection<A>, MC extends Collection<B>, RC extends Collection<C>, E extends Exception> MC, unzippRC> (Iterable<? extends T> c, Throwables.BiConsumer<? super T, Triple<A, throws EB, C>, E> unzip, IntFunction<? extends Collection<?>> supplier) - 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
-
groupBy
@Beta public static <K,T, Map<K,E extends Exception> List<T>> groupBy(T[] a, Throwables.Function<? super T, ? extends K, throws EE> keyExtractor) - Type Parameters:
K
-T
-E
-- Parameters:
a
-keyExtractor
-- Returns:
- Throws:
E
-
groupBy
@Beta public static <K,T, M groupByM extends Map<K, List<T>>, E extends Exception> (T[] a, Throwables.Function<? super T, ? extends K, throws EE> keyExtractor, Supplier<M> mapSupplier) - Type Parameters:
K
-T
-M
-E
-- Parameters:
a
-keyExtractor
-mapSupplier
-- Returns:
- Throws:
E
-
groupBy
@Beta public static <K,T, Map<K,E extends Exception> List<T>> groupBy(T[] a, int fromIndex, int toIndex, Throwables.Function<? super T, ? extends K, throws EE> keyExtractor) - Type Parameters:
K
-T
-E
-- Parameters:
a
-fromIndex
-toIndex
-keyExtractor
-- Returns:
- Throws:
E
-
groupBy
@Beta public static <K,T, M groupByM extends Map<K, List<T>>, E extends Exception> (T[] a, int fromIndex, int toIndex, Throwables.Function<? super T, ? extends K, throws EE> keyExtractor, Supplier<M> mapSupplier) - Type Parameters:
K
-T
-M
-E
-- Parameters:
a
-fromIndex
-toIndex
-keyExtractor
-mapSupplier
-- Returns:
- Throws:
E
-
groupBy
@Beta public static <K,T, Map<K,E extends Exception> List<T>> groupBy(Iterable<? extends T> iter, Throwables.Function<? super T, ? extends K, throws EE> keyExtractor) - Type Parameters:
K
-T
-E
-- Parameters:
iter
-keyExtractor
-- Returns:
- Throws:
E
-
groupBy
@Beta public static <K,T, M groupByM extends Map<K, List<T>>, E extends Exception> (Iterable<? extends T> iter, Throwables.Function<? super T, ? extends K, throws EE> keyExtractor, Supplier<M> mapSupplier) - Type Parameters:
K
-T
-M
-E
-- Parameters:
iter
-keyExtractor
-mapSupplier
-- Returns:
- Throws:
E
-
groupBy
@Beta public static <K,T, Map<K,E extends Exception> List<T>> groupBy(Iterator<? extends T> iter, Throwables.Function<? super T, ? extends K, throws EE> keyExtractor) - Type Parameters:
K
-T
-E
-- Parameters:
iter
-keyExtractor
-- Returns:
- Throws:
E
-
groupBy
@Beta public static <K,T, M groupByM extends Map<K, List<T>>, E extends Exception> (Iterator<? extends T> iter, Throwables.Function<? super T, ? extends K, throws EE> keyExtractor, Supplier<M> mapSupplier) - Type Parameters:
K
-T
-M
-E
-- Parameters:
iter
-keyExtractor
-mapSupplier
-- Returns:
- Throws:
E
-
iterate
- Type Parameters:
T
-- Parameters:
a
-- Returns:
- See Also:
-
iterate
- Type Parameters:
T
-- Parameters:
a
-fromIndex
-toIndex
-- Returns:
- See Also:
-
iterate
- Type Parameters:
T
-- Parameters:
iterable
-- Returns:
-
disjoint
- Parameters:
a
-b
-- Returns:
-
disjoint
Returnstrue
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
- Parameters:
obj
-- Returns:
-
toJSON
- Parameters:
obj
-prettyFormat
-- Returns:
-
toJSON
- Parameters:
obj
-config
-- Returns:
-
toJSON
- Parameters:
file
-obj
-
-
toJSON
- Parameters:
file
-obj
-config
-
-
toJSON
- Parameters:
os
-obj
-
-
toJSON
- Parameters:
os
-obj
-config
-
-
toJSON
- Parameters:
writer
-obj
-
-
toJSON
- Parameters:
writer
-obj
-config
-
-
fromJSON
- 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
- 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
- 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
- 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
- Type Parameters:
T
-- Parameters:
targetType
- can be theType
ofBean/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 theType
ofBean/Array/Collection/Map
.json
-config
-- Returns:
- See Also:
-
fromJSON
- Type Parameters:
T
-- Parameters:
targetType
- can be theType
ofBean/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 theType
ofBean/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 theType
ofBean/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 theType
ofBean/Array/Collection/Map
.json
-config
-- Returns:
- See Also:
-
fromJSON
- Type Parameters:
T
-- Parameters:
targetType
- can be theType
ofBean/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 theType
ofBean/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 theType
ofBean/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 theType
ofBean/Array/Collection/Map
.json
-fromIndex
-toIndex
-config
-- Returns:
- See Also:
-
streamJSON
public static <T> CheckedStream<T,IOException> streamJSON(Class<? extends T> elementClass, String source) - Type Parameters:
T
-- Parameters:
elementClass
- Only Bean/Map/Collection/Array/DataSet element types are supported at present.source
-- Returns:
-
streamJSON
public static <T> CheckedStream<T,IOException> streamJSON(Class<? extends T> elementClass, String source, JSONDeserializationConfig config) - Type Parameters:
T
-- Parameters:
elementClass
- Only Bean/Map/Collection/Array/DataSet element types are supported at present.source
-config
-- Returns:
-
streamJSON
public static <T> CheckedStream<T,IOException> streamJSON(Class<? extends T> elementClass, File source) - Type Parameters:
T
-- Parameters:
elementClass
- Only Bean/Map/Collection/Array/DataSet element types are supported at present.source
-- Returns:
-
streamJSON
public static <T> CheckedStream<T,IOException> streamJSON(Class<? extends T> elementClass, File source, JSONDeserializationConfig config) - Type Parameters:
T
-- Parameters:
elementClass
- Only Bean/Map/Collection/Array/DataSet element types are supported at present.source
-config
-- Returns:
-
streamJSON
public static <T> CheckedStream<T,IOException> streamJSON(Class<? extends T> elementClass, InputStream source) - Type Parameters:
T
-- Parameters:
elementClass
- Only Bean/Map/Collection/Array/DataSet element types are supported at present.source
-- Returns:
-
streamJSON
public static <T> CheckedStream<T,IOException> streamJSON(Class<? extends T> elementClass, InputStream source, boolean closeInputStreamWhenStreamIsClosed) - Type Parameters:
T
-- Parameters:
elementClass
- Only Bean/Map/Collection/Array/DataSet element types are supported at present.source
-closeInputStreamWhenStreamIsClosed
-- Returns:
-
streamJSON
public static <T> CheckedStream<T,IOException> streamJSON(Class<? extends T> elementClass, InputStream source, boolean closeInputStreamWhenStreamIsClosed, JSONDeserializationConfig config) - Type Parameters:
T
-- Parameters:
elementClass
- Only Bean/Map/Collection/Array/DataSet element types are supported at present.source
-closeInputStreamWhenStreamIsClosed
-config
-- Returns:
-
streamJSON
public static <T> CheckedStream<T,IOException> streamJSON(Class<? extends T> elementClass, Reader source) - Type Parameters:
T
-- Parameters:
elementClass
- Only Bean/Map/Collection/Array/DataSet element types are supported at present.source
-- Returns:
-
streamJSON
public static <T> CheckedStream<T,IOException> streamJSON(Class<? extends T> elementClass, Reader source, boolean closeReaderWhenStreamIsClosed) - Type Parameters:
T
-- Parameters:
elementClass
- Only Bean/Map/Collection/Array/DataSet element types are supported at present.source
-closeReaderWhenStreamIsClosed
-- Returns:
-
streamJSON
public static <T> CheckedStream<T,IOException> streamJSON(Class<? extends T> elementClass, Reader source, boolean closeReaderWhenStreamIsClosed, JSONDeserializationConfig config) - Type Parameters:
T
-- Parameters:
elementClass
- Only Bean/Map/Collection/Array/DataSet element types are supported at present.source
-closeReaderWhenStreamIsClosed
-config
-- Returns:
-
formatJSON
- Parameters:
json
-- Returns:
- See Also:
-
formatJSON
- Parameters:
json
-config
-- Returns:
- See Also:
-
formatJSON
- Parameters:
type
-json
-- Returns:
- See Also:
-
formatJSON
- Parameters:
type
-json
-config
-- Returns:
- See Also:
-
formatJSON
- Parameters:
type
-json
-- Returns:
- See Also:
-
formatJSON
public static String formatJSON(com.landawn.abacus.type.Type<?> type, String json, JSONSerializationConfig config) - Parameters:
type
-json
-config
-- Returns:
- See Also:
-
toXML
- Parameters:
obj
-- Returns:
-
toXML
- Parameters:
obj
-prettyFormat
-- Returns:
-
toXML
- Parameters:
obj
-config
-- Returns:
-
toXML
- Parameters:
file
-obj
-
-
toXML
- Parameters:
file
-obj
-config
-
-
toXML
- Parameters:
os
-obj
-
-
toXML
- Parameters:
os
-obj
-config
-
-
toXML
- Parameters:
writer
-obj
-
-
toXML
- Parameters:
writer
-obj
-config
-
-
fromXML
- 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
- 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
- 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
- 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
- Type Parameters:
T
-- Parameters:
targetType
- can be theType
ofBean/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 theType
ofBean/Array/Collection/Map
.xml
-config
-- Returns:
- See Also:
-
fromXML
- Type Parameters:
T
-- Parameters:
targetType
- can be theType
ofBean/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 theType
ofBean/Array/Collection/Map
.xml
-config
-- Returns:
- See Also:
-
fromXML
- Type Parameters:
T
-- Parameters:
targetType
- can be theType
ofBean/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 theType
ofBean/Array/Collection/Map
.xml
-config
-- Returns:
- See Also:
-
fromXML
- Type Parameters:
T
-- Parameters:
targetType
- can be theType
ofBean/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 theType
ofBean/Array/Collection/Map
.xml
-config
-- Returns:
- See Also:
-
formatXML
- Parameters:
xml
-- Returns:
- See Also:
-
formatXML
- Parameters:
xml
-config
-- Returns:
- See Also:
-
formatXML
- Parameters:
type
-xml
-- Returns:
- See Also:
-
formatXML
- Parameters:
type
-xml
-config
-- Returns:
- See Also:
-
formatXML
- Parameters:
type
-xml
-- Returns:
- See Also:
-
formatXML
public static String formatXML(com.landawn.abacus.type.Type<?> type, String xml, XMLSerializationConfig config) - Parameters:
type
-xml
-config
-- Returns:
- See Also:
-
xml2JSON
Xml 2 JSO.- Parameters:
xml
-- Returns:
- See Also:
-
xml2JSON
Xml 2 JSO.- Parameters:
cls
-xml
-- Returns:
- See Also:
-
json2XML
Json 2 XML.- Parameters:
json
-- Returns:
- See Also:
-
json2XML
Json 2 XML.- Parameters:
cls
-json
-- Returns:
- See Also:
-
execute
public static void execute(Throwables.Runnable<? extends Exception> cmd, int retryTimes, long retryIntervallInMillis, Predicate<? super Exception> retryCondition) - Parameters:
cmd
-retryTimes
-retryIntervallInMillis
-retryCondition
-- See Also:
-
execute
public static <R> R execute(Callable<R> cmd, int retryTimes, long retryIntervallInMillis, BiPredicate<? super R, ? super Exception> retryCondition) - Type Parameters:
R
-- Parameters:
cmd
-retryTimes
-retryIntervallInMillis
-retryCondition
-- Returns:
- See Also:
-
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 List<ContinuableFuture<Void>> asyncExecute(List<? extends Throwables.Runnable<? extends Exception>> commands, Executor executor) - Parameters:
commands
-executor
-- Returns:
- See Also:
-
asyncExecute
- Type Parameters:
R
-- Parameters:
command
-- Returns:
- See Also:
-
asyncExecute
- Type Parameters:
R
-- Parameters:
command
-delayInMillis
-- Returns:
- See Also:
-
asyncExecute
- 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 <R> List<ContinuableFuture<R>> asyncExecute(Collection<? extends Callable<R>> commands, Executor executor) - Type Parameters:
R
-- Parameters:
commands
-executor
-- Returns:
- See Also:
-
asyncExecute
public static ContinuableFuture<Void> asyncExecute(Throwables.Runnable<? extends Exception> cmd, int retryTimes, long retryIntervallInMillisInMillis, Predicate<? super Exception> retryCondition) - Parameters:
cmd
-retryTimes
-retryIntervallInMillisInMillis
-retryCondition
-- Returns:
- See Also:
-
asyncExecute
public static <R> ContinuableFuture<R> asyncExecute(Callable<R> cmd, int retryTimes, long retryIntervallInMillisInMillis, BiPredicate<? super R, ? super Exception> retryCondition) - Type Parameters:
R
-- Parameters:
cmd
-retryTimes
-retryIntervallInMillisInMillis
-retryCondition
-- Returns:
- See Also:
-
asyncExecute
public static ContinuableFuture<Void> asyncExecute(Throwables.Runnable<? extends Exception> command, Executor executor) - Parameters:
command
-executor
-- Returns:
-
asyncExecute
- Type Parameters:
R
-- Parameters:
command
-executor
-- Returns:
-
asynRun
public static ObjIterator<Void> asynRun(Collection<? extends Throwables.Runnable<? extends Exception>> commands) Executes the specified commands/tasks asynchronous and immediately returns aniterator
for iterating the result lazily. The first element will be the result of the command/task which is completed first.
If error happens in one command/task, iteration will be interrupted and error will be thrown. But other commands/tasks won't be impacted or cancelled.- Parameters:
commands
-- Returns:
-
asynRun
public static ObjIterator<Void> asynRun(Collection<? extends Throwables.Runnable<? extends Exception>> commands, Executor executor) Executes the specified commands/tasks asynchronous and immediately returns aniterator
for iterating the result lazily. The first element will be the result of the command/task which is completed first.
If error happens in one command/task, iteration will be interrupted and error will be thrown. But other commands/tasks won't be impacted or cancelled.- Parameters:
commands
-executor
-- Returns:
-
asynCall
Executes the specified commands/tasks asynchronous and immediately returns aniterator
for iterating the result lazily. The first element will be the result of the command/task which is completed first.
If error happens in one command/task, iteration will be interrupted and error will be thrown. But other commands/tasks won't be impacted or cancelled.- Type Parameters:
R
-- Parameters:
commands
-- Returns:
-
asynCall
public static <R> ObjIterator<R> asynCall(Collection<? extends Callable<? extends R>> commands, Executor executor) Executes the specified commands/tasks asynchronous and immediately returns aniterator
for iterating the result lazily. The first element will be the result of the command/task which is completed first.
If error happens in one command/task, iteration will be interrupted and error will be thrown. But other commands/tasks won't be impacted or cancelled.- Type Parameters:
R
-- Parameters:
commands
-executor
-- Returns:
-
runInParallel
public static void runInParallel(Throwables.Runnable<? extends Exception> command, Throwables.Runnable<? extends Exception> command2) Executes and complete the input commands in parallel.
if error happens in one task,cancel
will be called for other unfinished tasks.- Parameters:
command
- to be completed in current thread.command2
- to be completed in another thread.- See Also:
-
runInParallel
public static void runInParallel(Throwables.Runnable<? extends Exception> command, Throwables.Runnable<? extends Exception> command2, Throwables.Runnable<? extends Exception> command3) Executes and complete the input commands in parallel.
if error happens in one task,cancel
will be called for other unfinished tasks.- Parameters:
command
- to be completed in current thread.command2
- to be completed in another thread.command3
- to be completed in another thread.- See Also:
-
runInParallel
public static void runInParallel(Throwables.Runnable<? extends Exception> command, Throwables.Runnable<? extends Exception> command2, Throwables.Runnable<? extends Exception> command3, Throwables.Runnable<? extends Exception> command4) Executes and complete the input commands in parallel.
if error happens in one task,cancel
will be called for other unfinished tasks.- Parameters:
command
- to be completed in current thread.command2
- to be completed in another thread.command3
- to be completed in another thread.command4
- to be completed in another thread.- See Also:
-
runInParallel
public static void runInParallel(Throwables.Runnable<? extends Exception> command, Throwables.Runnable<? extends Exception> command2, Throwables.Runnable<? extends Exception> command3, Throwables.Runnable<? extends Exception> command4, Throwables.Runnable<? extends Exception> command5) Executes and complete the input commands in parallel.
if error happens in one task,cancel
will be called for other unfinished tasks.- Parameters:
command
- to be completed in current thread.command2
- to be completed in another thread.command3
- to be completed in another thread.command4
- to be completed in another thread.command5
- to be completed in another thread.- See Also:
-
runInParallel
public static void runInParallel(Collection<? extends Throwables.Runnable<? extends Exception>> commands) Executes and complete the input commands in parallel.
if error happens in one task,cancel
will be called for other unfinished tasks.- Parameters:
commands
-
-
runInParallel
public static void runInParallel(Collection<? extends Throwables.Runnable<? extends Exception>> commands, Executor executor) Executes and complete the input commands in parallel.
if error happens in one task,cancel
will be called for other unfinished tasks.- Parameters:
commands
-executor
-
-
callInParallel
Executes and complete the input commands in parallel.
if error happens in one task,cancel
will be called for other unfinished tasks.- Type Parameters:
R
-R2
-- Parameters:
command
- to be completed in current thread.command2
- to be completed in another thread.- Returns:
- See Also:
-
Fn#jr2c(Runnable)
-
callInParallel
public static <R,R2, Tuple.Tuple3<R,R3> R2, callInParallelR3> (Callable<R> command, Callable<R2> command2, Callable<R3> command3) Executes and complete the input commands in parallel.
if error happens in one task,cancel
will be called for other unfinished tasks.- Type Parameters:
R
-R2
-R3
-- Parameters:
command
- to be completed in current thread.command2
- to be completed in another thread.command3
- to be completed in another thread.- Returns:
- See Also:
-
Fn#jr2c(Runnable)
-
callInParallel
public static <R,R2, Tuple.Tuple4<R,R3, R4> R2, callInParallelR3, R4> (Callable<R> command, Callable<R2> command2, Callable<R3> command3, Callable<R4> command4) Executes and complete the input commands in parallel.
if error happens in one task,cancel
will be called for other unfinished tasks.- Type Parameters:
R
-R2
-R3
-R4
-- Parameters:
command
- to be completed in current thread.command2
- to be completed in another thread.command3
- to be completed in another thread.command4
- to be completed in another thread.- Returns:
- See Also:
-
Fn#jr2c(Runnable)
-
callInParallel
public static <R,R2, Tuple.Tuple5<R,R3, R4, R5> R2, callInParallelR3, R4, R5> (Callable<R> command, Callable<R2> command2, Callable<R3> command3, Callable<R4> command4, Callable<R5> command5) Executes and complete the input commands in parallel.
if error happens in one task,cancel
will be called for other unfinished tasks.- Type Parameters:
R
-R2
-R3
-R4
-R5
-- Parameters:
command
- to be completed in current thread.command2
- to be completed in another thread.command3
- to be completed in another thread.command4
- to be completed in another thread.command5
- to be completed in another thread.- Returns:
- See Also:
-
Fn#jr2c(Runnable)
-
callInParallel
Executes and complete the input commands in parallel.
if error happens in one task,cancel
will be called for other unfinished tasks.- Type Parameters:
R
-- Parameters:
commands
-- Returns:
-
callInParallel
public static <R> List<R> callInParallel(Collection<? extends Callable<? extends R>> commands, Executor executor) Executes and complete the input commands in parallel.
if error happens in one task,cancel
will be called for other unfinished tasks.- Type Parameters:
R
-- Parameters:
commands
-executor
-- Returns:
-
runByBatch
public static <T,E extends Exception> void runByBatch(T[] a, int batchSize, Throwables.Consumer<? super List<? extends T>, E> batchAction) throws E- Type Parameters:
T
-E
-- Parameters:
a
-batchSize
-batchAction
-- Throws:
E
-
runByBatch
public static <T,E extends Exception> void runByBatch(Iterable<? extends T> iter, int batchSize, Throwables.Consumer<? super List<? extends T>, E> batchAction) throws E- Type Parameters:
T
-E
-- Parameters:
iter
-batchSize
-batchAction
-- Throws:
E
-
runByBatch
public static <T,E extends Exception> void runByBatch(Iterator<? extends T> iter, int batchSize, Throwables.Consumer<? super List<? extends T>, E> batchAction) throws E- Type Parameters:
T
-E
-- Parameters:
iter
-batchSize
-batchAction
-- Throws:
E
-
runByBatch
public static <T,E extends Exception, void runByBatchE2 extends Exception> (T[] a, int batchSize, Throwables.Consumer<? super T, E> elementConsumer, Throwables.Runnable<E2> batchAction) throws E, E2- Type Parameters:
T
-E
-E2
-- Parameters:
a
-batchSize
-elementConsumer
-batchAction
-- Throws:
E
E2
-
runByBatch
public static <T,E extends Exception, void runByBatchE2 extends Exception> (Iterable<? extends T> iter, int batchSize, Throwables.Consumer<? super T, E> elementConsumer, Throwables.Runnable<E2> batchAction) throws E, E2- Type Parameters:
T
-E
-E2
-- Parameters:
iter
-batchSize
-elementConsumer
-batchAction
-- Throws:
E
E2
-
runByBatch
public static <T,E extends Exception, void runByBatchE2 extends Exception> (Iterator<? extends T> iter, int batchSize, Throwables.Consumer<? super T, E> elementConsumer, Throwables.Runnable<E2> batchAction) throws E, E2- Type Parameters:
T
-E
-E2
-- Parameters:
iter
-batchSize
-elementConsumer
-batchAction
-- Throws:
E
E2
-
callByBatch
public static <T,R, List<R> callByBatchE extends Exception> (T[] a, int batchSize, Throwables.Function<? super List<? extends T>, R, throws EE> batchAction) - Type Parameters:
T
-R
-E
-- Parameters:
a
-batchSize
-batchAction
-- Throws:
E
-
callByBatch
public static <T,R, List<R> callByBatchE extends Exception> (Iterable<? extends T> iter, int batchSize, Throwables.Function<? super List<? extends T>, R, throws EE> batchAction) - Type Parameters:
T
-R
-E
-- Parameters:
iter
-batchSize
-batchAction
-- Throws:
E
-
callByBatch
public static <T,R, List<R> callByBatchE extends Exception> (Iterator<? extends T> iter, int batchSize, Throwables.Function<? super List<? extends T>, R, throws EE> batchAction) - Type Parameters:
T
-R
-E
-- Parameters:
iter
-batchSize
-batchAction
-- Throws:
E
-
callByBatch
public static <T,R, List<R> callByBatchE extends Exception, E2 extends Exception> (T[] a, int batchSize, Throwables.Consumer<? super T, E> elementConsumer, Throwables.Callable<? extends R, throws E, E2E2> batchAction) - Type Parameters:
T
-R
-E
-E2
-- Parameters:
a
-batchSize
-elementConsumer
-batchAction
-- Throws:
E
E2
-
callByBatch
public static <T,R, List<R> callByBatchE extends Exception, E2 extends Exception> (Iterable<? extends T> iter, int batchSize, Throwables.Consumer<? super T, E> elementConsumer, Throwables.Callable<? extends R, throws E, E2E2> batchAction) - Type Parameters:
T
-E
-E2
-- Parameters:
iter
-batchSize
-elementConsumer
-batchAction
-- Throws:
E
E2
-
callByBatch
public static <T,R, List<R> callByBatchE extends Exception, E2 extends Exception> (Iterator<? extends T> iter, int batchSize, Throwables.Consumer<? super T, E> elementConsumer, Throwables.Callable<? extends R, throws E, E2E2> batchAction) - Type Parameters:
T
-R
-E
-E2
-- Parameters:
iter
-batchSize
-elementConsumer
-batchAction
-- Throws:
E
E2
-
runUninterruptibly
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, throws IllegalArgumentExceptionInterruptedException> 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:
timeout
-unit
-cmd
-- Throws:
IllegalArgumentException
- if the specifiedunit/cmd
isnull
.
-
callUninterruptibly
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, throws IllegalArgumentExceptionT, 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:
timeout
-unit
-cmd
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedunit/cmd
isnull
.
-
sleep
public static void sleep(long timeoutInMillis) - Parameters:
timeoutInMillis
-
-
sleep
- Parameters:
timeout
-unit
-- Throws:
IllegalArgumentException
- if the specifiedunit
isnull
.
-
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 specifiedunit
isnull
.
-
toRuntimeException
- Parameters:
e
-- Returns:
- See Also:
-
toRuntimeException
Converts the specifiedThrowable
to aRuntimeException
if it's a checkedexception
or anError
, otherwise returns itself.- Parameters:
e
-- Returns:
- See Also:
-
toRuntimeException
Converts the specifiedThrowable
to aRuntimeException
if it's a checkedexception
, or throw it if it's anError
. Otherwise returns itself.- Parameters:
e
-throwIfItIsError
-- Returns:
- See Also:
-
println
public static <T> T println(T obj) - Type Parameters:
T
-- Parameters:
obj
-- Returns:
-
fprintln
- Type Parameters:
T
-- Parameters:
format
-args
-- Returns:
-
castIfAssignable
Returns an emptyNullable
ifval
isnull
whiletargetType
is primitive or can not be assigned totargetType
. Please be aware thatnull
can be assigned to anyObject
type except primitive types:boolean/char/byte/short/int/long/double
.- Type Parameters:
T
-- Parameters:
val
-targetType
-- Returns:
-
tryOrEmptyIfExceptionOccurred
Returns aNullable
with the value returned byaction
or an emptyNullable
if exception happens.- Type Parameters:
R
-- Parameters:
cmd
-- Returns:
- See Also:
-
tryOrEmptyIfExceptionOccurred
@Beta public static <T,R> u.Nullable<R> tryOrEmptyIfExceptionOccurred(T init, Throwables.Function<? super T, ? extends R, ? extends Exception> func) Returns aNullable
with the value returned byfunc.apply(init)
or an emptyNullable
if exception happens.- Type Parameters:
T
-R
-- Parameters:
init
-func
-- Returns:
- See Also:
-
tryOrDefaultIfExceptionOccurred
@Beta public static <R> R tryOrDefaultIfExceptionOccurred(Callable<R> cmd, R defaultIfExceptionOccurred) Returns the value returned byaction
ordefaultIfExceptionOccurred
if exception happens.- Type Parameters:
R
-- Parameters:
cmd
-defaultIfExceptionOccurred
-- Returns:
- See Also:
-
tryOrDefaultIfExceptionOccurred
@Beta public static <T,R> R tryOrDefaultIfExceptionOccurred(T init, Throwables.Function<? super T, ? extends R, ? extends Exception> func, R defaultIfExceptionOccurred) Returns the value returned byaction
ordefaultIfExceptionOccurred
if exception happens.- Type Parameters:
T
-R
-- Parameters:
init
-func
-defaultIfExceptionOccurred
-- Returns:
- See Also:
-
tryOrDefaultIfExceptionOccurred
@Beta public static <R> R tryOrDefaultIfExceptionOccurred(Callable<R> cmd, Supplier<R> supplierForDefaultIfExceptionOccurred) Returns the value returned byaction
or{@code supplierForDefaultIfExceptionOccurred}
if exception happens.- Type Parameters:
R
-- Parameters:
cmd
-supplierForDefaultIfExceptionOccurred
-- Returns:
- See Also:
-
tryOrDefaultIfExceptionOccurred
@Beta public static <T,R> R tryOrDefaultIfExceptionOccurred(T init, Throwables.Function<? super T, ? extends R, ? extends Exception> func, Supplier<R> supplierForDefaultIfExceptionOccurred) Returns the value returned byaction
ordefaultIfExceptionOccurred
if exception happens.- Type Parameters:
T
-R
-- Parameters:
init
-func
-supplierForDefaultIfExceptionOccurred
-- Returns:
- See Also:
-
ifOrEmpty
@Beta public static <R,E extends Exception> u.Nullable<R> ifOrEmpty(boolean b, Throwables.Supplier<R, E> supplier) throws EReturns aNullable
with value got from the specifiedsupplier
ifb
istrue
, otherwise returns an emptyNullable
ifb
is false.- Type Parameters:
R
-E
-- Parameters:
b
-supplier
-- Returns:
- Throws:
E
- the e
-
ifOrEmpty
@Beta public static <T,R, u.Nullable<R> ifOrEmptyE extends Exception> (boolean b, T init, Throwables.Function<? super T, ? extends R, throws EE> func) Returns aNullable
with value returned byfunc.apply(init)
ifb
istrue
, otherwise returns an emptyNullable
ifb
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'snull
evenb
is true.actionForFalse
- do nothing if it'snull
evenb
is false.- Throws:
E1
- the e1E2
- the e2
-
ifOrElse
@Beta public static <T,E1 extends Exception, void ifOrElseE2 extends Exception> (boolean b, T init, Throwables.Consumer<? super T, E1> actionForTrue, Throwables.Consumer<? super T, throws E1, E2E2> actionForFalse) If or else.- Type Parameters:
T
-E1
-E2
-- Parameters:
b
-init
-actionForTrue
- do nothing if it'snull
evenb
is true.actionForFalse
- do nothing if it'snull
evenb
is false.- Throws:
E1
- the e1E2
- the e2
-
lazyInit
- Type Parameters:
T
-- Parameters:
supplier
-- Returns:
-
lazyInitialize
@Beta public static <T,E extends Exception> Throwables.LazyInitializer<T,E> lazyInitialize(Throwables.Supplier<T, E> supplier) - Type Parameters:
T
-E
-- Parameters:
supplier
-- Returns:
-
isPrimitiveType
Checks if is primitive type.- Parameters:
cls
-- Returns:
- true, if is primitive type
-
isWrapperType
Checks if is wrapper type.- Parameters:
cls
-- Returns:
- true, if is wrapper type
-
isPrimitiveArrayType
Checks if is primitive array type.- Parameters:
cls
-- Returns:
- true, if is primitive array type
-
wrap
Returns the corresponding wrapper type oftype
if it is a primitive type; otherwise returnstype
itself. Idempotent.wrap(int.class) == Integer.class wrap(Integer.class) == Integer.class wrap(String.class) == String.class
- Parameters:
cls
-- Returns:
-
unwrap
Returns the corresponding primitive type oftype
if it is a wrapper type; otherwise returnstype
itself. Idempotent.unwrap(Integer.class) == int.class unwrap(int.class) == int.class unwrap(String.class) == String.class
- Parameters:
cls
-- Returns:
-
isTrue
Returnstrue
if the specifiedboolean
isBoolean.TRUE
, notnull
orBoolean.FALSE
.- Parameters:
bool
-- Returns:
-
isNotTrue
Returnstrue
if the specifiedboolean
isnull
orBoolean.FALSE
.- Parameters:
bool
-- Returns:
-
isFalse
Returnstrue
if the specifiedboolean
isBoolean.FALSE
, notnull
orBoolean.TRUE
.- Returns:
-
isNotFalse
Returnstrue
if the specifiedboolean
isnull
orBoolean.TRUE
.- Parameters:
bool
-- Returns:
-
negate
Note: copied from Apache commons Lang under Apache license v2.0
Negates the specified boolean.
If
null
is passed in,null
will be returned.NOTE: This returns null and will throw a NullPointerException if autoboxed to a boolean.
BooleanUtils.negate(Boolean.TRUE) = Boolean.FALSE; BooleanUtils.negate(Boolean.FALSE) = Boolean.TRUE; BooleanUtils.negate(null) = null;
- Parameters:
bool
- the Boolean to negate, may be null- Returns:
- the negated Boolean, or
null
ifnull
input
-
negate
Negates boolean values in the specified boolean array
- Parameters:
a
-
-
negate
Negates boolean values
fromIndex
totoIndex
in the specified boolean array- Parameters:
a
-fromIndex
-toIndex
-
-
reverseOrder
Add it becauseComparator.reversed()
doesn't work well in some scenarios.- Type Parameters:
T
-- Parameters:
cmp
-- Returns:
- See Also:
-
unmodifiableCollection
Returns anunmodifiable view
of the specifiedCollection
. Or an emptyCollection
if the specifiedcollection
is null.- Type Parameters:
T
-- Parameters:
c
-- Returns:
- an empty
Collection
if the specifiedc
is null.
-
unmodifiableList
Returns anunmodifiable view
of the specifiedList
. Or an emptyList
if the specifiedlist
is null.- Type Parameters:
T
-- Parameters:
list
-- Returns:
-
unmodifiableSet
Returns anunmodifiable view
of the specifiedSet
. Or an emptySet
if the specifiedset
is null.- Type Parameters:
T
-- Parameters:
s
-- Returns:
-
unmodifiableSortedSet
Returns anunmodifiable view
of the specifiedSortedSet
. Or an emptySortedSet
if the specifiedset
is null.- Type Parameters:
T
-- Parameters:
s
-- Returns:
-
unmodifiableMap
Returns anunmodifiable view
of the specifiedMap
. Or an emptyMap
if the specifiedmap
is null.- Type Parameters:
K
-V
-- Parameters:
m
-- Returns:
- See Also:
-
unmodifiableSortedMap
Returns anunmodifiable view
of the specifiedSortedMap
. Or an emptySortedMap
if the specifiedmap
is null.- Type Parameters:
K
-V
-- Parameters:
m
-- Returns:
- See Also:
-
applyToEach
@Beta public static <T,E extends Exception> void applyToEach(T[] a, Throwables.Function<? super T, ? extends T, throws EE> converter) Updates each element in the specified arraya
with specified functionconverter
.- 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, throws EE> converter) - Type Parameters:
T
-E
-- Parameters:
c
-converter
-- Throws:
E
-
copyThenApply
public static <T,E extends Exception> T[] copyThenApply(T[] a, Throwables.Function<? super T, ? extends T, throws EE> converter) Copy the specified arraya
first, then callconverter
on the copy.- Type Parameters:
T
-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 specifiedtypeName
isnull
.
-
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 specifiedClass
isnull
.
-
defaultValueOf
Default value of.- Type Parameters:
T
-- Parameters:
cls
-- Returns:
-
defaultIfNull
Default if null.- Parameters:
b
-- Returns:
-
defaultIfNull
Default if null.- Parameters:
b
-defaultForNull
-- Returns:
-
defaultIfNull
Default if null.- Parameters:
c
-- Returns:
-
defaultIfNull
Default if null.- Parameters:
c
-defaultForNull
-- Returns:
-
defaultIfNull
Default if null.- Parameters:
b
-- Returns:
-
defaultIfNull
Default if null.- Parameters:
b
-defaultForNull
-- Returns:
-
defaultIfNull
Default if null.- Parameters:
b
-- Returns:
-
defaultIfNull
Default if null.- Parameters:
b
-defaultForNull
-- Returns:
-
defaultIfNull
Default if null.- Parameters:
b
-- Returns:
-
defaultIfNull
Default if null.- Parameters:
b
-defaultForNull
-- Returns:
-
defaultIfNull
Default if null.- Parameters:
b
-- Returns:
-
defaultIfNull
Default if null.- Parameters:
b
-defaultForNull
-- Returns:
-
defaultIfNull
Default if null.- Parameters:
b
-- Returns:
-
defaultIfNull
Default if null.- Parameters:
b
-defaultForNull
-- Returns:
-
defaultIfNull
Default if null.- Parameters:
b
-- Returns:
-
defaultIfNull
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:
-
defaultIfNull
Default if null.- Type Parameters:
T
-- Parameters:
obj
-supplierForDefault
-- Returns:
-
defaultIfEmpty
Same asStrings.defaultIfEmpty(CharSequence, CharSequence)
.- Type Parameters:
T
-- Parameters:
str
-defaultStr
-- Returns:
- See Also:
-
defaultIfEmpty
public static <T extends CharSequence> T defaultIfEmpty(T str, Supplier<? extends T> getterForDefaultStr) - Type Parameters:
T
-- Parameters:
str
-getterForDefaultStr
-- Returns:
- See Also:
-
defaultIfBlank
Same asStrings.defaultIfBlank(CharSequence, CharSequence)
.- Type Parameters:
T
-- Parameters:
str
-defaultStr
-- Returns:
- See Also:
-
defaultIfBlank
public static <T extends CharSequence> T defaultIfBlank(T str, Supplier<? extends T> getterForDefaultStr) - Type Parameters:
T
-- Parameters:
str
-getterForDefaultStr
-- Returns:
- See Also:
-
stringOf
- Parameters:
val
-- Returns:
-
stringOf
- Parameters:
val
-- Returns:
-
stringOf
- Parameters:
val
-- Returns:
-
stringOf
- Parameters:
val
-- Returns:
-
stringOf
- Parameters:
val
-- Returns:
-
stringOf
- Parameters:
val
-- Returns:
-
stringOf
- Parameters:
val
-- Returns:
-
stringOf
- Parameters:
val
-- Returns:
-
stringOf
- Parameters:
obj
-- Returns:
null
if the specified object is null.
-
valueOf
- Type Parameters:
T
-- Parameters:
str
-targetClass
-- Returns:
-
registerConverter
- Parameters:
srcClass
-converter
-- Returns:
true
if there is noconverter
registered with specifiedsrcClass
yet before this call.
-
convert
Try to convert the specifiedobj
to the specifiedtargetClass
. Default value oftargetClass
is returned ifsourceObject
is null. An instance oftargetClass
is returned if convert successfully- Type Parameters:
T
-- Parameters:
obj
-targetClass
-- Returns:
-
convert
- Type Parameters:
T
-- Parameters:
obj
-targetType
-- Returns:
-
isBeanClass
Deprecated.replaced byClassUtil.isBeanClass(Class)
Checks if is bean.- Parameters:
cls
-- Returns:
- true, if is bean
- See Also:
-
clone
public static <T> T clone(T obj) - Type Parameters:
T
-- Parameters:
obj
- a Java object which must be serializable and deserializable throughKryo
orJSON
.- Returns:
null
ifbean
isnull
-
clone
public static <T> T clone(Object obj, Class<? extends T> targetClass) throws IllegalArgumentException Deeply copy by: obj -> serialize -> kryo/Json -> deserialize -> new object.- Type Parameters:
T
-- Parameters:
obj
- a Java object which must be serializable and deserialiable throughKryo
orJSON
.targetClass
-- Returns:
- a new instance of
targetClass
even ifbean
isnull
. - Throws:
IllegalArgumentException
- iftargetClass
isnull
.
-
copy
public static <T> T copy(T bean) Returns a new created instance of the same class and set with same properties retrieved by 'getXXX' method in the specifiedbean
.- Type Parameters:
T
-- Parameters:
bean
- a Java Object what allows access to properties using getter and setter methods.- Returns:
null
ifbean
isnull
-
copy
- Type Parameters:
T
-- Parameters:
bean
-selectPropNames
-- Returns:
null
ifbean
isnull
-
copy
public static <T> T copy(Object bean, Class<? extends T> targetClass) throws IllegalArgumentException - Type Parameters:
T
-- Parameters:
bean
-targetClass
-- Returns:
- a new instance of
targetClass
even ifbean
isnull
. - Throws:
IllegalArgumentException
- iftargetClass
isnull
.
-
copy
public static <T> T copy(Object bean, Collection<String> selectPropNames, Class<? extends T> targetClass) throws IllegalArgumentException Returns a new created instance of the specifiedcls
and set with same properties retrieved by 'getXXX' method in the specifiedbean
.- Type Parameters:
T
-- Parameters:
bean
- a Java Object what allows access to properties using getter and setter methods.selectPropNames
-targetClass
- a Java Object what allows access to properties using getter and setter methods.- Returns:
- a new instance of
targetClass
even ifbean
isnull
. - Throws:
IllegalArgumentException
- iftargetClass
isnull
.
-
copy
public static <T> T copy(Object bean, boolean ignoreUnmatchedProperty, Set<String> ignoredPropNames, Class<? extends T> targetClass) throws IllegalArgumentException - Type Parameters:
T
-- Parameters:
bean
-ignoreUnmatchedProperty
-ignoredPropNames
-targetClass
-- Returns:
- a new instance of
targetClass
even ifbean
isnull
. - Throws:
IllegalArgumentException
- iftargetClass
isnull
.
-
merge
- Type Parameters:
T
-- Parameters:
sourceBean
-targetBean
-- Returns:
targetBean
- Throws:
IllegalArgumentException
- iftargetBean
isnull
.
-
merge
public static <T> T merge(Object sourceBean, T targetBean, Collection<String> selectPropNames) throws IllegalArgumentException Set all the signed properties(including all primitive type properties) in the specifiedsourceBean
to the specifiedtargetBean
.- Type Parameters:
T
-- Parameters:
sourceBean
- a Java Object what allows access to properties using getter and setter methods.targetBean
- a Java Object what allows access to properties using getter and setter methods.selectPropNames
-- Returns:
targetBean
- Throws:
IllegalArgumentException
- iftargetBean
isnull
.
-
merge
public static <T> T merge(Object sourceBean, T targetBean, BiPredicate<String, ?> filter) throws IllegalArgumentExceptionSet all the signed properties(including all primitive type properties) in the specifiedsourceBean
to the specifiedtargetBean
.- Type Parameters:
T
-- Parameters:
sourceBean
- a Java Object what allows access to properties using getter and setter methods.targetBean
- a Java Object what allows access to properties using getter and setter methods.filter
-- Returns:
targetBean
- Throws:
IllegalArgumentException
- iftargetBean
isnull
.
-
merge
public static <T> T merge(Object sourceBean, T targetBean, boolean ignoreUnmatchedProperty, Set<String> ignoredPropNames) throws IllegalArgumentException - Type Parameters:
T
-- Parameters:
sourceBean
-targetBean
-ignoreUnmatchedProperty
-ignoredPropNames
-- Returns:
targetBean
- Throws:
IllegalArgumentException
- iftargetBean
isnull
.
-
merge
public static <T> T merge(Object sourceBean, T targetBean, BinaryOperator<?> mergeFunc) throws IllegalArgumentException - Type Parameters:
T
-- Parameters:
sourceBean
-targetBean
-mergeFunc
- the first parameter is source property value, the second parameter is target property value.- Returns:
targetBean
- Throws:
IllegalArgumentException
- iftargetBean
isnull
.
-
merge
public static <T> T merge(Object sourceBean, T targetBean, Collection<String> selectPropNames, BinaryOperator<?> mergeFunc) throws IllegalArgumentException Set all the signed properties(including all primitive type properties) in the specifiedsourceBean
to the specifiedtargetBean
.- Type Parameters:
T
-- Parameters:
sourceBean
- a Java Object what allows access to properties using getter and setter methods.targetBean
- 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:
targetBean
- Throws:
IllegalArgumentException
- iftargetBean
isnull
.
-
merge
public static <T> T merge(Object sourceBean, T targetBean, BiPredicate<String, ?> filter, BinaryOperator<?> mergeFunc) throws IllegalArgumentExceptionSet all the signed properties(including all primitive type properties) in the specifiedsourceBean
to the specifiedtargetBean
.- Type Parameters:
T
-- Parameters:
sourceBean
- a Java Object what allows access to properties using getter and setter methods.targetBean
- 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:
targetBean
- Throws:
IllegalArgumentException
- iftargetBean
isnull
.
-
merge
public static <T> T merge(Object sourceBean, T targetBean, boolean ignoreUnmatchedProperty, Set<String> ignoredPropNames, BinaryOperator<?> mergeFunc) throws IllegalArgumentException - Type Parameters:
T
-- Parameters:
sourceBean
-targetBean
-ignoreUnmatchedProperty
-ignoredPropNames
-mergeFunc
- the first parameter is source property value, the second parameter is target property value.- Returns:
targetBean
- Throws:
IllegalArgumentException
- iftargetBean
isnull
.
-
erase
- Parameters:
bean
-propNames
-
-
erase
- Parameters:
bean
-propNames
-
-
eraseAll
- Parameters:
bean
-
-
enumListOf
Enum list of.- Type Parameters:
E
-- Parameters:
enumClass
-- Returns:
-
enumSetOf
Enum set of.- Type Parameters:
E
-- Parameters:
enumClass
-- Returns:
-
enumMapOf
Enum map of.- Type Parameters:
E
-- Parameters:
enumClass
-- Returns:
-
newInstance
- Type Parameters:
T
-- Parameters:
cls
-- Returns:
- T
- See Also:
-
Fn.Suppliers.ofCollection(Class)
Suppliers#registerForCollection(Class, com.landawn.abacus.util.function.Supplier)
Fn.Suppliers.ofMap(Class)
Suppliers#registerForMap(Class, com.landawn.abacus.util.function.Supplier)
Fn.Factory.ofCollection(Class)
IntFunctions#registerForCollection(Class, com.landawn.abacus.util.function.IntFunction)
Fn.Factory.ofMap(Class)
IntFunctions#registerForMap(Class, com.landawn.abacus.util.function.IntFunction)
-
newProxyInstance
New proxy instance.- Type Parameters:
T
-- Parameters:
interfaceClass
-h
-- Returns:
-
newProxyInstance
Refer tojava.lang.reflect
- Type Parameters:
T
-- Parameters:
interfaceClasses
-h
-- Returns:
-
newCollection
- Type Parameters:
T
-- Parameters:
targetClass
-- Returns:
- See Also:
-
Fn.Suppliers.ofCollection(Class)
Suppliers#registerForCollection(Class, com.landawn.abacus.util.function.Supplier)
-
newCollection
- Type Parameters:
T
-- Parameters:
targetClass
-size
-- Returns:
- See Also:
-
Fn.Factory.ofCollection(Class)
IntFunctions#registerForCollection(Class, com.landawn.abacus.util.function.IntFunction)
-
newMap
- Type Parameters:
K
-V
-- Parameters:
targetClass
-- Returns:
- See Also:
-
Fn.Suppliers.ofMap(Class)
Suppliers#registerForMap(Class, com.landawn.abacus.util.function.Supplier)
-
newMap
- Type Parameters:
K
-V
-- Parameters:
targetClass
-size
-- Returns:
- See Also:
-
Fn.Factory.ofMap(Class)
IntFunctions#registerForMap(Class, com.landawn.abacus.util.function.IntFunction)
-
newArray
- Type Parameters:
T
-- Parameters:
componentType
-length
-- Returns:
- T[]
-
newBean
- Type Parameters:
T
-- Parameters:
cls
-- Returns:
-
newBean
- Type Parameters:
T
-- Parameters:
cls
-beanName
-- Returns:
-
newSetFromMap
Returns a set backed by the specified map.- Type Parameters:
E
-- Parameters:
map
- the backing map- Returns:
- See Also:
-
newArrayList
New array list.- Type Parameters:
T
-- Returns:
-
newArrayList
New array list.- Type Parameters:
T
-- Parameters:
initialCapacity
-- Returns:
-
newArrayList
New array list.- Type Parameters:
T
-- Parameters:
c
-- Returns:
-
newLinkedList
New linked list.- Type Parameters:
T
-- Returns:
-
newLinkedList
New linked list.- Type Parameters:
T
-- Parameters:
c
-- Returns:
-
newHashSet
New hash set.- Type Parameters:
T
-- Returns:
-
newHashSet
New hash set.- Type Parameters:
T
-- Parameters:
initialCapacity
-- Returns:
-
newHashSet
New hash set.- Type Parameters:
T
-- Parameters:
c
-- Returns:
-
newLinkedHashSet
New linked hash set.- Type Parameters:
T
-- Returns:
-
newLinkedHashSet
New linked hash set.- Type Parameters:
T
-- Parameters:
initialCapacity
-- Returns:
-
newLinkedHashSet
New linked hash set.- Type Parameters:
T
-- Parameters:
c
-- Returns:
-
newTreeSet
New tree set.- Type Parameters:
T
-- Returns:
-
newTreeSet
New tree set.- Type Parameters:
T
-- Parameters:
comparator
-- Returns:
-
newTreeSet
New tree set.- Type Parameters:
T
-- Parameters:
c
-- Returns:
-
newTreeSet
New tree set.- Type Parameters:
T
-- Parameters:
c
-- Returns:
-
newMultiset
- Type Parameters:
T
-- Returns:
-
newMultiset
- Type Parameters:
T
-- Parameters:
initialCapacity
-- Returns:
-
newMultiset
- Type Parameters:
T
-- Parameters:
valueMapType
-- Returns:
-
newMultiset
- Type Parameters:
T
-- Parameters:
mapSupplier
-- Returns:
-
newMultiset
- Type Parameters:
T
-- Parameters:
c
-- Returns:
-
newLongMultiset
- Type Parameters:
T
-- Returns:
-
newLongMultiset
- Type Parameters:
T
-- Parameters:
initialCapacity
-- Returns:
-
newLongMultiset
- Type Parameters:
T
-- Parameters:
valueMapType
-- Returns:
-
newLongMultiset
- Type Parameters:
T
-- Parameters:
mapSupplier
-- Returns:
-
newLongMultiset
- Type Parameters:
T
-- Parameters:
c
-- Returns:
-
newArrayDeque
New array deque.- Type Parameters:
T
-- Returns:
-
newArrayDeque
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
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
- Type Parameters:
K
- the key typeV
- the value type- Parameters:
key
-value
-- Returns:
-
newImmutableEntry
New immutable entry.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
key
-value
-- Returns:
-
newHashMap
New hash map.- Type Parameters:
K
- the key typeV
- the value type- Returns:
-
newHashMap
New hash map.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
initialCapacity
-- Returns:
-
newHashMap
New hash map.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
m
-- Returns:
-
newHashMap
public static <K,V, Map<K,E extends Exception> V> newHashMap(Collection<? extends V> c, Throwables.Function<? super V, ? extends K, throws EE> keyMapper) New hash map.- Type Parameters:
K
- the key typeV
- the value typeE
-- Parameters:
c
-keyMapper
-- Returns:
- Throws:
E
- the e
-
newLinkedHashMap
New linked hash map.- Type Parameters:
K
- the key typeV
- the value type- Returns:
-
newLinkedHashMap
New linked hash map.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
initialCapacity
-- Returns:
-
newLinkedHashMap
New linked hash map.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
m
-- Returns:
-
newLinkedHashMap
public static <K,V, Map<K,E extends Exception> V> newLinkedHashMap(Collection<? extends V> c, Throwables.Function<? super V, ? extends K, throws EE> keyMapper) New linked hash map.- Type Parameters:
K
- the key typeV
- the value typeE
-- Parameters:
c
-keyMapper
-- Returns:
- Throws:
E
- the e
-
newTreeMap
New tree map.- Type Parameters:
K
- the key typeV
- the value type- Returns:
-
newTreeMap
New tree map.- Type Parameters:
C
-K
- the key typeV
- 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 typeV
- the value type- Parameters:
m
-- Returns:
-
newTreeMap
New tree map.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
m
-- Returns:
-
newIdentityHashMap
New identity hash map.- Type Parameters:
K
- the key typeV
- the value type- Returns:
-
newIdentityHashMap
New identity hash map.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
initialCapacity
-- Returns:
-
newIdentityHashMap
New identity hash map.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
m
-- Returns:
-
newConcurrentHashMap
New concurrent hash map.- Type Parameters:
K
- the key typeV
- the value type- Returns:
-
newConcurrentHashMap
New concurrent hash map.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
initialCapacity
-- Returns:
-
newConcurrentHashMap
New concurrent hash map.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
m
-- Returns:
-
newBiMap
New bi map.- Type Parameters:
K
- the key typeV
- the value type- Returns:
-
newBiMap
New bi map.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
initialCapacity
-- Returns:
-
newBiMap
New bi map.- Type Parameters:
K
- the key typeV
- 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 typeV
- 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 typeV
- the value type- Parameters:
keyMapSupplier
-valueMapSupplier
-- Returns:
-
newMultimap
public static <K,E, Multimap<K,V extends Collection<E>> E, newMultimapV> (Supplier<? extends Map<K, V>> mapSupplier, Supplier<? extends V> valueSupplier) - Type Parameters:
K
- the key typeE
-V
- the value type- Parameters:
mapSupplier
-valueSupplier
-- Returns:
-
newListMultimap
New list multimap.- Type Parameters:
K
- the key typeE
-- Returns:
-
newListMultimap
New list multimap.- Type Parameters:
K
- the key typeE
-- Parameters:
initialCapacity
-- Returns:
-
newListMultimap
New list multimap.- Type Parameters:
K
- the key typeE
-- Parameters:
m
-- Returns:
-
newListMultimap
New list multimap.- Type Parameters:
K
- the key typeE
-- 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 typeE
-- 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 typeE
-- Parameters:
mapSupplier
-valueSupplier
-- Returns:
-
newLinkedListMultimap
Return aListMultimap
backed byLinkedHashMap
.'Linked'
is about the map, not the value.- Type Parameters:
K
- the key typeE
-- Returns:
-
newLinkedListMultimap
Return aListMultimap
backed byLinkedHashMap
.'Linked'
is about the map, not the value.- Type Parameters:
K
- the key typeE
-- Parameters:
initialCapacity
-- Returns:
-
newLinkedListMultimap
Return aListMultimap
backed byLinkedHashMap
.'Linked'
is about the map, not the value.- Type Parameters:
K
- the key typeE
-- Parameters:
m
-- Returns:
-
newSortedListMultimap
Return aListMultimap
backed bySortedMap
.'Sorted'
is about the map, not the value.- Type Parameters:
K
- the key typeE
-- Returns:
-
newSortedListMultimap
public static <K extends Comparable<? super K>,E> ListMultimap<K,E> newSortedListMultimap(Map<? extends K, ? extends E> m) Return aListMultimap
backed bySortedMap
.'Sorted'
is about the map, not the value.- Type Parameters:
K
- the key typeE
-- Parameters:
m
-- Returns:
-
newSetMultimap
New set multimap.- Type Parameters:
K
- the key typeE
-- Returns:
-
newSetMultimap
New set multimap.- Type Parameters:
K
- the key typeE
-- Parameters:
initialCapacity
-- Returns:
-
newSetMultimap
New set multimap.- Type Parameters:
K
- the key typeE
-- Parameters:
m
-- Returns:
-
newSetMultimap
New set multimap.- Type Parameters:
K
- the key typeE
-- 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 typeE
-- 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 typeE
-- Parameters:
mapSupplier
-valueSupplier
-- Returns:
-
newLinkedSetMultimap
Return aSetMultimap
backed byLinkedHashMap
.'Linked'
is about the map, not the value.- Type Parameters:
K
- the key typeE
-- Returns:
-
newLinkedSetMultimap
Return aSetMultimap
backed byLinkedHashMap
.'Linked'
is about the map, not the value.- Type Parameters:
K
- the key typeE
-- Parameters:
initialCapacity
-- Returns:
-
newLinkedSetMultimap
Return aSetMultimap
backed byLinkedHashMap
.'Linked'
is about the map, not the value.- Type Parameters:
K
- the key typeE
-- Parameters:
m
-- Returns:
-
newSortedSetMultimap
Return aSetMultimap
backed bySortedMap
.'Sorted'
is about the map, not the value.- Type Parameters:
K
- the key typeE
-- Returns:
-
newSortedSetMultimap
public static <K extends Comparable<? super K>,E> SetMultimap<K,E> newSortedSetMultimap(Map<? extends K, ? extends E> m) Return aSetMultimap
backed bySortedMap
.'Sorted'
is about the map, not the value.- Type Parameters:
K
- the key typeE
-- Parameters:
m
-- Returns:
-
newEmptyDataSet
New empty data set.- Returns:
-
newEmptyDataSet
New empty data set.- Parameters:
columnNames
-- Returns:
-
newDataSet
Convert the specified Map to a two columnsDataSet
: one column is for keys and one column is for values.- Parameters:
keyColumnName
-valueColumnName
-m
-- Returns:
-
newDataSet
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 bean or map.- Parameters:
rowList
- list of row which can be: Map/Bean/Array/List- Returns:
-
newDataSet
If the specifiedcolumnNames
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 bean or map.- Parameters:
columnNames
-rowList
-- Returns:
-
newDataSet
- Parameters:
columnNames
-rowList
-- Returns:
-
newDataSet
New data set.- Type Parameters:
C
-- Parameters:
map
- keys are column names, values are columns- Returns:
-
merge
- Parameters:
a
-b
-- Returns:
-
merge
- Parameters:
a
-b
-c
-- Returns:
-
merge
- Parameters:
dss
-- Returns:
-
toArray
Returns an empty array if the specified collection is null or empty.- Parameters:
c
-- Returns:
-
toArray
- Parameters:
c
-fromIndex
-toIndex
-- Returns:
-
toArray
public static <A,T extends A> A[] toArray(Collection<? extends T> c, A[] a) throws IllegalArgumentException - Type Parameters:
A
-T
-- Parameters:
c
-a
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray
isnull
.
-
toArray
public static <A,T extends A> A[] toArray(Collection<? extends T> c, int fromIndex, int toIndex, A[] a) throws IllegalArgumentException - Type Parameters:
A
-T
-- Parameters:
c
-fromIndex
-toIndex
-a
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedArray
isnull
.
-
toArray
public static <A,T extends A> A[] toArray(Collection<? extends T> c, IntFunction<A[]> arraySupplier) - Type Parameters:
A
-T
-- Parameters:
c
-arraySupplier
-- Returns:
-
toArray
public static <A,T extends A> A[] toArray(Collection<? extends 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(Collection<? extends T> c, Class<A[]> targetClass) throws IllegalArgumentException - Type Parameters:
A
-T
-- Parameters:
c
-targetClass
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedClass
isnull
.
-
toArray
public static <A,T extends A> A[] toArray(Collection<? extends T> c, int fromIndex, int toIndex, Class<A[]> targetClass) throws IllegalArgumentException - Type Parameters:
A
-T
-- Parameters:
c
-fromIndex
-toIndex
-targetClass
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedClass
isnull
.
-
toBooleanArray
To boolean array.- Parameters:
c
-- Returns:
-
toBooleanArray
To boolean array.- Parameters:
c
-fromIndex
-toIndex
-- Returns:
-
toBooleanArray
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) - Parameters:
a
-- Returns:
-
toCharArray
To char array.- Parameters:
c
-- Returns:
-
toCharArray
To char array.- Parameters:
c
-fromIndex
-toIndex
-- Returns:
-
toCharArray
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
To byte array.- Parameters:
c
-- Returns:
-
toByteArray
To byte array.- Parameters:
c
-fromIndex
-toIndex
-- Returns:
-
toByteArray
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) - Parameters:
a
-- Returns:
-
toShortArray
To short array.- Parameters:
c
-- Returns:
-
toShortArray
To short array.- Parameters:
c
-fromIndex
-toIndex
-- Returns:
-
toShortArray
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
To int array.- Parameters:
c
-- Returns:
-
toIntArray
To int array.- Parameters:
c
-fromIndex
-toIndex
-- Returns:
-
toIntArray
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) - Parameters:
a
-- Returns:
-
toLongArray
To long array.- Parameters:
c
-- Returns:
-
toLongArray
To long array.- Parameters:
c
-fromIndex
-toIndex
-- Returns:
-
toLongArray
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
To float array.- Parameters:
c
-- Returns:
-
toFloatArray
To float array.- Parameters:
c
-fromIndex
-toIndex
-- Returns:
-
toFloatArray
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
To double array.- Parameters:
c
-- Returns:
-
toDoubleArray
To double array.- Parameters:
c
-fromIndex
-toIndex
-- Returns:
-
toDoubleArray
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
- Parameters:
a
-- Returns:
-
toList
- Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
toList
- Parameters:
a
-- Returns:
-
toList
- Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
toList
- Parameters:
a
-- Returns:
-
toList
- Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
toList
- Parameters:
a
-- Returns:
-
toList
- Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
toList
- Parameters:
a
-- Returns:
-
toList
- Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
toList
- Parameters:
a
-- Returns:
-
toList
- Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
toList
- Parameters:
a
-- Returns:
-
toList
- Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
toList
- Parameters:
a
-- Returns:
-
toList
- Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
toList
- Type Parameters:
T
-- Parameters:
a
-- Returns:
-
toList
- Type Parameters:
T
-- Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
toList
- Type Parameters:
T
-- Parameters:
iter
-- Returns:
-
toSet
- Parameters:
a
-- Returns:
-
toSet
- Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
toSet
- Parameters:
a
-- Returns:
-
toSet
- Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
toSet
- Parameters:
a
-- Returns:
-
toSet
- Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
toSet
- Parameters:
a
-- Returns:
-
toSet
- Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
toSet
- Parameters:
a
-- Returns:
-
toSet
- Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
toSet
- Parameters:
a
-- Returns:
-
toSet
- Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
toSet
- Parameters:
a
-- Returns:
-
toSet
- Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
toSet
- Parameters:
a
-- Returns:
-
toSet
- Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
toSet
- Type Parameters:
T
-- Parameters:
a
-- Returns:
-
toSet
- Type Parameters:
T
-- Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
toSet
- Type Parameters:
T
-- Parameters:
iter
-- Returns:
-
toCollection
public static <C extends Collection<Boolean>> C toCollection(boolean[] a, IntFunction<? extends C> supplier) - Type Parameters:
C
-- Parameters:
a
-supplier
-- Returns:
-
toCollection
public static <C extends Collection<Boolean>> C toCollection(boolean[] a, int fromIndex, int toIndex, IntFunction<? extends C> supplier) - 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
- 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) - Type Parameters:
T
-C
-- Parameters:
iter
-supplier
-- Returns:
-
toCollection
public static <T,C extends Collection<T>> C toCollection(Iterable<? extends T> iter, Supplier<? extends C> supplier) - Type Parameters:
T
-C
-- Parameters:
iter
-supplier
-- Returns:
-
asArray
The input array is returned.- Type Parameters:
T
-- Parameters:
a
-- Returns:
-
asMap
Return a modifiableMap
with specified key/value.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
k1
-v1
-- Returns:
-
asMap
Return a modifiableMap
with specified keys/values.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
k1
-v1
-k2
-v2
-- Returns:
-
asMap
Return a modifiableMap
with specified keys/values.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
k1
-v1
-k2
-v2
-k3
-v3
-- Returns:
-
asMap
Return a modifiableMap
with specified keys/values.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
k1
-v1
-k2
-v2
-k3
-v3
-k4
-v4
-- Returns:
-
asMap
Return a modifiableMap
with specified keys/values.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
k1
-v1
-k2
-v2
-k3
-v3
-k4
-v4
-k5
-v5
-- Returns:
-
asMap
public static <K,V> Map<K,V> asMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6) Return a modifiableMap
with specified keys/values.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
k1
-v1
-k2
-v2
-k3
-v3
-k4
-v4
-k5
-v5
-k6
-v6
-- Returns:
-
asMap
public static <K,V> Map<K,V> asMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7) Return a modifiableMap
with specified keys/values.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
k1
-v1
-k2
-v2
-k3
-v3
-k4
-v4
-k5
-v5
-k6
-v6
-k7
-v7
-- Returns:
-
asMap
Deprecated.Return a modifiableMap
with specified key/value.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
a
-- Returns:
-
asLinkedHashMap
Return a modifiableLinkedHashMap
with specified keys/values.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
k1
-v1
-- Returns:
-
asLinkedHashMap
Return a modifiableLinkedHashMap
with specified keys/values.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
k1
-v1
-k2
-v2
-- Returns:
-
asLinkedHashMap
Return a modifiableLinkedHashMap
with specified keys/values.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
k1
-v1
-k2
-v2
-k3
-v3
-- Returns:
-
asLinkedHashMap
Return a modifiableLinkedHashMap
with specified keys/values.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
k1
-v1
-k2
-v2
-k3
-v3
-k4
-v4
-- Returns:
-
asLinkedHashMap
public static <K,V> Map<K,V> asLinkedHashMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5) Return a modifiableLinkedHashMap
with specified keys/values.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
k1
-v1
-k2
-v2
-k3
-v3
-k4
-v4
-k5
-v5
-- Returns:
-
asLinkedHashMap
public static <K,V> Map<K,V> asLinkedHashMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6) Return a modifiableLinkedHashMap
with specified keys/values.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
k1
-v1
-k2
-v2
-k3
-v3
-k4
-v4
-k5
-v5
-k6
-v6
-- Returns:
-
asLinkedHashMap
public static <K,V> Map<K,V> asLinkedHashMap(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7) Return a modifiableLinkedHashMap
with specified keys/values.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
k1
-v1
-k2
-v2
-k3
-v3
-k4
-v4
-k5
-v5
-k6
-v6
-k7
-v7
-- Returns:
-
asLinkedHashMap
Deprecated.Return a modifiableLinkedHashMap
with specified keys/values.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
a
-- Returns:
-
asProps
Return a modifiableMap
with specified key/value.- Parameters:
propName
-propValue
-- Returns:
-
asProps
public static Map<String,Object> asProps(String propName1, Object propValue1, String propName2, Object propValue2) Return a modifiableMap
with specified keys/values.- Parameters:
propName1
-propValue1
-propName2
-propValue2
-- Returns:
-
asProps
public static Map<String,Object> asProps(String propName1, Object propValue1, String propName2, Object propValue2, String propName3, Object propValue3) Return a modifiableMap
with specified keys/values.- Parameters:
propName1
-propValue1
-propName2
-propValue2
-propName3
-propValue3
-- Returns:
-
asProps
public static Map<String,Object> asProps(String propName1, Object propValue1, String propName2, Object propValue2, String propName3, Object propValue3, String propName4, Object propValue4) Return a modifiableMap
with specified keys/values.- Parameters:
propName1
-propValue1
-propName2
-propValue2
-propName3
-propValue3
-propName4
-propValue4
-- Returns:
-
asProps
public static Map<String,Object> asProps(String propName1, Object propValue1, String propName2, Object propValue2, String propName3, Object propValue3, String propName4, Object propValue4, String propName5, Object propValue5) Return a modifiableMap
with specified keys/values.- Parameters:
propName1
-propValue1
-propName2
-propValue2
-propName3
-propValue3
-propName4
-propValue4
-propName5
-propValue5
-- Returns:
-
asProps
Deprecated.Return a modifiableMap
with specified keys/values.- Parameters:
a
- pairs of property name and value or a Java Bean Object what allows access to properties using getter and setter methods.- Returns:
-
asList
Return a modifiableList
with specified element.- Type Parameters:
T
-- Parameters:
e
-- Returns:
-
asList
Return a modifiableList
with specified elements.- Type Parameters:
T
-- Parameters:
e1
-e2
-- Returns:
-
asList
Return a modifiableList
with specified elements.- Type Parameters:
T
-- Parameters:
e1
-e2
-e3
-- Returns:
-
asList
Return a modifiableList
with specified elements.- Type Parameters:
T
-- Parameters:
e1
-e2
-e3
-e4
-- Returns:
-
asList
Return a modifiableList
with specified elements.- Type Parameters:
T
-- Parameters:
e1
-e2
-e3
-e4
-e5
-- Returns:
-
asList
Return a modifiableList
with specified elements.- Type Parameters:
T
-- Parameters:
e1
-e2
-e3
-e4
-e5
-e6
-- Returns:
-
asList
Return a modifiableList
with specified elements.- Type Parameters:
T
-- Parameters:
e1
-e2
-e3
-e4
-e5
-e6
-e7
-- Returns:
-
asList
Return a modifiableList
with specified elements.- Type Parameters:
T
-- Parameters:
e1
-e2
-e3
-e4
-e5
-e6
-e7
-e8
-- Returns:
-
asList
Return a modifiableList
with specified elements.- Type Parameters:
T
-- Parameters:
e1
-e2
-e3
-e4
-e5
-e6
-e7
-e8
-e9
-- Returns:
-
asList
Return a modifiableList
with specified elements. It's not backed by the specified array.- Type Parameters:
T
-- Parameters:
a
-- Returns:
-
asLinkedList
Return a modifiableLinkedList
with specified element.- Type Parameters:
T
-- Parameters:
e
-- Returns:
-
asLinkedList
Return a modifiableLinkedList
with specified elements.- Type Parameters:
T
-- Parameters:
e1
-e2
-- Returns:
-
asLinkedList
Return a modifiableLinkedList
with specified elements.- Type Parameters:
T
-- Parameters:
e1
-e2
-e3
-- Returns:
-
asLinkedList
Return a modifiableLinkedList
with specified elements.- Type Parameters:
T
-- Parameters:
e1
-e2
-e3
-e4
-- Returns:
-
asLinkedList
Return a modifiableLinkedList
with specified elements.- Type Parameters:
T
-- Parameters:
e1
-e2
-e3
-e4
-e5
-- Returns:
-
asLinkedList
Return a modifiableLinkedList
with specified elements.- Type Parameters:
T
-- Parameters:
e1
-e2
-e3
-e4
-e5
-e6
-- Returns:
-
asLinkedList
Return a modifiableLinkedList
with specified elements.- Type Parameters:
T
-- Parameters:
e1
-e2
-e3
-e4
-e5
-e6
-e7
-- Returns:
-
asLinkedList
Return a modifiableLinkedList
with specified elements. . It's not backed by the specified array.- Type Parameters:
T
-- Parameters:
a
-- Returns:
-
asSet
Return a modifiableSet
with specified element.- Type Parameters:
T
-- Parameters:
e
-- Returns:
-
asSet
Return a modifiableSet
with specified elements.- Type Parameters:
T
-- Parameters:
e1
-e2
-- Returns:
-
asSet
Return a modifiableSet
with specified elements.- Type Parameters:
T
-- Parameters:
e1
-e2
-e3
-- Returns:
-
asSet
Return a modifiableSet
with specified elements.- Type Parameters:
T
-- Parameters:
e1
-e2
-e3
-e4
-- Returns:
-
asSet
Return a modifiableSet
with specified elements.- Type Parameters:
T
-- Parameters:
e1
-e2
-e3
-e4
-e5
-- Returns:
-
asSet
Return a modifiableSet
with specified elements.- Type Parameters:
T
-- Parameters:
e1
-e2
-e3
-e4
-e5
-e6
-- Returns:
-
asSet
Return a modifiableSet
with specified elements.- Type Parameters:
T
-- Parameters:
e1
-e2
-e3
-e4
-e5
-e6
-e7
-- Returns:
-
asSet
Return a modifiableSet
with specified elements.- Type Parameters:
T
-- Parameters:
e1
-e2
-e3
-e4
-e5
-e6
-e7
-e8
-- Returns:
-
asSet
Return a modifiableSet
with specified elements.- Type Parameters:
T
-- Parameters:
e1
-e2
-e3
-e4
-e5
-e6
-e7
-e8
-e9
-- Returns:
-
asSet
Return a modifiableSet
with specified elements. It's not backed by the specified array.- Type Parameters:
T
-- Parameters:
a
-- Returns:
-
asLinkedHashSet
Return a modifiableLinkedHashSet
with specified element.- Type Parameters:
T
-- Parameters:
e
-- Returns:
-
asLinkedHashSet
Return a modifiableLinkedHashSet
with specified elements.- Type Parameters:
T
-- Parameters:
e1
-e2
-- Returns:
-
asLinkedHashSet
Return a modifiableLinkedHashSet
with specified elements.- Type Parameters:
T
-- Parameters:
e1
-e2
-e3
-- Returns:
-
asLinkedHashSet
Return a modifiableLinkedHashSet
with specified elements.- Type Parameters:
T
-- Parameters:
e1
-e2
-e3
-e4
-- Returns:
-
asLinkedHashSet
Return a modifiableLinkedHashSet
with specified elements.- Type Parameters:
T
-- Parameters:
e1
-e2
-e3
-e4
-e5
-- Returns:
-
asLinkedHashSet
Return a modifiableLinkedHashSet
with specified elements.- Type Parameters:
T
-- Parameters:
e1
-e2
-e3
-e4
-e5
-e6
-- Returns:
-
asLinkedHashSet
Return a modifiableLinkedHashSet
with specified elements.- Type Parameters:
T
-- Parameters:
e1
-e2
-e3
-e4
-e5
-e6
-e7
-- Returns:
-
asLinkedHashSet
Return a modifiableLinkedHashSet
with specified elements. It's not backed by the specified array.- Type Parameters:
T
-- Parameters:
a
-- Returns:
-
asSortedSet
Return a modifiableSortedSet
with specified elements. It's not backed by the specified array.- Type Parameters:
T
-- Parameters:
a
-- Returns:
-
asQueue
Return a modifiableQueue
with specified elements. It's not backed by the specified array.- Type Parameters:
T
-- Parameters:
a
-- Returns:
-
asArrayBlockingQueue
Return a modifiableArrayBlockingQueue
with specified elements. It's not backed by the specified array.- Type Parameters:
T
-- Parameters:
a
-- Returns:
-
asLinkedBlockingQueue
Return a modifiableLinkedBlockingQueue
with specified elements. It's not backed by the specified array.- Type Parameters:
T
-- Parameters:
a
-- Returns:
-
asConcurrentLinkedQueue
Return a modifiableConcurrentLinkedQueue
with specified elements. It's not backed by the specified array.- Type Parameters:
T
-- Parameters:
a
-- Returns:
-
asDelayQueue
Return a modifiableDelayQueue
with specified elements. It's not backed by the specified array.- Type Parameters:
T
-- Parameters:
a
-- Returns:
-
asPriorityQueue
Return a modifiablePriorityQueue
with specified elements. It's not backed by the specified array.- Type Parameters:
T
-- Parameters:
a
-- Returns:
-
asDeque
Return a modifiableDeque
with specified elements. It's not backed by the specified array.- Type Parameters:
T
-- Parameters:
a
-- Returns:
-
asArrayDeque
Return a modifiableArrayDeque
with specified elements. It's not backed by the specified array.- Type Parameters:
T
-- Parameters:
a
-- Returns:
-
asLinkedBlockingDeque
Return a modifiableLinkedBlockingDeque
with specified elements. It's not backed by the specified array.- Type Parameters:
T
-- Parameters:
a
-- Returns:
-
asConcurrentLinkedDeque
Return a modifiableConcurrentLinkedDeque
with specified elements. It's not backed by the specified array.- Type Parameters:
T
-- Parameters:
a
-- Returns:
-
asMultiset
Return a modifiableMultiset
with specified elements. It's not backed by the specified array.- Type Parameters:
T
-- Parameters:
a
-- Returns:
-
asSingletonList
Wrap the specified value with a singleton list.- Type Parameters:
T
-- Parameters:
o
-- Returns:
- an immutable list
- See Also:
-
asSingletonSet
Wrap the specified value with a singleton set.- Type Parameters:
T
-- Parameters:
o
-- Returns:
- an immutable set
- See Also:
-
asSingletonMap
Wrap the specified key/value with a singleton map.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
key
-value
-- Returns:
- an immutable Map
- See Also:
-
emptyList
Returns an empty immutableList
.- Type Parameters:
T
-- Returns:
- See Also:
-
emptySet
Returns an empty immutableSet
.- Type Parameters:
T
-- Returns:
- See Also:
-
emptySortedSet
Returns an empty immutableSortedSet
.- Type Parameters:
T
-- Returns:
- See Also:
-
emptyMap
Returns an empty immutableMap
.- Type Parameters:
K
- the key typeV
- the value type- Returns:
- See Also:
-
emptySortedMap
Returns an empty immutableSortedMap
.- Type Parameters:
K
- the key typeV
- the value type- Returns:
- See Also:
-
emptyIterator
Returns an empty immutableIterator
.- Type Parameters:
T
-- Returns:
- See Also:
-
emptyListIterator
Returns an empty immutableListIterator
.- Type Parameters:
T
-- Returns:
- See Also:
-
emptyInputStream
Returns an empty immutableInputStream
.- Returns:
-
getElement
- Type Parameters:
T
-- Parameters:
c
-index
-- Returns:
- Throws:
IndexOutOfBoundsException
- the index out of bounds exception
-
getElement
public static <T> T getElement(Iterator<? extends T> iter, long index) throws IndexOutOfBoundsException - Type Parameters:
T
-- Parameters:
iter
-index
-- Returns:
- Throws:
IndexOutOfBoundsException
- the index out of bounds exception
-
getOnlyElement
public static <T> u.Nullable<T> getOnlyElement(Iterable<? extends T> c) throws TooManyElementsException Gets the only element.- Type Parameters:
T
-- Parameters:
c
-- Returns:
- throws TooManyElementsException if there are more than one elements in the specified
iterable
. - Throws:
TooManyElementsException
-
getOnlyElement
public static <T> u.Nullable<T> getOnlyElement(Iterator<? extends T> iter) throws TooManyElementsException Gets the only element.- Type Parameters:
T
-- Parameters:
iter
-- Returns:
- throws TooManyElementsException if there are more than one elements in the specified
iter
. - Throws:
TooManyElementsException
- the duplicated result exception
-
firstElement
- Type Parameters:
T
-- Parameters:
c
-- Returns:
-
firstElement
- Type Parameters:
T
-- Parameters:
iter
-- Returns:
-
lastElement
- Type Parameters:
T
-- Parameters:
c
-- Returns:
-
lastElement
- Type Parameters:
T
-- Parameters:
iter
-- Returns:
-
firstElements
Return at most firstn
elements.- Type Parameters:
T
-- Parameters:
c
-n
-- Returns:
- the list
-
lastElements
Return at most lastn
elements.- Type Parameters:
T
-- Parameters:
c
-n
-- Returns:
- the list
-
firstNonNull
First non null.- Type Parameters:
T
-- Parameters:
a
-b
-- Returns:
-
firstNonNull
First non null.- Type Parameters:
T
-- Parameters:
a
-b
-c
-- Returns:
-
firstNonNull
First non null.- Type Parameters:
T
-- Parameters:
a
-- Returns:
-
firstNonNull
First non null.- Type Parameters:
T
-- Parameters:
c
-- Returns:
-
firstNonNull
First non null.- Type Parameters:
T
-- Parameters:
iter
-- Returns:
-
lastNonNull
Last non null.- Type Parameters:
T
-- Parameters:
a
-b
-- Returns:
-
lastNonNull
Last non null.- Type Parameters:
T
-- Parameters:
a
-b
-c
-- Returns:
-
lastNonNull
Last non null.- Type Parameters:
T
-- Parameters:
a
-- Returns:
-
lastNonNull
Last non null.- Type Parameters:
T
-- Parameters:
c
-- Returns:
-
lastNonNull
Last non null.- Type Parameters:
T
-- Parameters:
iter
-- Returns:
-
firstNonEmpty
- Type Parameters:
T
-- Parameters:
a
-b
-- Returns:
-
firstNonEmpty
- Type Parameters:
T
-- Parameters:
a
-b
-c
-- Returns:
-
firstNonEmpty
- Type Parameters:
T
-- Parameters:
a
-b
-- Returns:
-
firstNonEmpty
- Type Parameters:
T
-- Parameters:
a
-b
-c
-- Returns:
-
firstNonEmpty
- Type Parameters:
T
-- Parameters:
a
-b
-- Returns:
-
firstNonEmpty
- Type Parameters:
T
-- Parameters:
a
-b
-c
-- Returns:
-
firstNonEmpty
- Type Parameters:
T
-- Parameters:
a
-- Returns:
-
firstNonBlank
- Type Parameters:
T
-- Parameters:
a
-b
-- Returns:
-
firstNonBlank
- Type Parameters:
T
-- Parameters:
a
-b
-c
-- Returns:
-
firstNonBlank
- Type Parameters:
T
-- Parameters:
a
-- Returns:
-
firstEntry
- Type Parameters:
K
- the key typeV
- the value type- Parameters:
map
-- Returns:
-
lastEntry
- Type Parameters:
K
- the key typeV
- 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
First or null if empty.- Type Parameters:
T
-- Parameters:
c
-- Returns:
-
firstOrNullIfEmpty
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
First or default if empty.- Type Parameters:
T
-- Parameters:
c
-defaultValueForEmpty
-- Returns:
-
firstOrDefaultIfEmpty
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
Last or null if empty.- Type Parameters:
T
-- Parameters:
c
-- Returns:
-
lastOrNullIfEmpty
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
Last or default if empty.- Type Parameters:
T
-- Parameters:
c
-defaultValueForEmpty
-- Returns:
-
lastOrDefaultIfEmpty
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(Iterable<? 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(Iterable<? 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 EFind 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(Iterable<? extends T> c, Throwables.Predicate<? super T, E> predicate) throws EFind 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 EFind 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(Iterable<? extends T> c, Throwables.Predicate<? super T, E> predicate) throws EFind last non null.- Type Parameters:
T
-E
-- Parameters:
c
-predicate
-- Returns:
- the optional
- Throws:
E
- the e
-
len
Returns the length of the specifiedCharSequence
, or0
if it's empty ornull
.- Parameters:
s
-- Returns:
-
len
public static int len(boolean[] a) Returns the length/size of the specifiedArray/Collection/Map
, or0
if it's empty ornull
.- Parameters:
a
-- Returns:
-
len
public static int len(char[] a) Returns the length/size of the specifiedArray/Collection/Map
, or0
if it's empty ornull
.- Parameters:
a
-- Returns:
-
len
public static int len(byte[] a) Returns the length/size of the specifiedArray/Collection/Map
, or0
if it's empty ornull
.- Parameters:
a
-- Returns:
-
len
public static int len(short[] a) Returns the length/size of the specifiedArray/Collection/Map
, or0
if it's empty ornull
.- Parameters:
a
-- Returns:
-
len
public static int len(int[] a) Returns the length/size of the specifiedArray/Collection/Map
, or0
if it's empty ornull
.- Parameters:
a
-- Returns:
-
len
public static int len(long[] a) Returns the length/size of the specifiedArray/Collection/Map
, or0
if it's empty ornull
.- Parameters:
a
-- Returns:
-
len
public static int len(float[] a) Returns the length/size of the specifiedArray/Collection/Map
, or0
if it's empty ornull
.- Parameters:
a
-- Returns:
-
len
public static int len(double[] a) Returns the length/size of the specifiedArray/Collection/Map
, or0
if it's empty ornull
.- Parameters:
a
-- Returns:
-
len
Returns the length/size of the specifiedArray/Collection/Map
, or0
if it's empty ornull
.- Parameters:
a
-- Returns:
-
size
Returns the length/size of the specifiedArray/Collection/Map
, or0
if it's empty ornull
.- Parameters:
c
-- Returns:
-
size
Returns the length/size of the specifiedArray/Collection/Map
, or0
if it's empty ornull
.- Parameters:
m
-- Returns:
-
size
Returns the length/size of the specifiedArray/Collection/Map
, or0
if it's empty ornull
.- Parameters:
c
-- Returns:
-
nullToEmpty
- Parameters:
str
-- Returns:
- See Also:
-
nullToEmpty
Returns an immutable empty list if the specified List isnull
, otherwise itself is returned.- Type Parameters:
T
-- Parameters:
list
-- Returns:
- See Also:
-
nullToEmpty
Returns an immutable empty set if the specified Set isnull
, otherwise itself is returned.- Type Parameters:
T
-- Parameters:
set
-- Returns:
- See Also:
-
nullToEmpty
Returns an immutable emptySortedSet
if the specified SortedSet isnull
, otherwise itself is returned.- Type Parameters:
T
-- Parameters:
set
-- Returns:
- See Also:
-
nullToEmpty
Returns an immutable empty map if the specified Map isnull
, otherwise itself is returned.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
map
-- Returns:
- See Also:
-
nullToEmpty
Returns an immutable emptySortedMap
if the specified SortedMap isnull
, otherwise itself is returned.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
map
-- Returns:
- See Also:
-
nullToEmpty
Returns an immutable emptyIterator
if the specified Iterator isnull
, otherwise itself is returned.- Type Parameters:
T
-- Parameters:
iter
-- Returns:
- See Also:
-
nullToEmpty
Returns an immutable emptyListIterator
if the specified ListIterator isnull
, otherwise itself is returned.- Type Parameters:
T
-- Parameters:
iter
-- Returns:
- See Also:
-
nullToEmpty
public static boolean[] nullToEmpty(boolean[] a) Null to empty.- Parameters:
a
-- Returns:
-
nullToEmpty
public static char[] nullToEmpty(char[] a) Null to empty.- Parameters:
a
-- Returns:
-
nullToEmpty
public static byte[] nullToEmpty(byte[] a) Null to empty.- Parameters:
a
-- Returns:
-
nullToEmpty
public static short[] nullToEmpty(short[] a) Null to empty.- Parameters:
a
-- Returns:
-
nullToEmpty
public static int[] nullToEmpty(int[] a) Null to empty.- Parameters:
a
-- Returns:
-
nullToEmpty
public static long[] nullToEmpty(long[] a) Null to empty.- Parameters:
a
-- Returns:
-
nullToEmpty
public static float[] nullToEmpty(float[] a) Null to empty.- Parameters:
a
-- Returns:
-
nullToEmpty
public static double[] nullToEmpty(double[] a) Null to empty.- Parameters:
a
-- Returns:
-
nullToEmpty
Null to empty.- Parameters:
a
-- Returns:
- See Also:
-
nullToEmptyForEach
Converts the specified String array to an emptyString[0]
if it'snull
and eachnull
element String to empty String""
.- Parameters:
a
-- Returns:
- See Also:
-
nullToEmpty
Deprecated.replaced byCommonUtil.<T>nullToEmpty(T[],java.lang.Class<T[]>)
Null to empty.- Parameters:
a
-- Returns:
-
nullToEmpty
Null to empty.- Type Parameters:
T
-- Parameters:
a
-arrayType
-- Returns:
-
nullToEmpty
Returns an immutable empty Collection if the specified ImmutableCollection isnull
, otherwise itself is returned.- Type Parameters:
T
-- Parameters:
c
-- Returns:
-
nullToEmpty
Returns an immutable empty list if the specified ImmutableList isnull
, otherwise itself is returned.- Type Parameters:
T
-- Parameters:
list
-- Returns:
-
nullToEmpty
Returns an immutable empty list if the specified ImmutableSet isnull
, otherwise itself is returned.- Type Parameters:
T
-- Parameters:
set
-- Returns:
-
nullToEmpty
Returns an immutable empty list if the specified ImmutableSortedSet isnull
, otherwise itself is returned.- Type Parameters:
T
-- Parameters:
set
-- Returns:
-
nullToEmpty
Returns an immutable empty map if the specified ImmutableMap isnull
, otherwise itself is returned.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
map
-- Returns:
-
nullToEmpty
Returns an immutable empty map if the specified ImmutableSortedMap isnull
, otherwise itself is returned.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
map
-- Returns:
-
nullToEmpty
Returns an immutable empty map if the specified ImmutableBiMap isnull
, otherwise itself is returned.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
map
-- Returns:
-
isEmpty
Checks if the specifiedCharSequence
is null or empty.- Parameters:
cs
-- Returns:
-
isEmpty
public static boolean isEmpty(boolean[] a) Checks if is null or empty.- Parameters:
a
-- Returns:
- true, if is null or empty
-
isEmpty
public static boolean isEmpty(char[] a) Checks if is null or empty.- Parameters:
a
-- Returns:
- true, if is null or empty
-
isEmpty
public static boolean isEmpty(byte[] a) Checks if is null or empty.- Parameters:
a
-- Returns:
- true, if is null or empty
-
isEmpty
public static boolean isEmpty(short[] a) Checks if is null or empty.- Parameters:
a
-- Returns:
- true, if is null or empty
-
isEmpty
public static boolean isEmpty(int[] a) Checks if is null or empty.- Parameters:
a
-- Returns:
- true, if is null or empty
-
isEmpty
public static boolean isEmpty(long[] a) Checks if is null or empty.- Parameters:
a
-- Returns:
- true, if is null or empty
-
isEmpty
public static boolean isEmpty(float[] a) Checks if is null or empty.- Parameters:
a
-- Returns:
- true, if is null or empty
-
isEmpty
public static boolean isEmpty(double[] a) Checks if is null or empty.- Parameters:
a
-- Returns:
- true, if is null or empty
-
isEmpty
Checks if is null or empty.- Parameters:
a
-- Returns:
- true, if is null or empty
-
isEmpty
Checks if is null or empty.- Parameters:
c
-- Returns:
- true, if is null or empty
-
isEmpty
Not null or empty.- Parameters:
iter
-- Returns:
-
isEmpty
Not null or empty.- Parameters:
iter
-- Returns:
-
isEmpty
Checks if is null or empty.- Parameters:
m
-- Returns:
- true, if is null or empty
-
isEmpty
Checks if is null or empty.- Parameters:
list
-- Returns:
- true, if is null or empty
-
isEmpty
Checks if is null or empty.- Parameters:
s
-- Returns:
- true, if is null or empty
-
isEmpty
Checks if is null or empty.- Parameters:
s
-- Returns:
- true, if is null or empty
-
isEmpty
Checks if is null or empty.- Parameters:
m
-- Returns:
- true, if is null or empty
-
isEmpty
Checks if is null or empty.- Parameters:
rs
-- Returns:
- true, if is null or empty
-
isBlank
Checks if the specifiedCharSequence
is null or blank.- Parameters:
cs
-- Returns:
-
notEmpty
- Parameters:
cs
-- Returns:
-
notEmpty
public static boolean notEmpty(boolean[] a) Not null or empty.- Parameters:
a
-- Returns:
-
notEmpty
public static boolean notEmpty(char[] a) Not null or empty.- Parameters:
a
-- Returns:
-
notEmpty
public static boolean notEmpty(byte[] a) Not null or empty.- Parameters:
a
-- Returns:
-
notEmpty
public static boolean notEmpty(short[] a) Not null or empty.- Parameters:
a
-- Returns:
-
notEmpty
public static boolean notEmpty(int[] a) Not null or empty.- Parameters:
a
-- Returns:
-
notEmpty
public static boolean notEmpty(long[] a) Not null or empty.- Parameters:
a
-- Returns:
-
notEmpty
public static boolean notEmpty(float[] a) Not null or empty.- Parameters:
a
-- Returns:
-
notEmpty
public static boolean notEmpty(double[] a) Not null or empty.- Parameters:
a
-- Returns:
-
notEmpty
Not null or empty.- Parameters:
a
-- Returns:
-
notEmpty
Not null or empty.- Parameters:
c
-- Returns:
-
notEmpty
Not null or empty.- Parameters:
iter
-- Returns:
-
notEmpty
Not null or empty.- Parameters:
iter
-- Returns:
-
notEmpty
Not null or empty.- Parameters:
m
-- Returns:
-
notEmpty
Not null or empty.- Parameters:
list
-- Returns:
-
notEmpty
Not null or empty.- Parameters:
s
-- Returns:
-
notEmpty
Not null or empty.- Parameters:
s
-- Returns:
-
notEmpty
Not null or empty.- Parameters:
m
-- Returns:
-
notEmpty
Not null or empty.- Parameters:
rs
-- Returns:
-
notBlank
- Parameters:
cs
-- Returns:
-
anyNull
public static <A,B> boolean anyNull(A a, B b) - Type Parameters:
A
-B
-- Parameters:
a
-b
-- Returns:
-
anyNull
public static <A,B, boolean anyNullC> (A a, B b, C c) - Type Parameters:
A
-B
-C
-- Parameters:
a
-b
-c
-- Returns:
-
anyNull
- Type Parameters:
T
-- Parameters:
a
-- Returns:
-
anyNull
- Parameters:
c
-- Returns:
-
anyEmpty
-
anyEmpty
-
anyEmpty
Checks if any of the CharSequences are empty ("") or null.
Strings.anyEmpty((String) null) = true Strings.anyEmpty((String[]) null) = false Strings.anyEmpty(null, "foo") = true Strings.anyEmpty("", "bar") = true Strings.anyEmpty("bob", "") = true Strings.anyEmpty(" bob ", null) = true Strings.anyEmpty(" ", "bar") = false Strings.anyEmpty("foo", "bar") = false Strings.anyEmpty(new String[]{}) = false Strings.anyEmpty(new String[]{""}) = true
- Parameters:
css
- the CharSequences to check, may be null or empty- Returns:
true
if any of the CharSequences are empty or null- Since:
- 3.2
- See Also:
-
Strings#anyEmpty(CharSequence...)
-
anyEmpty
- Parameters:
css
-- Returns:
- See Also:
-
Strings#anyEmpty(CharSequence...)
-
anyEmpty
public static <A,B> boolean anyEmpty(A[] a, B[] b) - Type Parameters:
A
-B
-- Parameters:
a
-b
-- Returns:
-
anyEmpty
public static <A,B, boolean anyEmptyC> (A[] a, B[] b, C[] c) - Type Parameters:
A
-B
-C
-- Parameters:
a
-b
-c
-- Returns:
-
anyEmpty
- Parameters:
a
-b
-- Returns:
-
anyEmpty
- Parameters:
a
-b
-c
-- Returns:
-
anyBlank
-
anyBlank
-
anyBlank
Checks if any of the CharSequences are empty ("") or null or whitespace only.
Whitespace is defined by
Character.isWhitespace(char)
.Strings.anyBlank((String) null) = true Strings.anyBlank((String[]) null) = false Strings.anyBlank(null, "foo") = true Strings.anyBlank(null, null) = true Strings.anyBlank("", "bar") = true Strings.anyBlank("bob", "") = true Strings.anyBlank(" bob ", null) = true Strings.anyBlank(" ", "bar") = true Strings.anyBlank(new String[] {}) = false Strings.anyBlank(new String[]{""}) = true Strings.anyBlank("foo", "bar") = false
- Parameters:
css
- the CharSequences to check, may be null or empty- Returns:
true
if any of the CharSequences are empty or null or whitespace only- Since:
- 3.2
- See Also:
-
Strings#anyBlank(CharSequence...)
-
anyBlank
- Parameters:
css
-- Returns:
- See Also:
-
Strings#anyBlank(Collection)
-
allNull
public static <A,B> boolean allNull(A a, B b) - Type Parameters:
A
-B
-- Parameters:
a
-b
-- Returns:
-
allNull
public static <A,B, boolean allNullC> (A a, B b, C c) - Type Parameters:
A
-B
-C
-- Parameters:
a
-b
-c
-- Returns:
-
allNull
- Type Parameters:
T
-- Parameters:
a
-- Returns:
-
allNull
- Parameters:
c
-- Returns:
-
allEmpty
-
allEmpty
-
allEmpty
Checks if all of the CharSequences are empty ("") or null.
Strings.allEmpty(null) = true Strings.allEmpty(null, "") = true Strings.allEmpty(new String[] {}) = true Strings.allEmpty(null, "foo") = false Strings.allEmpty("", "bar") = false Strings.allEmpty("bob", "") = false Strings.allEmpty(" bob ", null) = false Strings.allEmpty(" ", "bar") = false Strings.allEmpty("foo", "bar") = false
- Parameters:
css
- the CharSequences to check, may be null or empty- Returns:
true
if all of the CharSequences are empty or null- Since:
- 3.6
- See Also:
-
Strings#allEmpty(CharSequence...)
-
allEmpty
- Parameters:
css
-- Returns:
- See Also:
-
Strings#allEmpty(Collection)
-
allEmpty
public static <A,B> boolean allEmpty(A[] a, B[] b) - Type Parameters:
A
-B
-- Parameters:
a
-b
-- Returns:
-
allEmpty
public static <A,B, boolean allEmptyC> (A[] a, B[] b, C[] c) - Type Parameters:
A
-B
-C
-- Parameters:
a
-b
-c
-- Returns:
-
allEmpty
- Parameters:
a
-b
-- Returns:
-
allEmpty
- Parameters:
a
-b
-c
-- Returns:
-
allBlank
-
allBlank
-
allBlank
Checks if all of the CharSequences are empty (""), null or whitespace only.
Whitespace is defined by
Character.isWhitespace(char)
.Strings.allBlank(null) = true Strings.allBlank(null, "foo") = false Strings.allBlank(null, null) = true Strings.allBlank("", "bar") = false Strings.allBlank("bob", "") = false Strings.allBlank(" bob ", null) = false Strings.allBlank(" ", "bar") = false Strings.allBlank("foo", "bar") = false Strings.allBlank(new String[] {}) = true
- Parameters:
css
- the CharSequences to check, may be null or empty- Returns:
true
if all of the CharSequences are empty or null or whitespace only- Since:
- 3.6
- See Also:
-
Strings#allBlank(CharSequence...)
-
allBlank
- Parameters:
css
-- Returns:
- See Also:
-
Strings#allBlank(Collection)
-
checkIndex
- 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-intervalsize
- the size of the sub-rangelength
- the upper-bound (exclusive) of the range- Throws:
IndexOutOfBoundsException
- the index out of bounds exception
-
checkArgNotNull
public static <T> T checkArgNotNull(T obj) Check arg not null.- Type Parameters:
T
-- Parameters:
obj
-- Returns:
- Throws:
IllegalArgumentException
- ifobj
isnull
-
checkArgNotNull
Check arg not null.- Type Parameters:
T
-- Parameters:
obj
-errorMessage
-- Returns:
- Throws:
IllegalArgumentException
- ifobj
isnull
-
checkArgNotEmpty
Checks if the specifiedarg
isnull
or empty, and throwsIllegalArgumentException
if it is.- Type Parameters:
T
-- Parameters:
arg
-argNameOrErrorMsg
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedarg
isnull
or empty.
-
checkArgNotEmpty
Checks if the specifiedarg
isnull
or empty, and throwsIllegalArgumentException
if it is.- Parameters:
arg
-argNameOrErrorMsg
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedarg
isnull
or empty.
-
checkArgNotEmpty
Checks if the specifiedarg
isnull
or empty, and throwsIllegalArgumentException
if it is.- Parameters:
arg
-argNameOrErrorMsg
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedarg
isnull
or empty.
-
checkArgNotEmpty
Checks if the specifiedarg
isnull
or empty, and throwsIllegalArgumentException
if it is.- Parameters:
arg
-argNameOrErrorMsg
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedarg
isnull
or empty.
-
checkArgNotEmpty
Checks if the specifiedarg
isnull
or empty, and throwsIllegalArgumentException
if it is.- Parameters:
arg
-argNameOrErrorMsg
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedarg
isnull
or empty.
-
checkArgNotEmpty
Checks if the specifiedarg
isnull
or empty, and throwsIllegalArgumentException
if it is.- Parameters:
arg
-argNameOrErrorMsg
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedarg
isnull
or empty.
-
checkArgNotEmpty
Checks if the specifiedarg
isnull
or empty, and throwsIllegalArgumentException
if it is.- Parameters:
arg
-argNameOrErrorMsg
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedarg
isnull
or empty.
-
checkArgNotEmpty
Checks if the specifiedarg
isnull
or empty, and throwsIllegalArgumentException
if it is.- Parameters:
arg
-argNameOrErrorMsg
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedarg
isnull
or empty.
-
checkArgNotEmpty
Checks if the specifiedarg
isnull
or empty, and throwsIllegalArgumentException
if it is.- Parameters:
arg
-argNameOrErrorMsg
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedarg
isnull
or empty.
-
checkArgNotEmpty
Checks if the specifiedarg
isnull
or empty, and throwsIllegalArgumentException
if it is.- Type Parameters:
T
-- Parameters:
arg
-argNameOrErrorMsg
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedarg
isnull
or empty.
-
checkArgNotEmpty
Checks if the specifiedarg
isnull
or empty, and throwsIllegalArgumentException
if it is.- Type Parameters:
T
-- Parameters:
arg
-argNameOrErrorMsg
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedarg
isnull
or empty.
-
checkArgNotEmpty
Checks if the specifiedarg
isnull
or empty, and throwsIllegalArgumentException
if it is.- Type Parameters:
T
-- Parameters:
arg
-argNameOrErrorMsg
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedarg
isnull
or empty.
-
checkArgNotEmpty
Checks if the specifiedarg
isnull
or empty, and throwsIllegalArgumentException
if it is.- Type Parameters:
T
-- Parameters:
arg
-argNameOrErrorMsg
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedarg
isnull
or empty.
-
checkArgNotEmpty
Checks if the specifiedarg
isnull
or empty, and throwsIllegalArgumentException
if it is.- Type Parameters:
T
-- Parameters:
arg
-argNameOrErrorMsg
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedarg
isnull
or empty.
-
checkArgNotEmpty
public static <T extends PrimitiveList<?,?, T checkArgNotEmpty?>> (T arg, String argNameOrErrorMsg) Checks if the specifiedarg
isnull
or empty, and throwsIllegalArgumentException
if it is.- Type Parameters:
T
-- Parameters:
arg
-argNameOrErrorMsg
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedarg
isnull
or empty.
-
checkArgNotEmpty
Checks if the specifiedarg
isnull
or empty, and throwsIllegalArgumentException
if it is.- Type Parameters:
T
-- Parameters:
arg
-argNameOrErrorMsg
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedarg
isnull
or empty.
-
checkArgNotEmpty
Checks if the specifiedarg
isnull
or empty, and throwsIllegalArgumentException
if it is.- Type Parameters:
T
-- Parameters:
arg
-argNameOrErrorMsg
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedarg
isnull
or empty.
-
checkArgNotEmpty
Checks if the specifiedarg
isnull
or empty, and throwsIllegalArgumentException
if it is.- Type Parameters:
T
-- Parameters:
arg
-argNameOrErrorMsg
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedarg
isnull
or empty.
-
checkArgNotEmpty
Checks if the specifiedarg
isnull
or empty, and throwsIllegalArgumentException
if it is.- Type Parameters:
T
-- Parameters:
arg
-argNameOrErrorMsg
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedarg
isnull
or empty.
-
checkArgNotBlank
Checks if a CharSequence is NOT
null
, empty ("") or whitespace only.- Type Parameters:
T
-- Parameters:
arg
-msg
- name of parameter or error message- Returns:
- Throws:
IllegalArgumentException
- if the specified parameter isnull
, empty ("") or whitespace only.- See Also:
-
Strings.isBlank(CharSequence)
Strings#notBlank(CharSequence)
-
checkArgNotNegative
Checks if the specifiedarg
is not negative, and throwsIllegalArgumentException
if it is.- Parameters:
arg
-argNameOrErrorMsg
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedarg
is negative.
-
checkArgNotNegative
Checks if the specifiedarg
is not negative, and throwsIllegalArgumentException
if it is.- Parameters:
arg
-argNameOrErrorMsg
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedarg
is negative.
-
checkArgNotNegative
Checks if the specifiedarg
is not negative, and throwsIllegalArgumentException
if it is.- Parameters:
arg
-argNameOrErrorMsg
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedarg
is negative.
-
checkArgNotNegative
Checks if the specifiedarg
is not negative, and throwsIllegalArgumentException
if it is.- Parameters:
arg
-argNameOrErrorMsg
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedarg
is negative.
-
checkArgNotNegative
Checks if the specifiedarg
is not negative, and throwsIllegalArgumentException
if it is.- Parameters:
arg
-argNameOrErrorMsg
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedarg
is negative.
-
checkArgNotNegative
Checks if the specifiedarg
is not negative, and throwsIllegalArgumentException
if it is.- Parameters:
arg
-argNameOrErrorMsg
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedarg
is negative.
-
checkArgPositive
Checks if the specifiedarg
is positive, and throwsIllegalArgumentException
if it is not.- Parameters:
arg
-argNameOrErrorMsg
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedarg
is negative.
-
checkArgPositive
Checks if the specifiedarg
is positive, and throwsIllegalArgumentException
if it is not.- Parameters:
arg
-argNameOrErrorMsg
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedarg
is negative.
-
checkArgPositive
Checks if the specifiedarg
is positive, and throwsIllegalArgumentException
if it is not.- Parameters:
arg
-argNameOrErrorMsg
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedarg
is negative.
-
checkArgPositive
Checks if the specifiedarg
is positive, and throwsIllegalArgumentException
if it is not.- Parameters:
arg
-argNameOrErrorMsg
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedarg
is negative.
-
checkArgPositive
Checks if the specifiedarg
is positive, and throwsIllegalArgumentException
if it is not.- Parameters:
arg
-argNameOrErrorMsg
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedarg
is negative.
-
checkArgPositive
Checks if the specifiedarg
is positive, and throwsIllegalArgumentException
if it is not.- Parameters:
arg
-argNameOrErrorMsg
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedarg
is negative.
-
checkElementNotNull
Check if the specifiedArray
contains anynull
element.- Parameters:
a
-- Throws:
IllegalArgumentException
- ifnull
element found ina
-
checkElementNotNull
Check if the specifiedArray
contains anynull
element.- Parameters:
a
-argNameOrErrorMsg
-- Throws:
IllegalArgumentException
- ifnull
element found ina
-
checkElementNotNull
Check if the specifiedCollection
contains anynull
element.- Parameters:
c
-- Throws:
IllegalArgumentException
- ifnull
element found inc
-
checkElementNotNull
Check if the specifiedCollection
contains anynull
element.- Parameters:
c
-argNameOrErrorMsg
-- Throws:
IllegalArgumentException
- ifnull
element found inc
-
checkKeyNotNull
Check if the specifiedMap
contains anynull
key.- Parameters:
m
-- Throws:
IllegalArgumentException
- ifnull
key found inm
-
checkKeyNotNull
Check if the specifiedMap
contains anynull
key.- Parameters:
m
-argNameOrErrorMsg
-- Throws:
IllegalArgumentException
- ifnull
key found inm
-
checkValueNotNull
Check if the specifiedMap
contains anynull
value.- Parameters:
m
-- Throws:
IllegalArgumentException
- ifnull
value found inm
-
checkValueNotNull
Check if the specifiedMap
contains anynull
value.- Parameters:
m
-argNameOrErrorMsg
-- Throws:
IllegalArgumentException
- ifnull
value found inm
-
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
- ifexpression
is false
-
checkArgument
Ensures the truth of an expression involving one or more parameters to the calling method.- Parameters:
expression
- a boolean expressionerrorMessage
- the exception message to use if the check fails; will be converted to a string usingString.valueOf(Object)
- Throws:
IllegalArgumentException
- ifexpression
is false
-
checkArgument
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
- Parameters:
b
-errorMessageSupplier
-
-
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
- ifexpression
is false
-
checkState
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 expressionerrorMessage
- the exception message to use if the check fails; will be converted to a string usingString.valueOf(Object)
- Throws:
IllegalStateException
- ifexpression
is false
-
checkState
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
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
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
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
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
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
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
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
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
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
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
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
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
- 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
- Type Parameters:
T
-- Parameters:
a
-b
-- Returns:
-
compare
Returns 0 if the arguments are identical andc.compare(a, b)
otherwise. Consequently, if both arguments arenull
0 is returned.Note that if one of the arguments is
null
, aNullPointerException
may or may not be thrown depending on what ordering policy, if any, theComparator
chooses to have fornull
values.- Type Parameters:
T
- the type of the objects being compared- Parameters:
a
- an objectb
- an object to be compared witha
cmp
- theComparator
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>, int compareT3 extends Comparable<T3>> (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>, int compareT3 extends Comparable<T3>, T4 extends Comparable<T4>> (T1 a1, T1 b1, T2 a2, T2 b2, T3 a3, T3 b3, T4 a4, T4 b4) Deprecated.please useBuilder.ComparisonBuilder
Continue to compare the pairs of values(a1, b1), (a2, b2), (a3, b3), (a4, b4)
until they're not equal.0
is returned if all of the pairs of values are equal.- Type Parameters:
T1
-T2
-T3
-T4
-- Parameters:
a1
-b1
-a2
-b2
-a3
-b3
-a4
-b4
-- Returns:
- See Also:
-
compare
@Deprecated public static <T1 extends Comparable<T1>,T2 extends Comparable<T2>, int compareT3 extends Comparable<T3>, T4 extends Comparable<T4>, T5 extends Comparable<T5>> (T1 a1, T1 b1, T2 a2, T2 b2, T3 a3, T3 b3, T4 a4, T4 b4, T5 a5, T5 b5) Deprecated.please useBuilder.ComparisonBuilder
Continue to compare the pairs of values(a1, b1), (a2, b2), (a3, b3), (a4, b4), (a5, b5)
until they're not equal.0
is returned if all of the pairs of values are equal.- Type Parameters:
T1
-T2
-T3
-T4
-T5
-- Parameters:
a1
-b1
-a2
-b2
-a3
-b3
-a4
-b4
-a5
-b5
-- Returns:
- See Also:
-
compare
@Deprecated public static <T1 extends Comparable<T1>,T2 extends Comparable<T2>, int compareT3 extends Comparable<T3>, T4 extends Comparable<T4>, T5 extends Comparable<T5>, T6 extends Comparable<T6>> (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 useBuilder.ComparisonBuilder
Continue to compare the pairs of values(a1, b1), (a2, b2), (a3, b3), (a4, b4), (a5, b5), (a6, b6)
until they're not equal.0
is returned if all of the pairs of values are equal.- Type Parameters:
T1
-T2
-T3
-T4
-T5
-T6
-- Parameters:
a1
-b1
-a2
-b2
-a3
-b3
-a4
-b4
-a5
-b5
-a6
-b6
-- Returns:
- See Also:
-
compare
@Deprecated public static <T1 extends Comparable<T1>,T2 extends Comparable<T2>, int compareT3 extends Comparable<T3>, T4 extends Comparable<T4>, T5 extends Comparable<T5>, T6 extends Comparable<T6>, T7 extends Comparable<T7>> (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 useBuilder.ComparisonBuilder
Continue to compare the pairs of values(a1, b1), (a2, b2), (a3, b3), (a4, b4), (a5, b5), (a6, b6), (a7, b7)
until they're not equal.0
is returned if all of the pairs of values are equal.- Type Parameters:
T1
-T2
-T3
-T4
-T5
-T6
-T7
-- Parameters:
a1
-b1
-a2
-b2
-a3
-b3
-a4
-b4
-a5
-b5
-a6
-b6
-a7
-b7
-- Returns:
- See Also:
-
compare
public static int compare(boolean[] a, boolean[] b) - 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
- 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
- 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
- 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
- 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
Compare ignore case.- Parameters:
a
-b
-- Returns:
-
lessThan
Returnstrue
isa < b
, otherwisefalse
is returned.- Type Parameters:
T
-- Parameters:
a
-b
-- Returns:
-
lessEqual
Returnstrue
isa <= b
, otherwisefalse
is returned.- Type Parameters:
T
-- Parameters:
a
-b
-- Returns:
-
greaterThan
Returnstrue
isa > b
, otherwisefalse
is returned.- Type Parameters:
T
-- Parameters:
a
-b
-- Returns:
-
greaterEqual
Returnstrue
isa >= b
, otherwisefalse
is returned.- Type Parameters:
T
-- Parameters:
a
-b
-- Returns:
-
gtAndLt
Returnstrue
ismin < value < max
, otherwisefalse
is returned.- Type Parameters:
T
-- Parameters:
value
-min
-max
-- Returns:
-
geAndLt
Returnstrue
ismin <= value < max
, otherwisefalse
is returned.- Type Parameters:
T
-- Parameters:
value
-min
-max
-- Returns:
-
geAndLe
Returnstrue
ismin <= value <= max
, otherwisefalse
is returned.- Type Parameters:
T
-- Parameters:
value
-min
-max
-- Returns:
-
gtAndLe
Returnstrue
ismin < value <= max
, otherwisefalse
is returned.- Type Parameters:
T
-- Parameters:
value
-min
-max
-- Returns:
-
isBetween
@Deprecated public static <T extends Comparable<? super T>> boolean isBetween(T value, T min, T max) Deprecated.replaced bygtAndLt(Comparable, Comparable, Comparable)
- 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
- Parameters:
a
-b
-- Returns:
-
equalsIgnoreCase
Equals ignore case.- Parameters:
a
-b
-- Returns:
-
equals
- Parameters:
a
-b
-- Returns:
- boolean
-
deepEquals
- 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
- Parameters:
a
-b
-- Returns:
- boolean
- See Also:
-
equals
- Parameters:
a
-fromIndexA
-b
-fromIndexB
-len
-- Returns:
-
deepEquals
- Parameters:
a
-b
-- Returns:
- See Also:
-
deepEquals
- Parameters:
a
-fromIndexA
-b
-fromIndexB
-len
-- Returns:
-
equalsIgnoreCase
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:
-
equalsByCommonProps
- Parameters:
bean1
-bean2
-- Returns:
- See Also:
-
MapDifference#of(Object, Object)
-
equalsByCommonProps
public static boolean equalsByCommonProps(Object bean1, Object bean2, Collection<String> propNamesToCompare) - Parameters:
bean1
-bean2
-propNamesToCompare
-- Returns:
- See Also:
-
MapDifference#of(Object, Object)
-
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
- Parameters:
obj
-- Returns:
- int
-
deepHashCode
- 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
- Parameters:
a
-- Returns:
- See Also:
-
hashCode
- Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
deepHashCode
Deep hash code.- Parameters:
a
-- Returns:
- See Also:
-
deepHashCode
Deep hash code.- Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
toString
- Parameters:
value
-- Returns:
- int
-
toString
- Parameters:
value
-- Returns:
- int
-
toString
- Parameters:
value
-- Returns:
- int
-
toString
- Parameters:
value
-- Returns:
- int
-
toString
- Parameters:
value
-- Returns:
- int
-
toString
- Parameters:
value
-- Returns:
- int
-
toString
- Parameters:
value
-- Returns:
- int
-
toString
- Parameters:
value
-- Returns:
- int
-
toString
- Parameters:
obj
-- Returns:
- int
-
deepToString
- Parameters:
obj
-- Returns:
- int
-
toString
- Parameters:
a
-- Returns:
- See Also:
-
toString
- Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
toString
- Parameters:
a
-- Returns:
- See Also:
-
toString
- Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
toString
- Parameters:
a
-- Returns:
- See Also:
-
toString
- Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
toString
- Parameters:
a
-- Returns:
- See Also:
-
toString
- Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
toString
- Parameters:
a
-- Returns:
- See Also:
-
toString
- Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
toString
- Parameters:
a
-- Returns:
- See Also:
-
toString
- Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
toString
- Parameters:
a
-- Returns:
- See Also:
-
toString
- Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
toString
- Parameters:
a
-- Returns:
- See Also:
-
toString
- Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
toString
- Parameters:
a
-- Returns:
- See Also:
-
toString
- Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
toString
- Parameters:
a
-defaultIfNull
-- Returns:
-
deepToString
Deep to string.- Parameters:
a
-- Returns:
- See Also:
-
deepToString
Deep to string.- Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
deepToString
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
Reverses the order of the given array.
There is no special handling for multi-dimensional arrays.
- Parameters:
a
-
-
reverse
Reverses the order of the given array in the given range.
- Parameters:
a
-fromIndex
-toIndex
-
-
reverse
- Parameters:
list
-
-
reverse
- Parameters:
list
-fromIndex
-toIndex
-
-
reverse
- 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
- Parameters:
a
-distance
-
-
rotate
- Parameters:
list
-distance
-- See Also:
-
rotate
- Parameters:
c
-distance
-
-
shuffle
public static void shuffle(boolean[] a) - Parameters:
a
-
-
shuffle
- Parameters:
a
-rnd
-
-
shuffle
public static void shuffle(char[] a) - Parameters:
a
-
-
shuffle
- Parameters:
a
-rnd
-
-
shuffle
public static void shuffle(byte[] a) - Parameters:
a
-
-
shuffle
- Parameters:
a
-rnd
-
-
shuffle
public static void shuffle(short[] a) - Parameters:
a
-
-
shuffle
- Parameters:
a
-rnd
-
-
shuffle
public static void shuffle(int[] a) - Parameters:
a
-
-
shuffle
- Parameters:
a
-rnd
-
-
shuffle
public static void shuffle(long[] a) - Parameters:
a
-
-
shuffle
- Parameters:
a
-rnd
-
-
shuffle
public static void shuffle(float[] a) - Parameters:
a
-
-
shuffle
- Parameters:
a
-rnd
-
-
shuffle
public static void shuffle(double[] a) - Parameters:
a
-
-
shuffle
- Parameters:
a
-rnd
-
-
shuffle
public static <T> void shuffle(T[] a) - Type Parameters:
T
-- Parameters:
a
-
-
shuffle
- Type Parameters:
T
-- Parameters:
a
-rnd
-
-
shuffle
- Parameters:
list
-
-
shuffle
- Parameters:
list
-rnd
-- See Also:
-
shuffle
- Parameters:
c
-
-
shuffle
- 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
- Parameters:
a
-i
-j
-
-
swap
- Parameters:
list
-i
-j
-
-
swap
- Type Parameters:
T
-- Parameters:
pair
-
-
swapIf
public static <T,E extends Exception> boolean swapIf(Pair<T, T> pair, Throwables.Predicate<? super Pair<T, throws ET>, E> predicate) - Type Parameters:
T
-E
-- Parameters:
pair
-predicate
-- Returns:
- Throws:
E
- the e
-
swap
- Type Parameters:
T
-M
-- Parameters:
triple
-
-
swapIf
public static <T,M, boolean swapIfE extends Exception> (Triple<T, M, throws ET> triple, Throwables.Predicate<? super Triple<T, M, T>, E> predicate) - 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
- Parameters:
a
-val
-
-
fill
- Parameters:
a
-fromIndex
-toIndex
-val
-
-
fill
- Type Parameters:
T
-- Parameters:
list
-val
-- See Also:
-
fill
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
-- See Also:
-
fill
Fill the properties of the bean with random values.- Parameters:
bean
- a bean object with getter/setter method
-
fill
Fill the properties of the bean with random values.- Type Parameters:
T
-- Parameters:
beanClass
- bean class with getter/setter methods- Returns:
-
fill
Fill the properties of the bean with random values.- Type Parameters:
T
-- Parameters:
beanClass
- bean class with getter/setter methodscount
-- Returns:
-
padLeft
- Type Parameters:
T
-- Parameters:
list
-minSize
-objToAdd
-- Returns:
- See Also:
-
padRight
- Type Parameters:
T
-- Parameters:
c
-minSize
-objToAdd
-- Returns:
- See Also:
-
repeat
- Type Parameters:
T
-- Parameters:
value
-n
-- Returns:
- See Also:
-
repeatElements
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:
-
repeatCollection
repeatAll(N.asList(1, 2, 3), 2) => [1, 2, 3, 1, 2, 3]
- Type Parameters:
T
-- Parameters:
c
-n
-- Returns:
-
repeatElementsToSize
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:
-
repeatCollectionToSize
repeatAllToSize(N.asList(1, 2, 3), 5) => [1, 2, 3, 1, 2]
- Type Parameters:
T
-- Parameters:
c
-size
-- Returns:
-
copy
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
- Parameters:
src
-srcPos
-dest
-destPos
-length
-
-
copy
- 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
- 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 inoriginal
, throughto
-from
, bystep
.- 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 inoriginal
, throughto
-from
, bystep
.- 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 inoriginal
, throughto
-from
, bystep
.- 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 inoriginal
, throughto
-from
, bystep
.- 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 inoriginal
, throughto
-from
, bystep
.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 inoriginal
, throughto
-from
, bystep
.- 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 inoriginal
, throughto
-from
, bystep
.- 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 inoriginal
, throughto
-from
, bystep
.- 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:
-
Arrays#copyOfRange(T[], int, int)
-
copyOfRange
public static <T> T[] copyOfRange(T[] original, int fromIndex, int toIndex, int step) Copy all the elements inoriginal
, throughto
-from
, bystep
.- 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 inoriginal
, throughto
-from
, bystep
.- Type Parameters:
T
-- Parameters:
original
-fromIndex
-toIndex
-step
-newType
-- Returns:
- See Also:
-
CommonUtil.copyOfRange(int[],int,int,int)
-
copyOfRange
Copy of range.- Type Parameters:
T
-- Parameters:
c
-fromIndex
-toIndex
-- Returns:
- See Also:
-
Arrays#copyOfRange(T[], int, int)
-
copyOfRange
Copy all the elements inoriginal
, throughto
-from
, bystep
.- Type Parameters:
T
-- Parameters:
c
-fromIndex
-toIndex
-step
-- Returns:
-
copyOfRange
Copy of range.- Parameters:
str
-fromIndex
-toIndex
-- Returns:
-
copyOfRange
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 isnull
.- Parameters:
original
-- Returns:
-
clone
public static char[] clone(char[] original) Clone the original array.null
is returned if the input array isnull
.- Parameters:
original
-- Returns:
-
clone
public static byte[] clone(byte[] original) Clone the original array.null
is returned if the input array isnull
.- Parameters:
original
-- Returns:
-
clone
public static short[] clone(short[] original) Clone the original array.null
is returned if the input array isnull
.- Parameters:
original
-- Returns:
-
clone
public static int[] clone(int[] original) Clone the original array.null
is returned if the input array isnull
.- Parameters:
original
-- Returns:
-
clone
public static long[] clone(long[] original) Clone the original array.null
is returned if the input array isnull
.- Parameters:
original
-- Returns:
-
clone
public static float[] clone(float[] original) Clone the original array.null
is returned if the input array isnull
.- Parameters:
original
-- Returns:
-
clone
public static double[] clone(double[] original) Clone the original array.null
is returned if the input array isnull
.- Parameters:
original
-- Returns:
-
clone
public static <T> T[] clone(T[] original) Clone the original array.null
is returned if the input array isnull
.- 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 isnull
.- 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 isnull
.- 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 isnull
.- 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 isnull
.- 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 isnull
.- 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 isnull
.- 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 isnull
.- 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 isnull
.- 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 isnull
.- 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 isnull
.- 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 isnull
.- 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 isnull
.- 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 isnull
.- 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 isnull
.- 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 isnull
.- 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 isnull
.- 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 isnull
.- 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 isnull
.- Type Parameters:
T
-- Parameters:
original
-- Returns:
-
isSorted
public static boolean isSorted(boolean[] a) - Parameters:
a
-- Returns:
-
isSorted
public static boolean isSorted(boolean[] a, int fromIndex, int toIndex) - Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
isSorted
public static boolean isSorted(char[] a) - Parameters:
a
-- Returns:
-
isSorted
public static boolean isSorted(char[] a, int fromIndex, int toIndex) - Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
isSorted
public static boolean isSorted(byte[] a) - Parameters:
a
-- Returns:
-
isSorted
public static boolean isSorted(byte[] a, int fromIndex, int toIndex) - Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
isSorted
public static boolean isSorted(short[] a) - Parameters:
a
-- Returns:
-
isSorted
public static boolean isSorted(short[] a, int fromIndex, int toIndex) - Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
isSorted
public static boolean isSorted(int[] a) - Parameters:
a
-- Returns:
-
isSorted
public static boolean isSorted(int[] a, int fromIndex, int toIndex) - Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
isSorted
public static boolean isSorted(long[] a) - Parameters:
a
-- Returns:
-
isSorted
public static boolean isSorted(long[] a, int fromIndex, int toIndex) - Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
isSorted
public static boolean isSorted(float[] a) - Parameters:
a
-- Returns:
-
isSorted
public static boolean isSorted(float[] a, int fromIndex, int toIndex) - Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
isSorted
public static boolean isSorted(double[] a) - Parameters:
a
-- Returns:
-
isSorted
public static boolean isSorted(double[] a, int fromIndex, int toIndex) - Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
isSorted
- Type Parameters:
T
-- Parameters:
a
-- Returns:
-
isSorted
- Type Parameters:
T
-- Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
isSorted
- Type Parameters:
T
-- Parameters:
a
-cmp
-- Returns:
-
isSorted
- Type Parameters:
T
-- Parameters:
a
-fromIndex
-toIndex
-cmp
-- Returns:
-
isSorted
- Type Parameters:
T
-- Parameters:
c
-- Returns:
-
isSorted
public static <T extends Comparable<? super T>> boolean isSorted(Collection<? extends T> c, int fromIndex, int toIndex) - Type Parameters:
T
-- Parameters:
c
-fromIndex
-toIndex
-- Returns:
-
isSorted
- Type Parameters:
T
-- Parameters:
c
-cmp
-- Returns:
-
isSorted
public static <T> boolean isSorted(Collection<? extends T> c, int fromIndex, int toIndex, Comparator<? super T> cmp) - Type Parameters:
T
-- Parameters:
c
-fromIndex
-toIndex
-cmp
-- Returns:
-
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
- Parameters:
a
-
-
sort
- Parameters:
a
-fromIndex
-toIndex
-
-
sort
- Type Parameters:
T
-- Parameters:
a
-cmp
-
-
sort
- Type Parameters:
T
-- Parameters:
a
-fromIndex
-toIndex
-cmp
-
-
sort
- 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
- 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
Sort by int.- Type Parameters:
T
-- Parameters:
a
-keyMapper
-
-
sortByInt
Sort by int.- Type Parameters:
T
-- Parameters:
list
-keyMapper
-
-
sortByLong
Sort by long.- Type Parameters:
T
-- Parameters:
a
-keyMapper
-
-
sortByLong
Sort by long.- Type Parameters:
T
-- Parameters:
list
-keyMapper
-
-
sortByFloat
Sort by float.- Type Parameters:
T
-- Parameters:
a
-keyMapper
-
-
sortByFloat
Sort by float.- Type Parameters:
T
-- Parameters:
list
-keyMapper
-
-
sortByDouble
Sort by double.- Type Parameters:
T
-- Parameters:
a
-keyMapper
-
-
sortByDouble
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
- Type Parameters:
T
-- Parameters:
a
-
-
parallelSort
public static <T extends Comparable<? super T>> void parallelSort(T[] a, int fromIndex, int toIndex) - Type Parameters:
T
-- Parameters:
a
-fromIndex
-toIndex
-
-
parallelSort
- Type Parameters:
T
-- Parameters:
a
-cmp
-
-
parallelSort
- Type Parameters:
T
-- Parameters:
a
-fromIndex
-toIndex
-cmp
-
-
parallelSort
- 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
- 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
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
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
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
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
- Parameters:
a
-
-
reverseSort
- Parameters:
a
-fromIndex
-toIndex
-
-
reverseSort
- 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
Note: All the objects with same value will be replaced by first element with the same value.- Parameters:
a
-
-
bucketSort
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 theComparable
interface.fromIndex
-toIndex
-
-
bucketSort
- Type Parameters:
T
-- Parameters:
a
-cmp
-
-
bucketSort
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
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
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
- Parameters:
a
-valueToFind
-- Returns:
-
binarySearch
- Parameters:
a
-fromIndex
-toIndex
-valueToFind
-- Returns:
-
binarySearch
- 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 anull
input array.- Parameters:
a
- the array to search through for the object, may benull
valueToFind
-tolerance
- tolerance of the search- Returns:
- the index of the value within the array,
INDEX_NOT_FOUND
(-1
) if not found ornull
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 anull
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 benull
startIndex
- the index to start searching atvalueToFind
-tolerance
- tolerance of the search- Returns:
- the index of the value within the array,
INDEX_NOT_FOUND
(-1
) if not found ornull
array input
-
indexOf
- Parameters:
a
-valueToFind
-- Returns:
-
indexOf
- Parameters:
a
-startIndex
- the index from which to start the search.valueToFind
-- Returns:
-
indexOf
- Parameters:
c
-valueToFind
-- Returns:
-
indexOf
- Parameters:
c
-startIndex
- the index from which to start the search.valueToFind
-- Returns:
-
indexOf
- Parameters:
iter
-valueToFind
-- Returns:
-
indexOfIgnoreCase
- Parameters:
a
-valueToFind
-- Returns:
-
indexOf
- Parameters:
iter
-startIndex
-valueToFind
-- Returns:
-
indexOfSubList
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 fromvalueToFind
-- 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 fromvalueToFind
-- 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 fromvalueToFind
-- 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 fromvalueToFind
-- 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 fromvalueToFind
-- 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 fromvalueToFind
-- 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 fromvalueToFind
-- 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 fromvalueToFind
-- 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 anull
input array.- Parameters:
a
- the array to search through for the object, may benull
valueToFind
-tolerance
- tolerance of the search- Returns:
- the index of the value within the array,
INDEX_NOT_FOUND
(-1
) if not found ornull
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 anull
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 benull
startIndexFromBack
- the start index to traverse backwards fromvalueToFind
-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 ornull
array input
-
lastIndexOf
Last index of.- Parameters:
a
-valueToFind
-- Returns:
-
lastIndexOf
Last index of.- Parameters:
a
-startIndexFromBack
- the start index to traverse backwards fromvalueToFind
-- Returns:
-
lastIndexOf
Last index of.- Parameters:
c
-valueToFind
-- Returns:
-
lastIndexOf
Last index of.- Parameters:
c
-startIndexFromBack
- the start index to traverse backwards fromvalueToFind
-- Returns:
-
lastIndexOfIgnoreCase
- Parameters:
a
-valueToFind
-- Returns:
-
lastIndexOfSubList
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 EFind first index.- Type Parameters:
T
-E
-- Parameters:
a
-predicate
-- Returns:
- the optional int
- Throws:
E
- the e
-
findFirstIndex
public static <T,U, u.OptionalInt findFirstIndexE extends Exception> (T[] a, U valueToFind, Throwables.BiPredicate<? super T, ? super U, throws EE> predicate) Find first index.- Type Parameters:
T
-U
-E
-- Parameters:
a
-valueToFind
-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 EFind first index.- Type Parameters:
T
-E
-- Parameters:
c
-predicate
-- Returns:
- the optional int
- Throws:
E
- the e
-
findFirstIndex
public static <T,U, u.OptionalInt findFirstIndexE extends Exception> (Collection<? extends T> c, U valueToFind, Throwables.BiPredicate<? super T, ? super U, throws EE> predicate) Find first index.- Type Parameters:
T
-U
-E
-- Parameters:
c
-valueToFind
-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 EFind last index.- Type Parameters:
T
-E
-- Parameters:
a
-predicate
-- Returns:
- the optional int
- Throws:
E
- the e
-
findLastIndex
public static <T,U, u.OptionalInt findLastIndexE extends Exception> (T[] a, U valueToFind, Throwables.BiPredicate<? super T, ? super U, throws EE> predicate) Find last index.- Type Parameters:
T
-U
-E
-- Parameters:
a
-valueToFind
-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 EFind last index.- Type Parameters:
T
-E
-- Parameters:
c
-predicate
-- Returns:
- the optional int
- Throws:
E
- the e
-
findLastIndex
public static <T,U, u.OptionalInt findLastIndexE extends Exception> (Collection<? extends T> c, U valueToFind, Throwables.BiPredicate<? super T, ? super U, throws EE> predicate) - Type Parameters:
T
-U
-E
-- Parameters:
c
-valueToFind
-predicate
-- Returns:
- Throws:
E
-
Builder.ComparisonBuilder