public final class N
extends java.lang.Object
Note: This class includes codes copied from Apache Commons Lang, Google Guava and other open source projects under the Apache License 2.0. The methods copied from other libraries/frameworks/projects may be modified in this class.
ClassN
is a general java utility class. It provides the most daily used operations for Object/primitive types/String/Array/Collection/Map/Entity/Date...:
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...
Modifier and Type | Field and Description |
---|---|
static boolean[] |
EMPTY_BOOLEAN_ARRAY
An empty immutable
boolean array. |
static java.lang.Boolean[] |
EMPTY_BOOLEAN_OBJ_ARRAY
An empty immutable
Boolean array. |
static byte[] |
EMPTY_BYTE_ARRAY
An empty immutable
byte array. |
static java.lang.Byte[] |
EMPTY_BYTE_OBJ_ARRAY
An empty immutable
Byte array. |
static char[] |
EMPTY_CHAR_ARRAY
An empty immutable
char array. |
static java.lang.Character[] |
EMPTY_CHAR_OBJ_ARRAY
An empty immutable
Character array. |
static double[] |
EMPTY_DOUBLE_ARRAY
An empty immutable
double array. |
static java.lang.Double[] |
EMPTY_DOUBLE_OBJ_ARRAY
An empty immutable
Double array. |
static float[] |
EMPTY_FLOAT_ARRAY
An empty immutable
float array. |
static java.lang.Float[] |
EMPTY_FLOAT_OBJ_ARRAY
An empty immutable
Float array. |
static int[] |
EMPTY_INT_ARRAY
An empty immutable
int array. |
static java.lang.Integer[] |
EMPTY_INT_OBJ_ARRAY
An empty immutable
Integer array. |
static long[] |
EMPTY_LONG_ARRAY
An empty immutable
long array. |
static java.lang.Long[] |
EMPTY_LONG_OBJ_ARRAY
An empty immutable
Long array. |
static java.lang.Object[] |
EMPTY_OBJECT_ARRAY
An empty immutable
Object array. |
static short[] |
EMPTY_SHORT_ARRAY
An empty immutable
short array. |
static java.lang.Short[] |
EMPTY_SHORT_OBJ_ARRAY
An empty immutable
Short array. |
static java.lang.String |
EMPTY_STRING |
static java.lang.String[] |
EMPTY_STRING_ARRAY
An empty immutable
String array. |
static int |
INDEX_NOT_FOUND
The index value when an element is not found in a list or array:
-1 . |
static java.lang.String |
ISO_8601_DATETIME_FORMAT
It's default date/time format.
|
static java.lang.String |
ISO_8601_TIMESTAMP_FORMAT
It's default timestamp format.
|
static java.lang.String |
LOCAL_DATE_FORMAT |
static java.lang.String |
LOCAL_DATETIME_FORMAT |
static java.lang.String |
LOCAL_MONTH_DAY_FORMAT |
static java.lang.String |
LOCAL_TIME_FORMAT |
static java.util.TimeZone |
LOCAL_TIME_ZONE
The system default time zone
|
static java.lang.String |
LOCAL_TIMESTAMP_FORMAT |
static java.lang.String |
LOCAL_YEAR_FORMAT
Date format.
|
static java.lang.String |
RFC1123_DATE_FORMAT
This constant defines the date format specified by
RFC 1123 / RFC 822.
|
static java.util.TimeZone |
UTC_TIME_ZONE |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
abbreviate(java.lang.String str,
int maxWidth)
Abbreviates a String using ellipses.
|
static boolean[] |
add(boolean[] a,
boolean element)
Copies the given array and adds the given element at the end of the new
array.
|
static byte[] |
add(byte[] a,
byte element)
Copies the given array and adds the given element at the end of the new
array.
|
static char[] |
add(char[] a,
char element)
Copies the given array and adds the given element at the end of the new
array.
|
static double[] |
add(double[] a,
double element)
Copies the given array and adds the given element at the end of the new
array.
|
static float[] |
add(float[] a,
float element)
Copies the given array and adds the given element at the end of the new
array.
|
static int[] |
add(int[] a,
int element)
Copies the given array and adds the given element at the end of the new
array.
|
static long[] |
add(long[] a,
long element)
Copies the given array and adds the given element at the end of the new
array.
|
static short[] |
add(short[] a,
short element)
Copies the given array and adds the given element at the end of the new
array.
|
static java.lang.String[] |
add(java.lang.String[] a,
java.lang.String element)
Copies the given array and adds the given element at the end of the new
array.
|
static <T> T[] |
add(T[] a,
T element)
Copies the given array and adds the given element at the end of the new
array.
|
static boolean[] |
addAll(boolean[] a,
boolean... b)
Adds all the elements of the given arrays into a new array.
|
static byte[] |
addAll(byte[] a,
byte... b)
Adds all the elements of the given arrays into a new array.
|
static char[] |
addAll(char[] a,
char... b)
Adds all the elements of the given arrays into a new array.
|
static double[] |
addAll(double[] a,
double... b)
Adds all the elements of the given arrays into a new array.
|
static float[] |
addAll(float[] a,
float... b)
Adds all the elements of the given arrays into a new array.
|
static int[] |
addAll(int[] a,
int... b)
Adds all the elements of the given arrays into a new array.
|
static long[] |
addAll(long[] a,
long... b)
Adds all the elements of the given arrays into a new array.
|
static short[] |
addAll(short[] a,
short... b)
Adds all the elements of the given arrays into a new array.
|
static java.lang.String[] |
addAll(java.lang.String[] a,
java.lang.String... b)
Adds all the elements of the given arrays into a new array.
|
static <T> T[] |
addAll(T[] a,
T... b)
Adds all the elements of the given arrays into a new array.
|
static <T> boolean |
allNull(java.util.Collection<T> c) |
static <T> boolean |
allNull(T... a) |
static <T> boolean |
allNull(T a,
T b) |
static <T> boolean |
allNull(T a,
T b,
T c) |
static <T> boolean |
anyNull(java.util.Collection<T> c) |
static <T> boolean |
anyNull(T... a) |
static <T> boolean |
anyNull(T a,
T b) |
static <T> boolean |
anyNull(T a,
T b,
T c) |
static java.lang.String |
appendIfMissing(java.lang.String str,
java.lang.String suffix) |
static <T extends java.util.Collection<?>> |
array2Collection(T c,
java.lang.Object a)
The input collection is returned
|
static <T> java.util.List<T> |
array2List(java.lang.Object a) |
static <T> java.util.Set<T> |
array2Set(java.lang.Object a) |
static <T> T |
as(java.lang.Class<T> targetClass,
java.lang.Object obj)
Try to convert the specified
sourceObject to the specified
cls . |
static <T> T |
as(com.landawn.abacus.type.Type<T> targetType,
java.lang.Object obj) |
static <T> T[] |
asArray(T... a)
The input array is returned.
|
static <T> java.util.concurrent.ArrayBlockingQueue<T> |
asArrayBlockingQueue(T... a) |
static boolean |
asBoolean(java.lang.Boolean b) |
static boolean |
asBoolean(java.lang.String str)
Returns a
Boolean with a value represented by the specified
string. |
static byte |
asByte(java.lang.Number num) |
static byte |
asByte(java.lang.String str)
Returns the value by calling
Byte.valueOf(String) if str
is not null , otherwise, the default value 0 for byte is
returned. |
static java.util.Calendar |
asCalendar(java.util.Calendar c) |
static java.util.Calendar |
asCalendar(java.util.Date date) |
static java.util.Calendar |
asCalendar(long timeInMillis) |
static java.util.Calendar |
asCalendar(java.lang.String calendar) |
static java.util.Calendar |
asCalendar(java.lang.String calendar,
java.lang.String format) |
static java.util.Calendar |
asCalendar(java.lang.String calendar,
java.lang.String format,
java.util.TimeZone timeZone)
Converts the specified
calendar with the specified format to a new instance of Calendar. |
static char |
asChar(java.lang.Character c) |
static char |
asChar(java.lang.String str) |
static <T> java.util.concurrent.ConcurrentLinkedDeque<T> |
asConcurrentLinkedDeque(T... a) |
static <T> java.util.concurrent.ConcurrentLinkedQueue<T> |
asConcurrentLinkedQueue(T... a) |
static java.sql.Date |
asDate(java.util.Calendar c) |
static java.sql.Date |
asDate(java.util.Date date) |
static java.sql.Date |
asDate(long timeInMillis) |
static java.sql.Date |
asDate(java.lang.String date) |
static java.sql.Date |
asDate(java.lang.String date,
java.lang.String format) |
static java.sql.Date |
asDate(java.lang.String date,
java.lang.String format,
java.util.TimeZone timeZone)
Converts the specified
date with the specified format to a new instance of java.sql.Date. |
static <T extends java.util.concurrent.Delayed> |
asDelayQueue(T... a) |
static <T> java.util.Deque<T> |
asDeque(T... a) |
static double |
asDouble(java.lang.Number num) |
static double |
asDouble(java.lang.String str)
Returns the value by calling
Double.valueOf(String) if str
is not null , otherwise, the default value 0d for double is
returned. |
static float |
asFloat(java.lang.Number num) |
static float |
asFloat(java.lang.String str)
Returns the value by calling
Float.valueOf(String) if str
is not null , otherwise, the default value 0f for float is
returned. |
static java.util.GregorianCalendar |
asGregorianCalendar(java.util.Calendar c) |
static java.util.GregorianCalendar |
asGregorianCalendar(java.util.Date date) |
static java.util.GregorianCalendar |
asGregorianCalendar(long timeInMillis) |
static java.util.GregorianCalendar |
asGregorianCalendar(java.lang.String calendar) |
static java.util.GregorianCalendar |
asGregorianCalendar(java.lang.String calendar,
java.lang.String format) |
static java.util.GregorianCalendar |
asGregorianCalendar(java.lang.String calendar,
java.lang.String format,
java.util.TimeZone timeZone)
Converts the specified
calendar with the specified format to a new instance of GregorianCalendar. |
static int |
asInt(java.lang.Number num) |
static int |
asInt(java.lang.String str)
Returns the value by calling
Integer.valueOf(String) if
str is not null , otherwise, the default value 0 for
int is returned. |
static java.util.Date |
asJUDate(java.util.Calendar c) |
static java.util.Date |
asJUDate(java.util.Date date) |
static java.util.Date |
asJUDate(long timeInMillis) |
static java.util.Date |
asJUDate(java.lang.String date) |
static java.util.Date |
asJUDate(java.lang.String date,
java.lang.String format) |
static java.util.Date |
asJUDate(java.lang.String date,
java.lang.String format,
java.util.TimeZone timeZone)
Converts the specified
date with the specified format to a new instance of java.util.Date. |
static <T> java.util.concurrent.LinkedBlockingDeque<T> |
asLinkedBlockingDeque(T... a) |
static <T> java.util.concurrent.LinkedBlockingQueue<T> |
asLinkedBlockingQueue(T... a) |
static <K,V,k extends K,v extends V> |
asLinkedHashMap(k k1,
v v1) |
static <K,V,k extends K,v extends V> |
asLinkedHashMap(k k1,
v v1,
k k2,
v v2) |
static <K,V,k extends K,v extends V> |
asLinkedHashMap(k k1,
v v1,
k k2,
v v2,
k k3,
v v3) |
static <K,V,k extends K,v extends V> |
asLinkedHashMap(k k1,
v v1,
k k2,
v v2,
k k3,
v v3,
k k4,
v v4) |
static <K,V,k extends K,v extends V> |
asLinkedHashMap(k k1,
v v1,
k k2,
v v2,
k k3,
v v3,
k k4,
v v4,
k k5,
v v5) |
static <K,V,k extends K,v extends 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) |
static <K,V,k extends K,v extends 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) |
static <K,V> java.util.LinkedHashMap<K,V> |
asLinkedHashMap(java.lang.Object... a) |
static <T> java.util.LinkedHashSet<T> |
asLinkedHashSet(T... a) |
static <T> java.util.LinkedList<T> |
asLinkedList(T... a) |
static <T> java.util.List<T> |
asList(T... a) |
static long |
asLong(java.lang.Number num) |
static long |
asLong(java.lang.String str)
Returns the value by calling
Long.valueOf(String) if str
is not null , otherwise, the default value 0 for long is
returned. |
static <K,V,k extends K,v extends V> |
asMap(k k1,
v v1) |
static <K,V,k extends K,v extends V> |
asMap(k k1,
v v1,
k k2,
v v2) |
static <K,V,k extends K,v extends V> |
asMap(k k1,
v v1,
k k2,
v v2,
k k3,
v v3) |
static <K,V,k extends K,v extends V> |
asMap(k k1,
v v1,
k k2,
v v2,
k k3,
v v3,
k k4,
v v4) |
static <K,V,k extends K,v extends V> |
asMap(k k1,
v v1,
k k2,
v v2,
k k3,
v v3,
k k4,
v v4,
k k5,
v v5) |
static <K,V,k extends K,v extends 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) |
static <K,V,k extends K,v extends 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) |
static <K,V> java.util.Map<K,V> |
asMap(java.lang.Object... a) |
static <T> Multiset<T> |
asMultiset(T... a) |
static <T> java.util.NavigableSet<T> |
asNavigableSet(T... a) |
static <T> java.util.PriorityQueue<T> |
asPriorityQueue(T... a) |
static java.util.Map<java.lang.String,java.lang.Object> |
asProps(java.lang.Object... a) |
static <T> java.util.Queue<T> |
asQueue(T... a) |
static <T> java.util.Set<T> |
asSet(T... a) |
static short |
asShort(java.lang.Number num) |
static short |
asShort(java.lang.String str)
Returns the value by calling
Short.valueOf(String) if str
is not null , otherwise, the default value 0 for short is
returned. |
static <T> java.util.List<T> |
asSingletonList(T o)
Wrap the specified value with a singleton list.
|
static <K,V> java.util.Map<K,V> |
asSingletonMap(K key,
V value)
Wrap the specified key/value with a singleton map.
|
static <T> java.util.Set<T> |
asSingletonSet(T o)
Wrap the specified value with a singleton set.
|
static <T> java.util.SortedSet<T> |
asSortedSet(T... a) |
static java.sql.Time |
asTime(java.util.Calendar c) |
static java.sql.Time |
asTime(java.util.Date date) |
static java.sql.Time |
asTime(long timeInMillis) |
static java.sql.Time |
asTime(java.lang.String date) |
static java.sql.Time |
asTime(java.lang.String date,
java.lang.String format) |
static java.sql.Time |
asTime(java.lang.String date,
java.lang.String format,
java.util.TimeZone timeZone)
Converts the specified
date with the specified format to a new instance of Time. |
static java.sql.Timestamp |
asTimestamp(java.util.Calendar c) |
static java.sql.Timestamp |
asTimestamp(java.util.Date date) |
static java.sql.Timestamp |
asTimestamp(long timeInMillis) |
static java.sql.Timestamp |
asTimestamp(java.lang.String date) |
static java.sql.Timestamp |
asTimestamp(java.lang.String date,
java.lang.String format) |
static java.sql.Timestamp |
asTimestamp(java.lang.String date,
java.lang.String format,
java.util.TimeZone timeZone)
Converts the specified
date with the specified format to a new instance of Timestamp. |
static javax.xml.datatype.XMLGregorianCalendar |
asXMLGregorianCalendar(java.util.Calendar c) |
static javax.xml.datatype.XMLGregorianCalendar |
asXMLGregorianCalendar(java.util.Date date) |
static javax.xml.datatype.XMLGregorianCalendar |
asXMLGregorianCalendar(long timeInMillis) |
static javax.xml.datatype.XMLGregorianCalendar |
asXMLGregorianCalendar(java.lang.String calendar) |
static javax.xml.datatype.XMLGregorianCalendar |
asXMLGregorianCalendar(java.lang.String calendar,
java.lang.String format) |
static javax.xml.datatype.XMLGregorianCalendar |
asXMLGregorianCalendar(java.lang.String calendar,
java.lang.String format,
java.util.TimeZone timeZone)
Converts the specified
calendar with the specified format to a new instance of XMLGregorianCalendar. |
static <T> java.util.List<CompletableFuture<T>> |
asyncExecute(java.util.concurrent.Callable<T>... commands) |
static <T> CompletableFuture<T> |
asyncExecute(java.util.concurrent.Callable<T> command) |
static <T> CompletableFuture<T> |
asyncExecute(java.util.concurrent.Callable<T> cmd,
int retryTimes,
long retryInterval,
BiPredicate<? super T,? super java.lang.Exception> retryCondition) |
static <T> CompletableFuture<T> |
asyncExecute(java.util.concurrent.Callable<T> command,
long delay) |
static <T> java.util.List<CompletableFuture<T>> |
asyncExecute(java.util.Collection<? extends java.util.concurrent.Callable<T>> commands) |
static java.util.List<CompletableFuture<java.lang.Void>> |
asyncExecute(java.util.List<? extends java.lang.Runnable> commands) |
static java.util.List<CompletableFuture<java.lang.Void>> |
asyncExecute(java.lang.Runnable... commands) |
static CompletableFuture<java.lang.Void> |
asyncExecute(java.lang.Runnable command) |
static CompletableFuture<java.lang.Void> |
asyncExecute(java.lang.Runnable command,
long delay) |
static CompletableFuture<java.lang.Void> |
asyncExecute(Try.Runnable<? extends java.lang.Exception> cmd,
int retryTimes,
long retryInterval,
Predicate<? super java.lang.Exception> retryCondition) |
static double |
average(byte... a) |
static double |
average(byte[] a,
int from,
int to) |
static double |
average(char... a) |
static double |
average(char[] a,
int from,
int to) |
static double |
average(double... a) |
static double |
average(double[] a,
int from,
int to) |
static double |
average(float... a) |
static double |
average(float[] a,
int from,
int to) |
static double |
average(int... a) |
static double |
average(int[] a,
int from,
int to) |
static double |
average(long... a) |
static double |
average(long[] a,
int from,
int to) |
static double |
average(short... a) |
static double |
average(short[] a,
int from,
int to) |
static <T extends java.lang.Number> |
averageDouble(java.util.Collection<? extends T> c) |
static <T extends java.lang.Number> |
averageDouble(java.util.Collection<? extends T> c,
int fromIndex,
int toIndex) |
static <T,E extends java.lang.Exception> |
averageDouble(java.util.Collection<? extends T> c,
int fromIndex,
int toIndex,
Try.ToDoubleFunction<? super T,E> func) |
static <T,E extends java.lang.Exception> |
averageDouble(java.util.Collection<? extends T> c,
Try.ToDoubleFunction<? super T,E> func) |
static <T extends java.lang.Number> |
averageDouble(T[] a) |
static <T extends java.lang.Number> |
averageDouble(T[] a,
int fromIndex,
int toIndex) |
static <T,E extends java.lang.Exception> |
averageDouble(T[] a,
int fromIndex,
int toIndex,
Try.ToDoubleFunction<? super T,E> func) |
static <T,E extends java.lang.Exception> |
averageDouble(T[] a,
Try.ToDoubleFunction<? super T,E> func) |
static <T extends java.lang.Number> |
averageInt(java.util.Collection<? extends T> c) |
static <T extends java.lang.Number> |
averageInt(java.util.Collection<? extends T> c,
int fromIndex,
int toIndex) |
static <T,E extends java.lang.Exception> |
averageInt(java.util.Collection<? extends T> c,
int fromIndex,
int toIndex,
Try.ToIntFunction<? super T,E> func) |
static <T,E extends java.lang.Exception> |
averageInt(java.util.Collection<? extends T> c,
Try.ToIntFunction<? super T,E> func) |
static <T extends java.lang.Number> |
averageInt(T[] a) |
static <T extends java.lang.Number> |
averageInt(T[] a,
int fromIndex,
int toIndex) |
static <T,E extends java.lang.Exception> |
averageInt(T[] a,
int fromIndex,
int toIndex,
Try.ToIntFunction<? super T,E> func) |
static <T,E extends java.lang.Exception> |
averageInt(T[] a,
Try.ToIntFunction<? super T,E> func) |
static <T extends java.lang.Number> |
averageLong(java.util.Collection<? extends T> c) |
static <T extends java.lang.Number> |
averageLong(java.util.Collection<? extends T> c,
int fromIndex,
int toIndex) |
static <T,E extends java.lang.Exception> |
averageLong(java.util.Collection<? extends T> c,
int fromIndex,
int toIndex,
Try.ToLongFunction<? super T,E> func) |
static <T,E extends java.lang.Exception> |
averageLong(java.util.Collection<? extends T> c,
Try.ToLongFunction<? super T,E> func) |
static <T extends java.lang.Number> |
averageLong(T[] a) |
static <T extends java.lang.Number> |
averageLong(T[] a,
int fromIndex,
int toIndex) |
static <T,E extends java.lang.Exception> |
averageLong(T[] a,
int fromIndex,
int toIndex,
Try.ToLongFunction<? super T,E> func) |
static <T,E extends java.lang.Exception> |
averageLong(T[] a,
Try.ToLongFunction<? super T,E> func) |
static byte[] |
base64Decode(java.lang.String src) |
static java.lang.String |
base64Encode(byte[] src) |
static byte[] |
base64MimeDecode(java.lang.String src) |
static java.lang.String |
base64MimeEncode(byte[] src) |
static byte[] |
base64UrlDecode(java.lang.String src) |
static java.lang.String |
base64UrlEncode(byte[] src) |
static int |
binarySearch(byte[] a,
byte key)
Arrays.binarySearch(byte[], byte) |
static int |
binarySearch(byte[] a,
int fromIndex,
int toIndex,
byte key)
Arrays.binarySearch(byte[], int, int, byte) |
static int |
binarySearch(char[] a,
char key)
Arrays.binarySearch(char[], char) |
static int |
binarySearch(char[] a,
int fromIndex,
int toIndex,
char key)
Arrays.binarySearch(char[], int, int, char) |
static int |
binarySearch(double[] a,
double key)
Arrays.binarySearch(double[], double) |
static int |
binarySearch(double[] a,
int fromIndex,
int toIndex,
double key)
Arrays.binarySearch(double[], int, int, double) |
static int |
binarySearch(float[] a,
float key)
Arrays.binarySearch(float[], float) |
static int |
binarySearch(float[] a,
int fromIndex,
int toIndex,
float key)
Arrays.binarySearch(float[], int, int, float) |
static int |
binarySearch(int[] a,
int key)
Arrays.binarySearch(int[], int) |
static int |
binarySearch(int[] a,
int fromIndex,
int toIndex,
int key)
Arrays.binarySearch(int[], int, int, int) |
static <T extends java.lang.Comparable<? super T>> |
binarySearch(java.util.List<? extends T> c,
int fromIndex,
int toIndex,
T key) |
static <T> int |
binarySearch(java.util.List<? extends T> c,
int fromIndex,
int toIndex,
T key,
java.util.Comparator<? super T> cmp) |
static <T extends java.lang.Comparable<? super T>> |
binarySearch(java.util.List<? extends T> c,
T key)
Collections.binarySearch(List, Object) |
static <T> int |
binarySearch(java.util.List<? extends T> c,
T key,
java.util.Comparator<? super T> cmp) |
static int |
binarySearch(long[] a,
int fromIndex,
int toIndex,
long key)
Arrays.binarySearch(long[], int, int, long) |
static int |
binarySearch(long[] a,
long key)
Arrays.binarySearch(long[], long) |
static int |
binarySearch(java.lang.Object[] a,
int fromIndex,
int toIndex,
java.lang.Object key)
Arrays.binarySearch(Object[], int, int, Object) |
static int |
binarySearch(java.lang.Object[] a,
java.lang.Object key)
Arrays.binarySearch(Object[], Object) |
static int |
binarySearch(short[] a,
int fromIndex,
int toIndex,
short key)
Arrays.binarySearch(short[], int, int, short) |
static int |
binarySearch(short[] a,
short key)
Arrays.binarySearch(short[], short) |
static <T> int |
binarySearch(T[] a,
int fromIndex,
int toIndex,
T key,
java.util.Comparator<? super T> cmp)
Arrays.binarySearch(Object[], int, int, Object, Comparator) |
static <T> int |
binarySearch(T[] a,
T key,
java.util.Comparator<? super T> cmp)
Arrays.binarySearch(Object[], Object, Comparator) |
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 <T> void |
bucketSort(java.util.List<? extends T> c,
java.util.Comparator<? super T> cmp)
Note: All the objects with same value will be replaced with first element with the same value.
|
static <T> void |
bucketSort(java.util.List<? extends T> c,
int fromIndex,
int toIndex,
java.util.Comparator<? super T> cmp)
Note: All the objects with same value will be replaced with first element with the same value.
|
static <T extends java.lang.Comparable<T>> |
bucketSort(java.util.List<T> c)
Note: All the objects with same value will be replaced with first element with the same value.
|
static <T extends java.lang.Comparable<T>> |
bucketSort(java.util.List<T> c,
int fromIndex,
int toIndex)
Note: All the objects with same value will be replaced with first element with the same value.
|
static void |
bucketSort(long[] a) |
static void |
bucketSort(long[] a,
int fromIndex,
int toIndex) |
static void |
bucketSort(java.lang.Object[] a)
Note: All the objects with same value will be replaced with first element with the same value.
|
static void |
bucketSort(java.lang.Object[] a,
int fromIndex,
int toIndex)
Note: All the objects with same value will be replaced with first element with the same value.
|
static <T> void |
bucketSort(T[] a,
java.util.Comparator<? super T> cmp) |
static <T> void |
bucketSort(T[] a,
int fromIndex,
int toIndex,
java.util.Comparator<? super T> cmp)
Note: All the objects with same value will be replaced with first element with the same value.
|
static <T> T |
callUninterruptibly(long timeout,
java.util.concurrent.TimeUnit unit,
Try.BiFunction<java.lang.Long,java.util.concurrent.TimeUnit,T,java.lang.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 timeoutInMillis,
Try.LongFunction<T,java.lang.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(Try.Callable<T,java.lang.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 java.lang.String |
capitalize(java.lang.String str) |
static <E> java.util.List<java.util.List<E>> |
cartesianProduct(java.util.Collection<? extends java.util.Collection<? extends E>> cs)
Note: copy from Google Guava under Apache License v2.
|
static <E> java.util.List<java.util.List<E>> |
cartesianProduct(java.util.Collection<? extends E>... cs)
Note: copy from Google Guava under Apache License v2.
|
static <T> Nullable<T> |
castIfAssignable(java.lang.Object val,
java.lang.Class<T> targetType)
Returns an empty
Nullable if val is null while targetType is primitive or can't be assigned to targetType . |
static void |
checkArgNotNegative(int arg,
java.lang.String argNameOrErrorMsg)
Checks if the specified
arg is negative, and throws IllegalArgumentException if it is. |
static void |
checkArgNotNegative(long arg,
java.lang.String argNameOrErrorMsg)
Checks if the specified
arg is negative, and throws IllegalArgumentException if it is. |
static void |
checkArgNotNullOrEmpty(boolean[] arg,
java.lang.String argNameOrErrorMsg)
Checks if the specified
arg is null or empty, and throws IllegalArgumentException if it is. |
static void |
checkArgNotNullOrEmpty(byte[] arg,
java.lang.String argNameOrErrorMsg)
Checks if the specified
arg is null or empty, and throws IllegalArgumentException if it is. |
static void |
checkArgNotNullOrEmpty(char[] arg,
java.lang.String argNameOrErrorMsg)
Checks if the specified
arg is null or empty, and throws IllegalArgumentException if it is. |
static void |
checkArgNotNullOrEmpty(double[] arg,
java.lang.String argNameOrErrorMsg)
Checks if the specified
arg is null or empty, and throws IllegalArgumentException if it is. |
static void |
checkArgNotNullOrEmpty(float[] arg,
java.lang.String argNameOrErrorMsg)
Checks if the specified
arg is null or empty, and throws IllegalArgumentException if it is. |
static void |
checkArgNotNullOrEmpty(int[] arg,
java.lang.String argNameOrErrorMsg)
Checks if the specified
arg is null or empty, and throws IllegalArgumentException if it is. |
static void |
checkArgNotNullOrEmpty(long[] arg,
java.lang.String argNameOrErrorMsg)
Checks if the specified
arg is null or empty, and throws IllegalArgumentException if it is. |
static void |
checkArgNotNullOrEmpty(short[] arg,
java.lang.String argNameOrErrorMsg)
Checks if the specified
arg is null or empty, and throws IllegalArgumentException if it is. |
static <T> void |
checkArgNotNullOrEmpty(T[] arg,
java.lang.String argNameOrErrorMsg)
Checks if the specified
arg is null or empty, and throws IllegalArgumentException if it is. |
static <T extends java.lang.CharSequence> |
checkArgNotNullOrEmpty(T arg,
java.lang.String argNameOrErrorMsg)
Checks if the specified
arg is null or empty, and throws IllegalArgumentException if it is. |
static <T extends java.util.Collection<?>> |
checkArgNotNullOrEmpty(T arg,
java.lang.String argNameOrErrorMsg)
Checks if the specified
arg is null or empty, and throws IllegalArgumentException if it is. |
static <T extends java.util.Map<?,?>> |
checkArgNotNullOrEmpty(T arg,
java.lang.String argNameOrErrorMsg)
Checks if the specified
arg is null or empty, and throws IllegalArgumentException if it is. |
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,
java.lang.String errorMessage)
Ensures the truth of an expression involving one or more parameters to the calling method.
|
static void |
checkArgument(boolean b,
java.lang.String errorMessageTemplate,
boolean p)
Ensures the truth of an expression involving one or more parameters to the calling method.
|
static void |
checkArgument(boolean b,
java.lang.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,
java.lang.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,
java.lang.String errorMessageTemplate,
byte p)
Ensures the truth of an expression involving one or more parameters to the calling method.
|
static void |
checkArgument(boolean b,
java.lang.String errorMessageTemplate,
char p)
Ensures the truth of an expression involving one or more parameters to the calling method.
|
static void |
checkArgument(boolean b,
java.lang.String errorMessageTemplate,
double p)
Ensures the truth of an expression involving one or more parameters to the calling method.
|
static void |
checkArgument(boolean b,
java.lang.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,
java.lang.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,
java.lang.String errorMessageTemplate,
float p)
Ensures the truth of an expression involving one or more parameters to the calling method.
|
static void |
checkArgument(boolean b,
java.lang.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,
java.lang.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,
java.lang.String errorMessageTemplate,
int p)
Ensures the truth of an expression involving one or more parameters to the calling method.
|
static void |
checkArgument(boolean b,
java.lang.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,
java.lang.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,
java.lang.String errorMessageTemplate,
long p)
Ensures the truth of an expression involving one or more parameters to the calling method.
|
static void |
checkArgument(boolean b,
java.lang.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,
java.lang.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,
java.lang.String errorMessageTemplate,
java.lang.Object p)
Ensures the truth of an expression involving one or more parameters to the calling method.
|
static void |
checkArgument(boolean b,
java.lang.String errorMessageTemplate,
java.lang.Object p1,
java.lang.Object p2)
Ensures the truth of an expression involving one or more parameters to the calling method.
|
static void |
checkArgument(boolean b,
java.lang.String errorMessageTemplate,
java.lang.Object p1,
java.lang.Object p2,
java.lang.Object p3)
Ensures the truth of an expression involving one or more parameters to the calling method.
|
static void |
checkArgument(boolean b,
java.lang.String errorMessageTemplate,
short p)
Ensures the truth of an expression involving one or more parameters to the calling method.
|
static void |
checkFromIndexSize(int fromIndex,
int size,
int length)
Copied from JDK 9 through: StreamSupport at: https://github.com/streamsupport/streamsupport. |
static void |
checkFromToIndex(int fromIndex,
int toIndex,
int length)
Copied from JDK 9 through: StreamSupport at: https://github.com/streamsupport/streamsupport. |
static void |
checkIndex(int index,
int length)
Copied from JDK 9 through: StreamSupport at: https://github.com/streamsupport/streamsupport. |
static boolean[] |
checkNullOrEmpty(boolean[] parameter,
java.lang.String msg)
Check if the specified parameter is null or empty
|
static byte[] |
checkNullOrEmpty(byte[] parameter,
java.lang.String msg)
Check if the specified parameter is null or empty
|
static char[] |
checkNullOrEmpty(char[] parameter,
java.lang.String msg)
Check if the specified parameter is null or empty
|
static double[] |
checkNullOrEmpty(double[] parameter,
java.lang.String msg)
Check if the specified parameter is null or empty
|
static float[] |
checkNullOrEmpty(float[] parameter,
java.lang.String msg)
Check if the specified parameter is null or empty
|
static int[] |
checkNullOrEmpty(int[] parameter,
java.lang.String msg)
Check if the specified parameter is null or empty
|
static long[] |
checkNullOrEmpty(long[] parameter,
java.lang.String msg)
Check if the specified parameter is null or empty
|
static <E> LongMultiset<E> |
checkNullOrEmpty(LongMultiset<E> parameter,
java.lang.String msg)
Check if the specified parameter is null or empty
|
static <E> Multiset<E> |
checkNullOrEmpty(Multiset<E> parameter,
java.lang.String msg)
Check if the specified parameter is null or empty
|
static short[] |
checkNullOrEmpty(short[] parameter,
java.lang.String msg)
Check if the specified parameter is null or empty
|
static <T> T[] |
checkNullOrEmpty(T[] parameter,
java.lang.String msg)
Check if the specified parameter is null or empty
|
static <E,T extends java.util.Collection<E>> |
checkNullOrEmpty(T parameter,
java.lang.String msg)
Check if the specified parameter is null or empty
|
static <K,E,V extends java.util.Collection<E>,T extends Multimap<K,E,V>> |
checkNullOrEmpty(T parameter,
java.lang.String msg)
Check if the specified parameter is null or empty
|
static <K,V,T extends java.util.Map<K,V>> |
checkNullOrEmpty(T parameter,
java.lang.String msg)
Check if the specified parameter is null or empty
|
static <T extends DataSet> |
checkNullOrEmpty(T parameter,
java.lang.String msg)
Check if the specified parameter is null or empty
|
static <T extends EntityId> |
checkNullOrEmpty(T parameter,
java.lang.String msg)
Check if the specified parameter is null or empty
|
static <T extends PrimitiveList> |
checkNullOrEmpty(T parameter,
java.lang.String msg) |
static <T extends java.lang.CharSequence> |
checkNullOrEmpty(T parameter,
java.lang.String msg)
Check if the specified parameter is null or empty
|
static <T extends java.lang.CharSequence> |
checkNullOrEmptyOrBlank(T parameter,
java.lang.String msg)
Check if the specified parameter is null or empty or blank
|
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,
java.lang.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,
java.lang.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,
java.lang.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,
java.lang.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,
java.lang.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,
java.lang.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,
java.lang.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,
java.lang.String errorMessageTemplate,
java.lang.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,
java.lang.String errorMessageTemplate,
java.lang.Object p1,
java.lang.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,
java.lang.String errorMessageTemplate,
java.lang.Object p1,
java.lang.Object p2,
java.lang.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 java.lang.String |
chomp(java.lang.String str)
Removes one newline from end of a String if it's there, otherwise leave
it alone.
|
static java.lang.String[] |
chomp(java.lang.String[] strs) |
static java.lang.String |
chop(java.lang.String str)
Remove the last character from a String.
|
static java.lang.String[] |
chop(java.lang.String[] strs) |
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 <T> T |
clone(java.lang.Class<T> targetClass,
java.lang.Object entity)
Deeply copy by: entity -> serialize -> String/bytes -> deserialize -> new
entity.
|
static double[] |
clone(double[] original)
Clone the original array.
|
static double[][] |
clone(double[][] original)
Clone the original array and its sub arrays.
|
static double[][][] |
clone(double[][][] original)
Clone the original array and its sub arrays.
|
static float[] |
clone(float[] original)
Clone the original array.
|
static float[][] |
clone(float[][] original)
Clone the original array and its sub arrays.
|
static float[][][] |
clone(float[][][] original)
Clone the original array and its sub arrays.
|
static int[] |
clone(int[] original)
Clone the original array.
|
static int[][] |
clone(int[][] original)
Clone the original array and its sub arrays.
|
static int[][][] |
clone(int[][][] original)
Clone the original array and its sub arrays.
|
static long[] |
clone(long[] original)
Clone the original array.
|
static long[][] |
clone(long[][] original)
Clone the original array and its sub arrays.
|
static long[][][] |
clone(long[][][] original)
Clone the original array and its sub arrays.
|
static short[] |
clone(short[] original)
Clone the original array.
|
static short[][] |
clone(short[][] original)
Clone the original array and its sub arrays.
|
static short[][][] |
clone(short[][][] original)
Clone the original array and its sub arrays.
|
static <T> T |
clone(T entity) |
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> T |
collection2Array(java.lang.Class<T> arrayClass,
java.util.Collection<?> c) |
static java.lang.String |
commonPrefix(java.lang.String... strs) |
static java.lang.String |
commonPrefix(java.lang.String a,
java.lang.String b)
Note: copy rights: Google Guava.
|
static java.lang.String |
commonSuffix(java.lang.String... strs) |
static java.lang.String |
commonSuffix(java.lang.String a,
java.lang.String b)
Note: copy rights: Google Guava.
|
static int |
compare(boolean[] a,
boolean[] b) |
static int |
compare(boolean a,
boolean b) |
static int |
compare(byte[] a,
byte[] b) |
static int |
compare(byte a,
byte b) |
static int |
compare(char[] a,
char[] b) |
static <T extends java.lang.Comparable<? super T>> |
compare(java.util.Collection<T> a,
java.util.Collection<T> b) |
static <T> int |
compare(java.util.Collection<T> a,
java.util.Collection<T> b,
java.util.Comparator<? super T> cmp) |
static int |
compare(double[] a,
double[] b) |
static int |
compare(double a,
double b) |
static int |
compare(float[] a,
float[] b) |
static int |
compare(float a,
float b) |
static int |
compare(int[] a,
int[] b) |
static int |
compare(int a,
int b) |
static int |
compare(long[] a,
long[] b) |
static int |
compare(long a,
long b) |
static int |
compare(short[] a,
short[] b) |
static int |
compare(short a,
short b) |
static <T extends java.lang.Comparable<? super T>> |
compare(T[] a,
T[] b) |
static <T> int |
compare(T[] a,
T[] b,
java.util.Comparator<? super T> cmp) |
static <T1 extends java.lang.Comparable<T1>,T2 extends java.lang.Comparable<T2>> |
compare(T1 a1,
T1 b1,
T2 a2,
T2 b2)
Continue to compare the pairs of values
(a1, b1), (a2, b2) until they're not equal. |
static <T1 extends java.lang.Comparable<T1>,T2 extends java.lang.Comparable<T2>,T3 extends java.lang.Comparable<T3>> |
compare(T1 a1,
T1 b1,
T2 a2,
T2 b2,
T3 a3,
T3 b3)
Continue to compare the pairs of values
(a1, b1), (a2, b2), (a3, b3) until they're not equal. |
static <T1 extends java.lang.Comparable<T1>,T2 extends java.lang.Comparable<T2>,T3 extends java.lang.Comparable<T3>,T4 extends java.lang.Comparable<T4>> |
compare(T1 a1,
T1 b1,
T2 a2,
T2 b2,
T3 a3,
T3 b3,
T4 a4,
T4 b4)
Continue to compare the pairs of values
(a1, b1), (a2, b2), (a3, b3), (a4, b4) until they're not equal. |
static <T1 extends java.lang.Comparable<T1>,T2 extends java.lang.Comparable<T2>,T3 extends java.lang.Comparable<T3>,T4 extends java.lang.Comparable<T4>,T5 extends java.lang.Comparable<T5>> |
compare(T1 a1,
T1 b1,
T2 a2,
T2 b2,
T3 a3,
T3 b3,
T4 a4,
T4 b4,
T5 a5,
T5 b5)
Continue to compare the pairs of values
(a1, b1), (a2, b2), (a3, b3), (a4, b4), (a5, b5) until they're not equal. |
static <T extends java.lang.Comparable<? super T>> |
compare(T a,
T b) |
static <T> int |
compare(T a,
T b,
java.util.Comparator<? super T> cmp)
Returns 0 if the arguments are identical and
c.compare(a, b)
otherwise. |
static int |
compareIgnoreCase(java.lang.String a,
java.lang.String b) |
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 <T> java.util.List<T> |
concat(java.util.Collection<? extends java.util.Collection<? extends T>> c) |
static <T> java.util.List<T> |
concat(java.util.Collection<? extends T>... a) |
static <T> java.util.List<T> |
concat(java.util.Collection<? extends T> a,
java.util.Collection<? extends T> 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 java.lang.String |
concat(java.lang.String... a) |
static java.lang.String |
concat(java.lang.String a,
java.lang.String b)
Returns
a + b |
static java.lang.String |
concat(java.lang.String a,
java.lang.String b,
java.lang.String c) |
static java.lang.String |
concat(java.lang.String a,
java.lang.String b,
java.lang.String c,
java.lang.String d) |
static java.lang.String |
concat(java.lang.String a,
java.lang.String b,
java.lang.String c,
java.lang.String d,
java.lang.String e) |
static java.lang.String |
concat(java.lang.String a,
java.lang.String b,
java.lang.String c,
java.lang.String d,
java.lang.String e,
java.lang.String f) |
static java.lang.String |
concat(java.lang.String a,
java.lang.String b,
java.lang.String c,
java.lang.String d,
java.lang.String e,
java.lang.String f,
java.lang.String g) |
static <T> T[] |
concat(T[]... aa) |
static <T> T[] |
concat(T[] a,
T[] b) |
static boolean |
contains(boolean[] a,
boolean objectToFind) |
static boolean |
contains(byte[] a,
byte objectToFind) |
static boolean |
contains(char[] a,
char objectToFind) |
static boolean |
contains(java.util.Collection<?> c,
java.lang.Object e) |
static boolean |
contains(double[] a,
double objectToFind) |
static boolean |
contains(float[] a,
float objectToFind) |
static boolean |
contains(int[] a,
int objectToFind) |
static boolean |
contains(long[] a,
long objectToFind) |
static boolean |
contains(java.lang.Object[] a,
java.lang.Object objectToFind) |
static boolean |
contains(short[] a,
short objectToFind) |
static boolean |
contains(java.lang.String str,
int targetChar) |
static boolean |
contains(java.lang.String str,
java.lang.String substr) |
static boolean |
contains(java.lang.String str,
java.lang.String substr,
java.lang.String delimiter) |
static boolean |
containsAny(java.lang.String str,
char... chs) |
static boolean |
containsIgnoreCase(java.lang.String str,
java.lang.String substr) |
static boolean |
containsNone(java.lang.String str,
char... chs) |
static boolean |
containsOnly(java.lang.String str,
char... chs) |
static boolean |
containsWhitespace(java.lang.String str) |
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 <T> T |
copy(java.lang.Class<T> targetClass,
java.lang.Object entity) |
static <T> T |
copy(java.lang.Class<T> targetClass,
java.lang.Object entity,
boolean ignoreUnknownProperty,
java.util.Set<java.lang.String> ignorePropNames) |
static <T> T |
copy(java.lang.Class<T> targetClass,
java.lang.Object entity,
java.util.Collection<java.lang.String> selectPropNames)
Returns a new created instance of the specified
cls and set with
same properties retrieved by 'getXXX' method in the specified
entity . |
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 <T> void |
copy(java.util.List<? extends T> src,
int srcPos,
java.util.List<? super T> dest,
int destPos,
int length) |
static <T> void |
copy(java.util.List<? extends T> src,
java.util.List<? super T> dest)
Copies all of the elements from one list into another.
|
static void |
copy(long[] src,
int srcPos,
long[] dest,
int destPos,
int length) |
static void |
copy(java.lang.Object[] src,
int srcPos,
java.lang.Object[] dest,
int destPos,
int length) |
static void |
copy(java.lang.Object src,
int srcPos,
java.lang.Object dest,
int destPos,
int length) |
static void |
copy(short[] src,
int srcPos,
short[] dest,
int destPos,
int length) |
static <T> T |
copy(T entity)
Returns a new created instance of the same class and set with same
properties retrieved by 'getXXX' method in the specified
entity . |
static <T> T |
copy(T entity,
java.util.Collection<java.lang.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[] |
copyOf(U[] original,
int newLength,
java.lang.Class<? extends T[]> newType) |
static boolean[] |
copyOfRange(boolean[] original,
int from,
int to) |
static boolean[] |
copyOfRange(boolean[] original,
int from,
int to,
int step)
Copy all the elements in
original , through to -from , by step . |
static byte[] |
copyOfRange(byte[] original,
int from,
int to) |
static byte[] |
copyOfRange(byte[] original,
int from,
int to,
int step)
Copy all the elements in
original , through to -from , by step . |
static char[] |
copyOfRange(char[] original,
int from,
int to) |
static char[] |
copyOfRange(char[] original,
int from,
int to,
int step)
Copy all the elements in
original , through to -from , by step . |
static double[] |
copyOfRange(double[] original,
int from,
int to) |
static double[] |
copyOfRange(double[] original,
int from,
int to,
int step)
Copy all the elements in
original , through to -from , by step . |
static float[] |
copyOfRange(float[] original,
int from,
int to) |
static float[] |
copyOfRange(float[] original,
int from,
int to,
int step)
Copy all the elements in
original , through to -from , by step . |
static int[] |
copyOfRange(int[] original,
int from,
int to) |
static int[] |
copyOfRange(int[] original,
int from,
int to,
int step)
Copy all the elements in
original , through to -from , by step . |
static <T> java.util.List<T> |
copyOfRange(java.util.List<T> c,
int from,
int to) |
static <T> java.util.List<T> |
copyOfRange(java.util.List<T> c,
int from,
int to,
int step)
Copy all the elements in
original , through to -from , by step . |
static long[] |
copyOfRange(long[] original,
int from,
int to) |
static long[] |
copyOfRange(long[] original,
int from,
int to,
int step)
Copy all the elements in
original , through to -from , by step . |
static short[] |
copyOfRange(short[] original,
int from,
int to) |
static short[] |
copyOfRange(short[] original,
int from,
int to,
int step)
Copy all the elements in
original , through to -from , by step . |
static java.lang.String |
copyOfRange(java.lang.String str,
int from,
int to) |
static java.lang.String |
copyOfRange(java.lang.String str,
int from,
int to,
int step) |
static <T> T[] |
copyOfRange(T[] original,
int from,
int to) |
static <T> T[] |
copyOfRange(T[] original,
int from,
int to,
int step)
Copy all the elements in
original , through to -from , by step . |
static <T> T[] |
copyOfRange(T[] original,
int from,
int to,
int step,
java.lang.Class<? extends T[]> newType)
Copy all the elements in
original , through to -from , by step . |
static <T,U> T[] |
copyOfRange(U[] original,
int from,
int to,
java.lang.Class<? extends T[]> newType)
Arrays.copyOfRange(Object[], int, int, Class) |
static <E extends java.lang.Exception> |
count(boolean[] a,
int fromIndex,
int toIndex,
Try.BooleanPredicate<E> filter)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <E extends java.lang.Exception> |
count(boolean[] a,
Try.BooleanPredicate<E> filter)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <E extends java.lang.Exception> |
count(byte[] a,
int fromIndex,
int toIndex,
Try.BytePredicate<E> filter)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <E extends java.lang.Exception> |
count(byte[] a,
Try.BytePredicate<E> filter)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <E extends java.lang.Exception> |
count(char[] a,
int fromIndex,
int toIndex,
Try.CharPredicate<E> filter)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <E extends java.lang.Exception> |
count(char[] a,
Try.CharPredicate<E> filter)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <T,E extends java.lang.Exception> |
count(java.util.Collection<? extends T> c,
int fromIndex,
int toIndex,
Try.Predicate<? super T,E> filter)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <T,E extends java.lang.Exception> |
count(java.util.Collection<? extends T> c,
Try.Predicate<? super T,E> filter)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <E extends java.lang.Exception> |
count(double[] a,
int fromIndex,
int toIndex,
Try.DoublePredicate<E> filter)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <E extends java.lang.Exception> |
count(double[] a,
Try.DoublePredicate<E> filter)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <E extends java.lang.Exception> |
count(float[] a,
int fromIndex,
int toIndex,
Try.FloatPredicate<E> filter)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <E extends java.lang.Exception> |
count(float[] a,
Try.FloatPredicate<E> filter)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <E extends java.lang.Exception> |
count(int[] a,
int fromIndex,
int toIndex,
Try.IntPredicate<E> filter)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <E extends java.lang.Exception> |
count(int[] a,
Try.IntPredicate<E> filter)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <E extends java.lang.Exception> |
count(long[] a,
int fromIndex,
int toIndex,
Try.LongPredicate<E> filter)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <E extends java.lang.Exception> |
count(long[] a,
Try.LongPredicate<E> filter)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <E extends java.lang.Exception> |
count(short[] a,
int fromIndex,
int toIndex,
Try.ShortPredicate<E> filter)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <E extends java.lang.Exception> |
count(short[] a,
Try.ShortPredicate<E> filter)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <T,E extends java.lang.Exception> |
count(T[] a,
int fromIndex,
int toIndex,
Try.Predicate<? super T,E> filter)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <T,E extends java.lang.Exception> |
count(T[] a,
Try.Predicate<? super T,E> filter)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static int |
countMatches(java.lang.String str,
char ch) |
static int |
countMatches(java.lang.String str,
java.lang.String substr) |
static Optional<java.math.BigDecimal> |
createBigDecimal(java.lang.String str)
Convert a
String to a BigDecimal . |
static Optional<java.math.BigInteger> |
createBigInteger(java.lang.String str)
Convert a
String to a BigInteger ; since 3.2 it
handles hex (0x or #) and octal (0) notations. |
static OptionalDouble |
createDouble(java.lang.String str)
Convert a
String to a Double . |
static OptionalFloat |
createFloat(java.lang.String str)
Convert a
String to a Float . |
static OptionalInt |
createInteger(java.lang.String str)
Convert a
String to a Integer , handling hex
(0xhhhh) and octal (0dddd) notations. |
static OptionalLong |
createLong(java.lang.String str)
Convert a
String to a Long ; since 3.1 it
handles hex (0Xhhhh) and octal (0ddd) notations. |
static Optional<java.lang.Number> |
createNumber(java.lang.String str)
Turns a string value into a java.lang.Number.
|
static java.util.Calendar |
currentCalendar()
A new instance of
java.util.Calendar returned is based on
the current time in the default time zone with the default locale. |
static java.sql.Date |
currentDate()
A new instance of
java.sql.Date returned is based on the
current time in the default time zone with the default locale. |
static java.util.GregorianCalendar |
currentGregorianCalendar() |
static java.util.Date |
currentJUDate()
A new instance of
java.util.Date returned is based on the
current time in the default time zone with the default locale. |
static long |
currentMillis() |
static java.sql.Time |
currentTime()
A new instance of
java.sql.Time returned is based on the
current time in the default time zone with the default locale. |
static java.sql.Timestamp |
currentTimestamp()
A new instance of
java.sql.Timestamp returned is based on
the current time in the default time zone with the default locale. |
static javax.xml.datatype.XMLGregorianCalendar |
currentXMLGregorianCalendar() |
static boolean |
deepEquals(java.lang.Object[] a,
int fromIndexA,
java.lang.Object[] b,
int fromIndexB,
int len) |
static boolean |
deepEquals(java.lang.Object[] a,
java.lang.Object[] b) |
static boolean |
deepEquals(java.lang.Object a,
java.lang.Object b)
compare
a and b by
Arrays.equals(Object[], Object[]) if both of them are array. |
static int |
deepHashCode(java.lang.Object obj)
Method deepHashCode.
|
static int |
deepHashCode(java.lang.Object[] a) |
static int |
deepHashCode(java.lang.Object[] a,
int fromIndex,
int toIndex) |
static java.lang.String |
deepToString(java.lang.Object obj)
Method deepToString.
|
static java.lang.String |
deepToString(java.lang.Object[] a) |
static java.lang.String |
deepToString(java.lang.Object[] a,
int from,
int to) |
static java.lang.String |
deepToString(java.lang.Object[] a,
java.lang.String defaultIfNull) |
static <T> T |
defaultValueOf(java.lang.Class<T> cls) |
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 boolean |
deleteAll(java.util.List<?> list,
int... indices)
Removes the elements at the specified positions from the specified List.
|
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 <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 from
fromIndex to toIndex . |
static byte[] |
deleteRange(byte[] a,
int fromIndex,
int toIndex)
Deletes the values from
fromIndex to toIndex . |
static char[] |
deleteRange(char[] a,
int fromIndex,
int toIndex)
Deletes the values from
fromIndex to toIndex . |
static double[] |
deleteRange(double[] a,
int fromIndex,
int toIndex)
Deletes the values from
fromIndex to toIndex . |
static float[] |
deleteRange(float[] a,
int fromIndex,
int toIndex)
Deletes the values from
fromIndex to toIndex . |
static int[] |
deleteRange(int[] a,
int fromIndex,
int toIndex)
Deletes the values from
fromIndex to toIndex . |
static <T> boolean |
deleteRange(java.util.List<T> c,
int fromIndex,
int toIndex)
Returns
true if the List is updated when fromIndex < toIndex , otherwise false is returned when fromIndex == toIndex . |
static long[] |
deleteRange(long[] a,
int fromIndex,
int toIndex)
Deletes the values from
fromIndex to toIndex . |
static short[] |
deleteRange(short[] a,
int fromIndex,
int toIndex)
Deletes the values from
fromIndex to toIndex . |
static <T> T[] |
deleteRange(T[] a,
int fromIndex,
int toIndex)
Deletes the values from
fromIndex to toIndex . |
static java.lang.String |
deleteWhitespace(java.lang.String str)
Deletes all white spaces from a String as defined by
Character.isWhitespace(char) . |
static java.lang.String[] |
deleteWhitespace(java.lang.String[] strs) |
static boolean[] |
difference(boolean[] a,
boolean[] b) |
static byte[] |
difference(byte[] a,
byte[] b) |
static char[] |
difference(char[] a,
char[] b) |
static <T> java.util.List<T> |
difference(java.util.Collection<? extends T> a,
java.util.Collection<?> b) |
static double[] |
difference(double[] a,
double[] b) |
static float[] |
difference(float[] a,
float[] b) |
static int[] |
difference(int[] a,
int[] b)
Returns a new array with all the elements in
b removed by occurrences. |
static long[] |
difference(long[] a,
long[] b) |
static short[] |
difference(short[] a,
short[] b) |
static <T> T[] |
difference(T[] a,
java.lang.Object[] b) |
static boolean |
disjoint(java.util.Collection<?> c1,
java.util.Collection<?> c2)
Returns
true if the two specified arrays have no elements in common. |
static boolean |
disjoint(java.lang.Object[] a,
java.lang.Object[] b) |
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 <T> java.util.List<T> |
distinct(java.util.Collection<? extends T> c)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <T> java.util.List<T> |
distinct(java.util.Collection<? extends T> c,
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> T[] |
distinct(T[] a)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <T> T[] |
distinct(T[] a,
int fromIndex,
int toIndex)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <T,E extends java.lang.Exception> |
distinctBy(java.util.Collection<? extends T> c,
int fromIndex,
int toIndex,
Try.Function<? super T,?,E> keyExtractor)
Distinct by the value mapped from
keyExtractor . |
static <T,E extends java.lang.Exception> |
distinctBy(java.util.Collection<? extends T> c,
Try.Function<? super T,?,E> keyExtractor)
Distinct by the value mapped from
keyExtractor . |
static <T,E extends java.lang.Exception> |
distinctBy(T[] a,
int fromIndex,
int toIndex,
Try.Function<? super T,?,E> keyExtractor)
Distinct by the value mapped from
keyExtractor . |
static <T,E extends java.lang.Exception> |
distinctBy(T[] a,
Try.Function<? super T,?,E> keyExtractor)
Distinct by the value mapped from
keyExtractor . |
static <T> java.util.Iterator<T> |
emptyIterator()
Returns an immutable iterator that has no elements
|
static <T> java.util.List<T> |
emptyList()
Returns an immutable list that is empty.
|
static <T> java.util.ListIterator<T> |
emptyListIterator()
Returns an immutable list iterator that has no elements
|
static <K,V> java.util.Map<K,V> |
emptyMap()
Returns an immutable map that is empty.
|
static <K,V> java.util.NavigableMap<K,V> |
emptyNavigableMap()
Returns an immutable
NavigableMap that is empty. |
static <T> java.util.NavigableSet<T> |
emptyNavigableSet()
Returns an immutable
NavigableSet that is empty. |
static <T> java.util.Set<T> |
emptySet()
Returns an immutable set that is empty.
|
static <K,V> java.util.SortedMap<K,V> |
emptySortedMap()
Returns an immutable
SortedMap that is empty. |
static <T> java.util.SortedSet<T> |
emptySortedSet()
Returns an immutable
SortedSet that is empty. |
static boolean |
endsWith(java.lang.String str,
java.lang.String suffix) |
static boolean |
endsWithAny(java.lang.String str,
java.lang.String... substrs) |
static boolean |
endsWithIgnoreCase(java.lang.String str,
java.lang.String suffix) |
static <E extends java.lang.Enum<E>> |
enumListOf(java.lang.Class<E> enumClass) |
static <E extends java.lang.Enum<E>> |
enumMapOf(java.lang.Class<E> enumClass) |
static <E extends java.lang.Enum<E>> |
enumSetOf(java.lang.Class<E> enumClass) |
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)
Method equals.
|
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)
Method equals.
|
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)
Method equals.
|
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)
Method equals.
|
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)
Method equals.
|
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)
Method equals.
|
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)
Method equals.
|
static boolean |
equals(java.lang.Object[] a,
int fromIndexA,
java.lang.Object[] b,
int fromIndexB,
int len) |
static boolean |
equals(java.lang.Object[] a,
java.lang.Object[] b) |
static boolean |
equals(java.lang.Object a,
java.lang.Object b)
compare
a and b by
Arrays.equals(Object[], Object[]) if both of them are array. |
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)
Method equals.
|
static boolean |
equals(java.lang.String a,
java.lang.String b) |
static boolean |
equalsIgnoreCase(java.lang.String[] a,
int fromIndexA,
java.lang.String[] b,
int fromIndexB,
int len) |
static boolean |
equalsIgnoreCase(java.lang.String[] a,
java.lang.String[] b) |
static boolean |
equalsIgnoreCase(java.lang.String a,
java.lang.String b) |
static void |
erase(java.lang.Object entity,
java.util.Collection<java.lang.String> propNames) |
static void |
erase(java.lang.Object entity,
java.lang.String... propNames) |
static void |
eraseAll(java.lang.Object entity) |
static <T> T |
execute(java.util.concurrent.Callable<T> cmd,
int retryTimes,
long retryInterval,
BiPredicate<? super T,? super java.lang.Exception> retryCondition) |
static void |
execute(Try.Runnable<? extends java.lang.Exception> cmd,
int retryTimes,
long retryInterval,
Predicate<? super java.lang.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 <T> T |
fill(java.lang.Class<T> entityClass)
Fill the properties of the entity with random values.
|
static <T> java.util.List<T> |
fill(java.lang.Class<T> entityClass,
int len)
Fill the properties of the entity with random values.
|
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 <T> void |
fill(java.util.List<? super T> list,
int fromIndex,
int toIndex,
T val)
The specified value will be added/inserted into the specified List.
|
static <T> void |
fill(java.util.List<? super T> list,
T val) |
static void |
fill(long[] a,
int fromIndex,
int toIndex,
long val) |
static void |
fill(long[] a,
long val) |
static void |
fill(java.lang.Object entity)
Fill the properties of the entity with random values.
|
static void |
fill(java.lang.Object[] a,
int fromIndex,
int toIndex,
java.lang.Object val) |
static void |
fill(java.lang.Object[] a,
java.lang.Object val) |
static void |
fill(short[] a,
int fromIndex,
int toIndex,
short val) |
static void |
fill(short[] a,
short val) |
static <E extends java.lang.Exception> |
filter(boolean[] a,
int fromIndex,
int toIndex,
Try.BooleanPredicate<E> filter) |
static <E extends java.lang.Exception> |
filter(boolean[] a,
int fromIndex,
int toIndex,
Try.BooleanPredicate<E> filter,
int max)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <E extends java.lang.Exception> |
filter(boolean[] a,
Try.BooleanPredicate<E> filter) |
static <E extends java.lang.Exception> |
filter(boolean[] a,
Try.BooleanPredicate<E> filter,
int max) |
static <E extends java.lang.Exception> |
filter(byte[] a,
int fromIndex,
int toIndex,
Try.BytePredicate<E> filter) |
static <E extends java.lang.Exception> |
filter(byte[] a,
int fromIndex,
int toIndex,
Try.BytePredicate<E> filter,
int max)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <E extends java.lang.Exception> |
filter(byte[] a,
Try.BytePredicate<E> filter) |
static <E extends java.lang.Exception> |
filter(byte[] a,
Try.BytePredicate<E> filter,
int max) |
static <E extends java.lang.Exception> |
filter(char[] a,
int fromIndex,
int toIndex,
Try.CharPredicate<E> filter) |
static <E extends java.lang.Exception> |
filter(char[] a,
int fromIndex,
int toIndex,
Try.CharPredicate<E> filter,
int max)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <E extends java.lang.Exception> |
filter(char[] a,
Try.CharPredicate<E> filter) |
static <E extends java.lang.Exception> |
filter(char[] a,
Try.CharPredicate<E> filter,
int max) |
static <T,E extends java.lang.Exception> |
filter(java.util.Collection<? extends T> c,
int fromIndex,
int toIndex,
Try.Predicate<? super T,E> filter) |
static <T,E extends java.lang.Exception> |
filter(java.util.Collection<? extends T> c,
int fromIndex,
int toIndex,
Try.Predicate<? super T,E> filter,
int max) |
static <T,R extends java.util.Collection<T>,E extends java.lang.Exception> |
filter(java.util.Collection<? extends T> c,
int fromIndex,
int toIndex,
Try.Predicate<? super T,E> filter,
IntFunction<R> supplier) |
static <T,R extends java.util.Collection<T>,E extends java.lang.Exception> |
filter(java.util.Collection<? extends T> c,
int fromIndex,
int toIndex,
Try.Predicate<? super T,E> filter,
int max,
IntFunction<R> supplier) |
static <T,E extends java.lang.Exception> |
filter(java.util.Collection<? extends T> c,
Try.Predicate<? super T,E> filter) |
static <T,E extends java.lang.Exception> |
filter(java.util.Collection<? extends T> c,
Try.Predicate<? super T,E> filter,
int max) |
static <T,R extends java.util.Collection<T>,E extends java.lang.Exception> |
filter(java.util.Collection<? extends T> c,
Try.Predicate<? super T,E> filter,
IntFunction<R> supplier) |
static <T,R extends java.util.Collection<T>,E extends java.lang.Exception> |
filter(java.util.Collection<? extends T> c,
Try.Predicate<? super T,E> filter,
int max,
IntFunction<R> supplier) |
static <E extends java.lang.Exception> |
filter(double[] a,
int fromIndex,
int toIndex,
Try.DoublePredicate<E> filter) |
static <E extends java.lang.Exception> |
filter(double[] a,
int fromIndex,
int toIndex,
Try.DoublePredicate<E> filter,
int max)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <E extends java.lang.Exception> |
filter(double[] a,
Try.DoublePredicate<E> filter) |
static <E extends java.lang.Exception> |
filter(double[] a,
Try.DoublePredicate<E> filter,
int max) |
static <E extends java.lang.Exception> |
filter(float[] a,
int fromIndex,
int toIndex,
Try.FloatPredicate<E> filter) |
static <E extends java.lang.Exception> |
filter(float[] a,
int fromIndex,
int toIndex,
Try.FloatPredicate<E> filter,
int max)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <E extends java.lang.Exception> |
filter(float[] a,
Try.FloatPredicate<E> filter) |
static <E extends java.lang.Exception> |
filter(float[] a,
Try.FloatPredicate<E> filter,
int max) |
static <E extends java.lang.Exception> |
filter(int[] a,
int fromIndex,
int toIndex,
Try.IntPredicate<E> filter) |
static <E extends java.lang.Exception> |
filter(int[] a,
int fromIndex,
int toIndex,
Try.IntPredicate<E> filter,
int max)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <E extends java.lang.Exception> |
filter(int[] a,
Try.IntPredicate<E> filter) |
static <E extends java.lang.Exception> |
filter(int[] a,
Try.IntPredicate<E> filter,
int max) |
static <E extends java.lang.Exception> |
filter(long[] a,
int fromIndex,
int toIndex,
Try.LongPredicate<E> filter) |
static <E extends java.lang.Exception> |
filter(long[] a,
int fromIndex,
int toIndex,
Try.LongPredicate<E> filter,
int max)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <E extends java.lang.Exception> |
filter(long[] a,
Try.LongPredicate<E> filter) |
static <E extends java.lang.Exception> |
filter(long[] a,
Try.LongPredicate<E> filter,
int max) |
static <E extends java.lang.Exception> |
filter(short[] a,
int fromIndex,
int toIndex,
Try.ShortPredicate<E> filter) |
static <E extends java.lang.Exception> |
filter(short[] a,
int fromIndex,
int toIndex,
Try.ShortPredicate<E> filter,
int max)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <E extends java.lang.Exception> |
filter(short[] a,
Try.ShortPredicate<E> filter) |
static <E extends java.lang.Exception> |
filter(short[] a,
Try.ShortPredicate<E> filter,
int max) |
static <T,E extends java.lang.Exception> |
filter(T[] a,
int fromIndex,
int toIndex,
Try.Predicate<? super T,E> filter) |
static <T,E extends java.lang.Exception> |
filter(T[] a,
int fromIndex,
int toIndex,
Try.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 java.util.Collection<T>,E extends java.lang.Exception> |
filter(T[] a,
int fromIndex,
int toIndex,
Try.Predicate<? super T,E> filter,
IntFunction<R> supplier) |
static <T,R extends java.util.Collection<T>,E extends java.lang.Exception> |
filter(T[] a,
int fromIndex,
int toIndex,
Try.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,E extends java.lang.Exception> |
filter(T[] a,
Try.Predicate<? super T,E> filter) |
static <T,E extends java.lang.Exception> |
filter(T[] a,
Try.Predicate<? super T,E> filter,
int max) |
static <T,R extends java.util.Collection<T>,E extends java.lang.Exception> |
filter(T[] a,
Try.Predicate<? super T,E> filter,
IntFunction<R> supplier) |
static <T,R extends java.util.Collection<T>,E extends java.lang.Exception> |
filter(T[] a,
Try.Predicate<? super T,E> filter,
int max,
IntFunction<R> supplier) |
static java.util.List<IntPair> |
findAllIndicesBetween(java.lang.String str,
char prefix,
char postfix)
findAllIndicesBetween("3[a2[c]]2[a]", '[', ']') = [[2, 7], [10, 11]] |
static java.util.List<IntPair> |
findAllIndicesBetween(java.lang.String str,
int fromIndex,
int toIndex,
char prefix,
char postfix)
findAllIndicesBetween("3[a2[c]]2[a]", '[', ']') = [[2, 7], [10, 11]] |
static java.util.List<IntPair> |
findAllIndicesBetween(java.lang.String str,
int fromIndex,
int toIndex,
java.lang.String prefix,
java.lang.String postfix)
findAllIndicesBetween("3[a2[c]]2[a]", '[', ']') = [[2, 7], [10, 11]] |
static java.util.List<IntPair> |
findAllIndicesBetween(java.lang.String str,
java.lang.String prefix,
java.lang.String postfix)
findAllIndicesBetween("3[a2[c]]2[a]", '[', ']') = [[2, 7], [10, 11]] |
static java.util.List<java.lang.String> |
findAllSubstringsBetween(java.lang.String str,
char prefix,
char postfix)
findAllIndicesBetween("3[a2[c]]2[a]", '[', ']') = [[2, 7], [10, 11]] |
static java.util.List<java.lang.String> |
findAllSubstringsBetween(java.lang.String str,
int fromIndex,
int toIndex,
char prefix,
char postfix)
findAllIndicesBetween("3[a2[c]]2[a]", '[', ']') = [[2, 7], [10, 11]] |
static java.util.List<java.lang.String> |
findAllSubstringsBetween(java.lang.String str,
int fromIndex,
int toIndex,
java.lang.String prefix,
java.lang.String postfix)
findAllIndicesBetween("3[a2[c]]2[a]", '[', ']') = [[2, 7], [10, 11]] |
static java.util.List<java.lang.String> |
findAllSubstringsBetween(java.lang.String str,
java.lang.String prefix,
java.lang.String postfix)
findAllIndicesBetween("3[a2[c]]2[a]", '[', ']') = [[2, 7], [10, 11]] |
static <T> Optional<T> |
firstNonNull(java.util.Collection<T> c) |
static <T> Optional<T> |
firstNonNull(T... a) |
static <T> Optional<T> |
firstNonNull(T a,
T b) |
static <T> Optional<T> |
firstNonNull(T a,
T b,
T c) |
static <T,R,E extends java.lang.Exception> |
flatMap(java.util.Collection<? extends T> c,
int fromIndex,
int toIndex,
Try.Function<? super T,? extends java.util.Collection<? extends R>,E> func)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <T,R,C extends java.util.Collection<R>,E extends java.lang.Exception> |
flatMap(java.util.Collection<? extends T> c,
int fromIndex,
int toIndex,
Try.Function<? super T,? extends java.util.Collection<? extends R>,E> func,
IntFunction<C> supplier)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <T,R,E extends java.lang.Exception> |
flatMap(java.util.Collection<? extends T> c,
Try.Function<? super T,? extends java.util.Collection<? extends R>,E> func) |
static <T,R,C extends java.util.Collection<R>,E extends java.lang.Exception> |
flatMap(java.util.Collection<? extends T> c,
Try.Function<? super T,? extends java.util.Collection<? extends R>,E> func,
IntFunction<C> supplier) |
static <T,R,E extends java.lang.Exception> |
flatMap(T[] a,
int fromIndex,
int toIndex,
Try.Function<? super T,? extends java.util.Collection<? extends R>,E> func)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <T,R,C extends java.util.Collection<R>,E extends java.lang.Exception> |
flatMap(T[] a,
int fromIndex,
int toIndex,
Try.Function<? super T,? extends java.util.Collection<? extends R>,E> func,
IntFunction<C> supplier)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <T,R,E extends java.lang.Exception> |
flatMap(T[] a,
Try.Function<? super T,? extends java.util.Collection<? extends R>,E> func) |
static <T,R,C extends java.util.Collection<R>,E extends java.lang.Exception> |
flatMap(T[] a,
Try.Function<? super T,? extends java.util.Collection<? extends R>,E> func,
IntFunction<C> supplier) |
static <T,R,E extends java.lang.Exception> |
flattMap(java.util.Collection<? extends T> c,
int fromIndex,
int toIndex,
Try.Function<? super T,? extends R[],E> func)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <T,R,C extends java.util.Collection<R>,E extends java.lang.Exception> |
flattMap(java.util.Collection<? extends T> c,
int fromIndex,
int toIndex,
Try.Function<? super T,? extends R[],E> func,
IntFunction<C> supplier)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <T,R,E extends java.lang.Exception> |
flattMap(java.util.Collection<? extends T> c,
Try.Function<? super T,? extends R[],E> func) |
static <T,R,C extends java.util.Collection<R>,E extends java.lang.Exception> |
flattMap(java.util.Collection<? extends T> c,
Try.Function<? super T,? extends R[],E> func,
IntFunction<C> supplier) |
static <T,R,E extends java.lang.Exception> |
flattMap(T[] a,
int fromIndex,
int toIndex,
Try.Function<? super T,? extends R[],E> func)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <T,R,C extends java.util.Collection<R>,E extends java.lang.Exception> |
flattMap(T[] a,
int fromIndex,
int toIndex,
Try.Function<? super T,? extends R[],E> func,
IntFunction<C> supplier)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <T,R,E extends java.lang.Exception> |
flattMap(T[] a,
Try.Function<? super T,? extends R[],E> func) |
static <T,R,C extends java.util.Collection<R>,E extends java.lang.Exception> |
flattMap(T[] a,
Try.Function<? super T,? extends R[],E> func,
IntFunction<C> supplier) |
static <A,B,E extends java.lang.Exception> |
forEach(A[] a,
B[] b,
A valueForNoneA,
B valueForNoneB,
Try.BiConsumer<? super A,? super B,E> action) |
static <A,B,C,E extends java.lang.Exception> |
forEach(A[] a,
B[] b,
C[] c,
A valueForNoneA,
B valueForNoneB,
C valueForNoneC,
Try.TriConsumer<? super A,? super B,? super C,E> action) |
static <A,B,C,E extends java.lang.Exception> |
forEach(A[] a,
B[] b,
C[] c,
Try.TriConsumer<? super A,? super B,? super C,E> action) |
static <A,B,E extends java.lang.Exception> |
forEach(A[] a,
B[] b,
Try.BiConsumer<? super A,? super B,E> action) |
static <T,C extends java.util.Collection<? extends T>,R,E extends java.lang.Exception,E2 extends java.lang.Exception> |
forEach(C c,
int fromIndex,
int toIndex,
R seed,
Try.BiFunction<R,? super T,R,E> accumulator,
Try.BiPredicate<? super R,? super T,E2> conditionToBreak)
Execute
accumulator on each element till true is returned by conditionToBreak |
static <T,C extends java.util.Collection<? extends T>,R,E extends java.lang.Exception,E2 extends java.lang.Exception> |
forEach(C c,
int fromIndex,
int toIndex,
R seed,
Try.IndexedBiFunction<R,? super T,R,E> accumulator,
Try.BiPredicate<? super R,? super T,E2> conditionToBreak)
Execute
accumulator on each element till true is returned by conditionToBreak |
static <T,C extends java.util.Collection<? extends T>,E extends java.lang.Exception> |
forEach(C c,
int fromIndex,
int toIndex,
Try.Consumer<? super T,E> action)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <T,C extends java.util.Collection<? extends T>,E extends java.lang.Exception> |
forEach(C c,
int fromIndex,
int toIndex,
Try.IndexedConsumer<? super T,E> action)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <A,B,E extends java.lang.Exception> |
forEach(java.util.Collection<A> a,
java.util.Collection<B> b,
A valueForNoneA,
B valueForNoneB,
Try.BiConsumer<? super A,? super B,E> action) |
static <A,B,C,E extends java.lang.Exception> |
forEach(java.util.Collection<A> a,
java.util.Collection<B> b,
java.util.Collection<C> c,
A valueForNoneA,
B valueForNoneB,
C valueForNoneC,
Try.TriConsumer<? super A,? super B,? super C,E> action) |
static <A,B,C,E extends java.lang.Exception> |
forEach(java.util.Collection<A> a,
java.util.Collection<B> b,
java.util.Collection<C> c,
Try.TriConsumer<? super A,? super B,? super C,E> action) |
static <A,B,E extends java.lang.Exception> |
forEach(java.util.Collection<A> a,
java.util.Collection<B> b,
Try.BiConsumer<? super A,? super B,E> action) |
static <T,T2,T3,E extends java.lang.Exception,E2 extends java.lang.Exception,E3 extends java.lang.Exception> |
forEach(java.util.Collection<T> c,
Try.Function<? super T,? extends java.util.Collection<T2>,E> flatMapper,
Try.Function<? super T2,? extends java.util.Collection<T3>,E2> flatMapper2,
Try.TriConsumer<? super T,? super T2,? super T3,E3> action) |
static <T,U,E extends java.lang.Exception,E2 extends java.lang.Exception> |
forEach(java.util.Collection<T> c,
Try.Function<? super T,? extends java.util.Collection<U>,E> flatMapper,
Try.BiConsumer<? super T,? super U,E2> action) |
static <T,C extends java.util.Collection<? extends T>,R,E extends java.lang.Exception,E2 extends java.lang.Exception> |
forEach(C c,
R seed,
Try.BiFunction<R,? super T,R,E> accumulator,
Try.BiPredicate<? super R,? super T,E2> conditionToBreak) |
static <T,C extends java.util.Collection<? extends T>,R,E extends java.lang.Exception,E2 extends java.lang.Exception> |
forEach(C c,
R seed,
Try.IndexedBiFunction<R,? super T,R,E> accumulator,
Try.BiPredicate<? super R,? super T,E2> conditionToBreak) |
static <T,C extends java.util.Collection<? extends T>,E extends java.lang.Exception> |
forEach(C c,
Try.Consumer<? super T,E> action) |
static <T,C extends java.util.Collection<? extends T>,E extends java.lang.Exception> |
forEach(C c,
Try.IndexedConsumer<? super T,E> action) |
static <E extends java.lang.Exception> |
forEach(int startInclusive,
int endExclusive,
int step,
Try.IntConsumer<E> action) |
static <T,E extends java.lang.Exception> |
forEach(int startInclusive,
int endExclusive,
int step,
T a,
Try.ObjIntConsumer<T,E> action) |
static <E extends java.lang.Exception> |
forEach(int startInclusive,
int endExclusive,
Try.IntConsumer<E> action) |
static <T,E extends java.lang.Exception> |
forEach(int startInclusive,
int endExclusive,
T a,
Try.ObjIntConsumer<T,E> action) |
static <T,R,E extends java.lang.Exception,E2 extends java.lang.Exception> |
forEach(T[] a,
int fromIndex,
int toIndex,
R seed,
Try.BiFunction<R,? super T,R,E> accumulator,
Try.BiPredicate<? super R,? super T,E2> conditionToBreak)
Execute
accumulator on each element till true is returned by conditionToBreak |
static <T,R,E extends java.lang.Exception,E2 extends java.lang.Exception> |
forEach(T[] a,
int fromIndex,
int toIndex,
R seed,
Try.IndexedBiFunction<R,? super T,R,E> accumulator,
Try.BiPredicate<? super R,? super T,E2> conditionToBreak)
Execute
accumulator on each element till true is returned by conditionToBreak |
static <T,E extends java.lang.Exception> |
forEach(T[] a,
int fromIndex,
int toIndex,
Try.Consumer<? super T,E> action) |
static <T,E extends java.lang.Exception> |
forEach(T[] a,
int fromIndex,
int toIndex,
Try.IndexedConsumer<? super T,E> action) |
static <T,R,E extends java.lang.Exception,E2 extends java.lang.Exception> |
forEach(T[] a,
R seed,
Try.BiFunction<R,? super T,R,E> accumulator,
Try.BiPredicate<? super R,? super T,E2> conditionToBreak) |
static <T,R,E extends java.lang.Exception,E2 extends java.lang.Exception> |
forEach(T[] a,
R seed,
Try.IndexedBiFunction<R,? super T,R,E> accumulator,
Try.BiPredicate<? super R,? super T,E2> conditionToBreak) |
static <T,E extends java.lang.Exception> |
forEach(T[] a,
Try.Consumer<? super T,E> action) |
static <T,T2,T3,E extends java.lang.Exception,E2 extends java.lang.Exception,E3 extends java.lang.Exception> |
forEach(T[] a,
Try.Function<? super T,? extends java.util.Collection<T2>,E> flatMapper,
Try.Function<? super T2,? extends java.util.Collection<T3>,E2> flatMapper2,
Try.TriConsumer<? super T,? super T2,? super T3,E3> action) |
static <T,U,E extends java.lang.Exception,E2 extends java.lang.Exception> |
forEach(T[] a,
Try.Function<? super T,? extends java.util.Collection<U>,E> flatMapper,
Try.BiConsumer<? super T,? super U,E2> action) |
static <T,E extends java.lang.Exception> |
forEach(T[] a,
Try.IndexedConsumer<? super T,E> action) |
static <T,T2,T3,E extends java.lang.Exception,E2 extends java.lang.Exception,E3 extends java.lang.Exception> |
forEachNonNull(java.util.Collection<T> c,
Try.Function<? super T,? extends java.util.Collection<T2>,E> flatMapper,
Try.Function<? super T2,? extends java.util.Collection<T3>,E2> flatMapper2,
Try.TriConsumer<? super T,? super T2,? super T3,E3> action) |
static <T,U,E extends java.lang.Exception,E2 extends java.lang.Exception> |
forEachNonNull(java.util.Collection<T> c,
Try.Function<? super T,? extends java.util.Collection<U>,E> flatMapper,
Try.BiConsumer<? super T,? super U,E2> action) |
static <T,T2,T3,E extends java.lang.Exception,E2 extends java.lang.Exception,E3 extends java.lang.Exception> |
forEachNonNull(T[] a,
Try.Function<? super T,? extends java.util.Collection<T2>,E> flatMapper,
Try.Function<? super T2,? extends java.util.Collection<T3>,E2> flatMapper2,
Try.TriConsumer<? super T,? super T2,? super T3,E3> action) |
static <T,U,E extends java.lang.Exception,E2 extends java.lang.Exception> |
forEachNonNull(T[] a,
Try.Function<? super T,? extends java.util.Collection<U>,E> flatMapper,
Try.BiConsumer<? super T,? super U,E2> action) |
static java.lang.String |
format(java.util.Calendar c) |
static java.lang.String |
format(java.util.Calendar c,
java.lang.String format) |
static java.lang.String |
format(java.util.Calendar c,
java.lang.String format,
java.util.TimeZone timeZone) |
static java.lang.String |
format(java.util.Date date) |
static java.lang.String |
format(java.util.Date date,
java.lang.String format) |
static java.lang.String |
format(java.util.Date date,
java.lang.String format,
java.util.TimeZone timeZone) |
static void |
format(java.io.Writer writer,
java.util.Calendar c) |
static void |
format(java.io.Writer writer,
java.util.Calendar c,
java.lang.String format,
java.util.TimeZone timeZone) |
static void |
format(java.io.Writer writer,
java.util.Date date) |
static void |
format(java.io.Writer writer,
java.util.Date date,
java.lang.String format,
java.util.TimeZone timeZone) |
static void |
format(java.io.Writer writer,
javax.xml.datatype.XMLGregorianCalendar c) |
static void |
format(java.io.Writer writer,
javax.xml.datatype.XMLGregorianCalendar c,
java.lang.String format,
java.util.TimeZone timeZone) |
static java.lang.String |
format(javax.xml.datatype.XMLGregorianCalendar c) |
static java.lang.String |
format(javax.xml.datatype.XMLGregorianCalendar c,
java.lang.String format) |
static java.lang.String |
format(javax.xml.datatype.XMLGregorianCalendar c,
java.lang.String format,
java.util.TimeZone timeZone) |
static <T> T[] |
fprintln(java.lang.String format,
T... args) |
static <T> T |
fromJSON(java.lang.Class<T> targetClass,
java.io.File json) |
static <T> T |
fromJSON(java.lang.Class<T> targetClass,
java.io.File json,
JSONDeserializationConfig config) |
static <T> T |
fromJSON(java.lang.Class<T> targetClass,
java.io.InputStream json) |
static <T> T |
fromJSON(java.lang.Class<T> targetClass,
java.io.InputStream json,
JSONDeserializationConfig config) |
static <T> T |
fromJSON(java.lang.Class<T> targetClass,
java.io.Reader json) |
static <T> T |
fromJSON(java.lang.Class<T> targetClass,
java.io.Reader json,
JSONDeserializationConfig config) |
static <T> T |
fromJSON(java.lang.Class<T> targetClass,
java.lang.String json) |
static <T> T |
fromJSON(java.lang.Class<T> targetClass,
java.lang.String json,
int fromIndex,
int toIndex) |
static <T> T |
fromJSON(java.lang.Class<T> targetClass,
java.lang.String json,
int fromIndex,
int toIndex,
JSONDeserializationConfig config) |
static <T> T |
fromJSON(java.lang.Class<T> targetClass,
java.lang.String json,
JSONDeserializationConfig config) |
static <T> T |
fromJSON(com.landawn.abacus.type.Type<T> targetType,
java.io.File json) |
static <T> T |
fromJSON(com.landawn.abacus.type.Type<T> targetType,
java.io.File json,
JSONDeserializationConfig config) |
static <T> T |
fromJSON(com.landawn.abacus.type.Type<T> targetType,
java.io.InputStream json) |
static <T> T |
fromJSON(com.landawn.abacus.type.Type<T> targetType,
java.io.InputStream json,
JSONDeserializationConfig config) |
static <T> T |
fromJSON(com.landawn.abacus.type.Type<T> targetType,
java.io.Reader json) |
static <T> T |
fromJSON(com.landawn.abacus.type.Type<T> targetType,
java.io.Reader json,
JSONDeserializationConfig config) |
static <T> T |
fromJSON(com.landawn.abacus.type.Type<T> targetType,
java.lang.String json) |
static <T> T |
fromJSON(com.landawn.abacus.type.Type<T> targetType,
java.lang.String json,
int fromIndex,
int toIndex) |
static <T> T |
fromJSON(com.landawn.abacus.type.Type<T> targetType,
java.lang.String json,
int fromIndex,
int toIndex,
JSONDeserializationConfig config) |
static <T> T |
fromJSON(com.landawn.abacus.type.Type<T> targetType,
java.lang.String json,
JSONDeserializationConfig config) |
static <T> T |
fromXML(java.lang.Class<T> targetClass,
java.io.File xml) |
static <T> T |
fromXML(java.lang.Class<T> targetClass,
java.io.File xml,
XMLDeserializationConfig config) |
static <T> T |
fromXML(java.lang.Class<T> targetClass,
java.io.InputStream xml) |
static <T> T |
fromXML(java.lang.Class<T> targetClass,
java.io.InputStream xml,
XMLDeserializationConfig config) |
static <T> T |
fromXML(java.lang.Class<T> targetClass,
java.io.Reader xml) |
static <T> T |
fromXML(java.lang.Class<T> targetClass,
java.io.Reader xml,
XMLDeserializationConfig config) |
static <T> T |
fromXML(java.lang.Class<T> targetClass,
java.lang.String xml) |
static <T> T |
fromXML(java.lang.Class<T> targetClass,
java.lang.String xml,
XMLDeserializationConfig config) |
static <T> T |
fromXML(com.landawn.abacus.type.Type<T> targetType,
java.io.File xml) |
static <T> T |
fromXML(com.landawn.abacus.type.Type<T> targetType,
java.io.File xml,
XMLDeserializationConfig config) |
static <T> T |
fromXML(com.landawn.abacus.type.Type<T> targetType,
java.io.InputStream xml) |
static <T> T |
fromXML(com.landawn.abacus.type.Type<T> targetType,
java.io.InputStream xml,
XMLDeserializationConfig config) |
static <T> T |
fromXML(com.landawn.abacus.type.Type<T> targetType,
java.io.Reader xml) |
static <T> T |
fromXML(com.landawn.abacus.type.Type<T> targetType,
java.io.Reader xml,
XMLDeserializationConfig config) |
static <T> T |
fromXML(com.landawn.abacus.type.Type<T> targetType,
java.lang.String xml) |
static <T> T |
fromXML(com.landawn.abacus.type.Type<T> targetType,
java.lang.String xml,
XMLDeserializationConfig config) |
static char[] |
getCharsForReadOnly(java.lang.String str)
Deprecated.
|
static java.lang.String |
guid()
Returns the UUID without '-'.
|
static boolean |
hasDuplicates(byte[] a) |
static boolean |
hasDuplicates(byte[] a,
boolean isSorted) |
static boolean |
hasDuplicates(char[] a) |
static boolean |
hasDuplicates(char[] a,
boolean isSorted) |
static boolean |
hasDuplicates(java.util.Collection<?> c) |
static boolean |
hasDuplicates(java.util.Collection<?> c,
boolean isSorted) |
static boolean |
hasDuplicates(double[] a) |
static boolean |
hasDuplicates(double[] a,
boolean isSorted) |
static boolean |
hasDuplicates(float[] a) |
static boolean |
hasDuplicates(float[] a,
boolean isSorted) |
static boolean |
hasDuplicates(int[] a) |
static boolean |
hasDuplicates(int[] a,
boolean isSorted) |
static boolean |
hasDuplicates(long[] a) |
static boolean |
hasDuplicates(long[] a,
boolean isSorted) |
static boolean |
hasDuplicates(short[] a) |
static boolean |
hasDuplicates(short[] a,
boolean isSorted) |
static <T> boolean |
hasDuplicates(T[] a) |
static <T> boolean |
hasDuplicates(T[] a,
boolean isSorted) |
static int |
hashCode(boolean value)
Method hashCode.
|
static int |
hashCode(boolean[] a) |
static int |
hashCode(boolean[] a,
int fromIndex,
int toIndex) |
static int |
hashCode(byte value)
Method hashCode.
|
static int |
hashCode(byte[] a) |
static int |
hashCode(byte[] a,
int fromIndex,
int toIndex) |
static int |
hashCode(char value)
Method hashCode.
|
static int |
hashCode(char[] a) |
static int |
hashCode(char[] a,
int fromIndex,
int toIndex) |
static int |
hashCode(double value)
Method hashCode.
|
static int |
hashCode(double[] a) |
static int |
hashCode(double[] a,
int fromIndex,
int toIndex) |
static int |
hashCode(float value)
Method hashCode.
|
static int |
hashCode(float[] a) |
static int |
hashCode(float[] a,
int fromIndex,
int toIndex) |
static int |
hashCode(int value)
Method hashCode.
|
static int |
hashCode(int[] a) |
static int |
hashCode(int[] a,
int fromIndex,
int toIndex) |
static int |
hashCode(long value)
Method hashCode.
|
static int |
hashCode(long[] a) |
static int |
hashCode(long[] a,
int fromIndex,
int toIndex) |
static int |
hashCode(java.lang.Object obj)
Method hashCode.
|
static int |
hashCode(java.lang.Object[] a) |
static int |
hashCode(java.lang.Object[] a,
int fromIndex,
int toIndex) |
static int |
hashCode(short value)
Method hashCode.
|
static int |
hashCode(short[] a) |
static int |
hashCode(short[] a,
int fromIndex,
int toIndex) |
static <E1 extends java.lang.Exception,E2 extends java.lang.Exception> |
ifOrElse(boolean b,
Try.Runnable<E1> actionForTrue,
Try.Runnable<E2> actionForFalse) |
static <T,E1 extends java.lang.Exception,E2 extends java.lang.Exception> |
ifOrElse(boolean b,
T seed,
Try.Consumer<T,E1> actionForTrue,
Try.Consumer<T,E2> actionForFalse) |
static <R,E extends java.lang.Exception> |
ifOrEmpty(boolean b,
Try.Supplier<R,E> supplier)
Returns a
Nullable with value got from the specified supplier if b is true ,
otherwise returns an empty Nullable if b is false. |
static <T,R,E extends java.lang.Exception> |
ifOrEmpty(boolean b,
T seed,
Try.Function<T,R,E> func)
Returns a
Nullable with value returned by func.apply(seed) if b is true ,
otherwise returns an empty Nullable if b is false. |
static int |
indexOf(boolean[] a,
boolean e) |
static int |
indexOf(boolean[] a,
int fromIndex,
boolean e) |
static int |
indexOf(byte[] a,
byte e) |
static int |
indexOf(byte[] a,
int fromIndex,
byte e) |
static int |
indexOf(char[] a,
char e) |
static int |
indexOf(char[] a,
int fromIndex,
char e) |
static int |
indexOf(double[] a,
double e) |
static int |
indexOf(double[] a,
int fromIndex,
double e) |
static int |
indexOf(float[] a,
float e) |
static int |
indexOf(float[] a,
int fromIndex,
float e) |
static int |
indexOf(int[] a,
int e) |
static int |
indexOf(int[] a,
int fromIndex,
int e) |
static int |
indexOf(java.util.List<?> list,
int fromIndex,
java.lang.Object e) |
static int |
indexOf(java.util.List<?> list,
java.lang.Object e) |
static int |
indexOf(long[] a,
int fromIndex,
long e) |
static int |
indexOf(long[] a,
long e) |
static int |
indexOf(java.lang.Object[] a,
int fromIndex,
java.lang.Object e) |
static int |
indexOf(java.lang.Object[] a,
java.lang.Object e) |
static int |
indexOf(short[] a,
int fromIndex,
short e) |
static int |
indexOf(short[] a,
short e) |
static int |
indexOf(java.lang.String str,
int targetChar) |
static int |
indexOf(java.lang.String str,
int fromIndex,
int targetChar) |
static int |
indexOf(java.lang.String str,
int fromIndex,
java.lang.String substr) |
static int |
indexOf(java.lang.String str,
int fromIndex,
java.lang.String substr,
java.lang.String delimiter) |
static int |
indexOf(java.lang.String str,
java.lang.String substr) |
static int |
indexOf(java.lang.String str,
java.lang.String substr,
java.lang.String delimiter) |
static int |
indexOfAny(java.lang.String str,
char... chs) |
static int |
indexOfAny(java.lang.String str,
java.lang.String... substrs) |
static int |
indexOfAnyBut(java.lang.String str,
char... chs) |
static int |
indexOfDifference(java.lang.String... strs)
Compares all Strings in an array and returns the index at which the
Strings begin to differ.
|
static int |
indexOfDifference(java.lang.String a,
java.lang.String b)
Compares two Strings, and returns the index at which the Stringss begin
to differ.
|
static int |
indexOfIgnoreCase(java.lang.String str,
int fromIndex,
java.lang.String substr) |
static int |
indexOfIgnoreCase(java.lang.String str,
java.lang.String substr) |
static int |
indexOfSubList(java.util.List<?> sourceList,
java.util.List<?> targetSubList) |
static int |
initHashCapacity(int size) |
static boolean[] |
insert(boolean[] a,
int index,
boolean element)
Inserts the specified element at the specified position in the array.
|
static byte[] |
insert(byte[] a,
int index,
byte element)
Inserts the specified element at the specified position in the array.
|
static char[] |
insert(char[] a,
int index,
char element)
Inserts the specified element at the specified position in the array.
|
static double[] |
insert(double[] a,
int index,
double element)
Inserts the specified element at the specified position in the array.
|
static float[] |
insert(float[] a,
int index,
float element)
Inserts the specified element at the specified position in the array.
|
static int[] |
insert(int[] a,
int index,
int element)
Inserts the specified element at the specified position in the array.
|
static long[] |
insert(long[] a,
int index,
long element)
Inserts the specified element at the specified position in the array.
|
static short[] |
insert(short[] a,
int index,
short element)
Inserts the specified element at the specified position in the array.
|
static java.lang.String[] |
insert(java.lang.String[] a,
int index,
java.lang.String element) |
static <T> T[] |
insert(T[] a,
int index,
T element)
Inserts the specified element at the specified position in the array.
|
static boolean[] |
insertAll(boolean[] a,
int index,
boolean... b)
Inserts the specified elements at the specified position in the array.
|
static byte[] |
insertAll(byte[] a,
int index,
byte... b)
Inserts the specified elements at the specified position in the array.
|
static char[] |
insertAll(char[] a,
int index,
char... b)
Inserts the specified elements at the specified position in the array.
|
static double[] |
insertAll(double[] a,
int index,
double... b)
Inserts the specified elements at the specified position in the array.
|
static float[] |
insertAll(float[] a,
int index,
float... b)
Inserts the specified elements at the specified position in the array.
|
static int[] |
insertAll(int[] a,
int index,
int... b)
Inserts the specified elements at the specified position in the array.
|
static long[] |
insertAll(long[] a,
int index,
long... b)
Inserts the specified elements at the specified position in the array.
|
static short[] |
insertAll(short[] a,
int index,
short... b)
Inserts the specified elements at the specified position in the array.
|
static java.lang.String[] |
insertAll(java.lang.String[] a,
int index,
java.lang.String... b) |
static <T> T[] |
insertAll(T[] a,
int index,
T... b)
Inserts the specified elements 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 <T> java.util.List<T> |
intersection(java.util.Collection<? extends T> a,
java.util.Collection<?> 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 in
b removed by occurrences. |
static long[] |
intersection(long[] a,
long[] b) |
static short[] |
intersection(short[] a,
short[] b) |
static <T> T[] |
intersection(T[] a,
java.lang.Object[] b) |
static boolean |
isAllLowerCase(java.lang.CharSequence cs) |
static boolean |
isAllUpperCase(java.lang.CharSequence cs) |
static boolean |
isAlpha(java.lang.CharSequence cs)
Checks if the CharSequence contains only Unicode letters.
|
static boolean |
isAlphanumeric(java.lang.CharSequence cs)
Checks if the CharSequence contains only Unicode letters or digits.
|
static boolean |
isAlphanumericSpace(java.lang.CharSequence cs)
Checks if the CharSequence contains only Unicode letters, digits or space
(
' ' ). |
static boolean |
isAlphaSpace(java.lang.CharSequence cs)
Checks if the CharSequence contains only Unicode letters and space (' ').
|
static boolean |
isAscii(char ch)
Checks whether the character is ASCII 7 bit.
|
static boolean |
isAsciiAlpha(char ch)
Checks whether the character is ASCII 7 bit alphabetic.
|
static boolean |
isAsciiAlpha(java.lang.CharSequence cs) |
static boolean |
isAsciiAlphaLower(char ch)
Checks whether the character is ASCII 7 bit alphabetic lower case.
|
static boolean |
isAsciiAlphanumeric(char ch)
Checks whether the character is ASCII 7 bit numeric.
|
static boolean |
isAsciiAlphanumeric(java.lang.CharSequence cs) |
static boolean |
isAsciiAlphanumericSpace(java.lang.CharSequence cs) |
static boolean |
isAsciiAlphaSpace(java.lang.CharSequence cs) |
static boolean |
isAsciiAlphaUpper(char ch)
Checks whether the character is ASCII 7 bit alphabetic upper case.
|
static boolean |
isAsciiControl(char ch)
Checks whether the character is ASCII 7 bit control.
|
static boolean |
isAsciiDigtalInteger(java.lang.String str)
true is returned if the specified str only
includes characters ('0' ~ '9', '-', '+' ). |
static boolean |
isAsciiDigtalNumber(java.lang.String str)
true is returned if the specified str only
includes characters ('0' ~ '9', '.', '-', '+', 'e'). |
static boolean |
isAsciiLowerCase(char ch) |
static boolean |
isAsciiNumeric(char ch)
Checks whether the character is ASCII 7 bit numeric.
|
static boolean |
isAsciiNumeric(java.lang.CharSequence cs) |
static boolean |
isAsciiPrintable(char ch)
Checks whether the character is ASCII 7 bit printable.
|
static boolean |
isAsciiPrintable(java.lang.CharSequence cs) |
static boolean |
isAsciiUpperCase(char ch) |
static boolean |
isDigit(char ch) |
static boolean |
isDirtyMarker(java.lang.Class<?> cls) |
static boolean |
isEntity(java.lang.Class<?> cls) |
static boolean |
isLetter(char ch) |
static boolean |
isLetterOrDigit(char ch) |
static boolean |
isLowerCase(char ch) |
static boolean |
isMixedCase(java.lang.CharSequence cs)
Copied from Apache Commons Lang: StringUtils#isMixedCase.
|
static boolean |
isNullOrEmpty(boolean[] a) |
static boolean |
isNullOrEmpty(byte[] a) |
static boolean |
isNullOrEmpty(char[] a) |
static boolean |
isNullOrEmpty(java.lang.CharSequence s) |
static boolean |
isNullOrEmpty(java.util.Collection<?> c) |
static boolean |
isNullOrEmpty(DataSet rs) |
static boolean |
isNullOrEmpty(double[] a) |
static boolean |
isNullOrEmpty(EntityId entityId) |
static boolean |
isNullOrEmpty(float[] a) |
static boolean |
isNullOrEmpty(int[] a) |
static boolean |
isNullOrEmpty(long[] a) |
static boolean |
isNullOrEmpty(LongMultiset<?> s) |
static boolean |
isNullOrEmpty(java.util.Map<?,?> m) |
static boolean |
isNullOrEmpty(Multimap<?,?,?> m) |
static boolean |
isNullOrEmpty(Multiset<?> s) |
static boolean |
isNullOrEmpty(java.lang.Object[] a) |
static boolean |
isNullOrEmpty(PrimitiveList list) |
static boolean |
isNullOrEmpty(short[] a) |
static boolean |
isNullOrEmptyOrBlank(java.lang.CharSequence s) |
static boolean |
isNumber(java.lang.String str)
Note: It's copied from NumberUtils in Apache Commons Lang under Apache
License 2.0
|
static boolean |
isNumeric(java.lang.CharSequence cs)
Checks if the CharSequence contains only Unicode digits.
|
static boolean |
isNumericSpace(java.lang.CharSequence cs)
Checks if the CharSequence contains only Unicode digits or space (
' ' ). |
static boolean |
isPrimitive(java.lang.Class<?> cls) |
static boolean |
isPrimitiveArray(java.lang.Class<?> cls) |
static boolean |
isPrimitiveOrWapper(java.lang.Class<?> cls) |
static boolean |
isPrimitiveWapper(java.lang.Class<?> cls) |
static boolean |
isUpperCase(char ch) |
static boolean |
isWhitespace(java.lang.CharSequence cs)
Checks if the CharSequence contains only whitespace.
|
static <T> ObjIterator<T> |
iterate(java.util.Collection<? extends java.util.Collection<? extends T>> c) |
static <T> ObjIterator<T> |
iterate(java.util.Collection<? extends T>... a) |
static <T> ObjIterator<T> |
iterate(T[]... a) |
static java.lang.String |
join(boolean[] a) |
static java.lang.String |
join(boolean[] a,
char delimiter) |
static java.lang.String |
join(boolean[] a,
int fromIndex,
int toIndex,
char delimiter) |
static java.lang.String |
join(boolean[] a,
int fromIndex,
int toIndex,
java.lang.String delimiter) |
static java.lang.String |
join(boolean[] a,
java.lang.String delimiter) |
static java.lang.String |
join(byte[] a) |
static java.lang.String |
join(byte[] a,
char delimiter) |
static java.lang.String |
join(byte[] a,
int fromIndex,
int toIndex,
char delimiter) |
static java.lang.String |
join(byte[] a,
int fromIndex,
int toIndex,
java.lang.String delimiter) |
static java.lang.String |
join(byte[] a,
java.lang.String delimiter) |
static java.lang.String |
join(char[] a) |
static java.lang.String |
join(char[] a,
char delimiter) |
static java.lang.String |
join(char[] a,
int fromIndex,
int toIndex,
char delimiter) |
static java.lang.String |
join(char[] a,
int fromIndex,
int toIndex,
java.lang.String delimiter) |
static java.lang.String |
join(char[] a,
java.lang.String delimiter) |
static java.lang.String |
join(java.util.Collection<?> c) |
static java.lang.String |
join(java.util.Collection<?> c,
char delimiter) |
static java.lang.String |
join(java.util.Collection<?> c,
int fromIndex,
int toIndex,
char delimiter) |
static java.lang.String |
join(java.util.Collection<?> c,
int fromIndex,
int toIndex,
char delimiter,
boolean trim) |
static java.lang.String |
join(java.util.Collection<?> c,
int fromIndex,
int toIndex,
java.lang.String delimiter) |
static java.lang.String |
join(java.util.Collection<?> c,
int fromIndex,
int toIndex,
java.lang.String delimiter,
boolean trim) |
static java.lang.String |
join(java.util.Collection<?> c,
java.lang.String delimiter) |
static java.lang.String |
join(double[] a) |
static java.lang.String |
join(double[] a,
char delimiter) |
static java.lang.String |
join(double[] a,
int fromIndex,
int toIndex,
char delimiter) |
static java.lang.String |
join(double[] a,
int fromIndex,
int toIndex,
java.lang.String delimiter) |
static java.lang.String |
join(double[] a,
java.lang.String delimiter) |
static java.lang.String |
join(float[] a) |
static java.lang.String |
join(float[] a,
char delimiter) |
static java.lang.String |
join(float[] a,
int fromIndex,
int toIndex,
char delimiter) |
static java.lang.String |
join(float[] a,
int fromIndex,
int toIndex,
java.lang.String delimiter) |
static java.lang.String |
join(float[] a,
java.lang.String delimiter) |
static java.lang.String |
join(int[] a) |
static java.lang.String |
join(int[] a,
char delimiter) |
static java.lang.String |
join(int[] a,
int fromIndex,
int toIndex,
char delimiter) |
static java.lang.String |
join(int[] a,
int fromIndex,
int toIndex,
java.lang.String delimiter) |
static java.lang.String |
join(int[] a,
java.lang.String delimiter) |
static java.lang.String |
join(long[] a) |
static java.lang.String |
join(long[] a,
char delimiter) |
static java.lang.String |
join(long[] a,
int fromIndex,
int toIndex,
char delimiter) |
static java.lang.String |
join(long[] a,
int fromIndex,
int toIndex,
java.lang.String delimiter) |
static java.lang.String |
join(long[] a,
java.lang.String delimiter) |
static java.lang.String |
join(java.lang.Object[] a) |
static java.lang.String |
join(java.lang.Object[] a,
char delimiter) |
static java.lang.String |
join(java.lang.Object[] a,
int fromIndex,
int toIndex,
char delimiter) |
static java.lang.String |
join(java.lang.Object[] a,
int fromIndex,
int toIndex,
char delimiter,
boolean trim) |
static java.lang.String |
join(java.lang.Object[] a,
int fromIndex,
int toIndex,
java.lang.String delimiter) |
static java.lang.String |
join(java.lang.Object[] a,
int fromIndex,
int toIndex,
java.lang.String delimiter,
boolean trim) |
static java.lang.String |
join(java.lang.Object[] a,
java.lang.String delimiter) |
static java.lang.String |
join(short[] a) |
static java.lang.String |
join(short[] a,
char delimiter) |
static java.lang.String |
join(short[] a,
int fromIndex,
int toIndex,
char delimiter) |
static java.lang.String |
join(short[] a,
int fromIndex,
int toIndex,
java.lang.String delimiter) |
static java.lang.String |
join(short[] a,
java.lang.String delimiter) |
static java.lang.String |
json2XML(java.lang.Class<?> cls,
java.lang.String json) |
static java.lang.String |
json2XML(java.lang.String json) |
static byte |
kthLargest(byte[] a,
int k) |
static byte |
kthLargest(byte[] a,
int from,
int to,
int k) |
static char |
kthLargest(char[] a,
int k) |
static char |
kthLargest(char[] a,
int from,
int to,
int k) |
static <T extends java.lang.Comparable<T>> |
kthLargest(java.util.Collection<? extends T> c,
int k) |
static <T> T |
kthLargest(java.util.Collection<? extends T> c,
int k,
java.util.Comparator<? super T> cmp) |
static <T extends java.lang.Comparable<T>> |
kthLargest(java.util.Collection<? extends T> c,
int from,
int to,
int k) |
static <T> T |
kthLargest(java.util.Collection<? extends T> c,
int from,
int to,
int k,
java.util.Comparator<? super T> cmp) |
static double |
kthLargest(double[] a,
int k) |
static double |
kthLargest(double[] a,
int from,
int to,
int k) |
static float |
kthLargest(float[] a,
int k) |
static float |
kthLargest(float[] a,
int from,
int to,
int k) |
static int |
kthLargest(int[] a,
int k) |
static int |
kthLargest(int[] a,
int from,
int to,
int k) |
static long |
kthLargest(long[] a,
int k) |
static long |
kthLargest(long[] a,
int from,
int to,
int k) |
static short |
kthLargest(short[] a,
int k) |
static short |
kthLargest(short[] a,
int from,
int to,
int k) |
static <T extends java.lang.Comparable<T>> |
kthLargest(T[] a,
int k) |
static <T> T |
kthLargest(T[] a,
int k,
java.util.Comparator<? super T> cmp) |
static <T extends java.lang.Comparable<T>> |
kthLargest(T[] a,
int from,
int to,
int k) |
static <T> T |
kthLargest(T[] a,
int from,
int to,
int k,
java.util.Comparator<? super T> cmp) |
static int |
lastIndexOf(boolean[] a,
boolean e) |
static int |
lastIndexOf(boolean[] a,
int fromIndex,
boolean e) |
static int |
lastIndexOf(byte[] a,
byte e) |
static int |
lastIndexOf(byte[] a,
int fromIndex,
byte e) |
static int |
lastIndexOf(char[] a,
char e) |
static int |
lastIndexOf(char[] a,
int fromIndex,
char e) |
static int |
lastIndexOf(double[] a,
double e) |
static int |
lastIndexOf(double[] a,
int fromIndex,
double e) |
static int |
lastIndexOf(float[] a,
float e) |
static int |
lastIndexOf(float[] a,
int fromIndex,
float e) |
static int |
lastIndexOf(int[] a,
int e) |
static int |
lastIndexOf(int[] a,
int fromIndex,
int e) |
static int |
lastIndexOf(java.util.List<?> list,
int fromIndex,
java.lang.Object e) |
static int |
lastIndexOf(java.util.List<?> list,
java.lang.Object e) |
static int |
lastIndexOf(long[] a,
int fromIndex,
long e) |
static int |
lastIndexOf(long[] a,
long e) |
static int |
lastIndexOf(java.lang.Object[] a,
int fromIndex,
java.lang.Object e) |
static int |
lastIndexOf(java.lang.Object[] a,
java.lang.Object e) |
static int |
lastIndexOf(short[] a,
int fromIndex,
short e) |
static int |
lastIndexOf(short[] a,
short e) |
static int |
lastIndexOf(java.lang.String str,
int targetChar) |
static int |
lastIndexOf(java.lang.String str,
int fromIndex,
int targetChar)
Returns the index within this string of the last occurrence of the
specified character, searching backward starting at the specified index.
|
static int |
lastIndexOf(java.lang.String str,
int fromIndex,
java.lang.String substr)
Returns the index within
str of the last occurrence of the
specified substr , searching backward starting at the
specified index. |
static int |
lastIndexOf(java.lang.String str,
int fromIndex,
java.lang.String substr,
java.lang.String delimiter) |
static int |
lastIndexOf(java.lang.String str,
java.lang.String substr) |
static int |
lastIndexOf(java.lang.String str,
java.lang.String substr,
java.lang.String delimiter) |
static int |
lastIndexOfAny(java.lang.String str,
char... chs) |
static int |
lastIndexOfAny(java.lang.String str,
java.lang.String... substrs) |
static int |
lastIndexOfIgnoreCase(java.lang.String str,
int fromIndex,
java.lang.String substr) |
static int |
lastIndexOfIgnoreCase(java.lang.String str,
java.lang.String substr) |
static int |
lastIndexOfSubList(java.util.List<?> sourceList,
java.util.List<?> targetSubList) |
static <T> Optional<T> |
lastNonNull(java.util.Collection<T> c) |
static <T> Optional<T> |
lastNonNull(T... a) |
static <T> Optional<T> |
lastNonNull(T a,
T b) |
static <T> Optional<T> |
lastNonNull(T a,
T b,
T c) |
static int |
lastOrdinalIndexOf(java.lang.String str,
java.lang.String substr,
int ordinal)
Finds the n-th last index within a String, handling
null . |
static <T,R,E extends java.lang.Exception> |
map(java.util.Collection<? extends T> c,
int fromIndex,
int toIndex,
Try.Function<? super T,? extends R,E> func)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <T,R,C extends java.util.Collection<R>,E extends java.lang.Exception> |
map(java.util.Collection<? extends T> c,
int fromIndex,
int toIndex,
Try.Function<? super T,? extends R,E> func,
IntFunction<C> supplier)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <T,R,E extends java.lang.Exception> |
map(java.util.Collection<? extends T> c,
Try.Function<? super T,? extends R,E> func) |
static <T,R,C extends java.util.Collection<R>,E extends java.lang.Exception> |
map(java.util.Collection<? extends T> c,
Try.Function<? super T,? extends R,E> func,
IntFunction<C> supplier) |
static <T,R,E extends java.lang.Exception> |
map(T[] a,
int fromIndex,
int toIndex,
Try.Function<? super T,? extends R,E> func)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <T,R,C extends java.util.Collection<R>,E extends java.lang.Exception> |
map(T[] a,
int fromIndex,
int toIndex,
Try.Function<? super T,? extends R,E> func,
IntFunction<C> supplier)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <T,R,E extends java.lang.Exception> |
map(T[] a,
Try.Function<? super T,? extends R,E> func) |
static <T,R,C extends java.util.Collection<R>,E extends java.lang.Exception> |
map(T[] a,
Try.Function<? super T,? extends R,E> func,
IntFunction<C> supplier) |
static <T,E extends java.lang.Exception> |
mapToBoolean(java.util.Collection<? extends T> c,
int fromIndex,
int toIndex,
Try.ToBooleanFunction<? super T,E> func)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <T,E extends java.lang.Exception> |
mapToBoolean(java.util.Collection<? extends T> c,
Try.ToBooleanFunction<? super T,E> func) |
static <T,E extends java.lang.Exception> |
mapToBoolean(T[] a,
int fromIndex,
int toIndex,
Try.ToBooleanFunction<? super T,E> func)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <T,E extends java.lang.Exception> |
mapToBoolean(T[] a,
Try.ToBooleanFunction<? super T,E> func) |
static <T,E extends java.lang.Exception> |
mapToByte(java.util.Collection<? extends T> c,
int fromIndex,
int toIndex,
Try.ToByteFunction<? super T,E> func)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <T,E extends java.lang.Exception> |
mapToByte(java.util.Collection<? extends T> c,
Try.ToByteFunction<? super T,E> func) |
static <T,E extends java.lang.Exception> |
mapToByte(T[] a,
int fromIndex,
int toIndex,
Try.ToByteFunction<? super T,E> func)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <T,E extends java.lang.Exception> |
mapToByte(T[] a,
Try.ToByteFunction<? super T,E> func) |
static <T,E extends java.lang.Exception> |
mapToChar(java.util.Collection<? extends T> c,
int fromIndex,
int toIndex,
Try.ToCharFunction<? super T,E> func)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <T,E extends java.lang.Exception> |
mapToChar(java.util.Collection<? extends T> c,
Try.ToCharFunction<? super T,E> func) |
static <T,E extends java.lang.Exception> |
mapToChar(T[] a,
int fromIndex,
int toIndex,
Try.ToCharFunction<? super T,E> func)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <T,E extends java.lang.Exception> |
mapToChar(T[] a,
Try.ToCharFunction<? super T,E> func) |
static <T,E extends java.lang.Exception> |
mapToDouble(java.util.Collection<? extends T> c,
int fromIndex,
int toIndex,
Try.ToDoubleFunction<? super T,E> func)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <T,E extends java.lang.Exception> |
mapToDouble(java.util.Collection<? extends T> c,
Try.ToDoubleFunction<? super T,E> func) |
static <T,E extends java.lang.Exception> |
mapToDouble(T[] a,
int fromIndex,
int toIndex,
Try.ToDoubleFunction<? super T,E> func)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <T,E extends java.lang.Exception> |
mapToDouble(T[] a,
Try.ToDoubleFunction<? super T,E> func) |
static <T,E extends java.lang.Exception> |
mapToFloat(java.util.Collection<? extends T> c,
int fromIndex,
int toIndex,
Try.ToFloatFunction<? super T,E> func)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <T,E extends java.lang.Exception> |
mapToFloat(java.util.Collection<? extends T> c,
Try.ToFloatFunction<? super T,E> func) |
static <T,E extends java.lang.Exception> |
mapToFloat(T[] a,
int fromIndex,
int toIndex,
Try.ToFloatFunction<? super T,E> func)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <T,E extends java.lang.Exception> |
mapToFloat(T[] a,
Try.ToFloatFunction<? super T,E> func) |
static <T,E extends java.lang.Exception> |
mapToInt(java.util.Collection<? extends T> c,
int fromIndex,
int toIndex,
Try.ToIntFunction<? super T,E> func)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <T,E extends java.lang.Exception> |
mapToInt(java.util.Collection<? extends T> c,
Try.ToIntFunction<? super T,E> func) |
static <T,E extends java.lang.Exception> |
mapToInt(T[] a,
int fromIndex,
int toIndex,
Try.ToIntFunction<? super T,E> func)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <T,E extends java.lang.Exception> |
mapToInt(T[] a,
Try.ToIntFunction<? super T,E> func) |
static <T,E extends java.lang.Exception> |
mapToLong(java.util.Collection<? extends T> c,
int fromIndex,
int toIndex,
Try.ToLongFunction<? super T,E> func)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <T,E extends java.lang.Exception> |
mapToLong(java.util.Collection<? extends T> c,
Try.ToLongFunction<? super T,E> func) |
static <T,E extends java.lang.Exception> |
mapToLong(T[] a,
int fromIndex,
int toIndex,
Try.ToLongFunction<? super T,E> func)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <T,E extends java.lang.Exception> |
mapToLong(T[] a,
Try.ToLongFunction<? super T,E> func) |
static <T,E extends java.lang.Exception> |
mapToShort(java.util.Collection<? extends T> c,
int fromIndex,
int toIndex,
Try.ToShortFunction<? super T,E> func)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <T,E extends java.lang.Exception> |
mapToShort(java.util.Collection<? extends T> c,
Try.ToShortFunction<? super T,E> func) |
static <T,E extends java.lang.Exception> |
mapToShort(T[] a,
int fromIndex,
int toIndex,
Try.ToShortFunction<? super T,E> func)
Mostly it's designed for one-step operation to complete the operation in one step.
|
static <T,E extends java.lang.Exception> |
mapToShort(T[] a,
Try.ToShortFunction<? super T,E> func) |
static byte |
max(byte... a)
Returns the maximum value in an array.
|
static byte |
max(byte[] a,
int from,
int to) |
static byte |
max(byte a,
byte b)
Gets the maximum of two
byte values. |
static byte |
max(byte a,
byte b,
byte c)
Gets the maximum of three
byte values. |
static char |
max(char... a)
Returns the maximum value in an array.
|
static char |
max(char[] a,
int from,
int to) |
static char |
max(char a,
char b)
Gets the maximum of two
char values. |
static char |
max(char a,
char b,
char c)
Gets the maximum of three
char values. |
static <T extends java.lang.Comparable<? super T>> |
max(java.util.Collection<? extends T> c) |
static <T> T |
max(java.util.Collection<? extends T> c,
java.util.Comparator<? super T> cmp) |
static <T extends java.lang.Comparable<? super T>> |
max(java.util.Collection<? extends T> c,
int from,
int to) |
static <T> T |
max(java.util.Collection<? extends T> c,
int from,
int to,
java.util.Comparator<? super T> cmp)
Returns the maximum element in the collection.
|
static double |
max(double... a)
Returns the maximum value in an array.
|
static double |
max(double[] a,
int from,
int to) |
static double |
max(double a,
double b)
Gets the maximum of two
double values. |
static double |
max(double a,
double b,
double c)
Gets the maximum of three
double values. |
static float |
max(float... a)
Returns the maximum value in an array.
|
static float |
max(float[] a,
int from,
int to) |
static float |
max(float a,
float b)
Gets the maximum of two
float values. |
static float |
max(float a,
float b,
float c)
Gets the maximum of three
float values. |
static int |
max(int... a)
Returns the maximum value in an array.
|
static int |
max(int[] a,
int from,
int to) |
static int |
max(int a,
int b)
Gets the maximum of two
int values. |
static int |
max(int a,
int b,
int c)
Gets the maximum of three
int values. |
static long |
max(long... a)
Returns the maximum value in an array.
|
static long |
max(long[] a,
int from,
int to) |
static long |
max(long a,
long b)
Gets the maximum of two
long values. |
static long |
max(long a,
long b,
long c)
Gets the maximum of three
long values. |
static short |
max(short... a)
Returns the maximum value in an array.
|
static short |
max(short[] a,
int from,
int to) |
static short |
max(short a,
short b)
Gets the maximum of two
short values. |
static short |
max(short a,
short b,
short c)
Gets the maximum of three
short values. |
static <T extends java.lang.Comparable<? super T>> |
max(T[] a)
Returns the maximum element in the array.
|
static <T> T |
max(T[] a,
java.util.Comparator<? super T> cmp)
Returns the maximum element in the array.
|
static <T extends java.lang.Comparable<? super T>> |
max(T[] a,
int from,
int to) |
static <T> T |
max(T[] a,
int from,
int to,
java.util.Comparator<? super T> cmp) |
static <T extends java.lang.Comparable<? super T>> |
max(T a,
T b) |
static <T> T |
max(T a,
T b,
java.util.Comparator<? super T> cmp) |
static <T extends java.lang.Comparable<? super T>> |
max(T a,
T b,
T c) |
static <T> T |
max(T a,
T b,
T c,
java.util.Comparator<? super T> cmp) |
static <T extends java.lang.Comparable<T>> |
maxAll(java.util.Collection<T> c) |
static <T> java.util.List<T> |
maxAll(java.util.Collection<T> c,
java.util.Comparator<? super T> cmp) |
static <T extends java.lang.Comparable<T>> |
maxAll(T[] a) |
static <T> java.util.List<T> |
maxAll(T[] a,
java.util.Comparator<? super T> cmp) |
static byte |
median(byte... a)
Returns the
length / 2 + 1 largest value in the specified array. |
static byte |
median(byte[] a,
int from,
int to) |
static byte |
median(byte a,
byte b,
byte c)
Gets the median of three values.
|
static char |
median(char... a)
Returns the
length / 2 + 1 largest value in the specified array. |
static char |
median(char[] a,
int from,
int to) |
static char |
median(char a,
char b,
char c)
Gets the median of three values.
|
static <T extends java.lang.Comparable<? super T>> |
median(java.util.Collection<? extends T> c)
Returns the
length / 2 + 1 largest value in the specified array. |
static <T> T |
median(java.util.Collection<? extends T> c,
java.util.Comparator<? super T> cmp)
Returns the
length / 2 + 1 largest value in the specified array. |
static <T extends java.lang.Comparable<? super T>> |
median(java.util.Collection<? extends T> c,
int from,
int to) |
static <T> T |
median(java.util.Collection<? extends T> c,
int from,
int to,
java.util.Comparator<? super T> cmp) |
static double |
median(double... a)
Returns the
length / 2 + 1 largest value in the specified array. |
static double |
median(double[] a,
int from,
int to) |
static double |
median(double a,
double b,
double c)
Gets the median of three values.
|
static float |
median(float... a)
Returns the
length / 2 + 1 largest value in the specified array. |
static float |
median(float[] a,
int from,
int to) |
static float |
median(float a,
float b,
float c)
Gets the median of three values.
|
static int |
median(int... a)
Returns the
length / 2 + 1 largest value in the specified array. |
static int |
median(int[] a,
int from,
int to) |
static int |
median(int a,
int b,
int c)
Gets the median of three values.
|
static long |
median(long... a)
Returns the
length / 2 + 1 largest value in the specified array. |
static long |
median(long[] a,
int from,
int to) |
static long |
median(long a,
long b,
long c)
Gets the median of three values.
|
static short |
median(short... a)
Returns the
length / 2 + 1 largest value in the specified array. |
static short |
median(short[] a,
int from,
int to) |
static short |
median(short a,
short b,
short c)
Gets the median of three values.
|
static <T extends java.lang.Comparable<? super T>> |
median(T[] a)
Returns the
length / 2 + 1 largest value in the specified array. |
static <T> T |
median(T[] a,
java.util.Comparator<? super T> cmp)
Returns the
length / 2 + 1 largest value in the specified array. |
static <T extends java.lang.Comparable<? super T>> |
median(T[] a,
int from,
int to) |
static <T> T |
median(T[] a,
int from,
int to,
java.util.Comparator<? super T> cmp) |
static <T extends java.lang.Comparable<? super T>> |
median(T a,
T b,
T c)
Gets the median of three values.
|
static <T> T |
median(T a,
T b,
T c,
java.util.Comparator<? super T> cmp)
Gets the median of three values.
|
static <T,E extends java.lang.Exception> |
merge(java.util.Collection<? extends T> a,
java.util.Collection<? extends T> b,
Try.BiFunction<? super T,? super T,com.landawn.abacus.util.Nth,E> nextSelector) |
static void |
merge(java.lang.Object sourceEntity,
java.lang.Object targetEntity) |
static void |
merge(java.lang.Object sourceEntity,
java.lang.Object targetEntity,
java.util.Collection<java.lang.String> selectPropNames)
Set all the signed properties(including all primitive type properties) in
the specified
sourceEntity to the specified targetEntity . |
static <T,E extends java.lang.Exception> |
merge(T[] a,
T[] b,
Try.BiFunction<? super T,? super T,com.landawn.abacus.util.Nth,E> nextSelector) |
static byte |
min(byte... a)
Returns the minimum value in an array.
|
static byte |
min(byte[] a,
int from,
int to) |
static byte |
min(byte a,
byte b)
Gets the minimum of two
byte values. |
static byte |
min(byte a,
byte b,
byte c)
Gets the minimum of three
byte values. |
static char |
min(char... a)
Returns the minimum value in an array.
|
static char |
min(char[] a,
int from,
int to) |
static char |
min(char a,
char b)
Gets the minimum of two
char values. |
static char |
min(char a,
char b,
char c)
Gets the minimum of three
char values. |
static <T extends java.lang.Comparable<? super T>> |
min(java.util.Collection<? extends T> c) |
static <T> T |
min(java.util.Collection<? extends T> c,
java.util.Comparator<? super T> cmp) |
static <T extends java.lang.Comparable<? super T>> |
min(java.util.Collection<? extends T> c,
int from,
int to) |
static <T> T |
min(java.util.Collection<? extends T> c,
int from,
int to,
java.util.Comparator<? super T> cmp)
Returns the minimum element in the collection.
|
static double |
min(double... a)
Returns the minimum value in an array.
|
static double |
min(double[] a,
int from,
int to) |
static double |
min(double a,
double b)
Gets the minimum of two
double values. |
static double |
min(double a,
double b,
double c)
Gets the minimum of three
double values. |
static float |
min(float... a)
Returns the minimum value in an array.
|
static float |
min(float[] a,
int from,
int to) |
static float |
min(float a,
float b)
Gets the minimum of two
float values. |
static float |
min(float a,
float b,
float c)
Gets the minimum of three
float values. |
static int |
min(int... a)
Returns the minimum value in an array.
|
static int |
min(int[] a,
int from,
int to) |
static int |
min(int a,
int b)
Gets the minimum of two
int values. |
static int |
min(int a,
int b,
int c)
Gets the minimum of three
int values. |
static long |
min(long... a)
Returns the minimum value in an array.
|
static long |
min(long[] a,
int from,
int to) |
static long |
min(long a,
long b)
Gets the minimum of two
long values. |
static long |
min(long a,
long b,
long c)
Gets the minimum of three
long values. |
static short |
min(short... a)
Returns the minimum value in an array.
|
static short |
min(short[] a,
int from,
int to) |
static short |
min(short a,
short b)
Gets the minimum of two
short values. |
static short |
min(short a,
short b,
short c)
Gets the minimum of three
short values. |
static <T extends java.lang.Comparable<? super T>> |
min(T[] a)
Returns the minimum element in the array.
|
static <T> T |
min(T[] a,
java.util.Comparator<? super T> cmp)
Returns the minimum element in the array.
|
static <T extends java.lang.Comparable<? super T>> |
min(T[] a,
int from,
int to) |
static <T> T |
min(T[] a,
int from,
int to,
java.util.Comparator<? super T> cmp) |
static <T extends java.lang.Comparable<? super T>> |
min(T a,
T b) |
static <T> T |
min(T a,
T b,
java.util.Comparator<? super T> cmp) |
static <T extends java.lang.Comparable<? super T>> |
min(T a,
T b,
T c) |
static <T> T |
min(T a,
T b,
T c,
java.util.Comparator<? super T> cmp) |
static <T extends java.lang.Comparable<T>> |
minAll(java.util.Collection<T> c) |
static <T> java.util.List<T> |
minAll(java.util.Collection<T> c,
java.util.Comparator<? super T> cmp) |
static <T extends java.lang.Comparable<T>> |
minAll(T[] a) |
static <T> java.util.List<T> |
minAll(T[] a,
java.util.Comparator<? super T> cmp) |
static <T> T |
newArray(java.lang.Class<?> componentType,
int length)
Method newArray.
|
static <T> java.util.ArrayDeque<T> |
newArrayDeque() |
static <E> java.util.ArrayDeque<E> |
newArrayDeque(java.util.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> java.util.ArrayDeque<T> |
newArrayDeque(int numElements)
Constructs an empty array deque with an initial capacity sufficient to hold the specified number of elements.
|
static <T> java.util.ArrayList<T> |
newArrayList() |
static <T> java.util.ArrayList<T> |
newArrayList(java.util.Collection<? extends T> c) |
static <T> java.util.ArrayList<T> |
newArrayList(int initialCapacity) |
static <K,V> java.util.concurrent.ConcurrentHashMap<K,V> |
newConcurrentHashMap() |
static <K,V> java.util.concurrent.ConcurrentHashMap<K,V> |
newConcurrentHashMap(int initialCapacity) |
static <K,V> java.util.concurrent.ConcurrentHashMap<K,V> |
newConcurrentHashMap(java.util.Map<? extends K,? extends V> m) |
static <T> DataSet |
newDataSet(java.util.Collection<java.lang.String> columnNames,
java.util.Collection<T> rowList)
Converts a list of row(which can be: Map/Entity/Array/Collection) into a
DataSet . |
static <T> DataSet |
newDataSet(java.util.Collection<T> rows)
Converts a list of row(which can be: Map/Entity/Array/Collection) into a
DataSet . |
static DataSet |
newDataSet(java.lang.String keyColumnName,
java.lang.String valueColumnName,
java.util.Map<?,?> m)
Convert the specified Map to a two columns
DataSet : one column is for keys and one column is for values |
static DataSet |
newEmptyDataSet() |
static <T> T |
newEntity(java.lang.Class<T> cls) |
static <T> T |
newEntity(java.lang.Class<T> cls,
java.lang.String entityName) |
static <K,V> java.util.HashMap<K,V> |
newHashMap() |
static <K,V,E extends java.lang.Exception> |
newHashMap(java.util.Collection<? extends V> c,
Try.Function<? super V,? extends K,E> keyExtractor) |
static <K,V> java.util.HashMap<K,V> |
newHashMap(int initialCapacity) |
static <K,V> java.util.HashMap<K,V> |
newHashMap(java.util.Map<? extends K,? extends V> m) |
static <T> java.util.HashSet<T> |
newHashSet() |
static <T> java.util.HashSet<T> |
newHashSet(java.util.Collection<? extends T> c) |
static <T> java.util.HashSet<T> |
newHashSet(int initialCapacity) |
static <K,V> java.util.IdentityHashMap<K,V> |
newIdentityHashMap() |
static <K,V> java.util.IdentityHashMap<K,V> |
newIdentityHashMap(int initialCapacity) |
static <K,V> java.util.IdentityHashMap<K,V> |
newIdentityHashMap(java.util.Map<? extends K,? extends V> m) |
static <T> T |
newInstance(java.lang.Class<T> cls)
Method newInstance.
|
static <K,V> java.util.LinkedHashMap<K,V> |
newLinkedHashMap() |
static <K,V,E extends java.lang.Exception> |
newLinkedHashMap(java.util.Collection<? extends V> c,
Try.Function<? super V,? extends K,E> keyExtractor) |
static <K,V> java.util.LinkedHashMap<K,V> |
newLinkedHashMap(int initialCapacity) |
static <K,V> java.util.LinkedHashMap<K,V> |
newLinkedHashMap(java.util.Map<? extends K,? extends V> m) |
static <T> java.util.LinkedHashSet<T> |
newLinkedHashSet() |
static <T> java.util.LinkedHashSet<T> |
newLinkedHashSet(java.util.Collection<? extends T> c) |
static <T> java.util.LinkedHashSet<T> |
newLinkedHashSet(int initialCapacity) |
static <T> java.util.LinkedList<T> |
newLinkedList() |
static <T> java.util.LinkedList<T> |
newLinkedList(java.util.Collection<? extends T> c) |
static <K,E> ListMultimap<K,E> |
newListLinkedMultimap() |
static <K,E> ListMultimap<K,E> |
newListLinkedMultimap(int initialCapacity) |
static <K,E> ListMultimap<K,E> |
newListLinkedMultimap(java.util.Map<? extends K,? extends E> m) |
static <K,E> ListMultimap<K,E> |
newListMultimap() |
static <K,E> ListMultimap<K,E> |
newListMultimap(java.lang.Class<? extends java.util.Map> mapType) |
static <K,E> ListMultimap<K,E> |
newListMultimap(java.lang.Class<? extends java.util.Map> mapType,
java.lang.Class<? extends java.util.List> valueType) |
static <K,E> ListMultimap<K,E> |
newListMultimap(int initialCapacity) |
static <K,E> ListMultimap<K,E> |
newListMultimap(java.util.Map<? extends K,? extends E> m) |
static <K,E> ListMultimap<K,E> |
newListSortedMultimap() |
static <K,E> ListMultimap<K,E> |
newListSortedMultimap(java.util.Map<? extends K,? extends E> m) |
static <T> T |
newProxyInstance(java.lang.Class<?>[] interfaceClasses,
java.lang.reflect.InvocationHandler h)
Refer to
java.lang.reflect |
static <T> T |
newProxyInstance(java.lang.Class<T> interfaceClass,
java.lang.reflect.InvocationHandler h) |
static <E> java.util.Set<E> |
newSetFromMap(java.util.Map<E,java.lang.Boolean> map)
Returns a set backed by the specified map.
|
static <K,E> SetMultimap<K,E> |
newSetLinkedMultimap() |
static <K,E> SetMultimap<K,E> |
newSetLinkedMultimap(int initialCapacity) |
static <K,E> SetMultimap<K,E> |
newSetLinkedMultimap(java.util.Map<? extends K,? extends E> m) |
static <K,E> SetMultimap<K,E> |
newSetMultimap() |
static <K,E> SetMultimap<K,E> |
newSetMultimap(java.lang.Class<? extends java.util.Map> mapType) |
static <K,E> SetMultimap<K,E> |
newSetMultimap(java.lang.Class<? extends java.util.Map> mapType,
java.lang.Class<? extends java.util.Set> valueType) |
static <K,E> SetMultimap<K,E> |
newSetMultimap(int initialCapacity) |
static <K,E> SetMultimap<K,E> |
newSetMultimap(java.util.Map<? extends K,? extends E> m) |
static <K,E> SetMultimap<K,E> |
newSetSortedMultimap() |
static <K,E> SetMultimap<K,E> |
newSetSortedMultimap(java.util.Map<? extends K,? extends E> m) |
static <K extends java.lang.Comparable,V> |
newTreeMap() |
static <C,K extends C,V> |
newTreeMap(java.util.Comparator<C> comparator) |
static <K extends java.lang.Comparable,V> |
newTreeMap(java.util.Map<? extends K,? extends V> m) |
static <K,V> java.util.TreeMap<K,V> |
newTreeMap(java.util.SortedMap<K,? extends V> m) |
static <T extends java.lang.Comparable> |
newTreeSet() |
static <T extends java.lang.Comparable> |
newTreeSet(java.util.Collection<? extends T> c) |
static <T> java.util.TreeSet<T> |
newTreeSet(java.util.Comparator<? super T> comparator) |
static <T> java.util.TreeSet<T> |
newTreeSet(java.util.SortedSet<T> c) |
static java.lang.String |
normalizeSpace(java.lang.String str)
|
static boolean |
notNullOrEmpty(boolean[] a) |
static boolean |
notNullOrEmpty(byte[] a) |
static boolean |
notNullOrEmpty(char[] a) |
static boolean |
notNullOrEmpty(java.lang.CharSequence s) |
static boolean |
notNullOrEmpty(java.util.Collection<?> c) |
static boolean |
notNullOrEmpty(DataSet rs) |
static boolean |
notNullOrEmpty(double[] a) |
static boolean |
notNullOrEmpty(EntityId entityId) |
static boolean |
notNullOrEmpty(float[] a) |
static boolean |
notNullOrEmpty(int[] a) |
static boolean |
notNullOrEmpty(long[] a) |
static boolean |
notNullOrEmpty(LongMultiset<?> s) |
static boolean |
notNullOrEmpty(java.util.Map<?,?> m) |
static boolean |
notNullOrEmpty(Multimap<?,?,?> m) |
static boolean |
notNullOrEmpty(Multiset<?> s) |
static boolean |
notNullOrEmpty(java.lang.Object[] a) |
static boolean |
notNullOrEmpty(PrimitiveList list) |
static boolean |
notNullOrEmpty(short[] a) |
static boolean |
notNullOrEmptyOrBlank(java.lang.CharSequence s) |
static boolean[] |
nullToEmpty(boolean[] a) |
static byte[] |
nullToEmpty(byte[] a) |
static char[] |
nullToEmpty(char[] a) |
static <T> T[] |
nullToEmpty(java.lang.Class<T[]> arrayType,
T[] a) |
static double[] |
nullToEmpty(double[] a) |
static float[] |
nullToEmpty(float[] a) |
static int[] |
nullToEmpty(int[] a) |
static <T> java.util.Iterator<T> |
nullToEmpty(java.util.Iterator<T> iter)
Returns an immutable empty
Iterator if the specified Iterator is null , otherwise itself is returned. |
static <T> java.util.List<T> |
nullToEmpty(java.util.List<T> list)
Returns an immutable empty list if the specified List is
null , otherwise itself is returned. |
static <T> java.util.ListIterator<T> |
nullToEmpty(java.util.ListIterator<T> iter)
Returns an immutable empty
ListIterator if the specified ListIterator is null , otherwise itself is returned. |
static long[] |
nullToEmpty(long[] a) |
static <K,V> java.util.Map<K,V> |
nullToEmpty(java.util.Map<K,V> map)
Returns an immutable empty map if the specified Map is
null , otherwise itself is returned. |
static <K,V> java.util.NavigableMap<K,V> |
nullToEmpty(java.util.NavigableMap<K,V> map)
Returns an immutable empty
NavigableMap if the specified NavigableMap is null , otherwise itself is returned. |
static <T> java.util.NavigableSet<T> |
nullToEmpty(java.util.NavigableSet<T> set)
Returns an immutable empty
NavigableSet if the specified NavigableSet is null , otherwise itself is returned. |
static java.lang.Object[] |
nullToEmpty(java.lang.Object[] a) |
static <T> java.util.Set<T> |
nullToEmpty(java.util.Set<T> set)
Returns an immutable empty set if the specified Set is
null , otherwise itself is returned. |
static short[] |
nullToEmpty(short[] a) |
static <K,V> java.util.SortedMap<K,V> |
nullToEmpty(java.util.SortedMap<K,V> map)
Returns an immutable empty
SortedMap if the specified SortedMap is null , otherwise itself is returned. |
static <T> java.util.SortedSet<T> |
nullToEmpty(java.util.SortedSet<T> set)
Returns an immutable empty
SortedSet if the specified SortedSet is null , otherwise itself is returned. |
static java.lang.String |
nullToEmpty(java.lang.String str) |
static java.lang.String[] |
nullToEmpty(java.lang.String[] a) |
static int |
occurrencesOf(boolean[] a,
boolean objectToFind) |
static int |
occurrencesOf(byte[] a,
byte objectToFind) |
static int |
occurrencesOf(char[] a,
char objectToFind) |
static int |
occurrencesOf(java.util.Collection<?> c,
java.lang.Object objectToFind) |
static int |
occurrencesOf(double[] a,
double objectToFind) |
static int |
occurrencesOf(float[] a,
float objectToFind) |
static int |
occurrencesOf(int[] a,
int objectToFind) |
static int |
occurrencesOf(long[] a,
long objectToFind) |
static int |
occurrencesOf(java.lang.Object[] a,
java.lang.Object objectToFind) |
static int |
occurrencesOf(short[] a,
short objectToFind) |
static <E extends java.lang.Comparable<? super E>> |
orderedPermutations(java.util.Collection<E> elements)
Note: copy from Google Guava under Apache License v2.
|
static <E> java.util.Collection<java.util.List<E>> |
orderedPermutations(java.util.Collection<E> elements,
java.util.Comparator<? super E> comparator)
Note: copy from Google Guava under Apache License v2.
|
static int |
ordinalIndexOf(java.lang.String str,
java.lang.String substr,
int ordinal)
Finds the n-th index within a String, handling
null . |
static java.lang.String |
padEnd(java.lang.String str,
int minLength) |
static java.lang.String |
padEnd(java.lang.String str,
int minLength,
char padChar) |
static java.lang.String |
padEnd(java.lang.String str,
int minLength,
java.lang.String padStr) |
static java.lang.String |
padStart(java.lang.String str,
int minLength) |
static java.lang.String |
padStart(java.lang.String str,
int minLength,
char padChar) |
static java.lang.String |
padStart(java.lang.String str,
int minLength,
java.lang.String padStr) |
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 <T extends java.lang.Comparable<? super T>> |
parallelSort(java.util.List<? extends T> c) |
static <T> void |
parallelSort(java.util.List<? extends T> c,
java.util.Comparator<? super T> cmp) |
static <T extends java.lang.Comparable<? super T>> |
parallelSort(java.util.List<? extends T> c,
int fromIndex,
int toIndex) |
static <T> void |
parallelSort(java.util.List<? extends T> c,
int fromIndex,
int toIndex,
java.util.Comparator<? super T> cmp) |
static void |
parallelSort(long[] a) |
static void |
parallelSort(long[] a,
int fromIndex,
int toIndex) |
static void |
parallelSort(java.lang.Object[] a) |
static void |
parallelSort(java.lang.Object[] a,
int fromIndex,
int toIndex) |
static void |
parallelSort(short[] a) |
static void |
parallelSort(short[] a,
int fromIndex,
int toIndex) |
static <T> void |
parallelSort(T[] a,
java.util.Comparator<? super T> cmp) |
static <T> void |
parallelSort(T[] a,
int fromIndex,
int toIndex,
java.util.Comparator<? super T> cmp) |
static <T,E extends java.lang.Exception> |
parse(java.util.Collection<? extends java.util.Iterator<? extends T>> iterators,
int readThreadNum,
int processThreadNum,
int queueSize,
Try.Consumer<? super T,E> elementParser) |
static <T,E extends java.lang.Exception,E2 extends java.lang.Exception> |
parse(java.util.Collection<? extends java.util.Iterator<? extends T>> iterators,
int readThreadNum,
int processThreadNum,
int queueSize,
Try.Consumer<? super T,E> elementParser,
Try.Runnable<E2> onComplete) |
static <T,E extends java.lang.Exception> |
parse(java.util.Collection<? extends java.util.Iterator<? extends T>> iterators,
long offset,
long count,
int readThreadNum,
int processThreadNum,
int queueSize,
Try.Consumer<? super T,E> elementParser) |
static <T,E extends java.lang.Exception,E2 extends java.lang.Exception> |
parse(java.util.Collection<? extends java.util.Iterator<? extends T>> iterators,
long offset,
long count,
int readThreadNum,
int processThreadNum,
int queueSize,
Try.Consumer<? super T,E> elementParser,
Try.Runnable<E2> onComplete)
Parse the elements in the specified iterators one by one.
|
static <T,E extends java.lang.Exception> |
parse(java.util.Collection<? extends java.util.Iterator<? extends T>> iterators,
long offset,
long count,
Try.Consumer<? super T,E> elementParser) |
static <T,E extends java.lang.Exception,E2 extends java.lang.Exception> |
parse(java.util.Collection<? extends java.util.Iterator<? extends T>> iterators,
long offset,
long count,
Try.Consumer<? super T,E> elementParser,
Try.Runnable<E2> onComplete) |
static <T,E extends java.lang.Exception> |
parse(java.util.Collection<? extends java.util.Iterator<? extends T>> iterators,
Try.Consumer<? super T,E> elementParser) |
static <T,E extends java.lang.Exception,E2 extends java.lang.Exception> |
parse(java.util.Collection<? extends java.util.Iterator<? extends T>> iterators,
Try.Consumer<? super T,E> elementParser,
Try.Runnable<E2> onComplete) |
static <T,E extends java.lang.Exception> |
parse(java.util.Iterator<? extends T> iter,
long offset,
long count,
int processThreadNum,
int queueSize,
Try.Consumer<? super T,E> elementParser) |
static <T,E extends java.lang.Exception,E2 extends java.lang.Exception> |
parse(java.util.Iterator<? extends T> iter,
long offset,
long count,
int processThreadNum,
int queueSize,
Try.Consumer<? super T,E> elementParser,
Try.Runnable<E2> onComplete)
Parse the elements in the specified iterators one by one.
|
static <T,E extends java.lang.Exception> |
parse(java.util.Iterator<? extends T> iter,
long offset,
long count,
Try.Consumer<? super T,E> elementParser) |
static <T,E extends java.lang.Exception,E2 extends java.lang.Exception> |
parse(java.util.Iterator<? extends T> iter,
long offset,
long count,
Try.Consumer<? super T,E> elementParser,
Try.Runnable<E2> onComplete) |
static <T,E extends java.lang.Exception> |
parse(java.util.Iterator<? extends T> iter,
Try.Consumer<? super T,E> elementParser) |
static <T,E extends java.lang.Exception,E2 extends java.lang.Exception> |
parse(java.util.Iterator<? extends T> iter,
Try.Consumer<? super T,E> elementParser,
Try.Runnable<E2> onComplete) |
static java.util.Map<com.landawn.abacus.util.Percentage,java.lang.Byte> |
percentiles(byte[] sortedArray)
Returns the elements at:
Percentage * length of the specified array. |
static java.util.Map<com.landawn.abacus.util.Percentage,java.lang.Character> |
percentiles(char[] sortedArray)
Returns the elements at:
Percentage * length of the specified array. |
static java.util.Map<com.landawn.abacus.util.Percentage,java.lang.Double> |
percentiles(double[] sortedArray)
Returns the elements at:
Percentage * length of the specified array. |
static java.util.Map<com.landawn.abacus.util.Percentage,java.lang.Float> |
percentiles(float[] sortedArray)
Returns the elements at:
Percentage * length of the specified array. |
static java.util.Map<com.landawn.abacus.util.Percentage,java.lang.Integer> |
percentiles(int[] sortedArray)
Returns the elements at:
Percentage * length of the specified array. |
static <T> java.util.Map<com.landawn.abacus.util.Percentage,T> |
percentiles(java.util.List<T> sortedList)
Returns the elements at:
Percentage * length of the specified array. |
static java.util.Map<com.landawn.abacus.util.Percentage,java.lang.Long> |
percentiles(long[] sortedArray)
Returns the elements at:
Percentage * length of the specified array. |
static java.util.Map<com.landawn.abacus.util.Percentage,java.lang.Short> |
percentiles(short[] sortedArray)
Returns the elements at:
Percentage * length of the specified array. |
static <T> java.util.Map<com.landawn.abacus.util.Percentage,T> |
percentiles(T[] sortedArray)
Returns the elements at:
Percentage * length of the specified array. |
static <E> java.util.Collection<java.util.List<E>> |
permutations(java.util.Collection<E> elements)
Note: copy from Google Guava under Apache License v2.
|
static <E> java.util.Set<java.util.Set<E>> |
powerSet(java.util.Set<E> set)
Note: copy from Google Guava under Apache License v2.
|
static java.lang.String |
prependIfMissing(java.lang.String str,
java.lang.String prefix) |
static java.lang.Class<?> |
primitiveOf(java.lang.Class<?> primitiveWrapperClass) |
static <T> T |
println(T obj) |
static java.lang.String |
quoteEscaped(java.lang.String str)
Replace ''' or '"' with '\'' or '\"' if the previous char of the
quotation is not '\'.
|
static boolean[] |
remove(boolean[] a,
boolean element)
Removes the first occurrence of the specified element from the specified
array.
|
static byte[] |
remove(byte[] a,
byte element)
Removes the first occurrence of the specified element from the specified
array.
|
static char[] |
remove(char[] a,
char element)
Removes the first occurrence of the specified element from the specified
array.
|
static double[] |
remove(double[] a,
double element)
Removes the first occurrence of the specified element from the specified
array.
|
static float[] |
remove(float[] a,
float element)
Removes the first occurrence of the specified element from the specified
array.
|
static int[] |
remove(int[] a,
int element)
Removes the first occurrence of the specified element from the specified
array.
|
static long[] |
remove(long[] a,
long element)
Removes the first occurrence of the specified element from the specified
array.
|
static short[] |
remove(short[] a,
short element)
Removes the first occurrence of the specified element from the specified
array.
|
static <T> T[] |
remove(T[] a,
java.lang.Object element)
Removes the first occurrence of the specified element from the specified
array.
|
static boolean[] |
removeAll(boolean[] a,
boolean... elements)
Returns a new array with removes all the occurrences of specified elements from
a |
static byte[] |
removeAll(byte[] a,
byte... elements)
Returns a new array with removes all the occurrences of specified elements from
a |
static char[] |
removeAll(char[] a,
char... elements)
Returns a new array with removes all the occurrences of specified elements from
a |
static boolean |
removeAll(java.util.Collection<?> c,
java.lang.Object... elements) |
static double[] |
removeAll(double[] a,
double... elements)
Returns a new array with removes all the occurrences of specified elements from
a |
static float[] |
removeAll(float[] a,
float... elements)
Returns a new array with removes all the occurrences of specified elements from
a |
static int[] |
removeAll(int[] a,
int... elements)
Returns a new array with removes all the occurrences of specified elements from
a |
static long[] |
removeAll(long[] a,
long... elements)
Returns a new array with removes all the occurrences of specified elements from
a |
static short[] |
removeAll(short[] a,
short... elements)
Returns a new array with removes all the occurrences of specified elements from
a |
static java.lang.String |
removeAll(java.lang.String str,
char removeChar)
Removes all occurrences of a character from within the source string.
|
static java.lang.String |
removeAll(java.lang.String str,
int fromIndex,
char removeChar) |
static java.lang.String |
removeAll(java.lang.String str,
int fromIndex,
java.lang.String removeStr) |
static java.lang.String |
removeAll(java.lang.String str,
java.lang.String removeStr)
Removes all occurrences of a substring from within the source string.
|
static <T> T[] |
removeAll(T[] a,
java.lang.Object... elements)
Returns a new array with removes all the occurrences of specified elements from
a |
static boolean[] |
removeAllOccurrences(boolean[] a,
boolean element)
Removes all the occurrences of the specified element from the specified
array.
|
static byte[] |
removeAllOccurrences(byte[] a,
byte element)
Removes all the occurrences of the specified element from the specified
array.
|
static char[] |
removeAllOccurrences(char[] a,
char element)
Removes all the occurrences of the specified element from the specified
array.
|
static boolean |
removeAllOccurrences(java.util.Collection<?> c,
java.lang.Object element) |
static double[] |
removeAllOccurrences(double[] a,
double element)
Removes all the occurrences of the specified element from the specified
array.
|
static float[] |
removeAllOccurrences(float[] a,
float element)
Removes all the occurrences of the specified element from the specified
array.
|
static int[] |
removeAllOccurrences(int[] a,
int element)
Removes all the occurrences of the specified element from the specified
array.
|
static long[] |
removeAllOccurrences(long[] a,
long element)
Removes all the occurrences of the specified element from the specified
array.
|
static short[] |
removeAllOccurrences(short[] a,
short element)
Removes all the occurrences of the specified element from the specified
array.
|
static <T> T[] |
removeAllOccurrences(T[] a,
java.lang.Object element)
Removes all the occurrences of the specified element from the specified
array.
|
static boolean[] |
removeDuplicates(boolean[] a) |
static boolean[] |
removeDuplicates(boolean[] a,
boolean isSorted) |
static boolean[] |
removeDuplicates(boolean[] a,
int from,
int to,
boolean isSorted) |
static byte[] |
removeDuplicates(byte[] a) |
static byte[] |
removeDuplicates(byte[] a,
boolean isSorted) |
static byte[] |
removeDuplicates(byte[] a,
int from,
int to,
boolean isSorted) |
static char[] |
removeDuplicates(char[] a) |
static char[] |
removeDuplicates(char[] a,
boolean isSorted) |
static char[] |
removeDuplicates(char[] a,
int from,
int to,
boolean isSorted) |
static boolean |
removeDuplicates(java.util.Collection<?> c) |
static boolean |
removeDuplicates(java.util.Collection<?> c,
boolean isSorted) |
static double[] |
removeDuplicates(double[] a) |
static double[] |
removeDuplicates(double[] a,
boolean isSorted) |
static double[] |
removeDuplicates(double[] a,
int from,
int to,
boolean isSorted) |
static float[] |
removeDuplicates(float[] a) |
static float[] |
removeDuplicates(float[] a,
boolean isSorted) |
static float[] |
removeDuplicates(float[] a,
int from,
int to,
boolean isSorted) |
static int[] |
removeDuplicates(int[] a) |
static int[] |
removeDuplicates(int[] a,
boolean isSorted) |
static int[] |
removeDuplicates(int[] a,
int from,
int to,
boolean isSorted) |
static long[] |
removeDuplicates(long[] a) |
static long[] |
removeDuplicates(long[] a,
boolean isSorted) |
static long[] |
removeDuplicates(long[] a,
int from,
int to,
boolean isSorted) |
static short[] |
removeDuplicates(short[] a) |
static short[] |
removeDuplicates(short[] a,
boolean isSorted) |
static short[] |
removeDuplicates(short[] a,
int from,
int to,
boolean isSorted) |
static <T> T[] |
removeDuplicates(T[] a)
Removes all duplicates elements
|
static <T> T[] |
removeDuplicates(T[] a,
boolean isSorted) |
static <T> T[] |
removeDuplicates(T[] a,
int from,
int to,
boolean isSorted) |
static java.lang.String |
removeEnd(java.lang.String str,
java.lang.String removeStr)
Removes a substring only if it is at the end of a source string,
otherwise returns the source string.
|
static java.lang.String |
removeEndIgnoreCase(java.lang.String str,
java.lang.String removeStr)
Case insensitive removal of a substring if it is at the end of a source
string, otherwise returns the source string.
|
static java.lang.String |
removePattern(java.lang.String source,
java.lang.String regex)
Removes each substring of the source String that matches the given
regular expression using the DOTALL option.
|
static java.lang.String |
removeStart(java.lang.String str,
java.lang.String removeStr)
Removes a substring only if it is at the beginning of a source string,
otherwise returns the source string.
|
static java.lang.String |
removeStartIgnoreCase(java.lang.String str,
java.lang.String removeStr)
Case insensitive removal of a substring if it is at the beginning of a
source string, otherwise returns the source string.
|
static <T> java.util.List<T> |
repeat(T value,
int n) |
static <T> java.util.List<T> |
repeatAll(java.util.Collection<T> c,
int n)
Seq.repeat(N.asList(1, 2, 3), 2) => [1, 2, 3, 1, 2, 3]
|
static <T> java.util.List<T> |
repeatAllToSize(java.util.Collection<T> c,
int size)
Seq.repeatToSize(N.asList(1, 2, 3), 5) => [1, 2, 3, 1, 2]
|
static <T> java.util.List<T> |
repeatEle(java.util.Collection<T> c,
int n)
Repeats the elements in the specified Collection one by one.
|
static <T> java.util.List<T> |
repeatEleToSize(java.util.Collection<T> c,
int size)
Repeats the elements in the specified Collection one by one till reach the specified size.
|
static java.lang.String |
repeatt(char ch,
int n) |
static java.lang.String |
repeatt(char ch,
int n,
char delimiter) |
static java.lang.String |
repeatt(java.lang.String str,
int repeat) |
static java.lang.String |
repeatt(java.lang.String str,
int n,
java.lang.String delimiter) |
static java.lang.String |
replace(java.lang.String str,
int fromIndex,
java.lang.String target,
java.lang.String replacement,
int max)
Replaces a String with another String inside a larger String, for the
first
max values of the search String. |
static int |
replaceAll(boolean[] a,
boolean oldVal,
boolean newVal) |
static int |
replaceAll(byte[] a,
byte oldVal,
byte newVal) |
static int |
replaceAll(char[] a,
char oldVal,
char newVal) |
static int |
replaceAll(double[] a,
double oldVal,
double newVal) |
static int |
replaceAll(float[] a,
float oldVal,
float newVal) |
static int |
replaceAll(int[] a,
int oldVal,
int newVal) |
static <T> int |
replaceAll(java.util.List<T> list,
java.lang.Object oldVal,
T newVal) |
static int |
replaceAll(long[] a,
long oldVal,
long newVal) |
static int |
replaceAll(short[] a,
short oldVal,
short newVal) |
static java.lang.String |
replaceAll(java.lang.String str,
int fromIndex,
java.lang.String target,
java.lang.String replacement) |
static java.lang.String |
replaceAll(java.lang.String str,
java.lang.String target,
java.lang.String replacement)
Replaces all occurrences of a String within another String.
|
static <T> int |
replaceAll(T[] a,
java.lang.Object oldVal,
T newVal) |
static java.lang.String |
replaceAllIgnoreCase(java.lang.String str,
int fromIndex,
java.lang.String target,
java.lang.String replacement) |
static java.lang.String |
replaceAllIgnoreCase(java.lang.String str,
java.lang.String target,
java.lang.String replacement) |
static java.lang.String |
replaceIgnoreCase(java.lang.String str,
int fromIndex,
java.lang.String target,
java.lang.String replacement,
int max) |
static java.lang.String |
replacePattern(java.lang.String source,
java.lang.String regex,
java.lang.String replacement)
Replaces each substring of the source String that matches the given
regular expression with the given replacement using the
Pattern.DOTALL option. |
static <T> T |
requireNonNull(T obj) |
static <T> T |
requireNonNull(T obj,
java.lang.String errorMessage) |
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(java.util.Collection<?> c) |
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(java.util.List<?> list) |
static void |
reverse(java.util.List<?> list,
int fromIndex,
int toIndex) |
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(java.lang.Object[] a)
Reverses the order of the given array.
|
static void |
reverse(java.lang.Object[] 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 java.lang.String |
reverse(java.lang.String str) |
static java.lang.String |
reverseDelimited(java.lang.String str,
char delimiter)
Reverses a String that is delimited by a specific character.
|
static java.lang.String |
reverseDelimited(java.lang.String str,
java.lang.String delimiter) |
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 <T extends java.lang.Comparable<? super T>> |
reverseSort(java.util.List<? extends T> c) |
static <T extends java.lang.Comparable<? super T>> |
reverseSort(java.util.List<? extends T> c,
int fromIndex,
int toIndex) |
static void |
reverseSort(long[] a) |
static void |
reverseSort(long[] a,
int fromIndex,
int toIndex) |
static void |
reverseSort(java.lang.Object[] a) |
static void |
reverseSort(java.lang.Object[] a,
int fromIndex,
int toIndex) |
static void |
reverseSort(short[] a) |
static void |
reverseSort(short[] a,
int fromIndex,
int toIndex) |
static <T extends java.util.Calendar> |
roll(T c,
long amount,
CalendarUnit unit)
Adds or subtracts the specified amount of time to the given calendar
unit, based on the calendar's rules.
|
static <T extends java.util.Date> |
roll(T date,
long amount,
CalendarUnit unit)
Adds or subtracts the specified amount of time to the given calendar
unit, based on the calendar's rules.
|
static <T extends java.util.Calendar> |
roll(T c,
long amount,
java.util.concurrent.TimeUnit unit)
Adds or subtracts the specified amount of time to the given time unit,
based on the calendar's rules.
|
static <T extends java.util.Date> |
roll(T date,
long amount,
java.util.concurrent.TimeUnit unit)
Adds or subtracts the specified amount of time to the given time unit,
based on the calendar's rules.
|
static <T> java.util.List<java.util.List<T>> |
rollup(java.util.Collection<? extends T> c) |
static void |
rotate(boolean[] a,
int distance) |
static void |
rotate(byte[] a,
int distance) |
static void |
rotate(char[] a,
int distance) |
static void |
rotate(java.util.Collection<?> c,
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(java.util.List<?> list,
int distance) |
static void |
rotate(long[] a,
int distance) |
static void |
rotate(java.lang.Object[] a,
int distance) |
static void |
rotate(short[] a,
int distance) |
static void |
runUninterruptibly(long timeout,
java.util.concurrent.TimeUnit unit,
Try.BiConsumer<java.lang.Long,java.util.concurrent.TimeUnit,java.lang.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 timeoutInMillis,
Try.LongConsumer<java.lang.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(Try.Runnable<java.lang.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 |
shuffle(boolean[] a) |
static void |
shuffle(boolean[] a,
java.util.Random rnd) |
static void |
shuffle(byte[] a) |
static void |
shuffle(byte[] a,
java.util.Random rnd) |
static void |
shuffle(char[] a) |
static void |
shuffle(char[] a,
java.util.Random rnd) |
static void |
shuffle(java.util.Collection<?> c) |
static void |
shuffle(java.util.Collection<?> c,
java.util.Random rnd) |
static void |
shuffle(double[] a) |
static void |
shuffle(double[] a,
java.util.Random rnd) |
static void |
shuffle(float[] a) |
static void |
shuffle(float[] a,
java.util.Random rnd) |
static void |
shuffle(int[] a) |
static void |
shuffle(int[] a,
java.util.Random rnd) |
static void |
shuffle(java.util.List<?> list) |
static void |
shuffle(java.util.List<?> list,
java.util.Random rnd) |
static void |
shuffle(long[] a) |
static void |
shuffle(long[] a,
java.util.Random rnd) |
static void |
shuffle(short[] a) |
static void |
shuffle(short[] a,
java.util.Random rnd) |
static <T> void |
shuffle(T[] a) |
static <T> void |
shuffle(T[] a,
java.util.Random rnd) |
static void |
sleep(long timeoutInMillis) |
static void |
sleep(long timeout,
java.util.concurrent.TimeUnit unit) |
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,
java.util.concurrent.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 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 <T extends java.lang.Comparable<? super T>> |
sort(java.util.List<? extends T> c) |
static <T> void |
sort(java.util.List<? extends T> c,
java.util.Comparator<? super T> cmp) |
static <T extends java.lang.Comparable<? super T>> |
sort(java.util.List<? extends T> c,
int fromIndex,
int toIndex) |
static <T> void |
sort(java.util.List<? extends T> c,
int fromIndex,
int toIndex,
java.util.Comparator<? super T> cmp) |
static void |
sort(long[] a) |
static void |
sort(long[] a,
int fromIndex,
int toIndex) |
static void |
sort(java.lang.Object[] a) |
static void |
sort(java.lang.Object[] a,
int fromIndex,
int toIndex) |
static void |
sort(short[] a) |
static void |
sort(short[] a,
int fromIndex,
int toIndex) |
static <T> void |
sort(T[] a,
java.util.Comparator<? super T> cmp) |
static <T> void |
sort(T[] a,
int fromIndex,
int toIndex,
java.util.Comparator<? super T> cmp) |
static java.util.List<boolean[]> |
split(boolean[] a,
int size)
Returns consecutive sub arrays of an array, each of the same size (the final list may be smaller),
or an empty List if the specified array is null or empty.
|
static java.util.List<boolean[]> |
split(boolean[] a,
int fromIndex,
int toIndex,
int size)
Returns consecutive sub arrays of an array, each of the same size (the final list may be smaller),
or an empty List if the specified array is null or empty.
|
static java.util.List<byte[]> |
split(byte[] a,
int size)
Returns consecutive sub arrays of an array, each of the same size (the final list may be smaller),
or an empty List if the specified array is null or empty.
|
static java.util.List<byte[]> |
split(byte[] a,
int fromIndex,
int toIndex,
int size)
Returns consecutive sub arrays of an array, each of the same size (the final list may be smaller),
or an empty List if the specified array is null or empty.
|
static java.util.List<char[]> |
split(char[] a,
int size)
Returns consecutive sub arrays of an array, each of the same size (the final list may be smaller),
or an empty List if the specified array is null or empty.
|
static java.util.List<char[]> |
split(char[] a,
int fromIndex,
int toIndex,
int size)
Returns consecutive sub arrays of an array, each of the same size (the final list may be smaller),
or an empty List if the specified array is null or empty.
|
static java.util.List<java.lang.String> |
split(java.lang.CharSequence str,
int size)
Returns consecutive substring of the specified string, each of the same length (the final list may be smaller),
or an empty array if the specified string is null or empty.
|
static java.util.List<java.lang.String> |
split(java.lang.CharSequence str,
int fromIndex,
int toIndex,
int size) |
static <T> java.util.List<java.util.List<T>> |
split(java.util.Collection<? extends T> c,
int size)
Returns consecutive sub lists of a collection, each of the same size (the final list may be smaller).
|
static <T> java.util.List<java.util.List<T>> |
split(java.util.Collection<? extends T> c,
int fromIndex,
int toIndex,
int size)
Returns consecutive sub lists of a collection, each of the same size (the final list may be smaller).
|
static java.util.List<double[]> |
split(double[] a,
int size)
Returns consecutive sub arrays of an array, each of the same size (the final list may be smaller),
or an empty List if the specified array is null or empty.
|
static java.util.List<double[]> |
split(double[] a,
int fromIndex,
int toIndex,
int size)
Returns consecutive sub arrays of an array, each of the same size (the final list may be smaller),
or an empty List if the specified array is null or empty.
|
static java.util.List<float[]> |
split(float[] a,
int size)
Returns consecutive sub arrays of an array, each of the same size (the final list may be smaller),
or an empty List if the specified array is null or empty.
|
static java.util.List<float[]> |
split(float[] a,
int fromIndex,
int toIndex,
int size)
Returns consecutive sub arrays of an array, each of the same size (the final list may be smaller),
or an empty List if the specified array is null or empty.
|
static java.util.List<int[]> |
split(int[] a,
int size)
Returns consecutive sub arrays of an array, each of the same size (the final list may be smaller),
or an empty List if the specified array is null or empty.
|
static java.util.List<int[]> |
split(int[] a,
int fromIndex,
int toIndex,
int size)
Returns consecutive sub arrays of an array, each of the same size (the final list may be smaller),
or an empty List if the specified array is null or empty.
|
static java.util.List<long[]> |
split(long[] a,
int size)
Returns consecutive sub arrays of an array, each of the same size (the final list may be smaller),
or an empty List if the specified array is null or empty.
|
static java.util.List<long[]> |
split(long[] a,
int fromIndex,
int toIndex,
int size)
Returns consecutive sub arrays of an array, each of the same size (the final list may be smaller),
or an empty List if the specified array is null or empty.
|
static java.util.List<short[]> |
split(short[] a,
int size)
Returns consecutive sub arrays of an array, each of the same size (the final list may be smaller),
or an empty List if the specified array is null or empty.
|
static java.util.List<short[]> |
split(short[] a,
int fromIndex,
int toIndex,
int size)
Returns consecutive sub arrays of an array, each of the same size (the final list may be smaller),
or an empty List if the specified array is null or empty.
|
static java.lang.String[] |
split(java.lang.String str,
char delimiter) |
static java.lang.String[] |
split(java.lang.String str,
char delimiter,
boolean trim) |
static java.lang.String[] |
split(java.lang.String str,
java.lang.String delimiter) |
static java.lang.String[] |
split(java.lang.String str,
java.lang.String delimiter,
boolean trim) |
static java.lang.String[] |
split(java.lang.String str,
java.lang.String delimiter,
int max) |
static java.lang.String[] |
split(java.lang.String str,
java.lang.String delimiter,
int max,
boolean trim) |
static <T> java.util.List<T[]> |
split(T[] a,
int size)
Returns consecutive sub arrays of an array, each of the same size (the final list may be smaller),
or an empty List if the specified array is null or empty.
|
static <T> java.util.List<T[]> |
split(T[] a,
int fromIndex,
int toIndex,
int size)
Returns consecutive sub arrays of an array, each of the same size (the final list may be smaller),
or an empty List if the specified array is null or empty.
|
static java.lang.String[] |
splitPreserveAllTokens(java.lang.String str,
char delimiter) |
static java.lang.String[] |
splitPreserveAllTokens(java.lang.String str,
char delimiter,
boolean trim) |
static java.lang.String[] |
splitPreserveAllTokens(java.lang.String str,
java.lang.String delimiter) |
static java.lang.String[] |
splitPreserveAllTokens(java.lang.String str,
java.lang.String delimiter,
boolean trim) |
static java.lang.String[] |
splitPreserveAllTokens(java.lang.String str,
java.lang.String delimiter,
int max) |
static java.lang.String[] |
splitPreserveAllTokens(java.lang.String str,
java.lang.String delimiter,
int max,
boolean trim) |
static boolean |
startsWith(java.lang.String str,
java.lang.String prefix) |
static boolean |
startsWithAny(java.lang.String str,
java.lang.String... substrs) |
static boolean |
startsWithIgnoreCase(java.lang.String str,
java.lang.String prefix) |
static java.lang.String |
stringOf(boolean val) |
static java.lang.String |
stringOf(byte val) |
static java.lang.String |
stringOf(char val) |
static java.lang.String |
stringOf(double val) |
static java.lang.String |
stringOf(float val) |
static java.lang.String |
stringOf(int val) |
static java.lang.String |
stringOf(long val) |
static java.lang.String |
stringOf(java.lang.Object obj) |
static java.lang.String |
stringOf(short val) |
static java.lang.String |
strip(java.lang.String str)
Strips whitespace from the start and end of a String.
|
static java.lang.String[] |
strip(java.lang.String[] strs) |
static java.lang.String[] |
strip(java.lang.String[] strs,
java.lang.String stripChars) |
static java.lang.String |
strip(java.lang.String str,
java.lang.String stripChars)
Strips any of a set of characters from the start and end of a String.
|
static java.lang.String |
stripAccents(java.lang.String str)
Removes diacritics (~= accents) from a string.
|
static java.lang.String[] |
stripAccents(java.lang.String[] strs) |
static java.lang.String[] |
stripEnd(java.lang.String[] strs,
java.lang.String stripChars) |
static java.lang.String |
stripEnd(java.lang.String str,
java.lang.String stripChars)
Strips any of a set of characters from the end of a String.
|
static java.lang.String[] |
stripStart(java.lang.String[] strs,
java.lang.String stripChars) |
static java.lang.String |
stripStart(java.lang.String str,
java.lang.String stripChars)
Strips any of a set of characters from the start of a String.
|
static java.lang.String |
stripToEmpty(java.lang.String str)
Strips whitespace from the start and end of a String returning an empty
String if
null input. |
static java.lang.String[] |
stripToEmpty(java.lang.String[] strs) |
static java.lang.String |
stripToNull(java.lang.String str)
Strips whitespace from the start and end of a String returning
null if the String is empty ("") after the strip. |
static java.lang.String[] |
stripToNull(java.lang.String[] strs) |
static Optional<java.lang.String> |
substring(java.lang.String str,
char delimiterOfInclusiveBeginIndex)
Returns an empty
Optional if N.isNullOrEmpty(str) || str.indexOf(delimiterOfInclusiveBeginIndex) < 0 ,
otherwise an Optional with String value: str.substring(str.indexOf(delimiterOfInclusiveBeginIndex)) is returned. |
static Optional<java.lang.String> |
substring(java.lang.String str,
char delimiterOfInclusiveBeginIndex,
int exclusiveEndIndex) |
static Optional<java.lang.String> |
substring(java.lang.String str,
int inclusiveBeginIndex)
Returns an empty
Optional if inclusiveBeginIndex < 0 ,
otherwise an Optional with String value: str.substring(inclusiveBeginIndex) is returned. |
static Optional<java.lang.String> |
substring(java.lang.String str,
int inclusiveBeginIndex,
char delimiterOfExclusiveEndIndex) |
static Optional<java.lang.String> |
substring(java.lang.String str,
int inclusiveBeginIndex,
int exclusiveEndIndex)
Returns an empty
Optional if inclusiveBeginIndex < 0 || exclusiveEndIndex < 0 || inclusiveBeginIndex > exclusiveEndIndex ,
otherwise an Optional with String value: str.substring(exclusiveBeginIndex, exclusiveEndIndex) is returned. |
static Optional<java.lang.String> |
substring(java.lang.String str,
int inclusiveBeginIndex,
IntUnaryOperator funcOfExclusiveEndIndex) |
static Optional<java.lang.String> |
substring(java.lang.String str,
int inclusiveBeginIndex,
java.lang.String delimiterOfExclusiveEndIndex) |
static Optional<java.lang.String> |
substring(java.lang.String str,
IntUnaryOperator funcOfInclusiveBeginIndex,
int exclusiveEndIndex) |
static Optional<java.lang.String> |
substring(java.lang.String str,
java.lang.String delimiterOfInclusiveBeginIndex)
Returns an empty
Optional if N.isNullOrEmpty(str) || str.indexOf(delimiterOfInclusiveBeginIndex) < 0 ,
otherwise an Optional with String value: str.substring(str.indexOf(delimiterOfInclusiveBeginIndex)) is returned. |
static Optional<java.lang.String> |
substring(java.lang.String str,
java.lang.String delimiterOfInclusiveBeginIndex,
int exclusiveEndIndex) |
static Optional<java.lang.String> |
substringBetween(java.lang.String str,
char delimiterOfExclusiveBeginIndex,
int exclusiveEndIndex) |
static Optional<java.lang.String> |
substringBetween(java.lang.String str,
int exclusiveBeginIndex,
char delimiterOfExclusiveEndIndex) |
static Optional<java.lang.String> |
substringBetween(java.lang.String str,
int exclusiveBeginIndex,
int exclusiveEndIndex)
Returns an empty
Optional if exclusiveBeginIndex < 0 || exclusiveEndIndex < 0 || exclusiveBeginIndex >= exclusiveEndIndex ,
otherwise an Optional with String value: str.substring(exclusiveBeginIndex + 1, exclusiveEndIndex) is returned. |
static Optional<java.lang.String> |
substringBetween(java.lang.String str,
int exclusiveBeginIndex,
IntUnaryOperator funcOfExclusiveEndIndex) |
static Optional<java.lang.String> |
substringBetween(java.lang.String str,
int exclusiveBeginIndex,
java.lang.String delimiterOfExclusiveEndIndex) |
static Optional<java.lang.String> |
substringBetween(java.lang.String str,
IntUnaryOperator funcOfExclusiveBeginIndex,
int exclusiveEndIndex) |
static Optional<java.lang.String> |
substringBetween(java.lang.String str,
java.lang.String delimiterOfExclusiveBeginIndex,
int exclusiveEndIndex) |
static int |
sum(byte... a) |
static int |
sum(byte[] a,
int from,
int to) |
static int |
sum(char... a) |
static int |
sum(char[] a,
int from,
int to) |
static double |
sum(double... a) |
static double |
sum(double[] a,
int from,
int to) |
static float |
sum(float... a) |
static float |
sum(float[] a,
int from,
int to) |
static int |
sum(int... a) |
static int |
sum(int[] a,
int from,
int to) |
static long |
sum(long... a) |
static long |
sum(long[] a,
int from,
int to) |
static int |
sum(short... a) |
static int |
sum(short[] a,
int from,
int to) |
static <T extends java.lang.Number> |
sumDouble(java.util.Collection<? extends T> c) |
static <T extends java.lang.Number> |
sumDouble(java.util.Collection<? extends T> c,
int fromIndex,
int toIndex) |
static <T,E extends java.lang.Exception> |
sumDouble(java.util.Collection<? extends T> c,
int fromIndex,
int toIndex,
Try.ToDoubleFunction<? super T,E> func) |
static <T,E extends java.lang.Exception> |
sumDouble(java.util.Collection<? extends T> c,
Try.ToDoubleFunction<? super T,E> func) |
static <T extends java.lang.Number> |
sumDouble(T[] a) |
static <T extends java.lang.Number> |
sumDouble(T[] a,
int fromIndex,
int toIndex) |
static <T,E extends java.lang.Exception> |
sumDouble(T[] a,
int fromIndex,
int toIndex,
Try.ToDoubleFunction<? super T,E> func) |
static <T,E extends java.lang.Exception> |
sumDouble(T[] a,
Try.ToDoubleFunction<? super T,E> func) |
static <T extends java.lang.Number> |
sumInt(java.util.Collection<? extends T> c) |
static <T extends java.lang.Number> |
sumInt(java.util.Collection<? extends T> c,
int fromIndex,
int toIndex) |
static <T,E extends java.lang.Exception> |
sumInt(java.util.Collection<? extends T> c,
int fromIndex,
int toIndex,
Try.ToIntFunction<? super T,E> func) |
static <T,E extends java.lang.Exception> |
sumInt(java.util.Collection<? extends T> c,
Try.ToIntFunction<? super T,E> func) |
static <T extends java.lang.Number> |
sumInt(T[] a) |
static <T extends java.lang.Number> |
sumInt(T[] a,
int fromIndex,
int toIndex) |
static <T,E extends java.lang.Exception> |
sumInt(T[] a,
int fromIndex,
int toIndex,
Try.ToIntFunction<? super T,E> func) |
static <T,E extends java.lang.Exception> |
sumInt(T[] a,
Try.ToIntFunction<? super T,E> func) |
static <T extends java.lang.Number> |
sumLong(java.util.Collection<? extends T> c) |
static <T extends java.lang.Number> |
sumLong(java.util.Collection<? extends T> c,
int fromIndex,
int toIndex) |
static <T,E extends java.lang.Exception> |
sumLong(java.util.Collection<? extends T> c,
int fromIndex,
int toIndex,
Try.ToLongFunction<? super T,E> func) |
static <T,E extends java.lang.Exception> |
sumLong(java.util.Collection<? extends T> c,
Try.ToLongFunction<? super T,E> func) |
static <T extends java.lang.Number> |
sumLong(T[] a) |
static <T extends java.lang.Number> |
sumLong(T[] a,
int fromIndex,
int toIndex) |
static <T,E extends java.lang.Exception> |
sumLong(T[] a,
int fromIndex,
int toIndex,
Try.ToLongFunction<? super T,E> func) |
static <T,E extends java.lang.Exception> |
sumLong(T[] a,
Try.ToLongFunction<? super T,E> func) |
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(java.util.List<?> list,
int i,
int j) |
static void |
swap(long[] a,
int i,
int j) |
static void |
swap(java.lang.Object[] a,
int i,
int j) |
static void |
swap(short[] a,
int i,
int j) |
static char |
swapCase(char ch) |
static java.lang.String |
swapCase(java.lang.String str)
Swaps the case of a String changing upper and title case to lower case,
and lower case to upper case.
|
static boolean[] |
symmetricDifference(boolean[] a,
boolean[] b) |
static byte[] |
symmetricDifference(byte[] a,
byte[] b) |
static char[] |
symmetricDifference(char[] a,
char[] b) |
static <T> java.util.List<T> |
symmetricDifference(java.util.Collection<? extends T> a,
java.util.Collection<? extends T> 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> T[] |
symmetricDifference(T[] a,
T[] b) |
static <T> T[] |
toArray(java.lang.Class<T[]> targetClass,
java.util.Collection<? extends T> c) |
static java.lang.Object[] |
toArray(java.util.Collection<?> c)
Returns an empty array if the specified collection is null or empty.
|
static <T> T[] |
toArray(java.util.Collection<? extends T> c,
T[] a) |
static void |
toJSON(java.io.File file,
java.lang.Object obj) |
static void |
toJSON(java.io.File file,
java.lang.Object obj,
JSONSerializationConfig config) |
static java.lang.String |
toJSON(java.lang.Object obj) |
static java.lang.String |
toJSON(java.lang.Object obj,
JSONSerializationConfig config) |
static void |
toJSON(java.io.OutputStream os,
java.lang.Object obj) |
static void |
toJSON(java.io.OutputStream os,
java.lang.Object obj,
JSONSerializationConfig config) |
static void |
toJSON(java.io.Writer writer,
java.lang.Object obj) |
static void |
toJSON(java.io.Writer writer,
java.lang.Object obj,
JSONSerializationConfig config) |
static char |
toLowerCase(char ch) |
static java.lang.String |
toLowerCase(java.lang.String str)
Converts a String to lower case as per
String.toLowerCase() . |
static java.lang.String |
toLowerCase(java.lang.String str,
java.util.Locale locale)
Converts a String to lower case as per
String.toLowerCase(Locale)
. |
static java.lang.String |
toLowerCaseWithUnderscore(java.lang.String str) |
static <T extends java.lang.Comparable<T>> |
top(java.util.Collection<? extends T> c,
int n) |
static <T> java.util.List<T> |
top(java.util.Collection<? extends T> c,
int n,
java.util.Comparator<? super T> cmp) |
static <T extends java.lang.Comparable<T>> |
top(java.util.Collection<? extends T> c,
int fromIndex,
int toIndex,
int n) |
static <T> java.util.List<T> |
top(java.util.Collection<? extends T> c,
int fromIndex,
int toIndex,
int n,
java.util.Comparator<? super T> cmp) |
static double[] |
top(double[] a,
int n) |
static double[] |
top(double[] a,
int n,
java.util.Comparator<? super java.lang.Double> cmp) |
static double[] |
top(double[] a,
int fromIndex,
int toIndex,
int n) |
static double[] |
top(double[] a,
int fromIndex,
int toIndex,
int n,
java.util.Comparator<? super java.lang.Double> cmp) |
static float[] |
top(float[] a,
int n) |
static float[] |
top(float[] a,
int n,
java.util.Comparator<? super java.lang.Float> cmp) |
static float[] |
top(float[] a,
int fromIndex,
int toIndex,
int n) |
static float[] |
top(float[] a,
int fromIndex,
int toIndex,
int n,
java.util.Comparator<? super java.lang.Float> cmp) |
static int[] |
top(int[] a,
int n) |
static int[] |
top(int[] a,
int n,
java.util.Comparator<? super java.lang.Integer> cmp) |
static int[] |
top(int[] a,
int fromIndex,
int toIndex,
int n) |
static int[] |
top(int[] a,
int fromIndex,
int toIndex,
int n,
java.util.Comparator<? super java.lang.Integer> cmp) |
static long[] |
top(long[] a,
int n) |
static long[] |
top(long[] a,
int n,
java.util.Comparator<? super java.lang.Long> cmp) |
static long[] |
top(long[] a,
int fromIndex,
int toIndex,
int n) |
static long[] |
top(long[] a,
int fromIndex,
int toIndex,
int n,
java.util.Comparator<? super java.lang.Long> cmp) |
static short[] |
top(short[] a,
int n) |
static short[] |
top(short[] a,
int n,
java.util.Comparator<? super java.lang.Short> cmp) |
static short[] |
top(short[] a,
int fromIndex,
int toIndex,
int n) |
static short[] |
top(short[] a,
int fromIndex,
int toIndex,
int n,
java.util.Comparator<? super java.lang.Short> cmp) |
static <T extends java.lang.Comparable<T>> |
top(T[] a,
int n) |
static <T> T[] |
top(T[] a,
int n,
java.util.Comparator<? super T> cmp) |
static <T extends java.lang.Comparable<T>> |
top(T[] a,
int fromIndex,
int toIndex,
int n) |
static <T> T[] |
top(T[] a,
int fromIndex,
int toIndex,
int n,
java.util.Comparator<? super T> cmp) |
static java.lang.RuntimeException |
toRuntimeException(java.lang.Throwable e) |
static java.lang.String |
toString(boolean value)
Method toString.
|
static java.lang.String |
toString(boolean[] a) |
static java.lang.String |
toString(boolean[] a,
int from,
int to) |
static java.lang.String |
toString(byte value)
Method toString.
|
static java.lang.String |
toString(byte[] a) |
static java.lang.String |
toString(byte[] a,
int from,
int to) |
static java.lang.String |
toString(char value)
Method toString.
|
static java.lang.String |
toString(char[] a) |
static java.lang.String |
toString(char[] a,
int from,
int to) |
static java.lang.String |
toString(double value)
Method toString.
|
static java.lang.String |
toString(double[] a) |
static java.lang.String |
toString(double[] a,
int from,
int to) |
static java.lang.String |
toString(float value)
Method toString.
|
static java.lang.String |
toString(float[] a) |
static java.lang.String |
toString(float[] a,
int from,
int to) |
static java.lang.String |
toString(int value)
Method toString.
|
static java.lang.String |
toString(int[] a) |
static java.lang.String |
toString(int[] a,
int from,
int to) |
static java.lang.String |
toString(long value)
Method toString.
|
static java.lang.String |
toString(long[] a) |
static java.lang.String |
toString(long[] a,
int from,
int to) |
static java.lang.String |
toString(java.lang.Object obj)
Method toString.
|
static java.lang.String |
toString(java.lang.Object[] a) |
static java.lang.String |
toString(java.lang.Object[] a,
int from,
int to) |
static java.lang.String |
toString(java.lang.Object a,
java.lang.String defaultIfNull) |
static java.lang.String |
toString(short value)
Method toString.
|
static java.lang.String |
toString(short[] a) |
static java.lang.String |
toString(short[] a,
int from,
int to) |
static char |
toUpperCase(char ch) |
static java.lang.String |
toUpperCase(java.lang.String str)
Converts a String to upper case as per
String.toUpperCase() . |
static java.lang.String |
toUpperCase(java.lang.String str,
java.util.Locale locale)
Converts a String to upper case as per
String.toUpperCase(Locale)
. |
static java.lang.String |
toUpperCaseWithUnderscore(java.lang.String str) |
static void |
toXML(java.io.File file,
java.lang.Object obj) |
static void |
toXML(java.io.File file,
java.lang.Object obj,
XMLSerializationConfig config) |
static java.lang.String |
toXML(java.lang.Object obj) |
static java.lang.String |
toXML(java.lang.Object obj,
XMLSerializationConfig config) |
static void |
toXML(java.io.OutputStream os,
java.lang.Object obj) |
static void |
toXML(java.io.OutputStream os,
java.lang.Object obj,
XMLSerializationConfig config) |
static void |
toXML(java.io.Writer writer,
java.lang.Object obj) |
static void |
toXML(java.io.Writer writer,
java.lang.Object obj,
XMLSerializationConfig config) |
static java.lang.String |
trim(java.lang.String str)
Removes control characters (char <= 32) from both ends of this String,
handling
null by returning null . |
static java.lang.String[] |
trim(java.lang.String[] strs) |
static java.lang.String |
trimToEmpty(java.lang.String str)
Removes control characters (char <= 32) from both ends of this String
returning an empty String ("") if the String is empty ("") after the trim
or if it is
null . |
static java.lang.String[] |
trimToEmpty(java.lang.String[] strs) |
static java.lang.String |
trimToNull(java.lang.String str)
Removes control characters (char <= 32) from both ends of this String
returning
null if the String is empty ("") after the trim or if
it is null . |
static java.lang.String[] |
trimToNull(java.lang.String[] strs) |
static <R> Nullable<R> |
tryOrEmpty(java.util.concurrent.Callable<R> cmd)
Returns a
Nullable with the value returned by action or an empty Nullable if exception happens. |
static <T,R,E extends java.lang.Exception> |
tryOrEmpty(T seed,
Try.Function<T,R,E> func)
Returns a
Nullable with the value returned by func.apply(seed) or an empty Nullable if exception happens. |
static <T> com.landawn.abacus.type.Type<T> |
typeOf(java.lang.Class<?> cls) |
static <T> com.landawn.abacus.type.Type<T> |
typeOf(java.lang.String typeName) |
static <T> java.util.List<com.landawn.abacus.type.Type<T>> |
typeOfAll(java.lang.Class<?>... classes) |
static <T> java.util.List<com.landawn.abacus.type.Type<T>> |
typeOfAll(java.util.Collection<? extends java.lang.Class<?>> classes) |
static java.lang.String |
uncapitalize(java.lang.String str) |
static java.lang.String |
unicodeEscaped(char ch)
Converts the char to the unicode format ' '.
|
static java.lang.String |
unwrap(java.lang.String str,
java.lang.String prefixSuffix) |
static java.lang.String |
unwrap(java.lang.String str,
java.lang.String prefix,
java.lang.String suffix)
Unwraps the specified string
str if and only if it's wrapped by the specified prefix and suffix |
static <T,L,R,E extends java.lang.Exception> |
unzip(java.util.Collection<? extends T> c,
Try.BiConsumer<? super T,Pair<L,R>,E> unzip) |
static <T,L,R,LC extends java.util.Collection<L>,RC extends java.util.Collection<R>,E extends java.lang.Exception> |
unzip(java.util.Collection<? extends T> c,
Try.BiConsumer<? super T,Pair<L,R>,E> unzip,
IntFunction<? extends java.util.Collection<?>> supplier) |
static <T,L,M,R,E extends java.lang.Exception> |
unzipp(java.util.Collection<? extends T> c,
Try.BiConsumer<? super T,Triple<L,M,R>,E> unzip) |
static <T,L,M,R,LC extends java.util.Collection<L>,MC extends java.util.Collection<M>,RC extends java.util.Collection<R>,E extends java.lang.Exception> |
unzipp(java.util.Collection<? extends T> c,
Try.BiConsumer<? super T,Triple<L,M,R>,E> unzip,
IntFunction<? extends java.util.Collection<?>> supplier) |
static <T> T |
urlDecode(java.lang.Class<T> targetClass,
java.lang.String urlQuery) |
static <T> T |
urlDecode(java.lang.Class<T> targetClass,
java.lang.String urlQuery,
java.nio.charset.Charset charset) |
static java.util.Map<java.lang.String,java.lang.String> |
urlDecode(java.lang.String urlQuery) |
static java.util.Map<java.lang.String,java.lang.String> |
urlDecode(java.lang.String urlQuery,
java.nio.charset.Charset charset) |
static java.lang.String |
urlEncode(java.lang.Object parameters) |
static java.lang.String |
urlEncode(java.lang.Object parameters,
java.nio.charset.Charset charset) |
static java.lang.String |
uuid()
Returns an UUID
|
static <T> T |
valueOf(java.lang.Class<T> targetClass,
java.lang.String str) |
static java.lang.String |
wrap(java.lang.String str,
java.lang.String prefixSuffix) |
static java.lang.String |
wrap(java.lang.String str,
java.lang.String prefix,
java.lang.String suffix)
N.wrap(null, "[", "]") -> "[]"
N.wrap("", "[", "]") -> "[]"
N.wrap("[", "[", "]") -> "[[]"
N.wrap("]", "[", "]") -> "[]]"
N.wrap("abc", "[", "]") -> "[abc]"
N.wrap("a", "aa", "aa") -> "aaaaa"
N.wrap("aa", "aa", "aa") -> "aaaaaa"
N.wrap("aaa", "aa", "aa") -> "aaaaaaa"
|
static java.lang.String |
wrapIfMissing(java.lang.String str,
java.lang.String prefixSuffix) |
static java.lang.String |
wrapIfMissing(java.lang.String str,
java.lang.String prefix,
java.lang.String suffix)
N.wrapIfMissing(null, "[", "]") -> "[]"
N.wrapIfMissing("", "[", "]") -> "[]"
N.wrapIfMissing("[", "[", "]") -> "[]"
N.wrapIfMissing("]", "[", "]") -> "[]"
N.wrapIfMissing("abc", "[", "]") -> "[abc]"
N.wrapIfMissing("a", "aa", "aa") -> "aaaaa"
N.wrapIfMissing("aa", "aa", "aa") -> "aaaa"
N.wrapIfMissing("aaa", "aa", "aa") -> "aaaaa"
N.wrapIfMissing("aaaa", "aa", "aa") -> "aaaa"
|
static java.lang.Class<?> |
wrapperOf(java.lang.Class<?> primitiveClass) |
static java.lang.String |
xml2JSON(java.lang.Class<?> cls,
java.lang.String xml) |
static java.lang.String |
xml2JSON(java.lang.String xml) |
static <A,B,R,E extends java.lang.Exception> |
zip(A[] a,
B[] b,
A valueForNoneA,
B valueForNoneB,
Try.BiFunction<? super A,? super B,R,E> zipFunction) |
static <A,B,C,R,E extends java.lang.Exception> |
zip(A[] a,
B[] b,
C[] c,
A valueForNoneA,
B valueForNoneB,
C valueForNoneC,
Try.TriFunction<? super A,? super B,? super C,R,E> zipFunction) |
static <A,B,C,R,E extends java.lang.Exception> |
zip(A[] a,
B[] b,
C[] c,
Try.TriFunction<? super A,? super B,? super C,R,E> zipFunction) |
static <A,B,R,E extends java.lang.Exception> |
zip(A[] a,
B[] b,
Try.BiFunction<? super A,? super B,R,E> zipFunction) |
static <A,B,R,E extends java.lang.Exception> |
zip(java.util.Collection<A> a,
java.util.Collection<B> b,
A valueForNoneA,
B valueForNoneB,
Try.BiFunction<? super A,? super B,R,E> zipFunction) |
static <A,B,C,R,E extends java.lang.Exception> |
zip(java.util.Collection<A> a,
java.util.Collection<B> b,
java.util.Collection<C> c,
A valueForNoneA,
B valueForNoneB,
C valueForNoneC,
Try.TriFunction<? super A,? super B,? super C,R,E> zipFunction) |
static <A,B,C,R,E extends java.lang.Exception> |
zip(java.util.Collection<A> a,
java.util.Collection<B> b,
java.util.Collection<C> c,
Try.TriFunction<? super A,? super B,? super C,R,E> zipFunction) |
static <A,B,R,E extends java.lang.Exception> |
zip(java.util.Collection<A> a,
java.util.Collection<B> b,
Try.BiFunction<? super A,? super B,R,E> zipFunction) |
public static final int INDEX_NOT_FOUND
-1
. This value is returned by methods in this class and can also
be used in comparisons with values returned by various method from
List
.public static final java.util.TimeZone UTC_TIME_ZONE
public static final java.util.TimeZone LOCAL_TIME_ZONE
public static final java.lang.String LOCAL_YEAR_FORMAT
public static final java.lang.String LOCAL_MONTH_DAY_FORMAT
public static final java.lang.String LOCAL_DATE_FORMAT
public static final java.lang.String LOCAL_TIME_FORMAT
public static final java.lang.String LOCAL_DATETIME_FORMAT
public static final java.lang.String LOCAL_TIMESTAMP_FORMAT
public static final java.lang.String ISO_8601_DATETIME_FORMAT
public static final java.lang.String ISO_8601_TIMESTAMP_FORMAT
public static final java.lang.String RFC1123_DATE_FORMAT
public static final java.lang.String EMPTY_STRING
public static final boolean[] EMPTY_BOOLEAN_ARRAY
boolean
array.public static final char[] EMPTY_CHAR_ARRAY
char
array.public static final byte[] EMPTY_BYTE_ARRAY
byte
array.public static final short[] EMPTY_SHORT_ARRAY
short
array.public static final int[] EMPTY_INT_ARRAY
int
array.public static final long[] EMPTY_LONG_ARRAY
long
array.public static final float[] EMPTY_FLOAT_ARRAY
float
array.public static final double[] EMPTY_DOUBLE_ARRAY
double
array.public static final java.lang.Boolean[] EMPTY_BOOLEAN_OBJ_ARRAY
Boolean
array.public static final java.lang.Character[] EMPTY_CHAR_OBJ_ARRAY
Character
array.public static final java.lang.Byte[] EMPTY_BYTE_OBJ_ARRAY
Byte
array.public static final java.lang.Short[] EMPTY_SHORT_OBJ_ARRAY
Short
array.public static final java.lang.Integer[] EMPTY_INT_OBJ_ARRAY
Integer
array.public static final java.lang.Long[] EMPTY_LONG_OBJ_ARRAY
Long
array.public static final java.lang.Float[] EMPTY_FLOAT_OBJ_ARRAY
Float
array.public static final java.lang.Double[] EMPTY_DOUBLE_OBJ_ARRAY
Double
array.public static final java.lang.String[] EMPTY_STRING_ARRAY
String
array.public static final java.lang.Object[] EMPTY_OBJECT_ARRAY
Object
array.public static <T> com.landawn.abacus.type.Type<T> typeOf(java.lang.String typeName)
public static <T> com.landawn.abacus.type.Type<T> typeOf(java.lang.Class<?> cls)
@SafeVarargs public static <T> java.util.List<com.landawn.abacus.type.Type<T>> typeOfAll(java.lang.Class<?>... classes)
public static <T> java.util.List<com.landawn.abacus.type.Type<T>> typeOfAll(java.util.Collection<? extends java.lang.Class<?>> classes)
public static java.lang.String stringOf(boolean val)
public static java.lang.String stringOf(char val)
public static java.lang.String stringOf(byte val)
public static java.lang.String stringOf(short val)
public static java.lang.String stringOf(int val)
public static java.lang.String stringOf(long val)
public static java.lang.String stringOf(float val)
public static java.lang.String stringOf(double val)
public static java.lang.String stringOf(java.lang.Object obj)
obj
- null
if the specified object is null.public static <T> T valueOf(java.lang.Class<T> targetClass, java.lang.String str)
targetClass
- str
- targetClass
if the specified string is null.public static <T> T defaultValueOf(java.lang.Class<T> cls)
public static <E extends java.lang.Enum<E>> java.util.List<E> enumListOf(java.lang.Class<E> enumClass)
public static <E extends java.lang.Enum<E>> java.util.Set<E> enumSetOf(java.lang.Class<E> enumClass)
public static <E extends java.lang.Enum<E>> BiMap<E,java.lang.String> enumMapOf(java.lang.Class<E> enumClass)
public static <T> T newInstance(java.lang.Class<T> cls)
cls
- public static <T> T newProxyInstance(java.lang.Class<T> interfaceClass, java.lang.reflect.InvocationHandler h)
public static <T> T newProxyInstance(java.lang.Class<?>[] interfaceClasses, java.lang.reflect.InvocationHandler h)
java.lang.reflect
interfaceClasses
- h
- public static <T> T newArray(java.lang.Class<?> componentType, int length)
componentType
- length
- public static <T> T newEntity(java.lang.Class<T> cls)
public static <T> T newEntity(java.lang.Class<T> cls, java.lang.String entityName)
public static <E> java.util.Set<E> newSetFromMap(java.util.Map<E,java.lang.Boolean> map)
map
- the backing mapCollections.newSetFromMap(Map)
public static int initHashCapacity(int size)
public static <T> java.util.ArrayList<T> newArrayList()
public static <T> java.util.ArrayList<T> newArrayList(int initialCapacity)
public static <T> java.util.ArrayList<T> newArrayList(java.util.Collection<? extends T> c)
public static <T> java.util.LinkedList<T> newLinkedList()
public static <T> java.util.LinkedList<T> newLinkedList(java.util.Collection<? extends T> c)
public static <T> java.util.HashSet<T> newHashSet()
public static <T> java.util.HashSet<T> newHashSet(int initialCapacity)
initialCapacity
- multiply 1.25 as the initial capacity of new HashSetpublic static <T> java.util.HashSet<T> newHashSet(java.util.Collection<? extends T> c)
public static <T> java.util.LinkedHashSet<T> newLinkedHashSet()
public static <T> java.util.LinkedHashSet<T> newLinkedHashSet(int initialCapacity)
initialCapacity
- multiply 1.25 as the initial capacity of new HashSetpublic static <T> java.util.LinkedHashSet<T> newLinkedHashSet(java.util.Collection<? extends T> c)
public static <T extends java.lang.Comparable> java.util.TreeSet<T> newTreeSet()
public static <T> java.util.TreeSet<T> newTreeSet(java.util.Comparator<? super T> comparator)
public static <T extends java.lang.Comparable> java.util.TreeSet<T> newTreeSet(java.util.Collection<? extends T> c)
public static <T> java.util.TreeSet<T> newTreeSet(java.util.SortedSet<T> c)
public static <T> java.util.ArrayDeque<T> newArrayDeque()
public static <T> java.util.ArrayDeque<T> newArrayDeque(int numElements)
numElements
- lower bound on initial capacity of the deque.public static <E> java.util.ArrayDeque<E> newArrayDeque(java.util.Collection<? extends E> c)
c
- public static <K,V> java.util.HashMap<K,V> newHashMap()
public static <K,V> java.util.HashMap<K,V> newHashMap(int initialCapacity)
initialCapacity
- multiply 1.25 as the initial capacity of new HashSetpublic static <K,V> java.util.HashMap<K,V> newHashMap(java.util.Map<? extends K,? extends V> m)
public static <K,V,E extends java.lang.Exception> java.util.HashMap<K,V> newHashMap(java.util.Collection<? extends V> c, Try.Function<? super V,? extends K,E> keyExtractor) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <K,V> java.util.LinkedHashMap<K,V> newLinkedHashMap()
public static <K,V> java.util.LinkedHashMap<K,V> newLinkedHashMap(int initialCapacity)
initialCapacity
- multiply 1.25 as the initial capacity of new HashSetpublic static <K,V> java.util.LinkedHashMap<K,V> newLinkedHashMap(java.util.Map<? extends K,? extends V> m)
public static <K,V,E extends java.lang.Exception> java.util.LinkedHashMap<K,V> newLinkedHashMap(java.util.Collection<? extends V> c, Try.Function<? super V,? extends K,E> keyExtractor) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <K extends java.lang.Comparable,V> java.util.TreeMap<K,V> newTreeMap()
public static <C,K extends C,V> java.util.TreeMap<K,V> newTreeMap(java.util.Comparator<C> comparator)
public static <K extends java.lang.Comparable,V> java.util.TreeMap<K,V> newTreeMap(java.util.Map<? extends K,? extends V> m)
public static <K,V> java.util.TreeMap<K,V> newTreeMap(java.util.SortedMap<K,? extends V> m)
public static <K,V> java.util.IdentityHashMap<K,V> newIdentityHashMap()
public static <K,V> java.util.IdentityHashMap<K,V> newIdentityHashMap(int initialCapacity)
initialCapacity
- multiply 1.25 as the initial capacity of new HashSetpublic static <K,V> java.util.IdentityHashMap<K,V> newIdentityHashMap(java.util.Map<? extends K,? extends V> m)
public static <K,V> java.util.concurrent.ConcurrentHashMap<K,V> newConcurrentHashMap()
public static <K,V> java.util.concurrent.ConcurrentHashMap<K,V> newConcurrentHashMap(int initialCapacity)
initCapacity
- multiply 1.25 as the initial capacity of new HashSetpublic static <K,V> java.util.concurrent.ConcurrentHashMap<K,V> newConcurrentHashMap(java.util.Map<? extends K,? extends V> m)
public static <K,E> ListMultimap<K,E> newListMultimap()
public static <K,E> ListMultimap<K,E> newListMultimap(int initialCapacity)
public static <K,E> ListMultimap<K,E> newListMultimap(java.util.Map<? extends K,? extends E> m)
public static <K,E> ListMultimap<K,E> newListLinkedMultimap()
public static <K,E> ListMultimap<K,E> newListLinkedMultimap(int initialCapacity)
public static <K,E> ListMultimap<K,E> newListLinkedMultimap(java.util.Map<? extends K,? extends E> m)
public static <K,E> ListMultimap<K,E> newListSortedMultimap()
public static <K,E> ListMultimap<K,E> newListSortedMultimap(java.util.Map<? extends K,? extends E> m)
public static <K,E> ListMultimap<K,E> newListMultimap(java.lang.Class<? extends java.util.Map> mapType)
public static <K,E> ListMultimap<K,E> newListMultimap(java.lang.Class<? extends java.util.Map> mapType, java.lang.Class<? extends java.util.List> valueType)
public static <K,E> SetMultimap<K,E> newSetMultimap()
public static <K,E> SetMultimap<K,E> newSetMultimap(int initialCapacity)
public static <K,E> SetMultimap<K,E> newSetMultimap(java.util.Map<? extends K,? extends E> m)
public static <K,E> SetMultimap<K,E> newSetLinkedMultimap()
public static <K,E> SetMultimap<K,E> newSetLinkedMultimap(int initialCapacity)
public static <K,E> SetMultimap<K,E> newSetLinkedMultimap(java.util.Map<? extends K,? extends E> m)
public static <K,E> SetMultimap<K,E> newSetSortedMultimap()
public static <K,E> SetMultimap<K,E> newSetSortedMultimap(java.util.Map<? extends K,? extends E> m)
public static <K,E> SetMultimap<K,E> newSetMultimap(java.lang.Class<? extends java.util.Map> mapType)
public static <K,E> SetMultimap<K,E> newSetMultimap(java.lang.Class<? extends java.util.Map> mapType, java.lang.Class<? extends java.util.Set> valueType)
public static DataSet newEmptyDataSet()
public static DataSet newDataSet(java.lang.String keyColumnName, java.lang.String valueColumnName, java.util.Map<?,?> m)
DataSet
: one column is for keys and one column is for valueskeyColumnName
- valueColumnName
- m
- public static <T> DataSet newDataSet(java.util.Collection<T> rows)
DataSet
.rows
- list of row which can be: Map/Entity/Array/Collection.public static <T> DataSet newDataSet(java.util.Collection<java.lang.String> columnNames, java.util.Collection<T> rowList)
DataSet
.columnNames
- rows
- list of row which can be: Map/Entity/Array/Collection.@SafeVarargs public static <T> T[] asArray(T... a)
a
- public static java.lang.Object[] toArray(java.util.Collection<?> c)
c
- public static <T> T[] toArray(java.util.Collection<? extends T> c, T[] a)
public static <T> T[] toArray(java.lang.Class<T[]> targetClass, java.util.Collection<? extends T> c)
@SafeVarargs public static java.util.Map<java.lang.String,java.lang.Object> asProps(java.lang.Object... a)
a
- pairs of property name and value or a Java Entity Object what
allows access to properties using getter and setter methods.public static <K,V,k extends K,v extends V> java.util.Map<K,V> asMap(k k1, v v1)
public static <K,V,k extends K,v extends V> java.util.Map<K,V> asMap(k k1, v v1, k k2, v v2)
public static <K,V,k extends K,v extends V> java.util.Map<K,V> asMap(k k1, v v1, k k2, v v2, k k3, v v3)
public static <K,V,k extends K,v extends V> java.util.Map<K,V> asMap(k k1, v v1, k k2, v v2, k k3, v v3, k k4, v v4)
public static <K,V,k extends K,v extends V> java.util.Map<K,V> asMap(k k1, v v1, k k2, v v2, k k3, v v3, k k4, v v4, k k5, v v5)
public static <K,V,k extends K,v extends V> java.util.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)
public static <K,V,k extends K,v extends V> java.util.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)
@SafeVarargs public static <K,V> java.util.Map<K,V> asMap(java.lang.Object... a)
public static <K,V,k extends K,v extends V> java.util.LinkedHashMap<K,V> asLinkedHashMap(k k1, v v1)
public static <K,V,k extends K,v extends V> java.util.LinkedHashMap<K,V> asLinkedHashMap(k k1, v v1, k k2, v v2)
public static <K,V,k extends K,v extends V> java.util.LinkedHashMap<K,V> asLinkedHashMap(k k1, v v1, k k2, v v2, k k3, v v3)
public static <K,V,k extends K,v extends V> java.util.LinkedHashMap<K,V> asLinkedHashMap(k k1, v v1, k k2, v v2, k k3, v v3, k k4, v v4)
public static <K,V,k extends K,v extends V> java.util.LinkedHashMap<K,V> asLinkedHashMap(k k1, v v1, k k2, v v2, k k3, v v3, k k4, v v4, k k5, v v5)
public static <K,V,k extends K,v extends V> java.util.LinkedHashMap<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)
public static <K,V,k extends K,v extends V> java.util.LinkedHashMap<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)
@SafeVarargs public static <K,V> java.util.LinkedHashMap<K,V> asLinkedHashMap(java.lang.Object... a)
@SafeVarargs @NullSafe public static <T> java.util.List<T> asList(T... a)
a
- @SafeVarargs @NullSafe public static <T> java.util.LinkedList<T> asLinkedList(T... a)
@SafeVarargs @NullSafe public static <T> java.util.Set<T> asSet(T... a)
@SafeVarargs public static <T> java.util.LinkedHashSet<T> asLinkedHashSet(T... a)
@SafeVarargs public static <T> java.util.SortedSet<T> asSortedSet(T... a)
@SafeVarargs public static <T> java.util.NavigableSet<T> asNavigableSet(T... a)
@SafeVarargs public static <T> java.util.Queue<T> asQueue(T... a)
@SafeVarargs public static <T> java.util.concurrent.ArrayBlockingQueue<T> asArrayBlockingQueue(T... a)
@SafeVarargs public static <T> java.util.concurrent.LinkedBlockingQueue<T> asLinkedBlockingQueue(T... a)
@SafeVarargs public static <T> java.util.concurrent.ConcurrentLinkedQueue<T> asConcurrentLinkedQueue(T... a)
@SafeVarargs public static <T extends java.util.concurrent.Delayed> java.util.concurrent.DelayQueue<T> asDelayQueue(T... a)
@SafeVarargs public static <T> java.util.PriorityQueue<T> asPriorityQueue(T... a)
@SafeVarargs public static <T> java.util.Deque<T> asDeque(T... a)
@SafeVarargs public static <T> java.util.concurrent.LinkedBlockingDeque<T> asLinkedBlockingDeque(T... a)
@SafeVarargs public static <T> java.util.concurrent.ConcurrentLinkedDeque<T> asConcurrentLinkedDeque(T... a)
@SafeVarargs public static <T> Multiset<T> asMultiset(T... a)
public static <T> java.util.List<T> asSingletonList(T o)
o
- Collections.singletonList(Object)
public static <T> java.util.Set<T> asSingletonSet(T o)
o
- Collections.singleton(Object)
public static <K,V> java.util.Map<K,V> asSingletonMap(K key, V value)
key
- value
- Collections.singletonMap(Object, Object)
public static <T> T as(java.lang.Class<T> targetClass, java.lang.Object obj)
sourceObject
to the specified
cls
. Default value of cls
is returned if
sourceObject
is null. An instance of cls
is returned if
convert successfullytargetClass
- obj
- java.lang.ClassCastException
public static <T> T as(com.landawn.abacus.type.Type<T> targetType, java.lang.Object obj)
public static boolean asBoolean(java.lang.String str)
Boolean
with a value represented by the specified
string. The Boolean
returned represents a true value if the
string argument is not null
and is equal, ignoring case, to
the string "true"
.str
- a string.Boolean
value represented by the string.public static boolean asBoolean(java.lang.Boolean b)
public static char asChar(java.lang.String str)
public static char asChar(java.lang.Character c)
public static byte asByte(java.lang.String str)
Byte.valueOf(String)
if str
is not null
, otherwise, the default value 0 for byte
is
returned.str
- java.lang.NumberFormatException
- If the string does not
contain a parsable byte
.public static byte asByte(java.lang.Number num)
public static short asShort(java.lang.String str)
Short.valueOf(String)
if str
is not null
, otherwise, the default value 0 for short
is
returned.str
- java.lang.NumberFormatException
- If the string does not
contain a parsable short
.public static short asShort(java.lang.Number num)
public static int asInt(java.lang.String str)
Integer.valueOf(String)
if
str
is not null
, otherwise, the default value 0 for
int
is returned.str
- java.lang.NumberFormatException
- If the string does not
contain a parsable int
.public static int asInt(java.lang.Number num)
public static long asLong(java.lang.String str)
Long.valueOf(String)
if str
is not null
, otherwise, the default value 0 for long
is
returned.str
- java.lang.NumberFormatException
- If the string does not
contain a parsable long
.public static long asLong(java.lang.Number num)
public static float asFloat(java.lang.String str)
Float.valueOf(String)
if str
is not null
, otherwise, the default value 0f for float
is
returned.str
- java.lang.NumberFormatException
- If the string does not
contain a parsable float
.public static float asFloat(java.lang.Number num)
public static double asDouble(java.lang.String str)
Double.valueOf(String)
if str
is not null
, otherwise, the default value 0d for double
is
returned.str
- java.lang.NumberFormatException
- If the string does not
contain a parsable double
.public static double asDouble(java.lang.Number num)
public static java.util.Date asJUDate(java.util.Calendar c)
public static java.util.Date asJUDate(java.util.Date date)
public static java.util.Date asJUDate(long timeInMillis)
public static java.util.Date asJUDate(java.lang.String date)
public static java.util.Date asJUDate(java.lang.String date, java.lang.String format)
public static java.util.Date asJUDate(java.lang.String date, java.lang.String format, java.util.TimeZone timeZone)
date
with the specified format
to a new instance of java.util.Date.
null
is returned if the specified date
is null or empty.date
- format
- java.lang.IllegalArgumentException
- if the date given can't be parsed with specified format.public static java.sql.Date asDate(java.util.Calendar c)
public static java.sql.Date asDate(java.util.Date date)
public static java.sql.Date asDate(long timeInMillis)
public static java.sql.Date asDate(java.lang.String date)
public static java.sql.Date asDate(java.lang.String date, java.lang.String format)
public static java.sql.Date asDate(java.lang.String date, java.lang.String format, java.util.TimeZone timeZone)
date
with the specified format
to a new instance of java.sql.Date.
null
is returned if the specified date
is null or empty.date
- format
- timeZone
- public static java.sql.Time asTime(java.util.Calendar c)
public static java.sql.Time asTime(java.util.Date date)
public static java.sql.Time asTime(long timeInMillis)
public static java.sql.Time asTime(java.lang.String date)
public static java.sql.Time asTime(java.lang.String date, java.lang.String format)
public static java.sql.Time asTime(java.lang.String date, java.lang.String format, java.util.TimeZone timeZone)
date
with the specified format
to a new instance of Time.
null
is returned if the specified date
is null or empty.date
- format
- timeZone
- public static java.sql.Timestamp asTimestamp(java.util.Calendar c)
public static java.sql.Timestamp asTimestamp(java.util.Date date)
public static java.sql.Timestamp asTimestamp(long timeInMillis)
public static java.sql.Timestamp asTimestamp(java.lang.String date)
public static java.sql.Timestamp asTimestamp(java.lang.String date, java.lang.String format)
public static java.sql.Timestamp asTimestamp(java.lang.String date, java.lang.String format, java.util.TimeZone timeZone)
date
with the specified format
to a new instance of Timestamp.
null
is returned if the specified date
is null or empty.date
- format
- timeZone
- public static java.util.Calendar asCalendar(java.util.Calendar c)
public static java.util.Calendar asCalendar(java.util.Date date)
public static java.util.Calendar asCalendar(long timeInMillis)
public static java.util.Calendar asCalendar(java.lang.String calendar)
public static java.util.Calendar asCalendar(java.lang.String calendar, java.lang.String format)
public static java.util.Calendar asCalendar(java.lang.String calendar, java.lang.String format, java.util.TimeZone timeZone)
calendar
with the specified format
to a new instance of Calendar.
null
is returned if the specified date
is null or empty.calendar
- format
- timeZone
- public static java.util.GregorianCalendar asGregorianCalendar(java.util.Calendar c)
public static java.util.GregorianCalendar asGregorianCalendar(java.util.Date date)
public static java.util.GregorianCalendar asGregorianCalendar(long timeInMillis)
public static java.util.GregorianCalendar asGregorianCalendar(java.lang.String calendar)
public static java.util.GregorianCalendar asGregorianCalendar(java.lang.String calendar, java.lang.String format)
public static java.util.GregorianCalendar asGregorianCalendar(java.lang.String calendar, java.lang.String format, java.util.TimeZone timeZone)
calendar
with the specified format
to a new instance of GregorianCalendar.
null
is returned if the specified date
is null or empty.calendar
- format
- timeZone
- public static javax.xml.datatype.XMLGregorianCalendar asXMLGregorianCalendar(java.util.Calendar c)
public static javax.xml.datatype.XMLGregorianCalendar asXMLGregorianCalendar(java.util.Date date)
public static javax.xml.datatype.XMLGregorianCalendar asXMLGregorianCalendar(long timeInMillis)
public static javax.xml.datatype.XMLGregorianCalendar asXMLGregorianCalendar(java.lang.String calendar)
public static javax.xml.datatype.XMLGregorianCalendar asXMLGregorianCalendar(java.lang.String calendar, java.lang.String format)
public static javax.xml.datatype.XMLGregorianCalendar asXMLGregorianCalendar(java.lang.String calendar, java.lang.String format, java.util.TimeZone timeZone)
calendar
with the specified format
to a new instance of XMLGregorianCalendar.
null
is returned if the specified date
is null or empty.calendar
- format
- timeZone
- public static long currentMillis()
System.currentTimeMillis()
public static java.sql.Time currentTime()
java.sql.Time
returned is based on the
current time in the default time zone with the default locale.public static java.sql.Date currentDate()
java.sql.Date
returned is based on the
current time in the default time zone with the default locale.public static java.sql.Timestamp currentTimestamp()
java.sql.Timestamp
returned is based on
the current time in the default time zone with the default locale.public static java.util.Date currentJUDate()
java.util.Date
returned is based on the
current time in the default time zone with the default locale.public static java.util.Calendar currentCalendar()
java.util.Calendar
returned is based on
the current time in the default time zone with the default locale.public static java.util.GregorianCalendar currentGregorianCalendar()
public static javax.xml.datatype.XMLGregorianCalendar currentXMLGregorianCalendar()
public static <T extends java.util.Date> T roll(T date, long amount, java.util.concurrent.TimeUnit unit)
N.roll(date, -5, TimeUnit.DAYS)
.
date
- amount
- unit
- public static <T extends java.util.Date> T roll(T date, long amount, CalendarUnit unit)
N.roll(date, -5, CalendarUnit.DAY)
.
date
- amount
- unit
- public static <T extends java.util.Calendar> T roll(T c, long amount, java.util.concurrent.TimeUnit unit)
N.roll(c, -5, TimeUnit.DAYS)
.
c
- amount
- unit
- public static <T extends java.util.Calendar> T roll(T c, long amount, CalendarUnit unit)
N.roll(c, -5, CalendarUnit.DAY)
.
c
- amount
- unit
- public static java.lang.String format(java.util.Date date)
public static java.lang.String format(java.util.Date date, java.lang.String format)
public static java.lang.String format(java.util.Date date, java.lang.String format, java.util.TimeZone timeZone)
public static void format(java.io.Writer writer, java.util.Date date)
public static void format(java.io.Writer writer, java.util.Date date, java.lang.String format, java.util.TimeZone timeZone)
public static java.lang.String format(java.util.Calendar c)
public static java.lang.String format(java.util.Calendar c, java.lang.String format)
public static java.lang.String format(java.util.Calendar c, java.lang.String format, java.util.TimeZone timeZone)
public static void format(java.io.Writer writer, java.util.Calendar c)
public static void format(java.io.Writer writer, java.util.Calendar c, java.lang.String format, java.util.TimeZone timeZone)
public static java.lang.String format(javax.xml.datatype.XMLGregorianCalendar c)
public static java.lang.String format(javax.xml.datatype.XMLGregorianCalendar c, java.lang.String format)
public static java.lang.String format(javax.xml.datatype.XMLGregorianCalendar c, java.lang.String format, java.util.TimeZone timeZone)
public static void format(java.io.Writer writer, javax.xml.datatype.XMLGregorianCalendar c)
public static void format(java.io.Writer writer, javax.xml.datatype.XMLGregorianCalendar c, java.lang.String format, java.util.TimeZone timeZone)
public static java.lang.String base64Encode(byte[] src)
src
- public static byte[] base64Decode(java.lang.String src)
src
- public static java.lang.String base64UrlEncode(byte[] src)
src
- public static byte[] base64UrlDecode(java.lang.String src)
src
- public static java.lang.String base64MimeEncode(byte[] src)
src
- public static byte[] base64MimeDecode(java.lang.String src)
src
- public static java.lang.String urlEncode(java.lang.Object parameters)
public static java.lang.String urlEncode(java.lang.Object parameters, java.nio.charset.Charset charset)
public static java.util.Map<java.lang.String,java.lang.String> urlDecode(java.lang.String urlQuery)
public static java.util.Map<java.lang.String,java.lang.String> urlDecode(java.lang.String urlQuery, java.nio.charset.Charset charset)
public static <T> T urlDecode(java.lang.Class<T> targetClass, java.lang.String urlQuery)
public static <T> T urlDecode(java.lang.Class<T> targetClass, java.lang.String urlQuery, java.nio.charset.Charset charset)
public static java.lang.String guid()
UUID.randomUUID().
public static java.lang.String uuid()
UUID.randomUUID().
public static OptionalInt createInteger(java.lang.String str)
Convert a String
to a Integer
, handling hex
(0xhhhh) and octal (0dddd) notations. N.B. a leading zero means octal;
spaces are not trimmed.
Returns an empty OptionalInt
if the string is null
or can't be parsed as Integer
.
str
- a String
to convert, may be nullpublic static OptionalLong createLong(java.lang.String str)
Convert a String
to a Long
; since 3.1 it
handles hex (0Xhhhh) and octal (0ddd) notations. N.B. a leading zero
means octal; spaces are not trimmed.
Returns an empty OptionalLong
if the string is null
or can't be parsed as Long
.
str
- a String
to convert, may be nullpublic static OptionalFloat createFloat(java.lang.String str)
Convert a String
to a Float
.
Returns an empty OptionalFloat
if the string is null
or can't be parsed as Float
.
str
- a String
to convert, may be nullpublic static OptionalDouble createDouble(java.lang.String str)
Convert a String
to a Double
.
Returns an empty OptionalDouble
if the string is null
or can't be parsed as Double
.
str
- a String
to convert, may be nullpublic static Optional<java.math.BigInteger> createBigInteger(java.lang.String str)
Convert a String
to a BigInteger
; since 3.2 it
handles hex (0x or #) and octal (0) notations.
Returns an empty Optional
if the string is null
or can't be parsed as BigInteger
.
str
- a String
to convert, may be nullpublic static Optional<java.math.BigDecimal> createBigDecimal(java.lang.String str)
Convert a String
to a BigDecimal
.
Returns an empty Optional
if the string is null
or can't be parsed as BigDecimal
.
str
- a String
to convert, may be nullpublic static Optional<java.lang.Number> createNumber(java.lang.String str)
Turns a string value into a java.lang.Number.
If the string starts with 0x
or -0x
(lower or upper case)
or #
or -#
, it will be interpreted as a hexadecimal
Integer - or Long, if the number of digits after the prefix is more than
8 - or BigInteger if there are more than 16 digits.
Then, the value is examined for a type qualifier on the end, i.e. one of
'f','F','d','D','l','L'
. If it is found, it starts trying to
create successively larger types from the type specified until one is
found that can represent the value.
If a type specifier is not found, it will check for a decimal point and
then try successively larger types from Integer
to
BigInteger
and from double
to
BigDecimal
.
Integral values with a leading 0
will be interpreted as octal;
the returned number will be Integer, Long or BigDecimal as appropriate.
Returns an empty Optional
if the string is null
or can't be parsed as Number
.
str
- a String containing a number, may be nullpublic static <T> T clone(T entity)
public static <T> T clone(java.lang.Class<T> targetClass, java.lang.Object entity)
targetClass
- a Java Object what allows access to properties using getter
and setter methods.entity
- a Java Object what allows access to properties using getter
and setter methods.public static <T> T copy(T entity)
entity
.entity
- a Java Object what allows access to properties using getter
and setter methods.public static <T> T copy(T entity, java.util.Collection<java.lang.String> selectPropNames)
public static <T> T copy(java.lang.Class<T> targetClass, java.lang.Object entity)
public static <T> T copy(java.lang.Class<T> targetClass, java.lang.Object entity, java.util.Collection<java.lang.String> selectPropNames)
cls
and set with
same properties retrieved by 'getXXX' method in the specified
entity
.targetClass
- a Java Object what allows access to properties using getter
and setter methods.entity
- a Java Object what allows access to properties using getter
and setter methods.selectPropNames
- public static <T> T copy(java.lang.Class<T> targetClass, java.lang.Object entity, boolean ignoreUnknownProperty, java.util.Set<java.lang.String> ignorePropNames)
public static void merge(java.lang.Object sourceEntity, java.lang.Object targetEntity)
public static void merge(java.lang.Object sourceEntity, java.lang.Object targetEntity, java.util.Collection<java.lang.String> selectPropNames)
sourceEntity
to the specified targetEntity
.sourceEntity
- a Java Object what allows access to properties using getter
and setter methods.targetEntity
- a Java Object what allows access to properties using getter
and setter methods.selectPropNames
- @SafeVarargs public static void erase(java.lang.Object entity, java.lang.String... propNames)
public static void erase(java.lang.Object entity, java.util.Collection<java.lang.String> propNames)
public static void eraseAll(java.lang.Object entity)
public static int compare(boolean a, boolean b)
public static int compare(byte a, byte b)
public static int compare(short a, short b)
public static int compare(int a, int b)
public static int compare(long a, long b)
public static int compare(float a, float b)
public static int compare(double a, double b)
public static <T extends java.lang.Comparable<? super T>> int compare(T a, T b)
public static <T> int compare(T a, T b, java.util.Comparator<? super T> cmp)
c.compare(a, b)
otherwise. Consequently, if both arguments are null
0 is
returned.
Note that if one of the arguments is null
, a
NullPointerException
may or may not be thrown depending on what
ordering policy, if any, the Comparator
chooses to
have for null
values.
T
- the type of the objects being compareda
- an objectb
- an object to be compared with a
cmp
- the Comparator
to compare the first two argumentsc.compare(a, b)
otherwise.Comparable
,
Comparator
public static <T1 extends java.lang.Comparable<T1>,T2 extends java.lang.Comparable<T2>> int compare(T1 a1, T1 b1, T2 a2, T2 b2)
(a1, b1), (a2, b2)
until they're not equal.
0
is returned if all of the pairs of values are equal.a1
- b1
- a2
- b2
- public static <T1 extends java.lang.Comparable<T1>,T2 extends java.lang.Comparable<T2>,T3 extends java.lang.Comparable<T3>> int compare(T1 a1, T1 b1, T2 a2, T2 b2, T3 a3, T3 b3)
(a1, b1), (a2, b2), (a3, b3)
until they're not equal.
0
is returned if all of the pairs of values are equal.a1
- b1
- a2
- b2
- a3
- b3
- public static <T1 extends java.lang.Comparable<T1>,T2 extends java.lang.Comparable<T2>,T3 extends java.lang.Comparable<T3>,T4 extends java.lang.Comparable<T4>> int compare(T1 a1, T1 b1, T2 a2, T2 b2, T3 a3, T3 b3, T4 a4, T4 b4)
(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.a1
- b1
- a2
- b2
- a3
- b3
- a4
- b4
- public static <T1 extends java.lang.Comparable<T1>,T2 extends java.lang.Comparable<T2>,T3 extends java.lang.Comparable<T3>,T4 extends java.lang.Comparable<T4>,T5 extends java.lang.Comparable<T5>> int compare(T1 a1, T1 b1, T2 a2, T2 b2, T3 a3, T3 b3, T4 a4, T4 b4, T5 a5, T5 b5)
(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.a1
- b1
- a2
- b2
- a3
- b3
- a4
- b4
- a5
- b5
- public static int compare(boolean[] a, boolean[] b)
public static int compare(char[] a, char[] b)
public static int compare(byte[] a, byte[] b)
public static int compare(short[] a, short[] b)
public static int compare(int[] a, int[] b)
public static int compare(long[] a, long[] b)
public static int compare(float[] a, float[] b)
public static int compare(double[] a, double[] b)
public static <T extends java.lang.Comparable<? super T>> int compare(T[] a, T[] b)
public static <T> int compare(T[] a, T[] b, java.util.Comparator<? super T> cmp)
public static <T extends java.lang.Comparable<? super T>> int compare(java.util.Collection<T> a, java.util.Collection<T> b)
public static <T> int compare(java.util.Collection<T> a, java.util.Collection<T> b, java.util.Comparator<? super T> cmp)
public static int compareIgnoreCase(java.lang.String a, java.lang.String b)
public static java.lang.String abbreviate(java.lang.String str, int maxWidth)
Abbreviates a String using ellipses. This will turn "Now is the time for all good men" into "Now is the time for..."
Specifically:
str
is less than or equals to maxWidth
characters
long, return it.(substring(str, 0, max-3) + "...")
.maxWidth
is less than 4
, throw an
IllegalArgumentException
.maxWidth
.N.abbreviate(null, *) = null N.abbreviate("", 4) = "" N.abbreviate("abcdefg", 6) = "abc..." N.abbreviate("abcdefg", 7) = "abcdefg" N.abbreviate("abcdefg", 8) = "abcdefg" N.abbreviate("abcdefg", 4) = "a..." N.abbreviate("abcdefg", 3) = IllegalArgumentException
str
- the String to check, may be nullmaxWidth
- maximum length of result String, must be at least 4""
if null or "" String inputjava.lang.IllegalArgumentException
- if the width is too smallpublic static java.lang.String reverse(java.lang.String str)
public static java.lang.String reverseDelimited(java.lang.String str, char delimiter)
Reverses a String that is delimited by a specific character.
The Strings between the delimiters are not reversed. Thus
java.lang.String becomes String.lang.java (if the delimiter is
'.'
).
N.reverseDelimited(null, *) = null N.reverseDelimited("", *) = "" N.reverseDelimited("a.b.c", 'x') = "a.b.c" N.reverseDelimited("a.b.c", ".") = "c.b.a"
str
- the String to reverse, may be nulldelimiter
- the delimiter character to usenull
if null String inputpublic static java.lang.String reverseDelimited(java.lang.String str, java.lang.String delimiter)
public static java.lang.String padStart(java.lang.String str, int minLength)
public static java.lang.String padStart(java.lang.String str, int minLength, char padChar)
str
- minLength
- padChar
- public static java.lang.String padStart(java.lang.String str, int minLength, java.lang.String padStr)
public static java.lang.String padEnd(java.lang.String str, int minLength)
public static java.lang.String padEnd(java.lang.String str, int minLength, char padChar)
str
- minLength
- padChar
- public static java.lang.String padEnd(java.lang.String str, int minLength, java.lang.String padStr)
public static java.lang.String repeatt(char ch, int n)
public static java.lang.String repeatt(char ch, int n, char delimiter)
public static java.lang.String repeatt(java.lang.String str, int repeat)
str
- repeat
- public static java.lang.String repeatt(java.lang.String str, int n, java.lang.String delimiter)
public static char toLowerCase(char ch)
public static java.lang.String toLowerCase(java.lang.String str)
Converts a String to lower case as per String.toLowerCase()
.
A null
input String returns null
.
N.toLowerCase(null) = null N.toLowerCase("") = "" N.toLowerCase("aBc") = "abc"
Note: As described in the documentation for
String.toLowerCase()
, the result of this method is affected by
the current locale. For platform-independent case transformations, the
method toLowerCase(String, Locale)
should be used with a specific
locale (e.g. Locale.ENGLISH
).
str
- the String to lower case, may be nullnull
if null String inputpublic static java.lang.String toLowerCase(java.lang.String str, java.util.Locale locale)
Converts a String to lower case as per String.toLowerCase(Locale)
.
A null
input String returns null
.
N.toLowerCase(null, Locale.ENGLISH) = null N.toLowerCase("", Locale.ENGLISH) = "" N.toLowerCase("aBc", Locale.ENGLISH) = "abc"
str
- the String to lower case, may be nulllocale
- the locale that defines the case transformation rules, must
not be nullnull
if null String inputpublic static java.lang.String toLowerCaseWithUnderscore(java.lang.String str)
public static char toUpperCase(char ch)
public static java.lang.String toUpperCase(java.lang.String str)
Converts a String to upper case as per String.toUpperCase()
.
A null
input String returns null
.
N.toUpperCase(null) = null N.toUpperCase("") = "" N.toUpperCase("aBc") = "ABC"
Note: As described in the documentation for
String.toUpperCase()
, the result of this method is affected by
the current locale. For platform-independent case transformations, the
method toLowerCase(String, Locale)
should be used with a specific
locale (e.g. Locale.ENGLISH
).
str
- the String to upper case, may be nullnull
if null String inputpublic static java.lang.String toUpperCase(java.lang.String str, java.util.Locale locale)
Converts a String to upper case as per String.toUpperCase(Locale)
.
A null
input String returns null
.
N.toUpperCase(null, Locale.ENGLISH) = null N.toUpperCase("", Locale.ENGLISH) = "" N.toUpperCase("aBc", Locale.ENGLISH) = "ABC"
str
- the String to upper case, may be nulllocale
- the locale that defines the case transformation rules, must
not be nullnull
if null String inputpublic static java.lang.String toUpperCaseWithUnderscore(java.lang.String str)
public static char swapCase(char ch)
public static java.lang.String swapCase(java.lang.String str)
Swaps the case of a String changing upper and title case to lower case, and lower case to upper case.
For a word based algorithm, see
WordUtils.swapCase(String)
. A
null
input String returns null
.
N.swapCase(null) = null N.swapCase("") = "" N.swapCase("The dog has a BONE") = "tHE DOG HAS A bone"
NOTE: This method changed in Lang version 2.0. It no longer performs a word based algorithm. If you only use ASCII, you will notice no change. That functionality is available in org.apache.commons.lang3.text.WordUtils.
str
- the String to swap case, may be nullnull
if null String inputpublic static java.lang.String capitalize(java.lang.String str)
str
- public static java.lang.String uncapitalize(java.lang.String str)
str
- public static java.lang.String quoteEscaped(java.lang.String str)
null
or empty.str
- public static java.lang.String unicodeEscaped(char ch)
Converts the char to the unicode format ' '.
This format is the Java source code format.
CharUtils.unicodeEscaped(' ') = " " CharUtils.unicodeEscaped('A') = "A"
ch
- the character to convertpublic static java.lang.String normalizeSpace(java.lang.String str)
Similar to http://www.w3.org/TR/xpath/#function-normalize -space
The function returns the argument string with whitespace normalized by
using
to remove leading and trailing
whitespace and then replacing sequences of whitespace characters by a
single space.
trim(String)
Java's regexp pattern \s defines whitespace as [ \t\n\x0B\f\r]
For reference:
The difference is that Java's whitespace includes vertical tab and form
feed, which this functional will also normalize. Additionally
removes control characters (char <=
32) from both ends of this String.
trim(String)
str
- the source String to normalize whitespaces from, may be nullnull
if
null String inputPattern
,
trim(String)
,
http://www.w3.org/TR/xpath/#function-normalize-spacepublic static java.lang.String replaceAll(java.lang.String str, java.lang.String target, java.lang.String replacement)
Replaces all occurrences of a String within another String.
A null
reference passed to this method is a no-op.
N.replaceAll(null, *, *) = null N.replaceAll("", *, *) = "" N.replaceAll("any", null, *) = "any" N.replaceAll("any", *, null) = "any" N.replaceAll("any", "", *) = "any" N.replaceAll("aba", "a", null) = "aba" N.replaceAll("aba", "a", "") = "b" N.replaceAll("aba", "a", "z") = "zbz"
str
- text to search and replace in, may be nulltarget
- the String to search for, may be nullreplacement
- the String to replace it with, may be nullnull
if null
String input#replaceAll(String text, String searchString, String replacement,
int max)
public static java.lang.String replaceAll(java.lang.String str, int fromIndex, java.lang.String target, java.lang.String replacement)
public static java.lang.String replace(java.lang.String str, int fromIndex, java.lang.String target, java.lang.String replacement, int max)
Replaces a String with another String inside a larger String, for the
first max
values of the search String.
A null
reference passed to this method is a no-op.
N.replace(null, *, *, *) = null N.replace("", *, *, *) = "" N.replace("any", null, *, *) = "any" N.replace("any", "", *, *) = "any" N.replace("any", *, *, 0) = "any" N.replace("abaa", 0, "a", null, -1) = "abaa" N.replace("abaa", 0, "a", "", -1) = "b" N.replace("abaa", 0, "a", "z", 0) = "abaa" N.replace("abaa", 0, "a", "z", 1) = "zbaa" N.replace("abaa", 0, "a", "z", 2) = "zbza" N.replace("abaa", 0, "a", "z", -1) = "zbzz"
str
- text to search and replace in, may be nullfromIndex
- target
- the String to search for, may be nullreplacement
- the String to replace it with, can't be nullmax
- maximum number of values to replace, or -1
if no
maximumnull
if null
String inputpublic static java.lang.String replaceAllIgnoreCase(java.lang.String str, java.lang.String target, java.lang.String replacement)
public static java.lang.String replaceAllIgnoreCase(java.lang.String str, int fromIndex, java.lang.String target, java.lang.String replacement)
public static java.lang.String replaceIgnoreCase(java.lang.String str, int fromIndex, java.lang.String target, java.lang.String replacement, int max)
public static java.lang.String replacePattern(java.lang.String source, java.lang.String regex, java.lang.String replacement)
Pattern.DOTALL
option. DOTALL is also know as single-line mode in
Perl. This call is also equivalent to:
source.replaceAll("(?s)" + regex, replacement)
Pattern.compile(regex, Pattern.DOTALL).filter(source).replaceAll(replacement)
source
- the source stringregex
- the regular expression to which this string is to be matchedreplacement
- the string to be substituted for each matchString
String.replaceAll(String, String)
,
Pattern.DOTALL
public static java.lang.String removeStart(java.lang.String str, java.lang.String removeStr)
Removes a substring only if it is at the beginning of a source string, otherwise returns the source string.
A null
source string will return null
. An empty ("")
source string will return the empty string. A null
search string
will return the source string.
N.removeStart(null, *) = null N.removeStart("", *) = "" N.removeStart(*, null) = * N.removeStart("www.domain.com", "www.") = "domain.com" N.removeStart("domain.com", "www.") = "domain.com" N.removeStart("www.domain.com", "domain") = "www.domain.com" N.removeStart("abc", "") = "abc"
str
- the source String to search, may be nullremoveStr
- the String to search for and remove, may be nullnull
if
null String inputpublic static java.lang.String removeStartIgnoreCase(java.lang.String str, java.lang.String removeStr)
Case insensitive removal of a substring if it is at the beginning of a source string, otherwise returns the source string.
A null
source string will return null
. An empty ("")
source string will return the empty string. A null
search string
will return the source string.
N.removeStartIgnoreCase(null, *) = null N.removeStartIgnoreCase("", *) = "" N.removeStartIgnoreCase(*, null) = * N.removeStartIgnoreCase("www.domain.com", "www.") = "domain.com" N.removeStartIgnoreCase("www.domain.com", "WWW.") = "domain.com" N.removeStartIgnoreCase("domain.com", "www.") = "domain.com" N.removeStartIgnoreCase("www.domain.com", "domain") = "www.domain.com" N.removeStartIgnoreCase("abc", "") = "abc"
str
- the source String to search, may be nullremoveStr
- the String to search for (case insensitive) and remove, may be
nullnull
if
null String inputpublic static java.lang.String removeEnd(java.lang.String str, java.lang.String removeStr)
Removes a substring only if it is at the end of a source string, otherwise returns the source string.
A null
source string will return null
. An empty ("")
source string will return the empty string. A null
search string
will return the source string.
N.removeEnd(null, *) = null N.removeEnd("", *) = "" N.removeEnd(*, null) = * N.removeEnd("www.domain.com", ".com.") = "www.domain.com" N.removeEnd("www.domain.com", ".com") = "www.domain" N.removeEnd("www.domain.com", "domain") = "www.domain.com" N.removeEnd("abc", "") = "abc"
str
- the source String to search, may be nullremoveStr
- the String to search for and remove, may be nullnull
if
null String inputpublic static java.lang.String removeEndIgnoreCase(java.lang.String str, java.lang.String removeStr)
Case insensitive removal of a substring if it is at the end of a source string, otherwise returns the source string.
A null
source string will return null
. An empty ("")
source string will return the empty string. A null
search string
will return the source string.
N.removeEndIgnoreCase(null, *) = null N.removeEndIgnoreCase("", *) = "" N.removeEndIgnoreCase(*, null) = * N.removeEndIgnoreCase("www.domain.com", ".com.") = "www.domain.com" N.removeEndIgnoreCase("www.domain.com", ".com") = "www.domain" N.removeEndIgnoreCase("www.domain.com", "domain") = "www.domain.com" N.removeEndIgnoreCase("abc", "") = "abc" N.removeEndIgnoreCase("www.domain.com", ".COM") = "www.domain") N.removeEndIgnoreCase("www.domain.COM", ".com") = "www.domain")
str
- the source String to search, may be nullremoveStr
- the String to search for (case insensitive) and remove, may be
nullnull
if
null String inputpublic static java.lang.String removeAll(java.lang.String str, char removeChar)
Removes all occurrences of a character from within the source string.
A null
source string will return null
. An empty ("")
source string will return the empty string.
N.remove(null, *) = null N.remove("", *) = "" N.remove("queued", 'u') = "qeed" N.remove("queued", 'z') = "queued"
str
- the source String to search, may be nullremoveChar
- the char to search for and remove, may be nullnull
if
null String inputpublic static java.lang.String removeAll(java.lang.String str, int fromIndex, char removeChar)
public static java.lang.String removeAll(java.lang.String str, java.lang.String removeStr)
Removes all occurrences of a substring from within the source string.
A null
source string will return null
. An empty ("")
source string will return the empty string. A null
remove string
will return the source string. An empty ("") remove string will return
the source string.
N.remove(null, *) = null N.remove("", *) = "" N.remove(*, null) = * N.remove(*, "") = * N.remove("queued", "ue") = "qd" N.remove("queued", "zz") = "queued"
str
- the source String to search, may be nullremoveStr
- the String to search for and remove, may be nullnull
if
null String inputpublic static java.lang.String removeAll(java.lang.String str, int fromIndex, java.lang.String removeStr)
public static java.lang.String removePattern(java.lang.String source, java.lang.String regex)
source
- the source stringregex
- the regular expression to which this string is to be matchedString
String.replaceAll(String, String)
,
Pattern.DOTALL
public static java.lang.String[] split(java.lang.String str, char delimiter)
public static java.lang.String[] split(java.lang.String str, char delimiter, boolean trim)
public static java.lang.String[] split(java.lang.String str, java.lang.String delimiter)
public static java.lang.String[] split(java.lang.String str, java.lang.String delimiter, boolean trim)
public static java.lang.String[] split(java.lang.String str, java.lang.String delimiter, int max)
public static java.lang.String[] split(java.lang.String str, java.lang.String delimiter, int max, boolean trim)
public static java.lang.String[] splitPreserveAllTokens(java.lang.String str, char delimiter)
public static java.lang.String[] splitPreserveAllTokens(java.lang.String str, char delimiter, boolean trim)
public static java.lang.String[] splitPreserveAllTokens(java.lang.String str, java.lang.String delimiter)
public static java.lang.String[] splitPreserveAllTokens(java.lang.String str, java.lang.String delimiter, boolean trim)
public static java.lang.String[] splitPreserveAllTokens(java.lang.String str, java.lang.String delimiter, int max)
public static java.lang.String[] splitPreserveAllTokens(java.lang.String str, java.lang.String delimiter, int max, boolean trim)
public static java.lang.String trim(java.lang.String str)
Removes control characters (char <= 32) from both ends of this String,
handling null
by returning null
.
The String is trimmed using String.trim()
. Trim removes start and
end characters <= 32. To strip whitespace use strip(String)
.
To trim your choice of characters, use the strip(String, String)
methods.
N.trim(null) = null N.trim("") = "" N.trim(" ") = "" N.trim("abc") = "abc" N.trim(" abc ") = "abc"
str
- the String to be trimmed, may be nullnull
if null String inputpublic static java.lang.String[] trim(java.lang.String[] strs)
public static java.lang.String trimToNull(java.lang.String str)
Removes control characters (char <= 32) from both ends of this String
returning null
if the String is empty ("") after the trim or if
it is null
.
The String is trimmed using String.trim()
. Trim removes start and
end characters <= 32. To strip whitespace use
stripToNull(String)
.
N.trimToNull(null) = null N.trimToNull("") = null N.trimToNull(" ") = null N.trimToNull("abc") = "abc" N.trimToNull(" abc ") = "abc"
str
- the String to be trimmed, may be nullnull
if only chars <= 32, empty or
null String inputpublic static java.lang.String[] trimToNull(java.lang.String[] strs)
public static java.lang.String trimToEmpty(java.lang.String str)
Removes control characters (char <= 32) from both ends of this String
returning an empty String ("") if the String is empty ("") after the trim
or if it is null
.
The String is trimmed using String.trim()
. Trim removes start and
end characters <= 32. To strip whitespace use
stripToEmpty(String)
.
N.trimToEmpty(null) = "" N.trimToEmpty("") = "" N.trimToEmpty(" ") = "" N.trimToEmpty("abc") = "abc" N.trimToEmpty(" abc ") = "abc"
str
- the String to be trimmed, may be nullnull
inputpublic static java.lang.String[] trimToEmpty(java.lang.String[] strs)
public static java.lang.String strip(java.lang.String str)
Strips whitespace from the start and end of a String.
This is similar to trim(String)
but removes whitespace.
Whitespace is defined by Character.isWhitespace(char)
.
A null
input String returns null
.
N.strip(null) = null N.strip("") = "" N.strip(" ") = "" N.strip("abc") = "abc" N.strip(" abc") = "abc" N.strip("abc ") = "abc" N.strip(" abc ") = "abc" N.strip(" ab c ") = "ab c"
str
- the String to remove whitespace from, may be nullnull
if null String inputpublic static java.lang.String[] strip(java.lang.String[] strs)
public static java.lang.String stripToNull(java.lang.String str)
Strips whitespace from the start and end of a String returning
null
if the String is empty ("") after the strip.
This is similar to trimToNull(String)
but removes whitespace.
Whitespace is defined by Character.isWhitespace(char)
.
N.stripToNull(null) = null N.stripToNull("") = null N.stripToNull(" ") = null N.stripToNull("abc") = "abc" N.stripToNull(" abc") = "abc" N.stripToNull("abc ") = "abc" N.stripToNull(" abc ") = "abc" N.stripToNull(" ab c ") = "ab c"
str
- the String to be stripped, may be nullnull
if whitespace, empty or null
String inputpublic static java.lang.String[] stripToNull(java.lang.String[] strs)
public static java.lang.String stripToEmpty(java.lang.String str)
Strips whitespace from the start and end of a String returning an empty
String if null
input.
This is similar to trimToEmpty(String)
but removes whitespace.
Whitespace is defined by Character.isWhitespace(char)
.
N.stripToEmpty(null) = "" N.stripToEmpty("") = "" N.stripToEmpty(" ") = "" N.stripToEmpty("abc") = "abc" N.stripToEmpty(" abc") = "abc" N.stripToEmpty("abc ") = "abc" N.stripToEmpty(" abc ") = "abc" N.stripToEmpty(" ab c ") = "ab c"
str
- the String to be stripped, may be nullnull
inputpublic static java.lang.String[] stripToEmpty(java.lang.String[] strs)
public static java.lang.String strip(java.lang.String str, java.lang.String stripChars)
Strips any of a set of characters from the start and end of a String.
This is similar to String.trim()
but allows the characters to be
stripped to be controlled.
A null
input String returns null
. An empty string ("")
input returns the empty string.
If the stripChars String is null
, whitespace is stripped as
defined by Character.isWhitespace(char)
. Alternatively use
strip(String)
.
N.strip(null, *) = null N.strip("", *) = "" N.strip("abc", null) = "abc" N.strip(" abc", null) = "abc" N.strip("abc ", null) = "abc" N.strip(" abc ", null) = "abc" N.strip(" abcyx", "xyz") = " abc"
str
- the String to remove characters from, may be nullstripChars
- the characters to remove, null treated as whitespacenull
if null String inputpublic static java.lang.String[] strip(java.lang.String[] strs, java.lang.String stripChars)
public static java.lang.String stripStart(java.lang.String str, java.lang.String stripChars)
Strips any of a set of characters from the start of a String.
A null
input String returns null
. An empty string ("")
input returns the empty string.
If the stripChars String is null
, whitespace is stripped as
defined by Character.isWhitespace(char)
.
N.stripStart(null, *) = null N.stripStart("", *) = "" N.stripStart("abc", "") = "abc" N.stripStart("abc", null) = "abc" N.stripStart(" abc", null) = "abc" N.stripStart("abc ", null) = "abc " N.stripStart(" abc ", null) = "abc " N.stripStart("yxabc ", "xyz") = "abc "
str
- the String to remove characters from, may be nullstripChars
- the characters to remove, null treated as whitespacenull
if null String inputpublic static java.lang.String[] stripStart(java.lang.String[] strs, java.lang.String stripChars)
public static java.lang.String stripEnd(java.lang.String str, java.lang.String stripChars)
Strips any of a set of characters from the end of a String.
A null
input String returns null
. An empty string ("")
input returns the empty string.
If the stripChars String is null
, whitespace is stripped as
defined by Character.isWhitespace(char)
.
N.stripEnd(null, *) = null N.stripEnd("", *) = "" N.stripEnd("abc", "") = "abc" N.stripEnd("abc", null) = "abc" N.stripEnd(" abc", null) = " abc" N.stripEnd("abc ", null) = "abc" N.stripEnd(" abc ", null) = " abc" N.stripEnd(" abcyx", "xyz") = " abc" N.stripEnd("120.00", ".0") = "12"
str
- the String to remove characters from, may be nullstripChars
- the set of characters to remove, null treated as whitespacenull
if null String inputpublic static java.lang.String[] stripEnd(java.lang.String[] strs, java.lang.String stripChars)
public static java.lang.String stripAccents(java.lang.String str)
Removes diacritics (~= accents) from a string. The case will not be altered.
For instance, 'à' will be replaced by 'a'.
Note that ligatures will be left as is.
N.stripAccents(null) = null N.stripAccents("") = "" N.stripAccents("control") = "control" N.stripAccents("éclair") = "eclair"
strs
- String to be strippedpublic static java.lang.String[] stripAccents(java.lang.String[] strs)
public static java.lang.String chomp(java.lang.String str)
Removes one newline from end of a String if it's there, otherwise leave
it alone. A newline is "\n
", "\r
",
or "\r\n
".
NOTE: This method changed in 2.0. It now more closely matches Perl chomp.
N.chomp(null) = null N.chomp("") = "" N.chomp("abc \r") = "abc " N.chomp("abc\n") = "abc" N.chomp("abc\r\n") = "abc" N.chomp("abc\r\n\r\n") = "abc\r\n" N.chomp("abc\n\r") = "abc\n" N.chomp("abc\n\rabc") = "abc\n\rabc" N.chomp("\r") = "" N.chomp("\n") = "" N.chomp("\r\n") = ""
str
- the String to chomp a newline from, may be nullnull
if null String inputpublic static java.lang.String[] chomp(java.lang.String[] strs)
public static java.lang.String chop(java.lang.String str)
Remove the last character from a String.
If the String ends in \r\n
, then remove both of them.
N.chop(null) = null N.chop("") = "" N.chop("abc \r") = "abc " N.chop("abc\n") = "abc" N.chop("abc\r\n") = "abc" N.chop("abc") = "ab" N.chop("abc\nabc") = "abc\nab" N.chop("a") = "" N.chop("\r") = "" N.chop("\n") = "" N.chop("\r\n") = ""
str
- the String to chop last character from, may be nullnull
if null String inputpublic static java.lang.String[] chop(java.lang.String[] strs)
public static java.lang.String deleteWhitespace(java.lang.String str)
Deletes all white spaces from a String as defined by
Character.isWhitespace(char)
.
N.deleteWhitespace(null) = null N.deleteWhitespace("") = "" N.deleteWhitespace("abc") = "abc" N.deleteWhitespace(" ab c ") = "abc"
str
- the String to delete whitespace from, may be nullnull
if null String inputpublic static java.lang.String[] deleteWhitespace(java.lang.String[] strs)
public static java.lang.String appendIfMissing(java.lang.String str, java.lang.String suffix)
str
- suffix
- public static java.lang.String prependIfMissing(java.lang.String str, java.lang.String prefix)
public static java.lang.String wrapIfMissing(java.lang.String str, java.lang.String prefixSuffix)
public static java.lang.String wrapIfMissing(java.lang.String str, java.lang.String prefix, java.lang.String suffix)
N.wrapIfMissing(null, "[", "]") -> "[]" N.wrapIfMissing("", "[", "]") -> "[]" N.wrapIfMissing("[", "[", "]") -> "[]" N.wrapIfMissing("]", "[", "]") -> "[]" N.wrapIfMissing("abc", "[", "]") -> "[abc]" N.wrapIfMissing("a", "aa", "aa") -> "aaaaa" N.wrapIfMissing("aa", "aa", "aa") -> "aaaa" N.wrapIfMissing("aaa", "aa", "aa") -> "aaaaa" N.wrapIfMissing("aaaa", "aa", "aa") -> "aaaa"
str
- prefix
- suffix
- public static java.lang.String wrap(java.lang.String str, java.lang.String prefixSuffix)
public static java.lang.String wrap(java.lang.String str, java.lang.String prefix, java.lang.String suffix)
N.wrap(null, "[", "]") -> "[]" N.wrap("", "[", "]") -> "[]" N.wrap("[", "[", "]") -> "[[]" N.wrap("]", "[", "]") -> "[]]" N.wrap("abc", "[", "]") -> "[abc]" N.wrap("a", "aa", "aa") -> "aaaaa" N.wrap("aa", "aa", "aa") -> "aaaaaa" N.wrap("aaa", "aa", "aa") -> "aaaaaaa"
str
- prefix
- suffix
- public static java.lang.String unwrap(java.lang.String str, java.lang.String prefixSuffix)
public static java.lang.String unwrap(java.lang.String str, java.lang.String prefix, java.lang.String suffix)
Unwraps the specified string str
if and only if it's wrapped by the specified prefix
and suffix
N.unwrap(null, "[", "]") -> "" N.unwrap("", "[", "]") -> "" N.unwrap("[", "[", "]") -> "[" N.unwrap("]", "[", "]") -> "[" N.unwrap("[abc]", "[", "]") -> "abc" N.unwrap("aaaaa", "aa", "aa") -> "a" N.unwrap("aa", "aa", "aa") -> "aa" N.unwrap("aaa", "aa", "aa") -> "aaa" N.unwrap("aaaa", "aa", "aa") -> ""
str
- prefix
- suffix
- public static boolean isLowerCase(char ch)
public static boolean isAsciiLowerCase(char ch)
public static boolean isUpperCase(char ch)
public static boolean isAsciiUpperCase(char ch)
public static boolean isAllLowerCase(java.lang.CharSequence cs)
public static boolean isAllUpperCase(java.lang.CharSequence cs)
public static boolean isMixedCase(java.lang.CharSequence cs)
cs
- public static boolean isDigit(char ch)
ch
- Character.isDigit(char)
public static boolean isLetter(char ch)
ch
- Character.isLetter(char)
public static boolean isLetterOrDigit(char ch)
ch
- Character.isLetterOrDigit(char)
public static boolean isAscii(char ch)
Checks whether the character is ASCII 7 bit.
CharUtils.isAscii('a') = true CharUtils.isAscii('A') = true CharUtils.isAscii('3') = true CharUtils.isAscii('-') = true CharUtils.isAscii('\n') = true CharUtils.isAscii('©') = false
ch
- the character to checkpublic static boolean isAsciiPrintable(char ch)
Checks whether the character is ASCII 7 bit printable.
CharUtils.isAsciiPrintable('a') = true CharUtils.isAsciiPrintable('A') = true CharUtils.isAsciiPrintable('3') = true CharUtils.isAsciiPrintable('-') = true CharUtils.isAsciiPrintable('\n') = false CharUtils.isAsciiPrintable('©') = false
ch
- the character to checkpublic static boolean isAsciiControl(char ch)
Checks whether the character is ASCII 7 bit control.
CharUtils.isAsciiControl('a') = false CharUtils.isAsciiControl('A') = false CharUtils.isAsciiControl('3') = false CharUtils.isAsciiControl('-') = false CharUtils.isAsciiControl('\n') = true CharUtils.isAsciiControl('©') = false
ch
- the character to checkpublic static boolean isAsciiAlpha(char ch)
Checks whether the character is ASCII 7 bit alphabetic.
CharUtils.isAsciiAlpha('a') = true CharUtils.isAsciiAlpha('A') = true CharUtils.isAsciiAlpha('3') = false CharUtils.isAsciiAlpha('-') = false CharUtils.isAsciiAlpha('\n') = false CharUtils.isAsciiAlpha('©') = false
ch
- the character to checkpublic static boolean isAsciiAlphaUpper(char ch)
Checks whether the character is ASCII 7 bit alphabetic upper case.
CharUtils.isAsciiAlphaUpper('a') = false CharUtils.isAsciiAlphaUpper('A') = true CharUtils.isAsciiAlphaUpper('3') = false CharUtils.isAsciiAlphaUpper('-') = false CharUtils.isAsciiAlphaUpper('\n') = false CharUtils.isAsciiAlphaUpper('©') = false
ch
- the character to checkpublic static boolean isAsciiAlphaLower(char ch)
Checks whether the character is ASCII 7 bit alphabetic lower case.
CharUtils.isAsciiAlphaLower('a') = true CharUtils.isAsciiAlphaLower('A') = false CharUtils.isAsciiAlphaLower('3') = false CharUtils.isAsciiAlphaLower('-') = false CharUtils.isAsciiAlphaLower('\n') = false CharUtils.isAsciiAlphaLower('©') = false
ch
- the character to checkpublic static boolean isAsciiNumeric(char ch)
Checks whether the character is ASCII 7 bit numeric.
CharUtils.isAsciiNumeric('a') = false CharUtils.isAsciiNumeric('A') = false CharUtils.isAsciiNumeric('3') = true CharUtils.isAsciiNumeric('-') = false CharUtils.isAsciiNumeric('\n') = false CharUtils.isAsciiNumeric('©') = false
ch
- the character to checkpublic static boolean isAsciiAlphanumeric(char ch)
Checks whether the character is ASCII 7 bit numeric.
CharUtils.isAsciiAlphanumeric('a') = true CharUtils.isAsciiAlphanumeric('A') = true CharUtils.isAsciiAlphanumeric('3') = true CharUtils.isAsciiAlphanumeric('-') = false CharUtils.isAsciiAlphanumeric('\n') = false CharUtils.isAsciiAlphanumeric('©') = false
ch
- the character to checkpublic static boolean isAsciiPrintable(java.lang.CharSequence cs)
public static boolean isAsciiAlpha(java.lang.CharSequence cs)
public static boolean isAsciiAlphaSpace(java.lang.CharSequence cs)
public static boolean isAsciiAlphanumeric(java.lang.CharSequence cs)
public static boolean isAsciiAlphanumericSpace(java.lang.CharSequence cs)
public static boolean isAsciiNumeric(java.lang.CharSequence cs)
public static boolean isAlpha(java.lang.CharSequence cs)
Checks if the CharSequence contains only Unicode letters.
null
or empty CharSequence (length()=0) will return false
.
N.isAlpha(null) = false N.isAlpha("") = false N.isAlpha(" ") = false N.isAlpha("abc") = true N.isAlpha("ab2c") = false N.isAlpha("ab-c") = false
cs
- the CharSequence to check, may be nulltrue
if only contains letters, and is non-nullpublic static boolean isAlphaSpace(java.lang.CharSequence cs)
Checks if the CharSequence contains only Unicode letters and space (' ').
null
or empty CharSequence (length()=0) will return false
.
N.isAlphaSpace(null) = false N.isAlphaSpace("") = false N.isAlphaSpace(" ") = true N.isAlphaSpace("abc") = true N.isAlphaSpace("ab c") = true N.isAlphaSpace("ab2c") = false N.isAlphaSpace("ab-c") = false
cs
- the CharSequence to check, may be nulltrue
if only contains letters and space, and is non-nullpublic static boolean isAlphanumeric(java.lang.CharSequence cs)
Checks if the CharSequence contains only Unicode letters or digits.
null
or empty CharSequence (length()=0) will return false
.
N.isAlphanumeric(null) = false N.isAlphanumeric("") = false N.isAlphanumeric(" ") = false N.isAlphanumeric("abc") = true N.isAlphanumeric("ab c") = false N.isAlphanumeric("ab2c") = true N.isAlphanumeric("ab-c") = false
cs
- the CharSequence to check, may be nulltrue
if only contains letters or digits, and is non-nullpublic static boolean isAlphanumericSpace(java.lang.CharSequence cs)
Checks if the CharSequence contains only Unicode letters, digits or space
(' '
).
null
or empty CharSequence (length()=0) will return false
.
N.isAlphanumericSpace(null) = false N.isAlphanumericSpace("") = false N.isAlphanumericSpace(" ") = true N.isAlphanumericSpace("abc") = true N.isAlphanumericSpace("ab c") = true N.isAlphanumericSpace("ab2c") = true N.isAlphanumericSpace("ab-c") = false
cs
- the CharSequence to check, may be nulltrue
if only contains letters, digits or space, and is
non-nullpublic static boolean isNumeric(java.lang.CharSequence cs)
Checks if the CharSequence contains only Unicode digits. A decimal point is not a Unicode digit and returns false.
null
will return false
. An empty CharSequence
(length()=0) will return false
.
Note that the method does not allow for a leading sign, either positive or negative. Also, if a String passes the numeric test, it may still generate a NumberFormatException when parsed by Integer.parseInt or Long.parseLong, e.g. if the value is outside the range for int or long respectively.
N.isNumeric(null) = false N.isNumeric("") = false N.isNumeric(" ") = false N.isNumeric("123") = true N.isNumeric("12 3") = false N.isNumeric("ab2c") = false N.isNumeric("12-3") = false N.isNumeric("12.3") = false N.isNumeric("-123") = false N.isNumeric("+123") = false
cs
- the CharSequence to check, may be nulltrue
if only contains digits, and is non-nullpublic static boolean isNumericSpace(java.lang.CharSequence cs)
Checks if the CharSequence contains only Unicode digits or space (
' '
). A decimal point is not a Unicode digit and returns false.
null
or empty CharSequence (length()=0) will return false
.
N.isNumericSpace(null) = false N.isNumericSpace("") = false N.isNumericSpace(" ") = true N.isNumericSpace("123") = true N.isNumericSpace("12 3") = true N.isNumericSpace("ab2c") = false N.isNumericSpace("12-3") = false N.isNumericSpace("12.3") = false
cs
- the CharSequence to check, may be nulltrue
if only contains digits or space, and is non-nullpublic static boolean isWhitespace(java.lang.CharSequence cs)
Checks if the CharSequence contains only whitespace.
null
or empty CharSequence (length()=0) will return false
.
N.isWhitespace(null) = false N.isWhitespace("") = false N.isWhitespace(" ") = true N.isWhitespace("abc") = false N.isWhitespace("ab2c") = false N.isWhitespace("ab-c") = false
cs
- the CharSequence to check, may be nulltrue
if only contains whitespace, and is non-nullpublic static boolean isNumber(java.lang.String str)
Checks whether the String a valid Java number. true
is
returned if there is a number which can be initialized by
createNumber
with specified String.
Null
and empty String will return false
.
str
- the String
to checktrue
if the string is a correctly formatted number0Xhhh
and octal 0ddd
validationpublic static boolean isAsciiDigtalNumber(java.lang.String str)
true
is returned if the specified str
only
includes characters ('0' ~ '9', '.', '-', '+', 'e').
false
is return if the specified String is null/empty, or contains empty chars.
"0" => true
" 0.1 " => false
"abc" => false
"1 a" => false
"2e10" => true
"2E-10" => trueval
- public static boolean isAsciiDigtalInteger(java.lang.String str)
true
is returned if the specified str
only
includes characters ('0' ~ '9', '-', '+' ).
false
is return if the specified String is null/empty, or contains empty chars.
"-123" => true
"+123" => true
"123" => true
"+0" => true
"-0" => true
"0" => true
" 0.1 " => false
"abc" => false
"1 a" => false
"2e10" => falseval
- public static boolean isEntity(java.lang.Class<?> cls)
public static boolean isDirtyMarker(java.lang.Class<?> cls)
public static boolean isPrimitive(java.lang.Class<?> cls)
public static boolean isPrimitiveWapper(java.lang.Class<?> cls)
public static boolean isPrimitiveOrWapper(java.lang.Class<?> cls)
public static boolean isPrimitiveArray(java.lang.Class<?> cls)
public static java.lang.Class<?> wrapperOf(java.lang.Class<?> primitiveClass)
public static java.lang.Class<?> primitiveOf(java.lang.Class<?> primitiveWrapperClass)
public static <T> T collection2Array(java.lang.Class<T> arrayClass, java.util.Collection<?> c)
public static <T> java.util.List<T> array2List(java.lang.Object a)
public static <T> java.util.Set<T> array2Set(java.lang.Object a)
public static <T extends java.util.Collection<?>> T array2Collection(T c, java.lang.Object a)
c
- a
- public static java.lang.String join(boolean[] a)
public static java.lang.String join(boolean[] a, char delimiter)
public static java.lang.String join(boolean[] a, java.lang.String delimiter)
public static java.lang.String join(boolean[] a, int fromIndex, int toIndex, char delimiter)
public static java.lang.String join(boolean[] a, int fromIndex, int toIndex, java.lang.String delimiter)
public static java.lang.String join(char[] a)
public static java.lang.String join(char[] a, char delimiter)
public static java.lang.String join(char[] a, java.lang.String delimiter)
public static java.lang.String join(char[] a, int fromIndex, int toIndex, char delimiter)
public static java.lang.String join(char[] a, int fromIndex, int toIndex, java.lang.String delimiter)
public static java.lang.String join(byte[] a)
public static java.lang.String join(byte[] a, char delimiter)
public static java.lang.String join(byte[] a, java.lang.String delimiter)
public static java.lang.String join(byte[] a, int fromIndex, int toIndex, char delimiter)
public static java.lang.String join(byte[] a, int fromIndex, int toIndex, java.lang.String delimiter)
public static java.lang.String join(short[] a)
public static java.lang.String join(short[] a, char delimiter)
public static java.lang.String join(short[] a, java.lang.String delimiter)
public static java.lang.String join(short[] a, int fromIndex, int toIndex, char delimiter)
public static java.lang.String join(short[] a, int fromIndex, int toIndex, java.lang.String delimiter)
public static java.lang.String join(int[] a)
public static java.lang.String join(int[] a, char delimiter)
public static java.lang.String join(int[] a, java.lang.String delimiter)
public static java.lang.String join(int[] a, int fromIndex, int toIndex, char delimiter)
public static java.lang.String join(int[] a, int fromIndex, int toIndex, java.lang.String delimiter)
public static java.lang.String join(long[] a)
public static java.lang.String join(long[] a, char delimiter)
public static java.lang.String join(long[] a, java.lang.String delimiter)
public static java.lang.String join(long[] a, int fromIndex, int toIndex, char delimiter)
public static java.lang.String join(long[] a, int fromIndex, int toIndex, java.lang.String delimiter)
public static java.lang.String join(float[] a)
public static java.lang.String join(float[] a, char delimiter)
public static java.lang.String join(float[] a, java.lang.String delimiter)
public static java.lang.String join(float[] a, int fromIndex, int toIndex, char delimiter)
public static java.lang.String join(float[] a, int fromIndex, int toIndex, java.lang.String delimiter)
public static java.lang.String join(double[] a)
public static java.lang.String join(double[] a, char delimiter)
public static java.lang.String join(double[] a, java.lang.String delimiter)
public static java.lang.String join(double[] a, int fromIndex, int toIndex, char delimiter)
public static java.lang.String join(double[] a, int fromIndex, int toIndex, java.lang.String delimiter)
public static java.lang.String join(java.lang.Object[] a)
public static java.lang.String join(java.lang.Object[] a, char delimiter)
public static java.lang.String join(java.lang.Object[] a, java.lang.String delimiter)
public static java.lang.String join(java.lang.Object[] a, int fromIndex, int toIndex, char delimiter)
public static java.lang.String join(java.lang.Object[] a, int fromIndex, int toIndex, char delimiter, boolean trim)
public static java.lang.String join(java.lang.Object[] a, int fromIndex, int toIndex, java.lang.String delimiter)
public static java.lang.String join(java.lang.Object[] a, int fromIndex, int toIndex, java.lang.String delimiter, boolean trim)
public static java.lang.String join(java.util.Collection<?> c)
public static java.lang.String join(java.util.Collection<?> c, char delimiter)
public static java.lang.String join(java.util.Collection<?> c, java.lang.String delimiter)
public static java.lang.String join(java.util.Collection<?> c, int fromIndex, int toIndex, char delimiter)
public static java.lang.String join(java.util.Collection<?> c, int fromIndex, int toIndex, char delimiter, boolean trim)
public static java.lang.String join(java.util.Collection<?> c, int fromIndex, int toIndex, java.lang.String delimiter)
public static java.lang.String join(java.util.Collection<?> c, int fromIndex, int toIndex, java.lang.String delimiter, boolean trim)
public static <T> java.util.List<T> emptyList()
Collections.emptyList()
public static <T> java.util.Set<T> emptySet()
Collections.emptySet()
public static <T> java.util.SortedSet<T> emptySortedSet()
SortedSet
that is empty.Collections.emptySortedSet()
public static <T> java.util.NavigableSet<T> emptyNavigableSet()
NavigableSet
that is empty.Collections.emptyNavigableSet()
public static <K,V> java.util.Map<K,V> emptyMap()
Collections.emptyMap()
public static <K,V> java.util.SortedMap<K,V> emptySortedMap()
SortedMap
that is empty.Collections.emptySortedMap()
public static <K,V> java.util.NavigableMap<K,V> emptyNavigableMap()
NavigableMap
that is empty.Collections.emptyNavigableMap()
public static <T> java.util.Iterator<T> emptyIterator()
Collections.emptyIterator()
public static <T> java.util.ListIterator<T> emptyListIterator()
Collections.emptyListIterator()
public static <T> boolean anyNull(T a, T b)
public static <T> boolean anyNull(T a, T b, T c)
@SafeVarargs public static <T> boolean anyNull(T... a)
public static <T> boolean anyNull(java.util.Collection<T> c)
public static <T> boolean allNull(T a, T b)
public static <T> boolean allNull(T a, T b, T c)
@SafeVarargs public static <T> boolean allNull(T... a)
public static <T> boolean allNull(java.util.Collection<T> c)
public static <T> Optional<T> firstNonNull(T a, T b)
public static <T> Optional<T> firstNonNull(T a, T b, T c)
@SafeVarargs public static <T> Optional<T> firstNonNull(T... a)
public static <T> Optional<T> firstNonNull(java.util.Collection<T> c)
public static <T> Optional<T> lastNonNull(T a, T b)
public static <T> Optional<T> lastNonNull(T a, T b, T c)
@SafeVarargs public static <T> Optional<T> lastNonNull(T... a)
public static <T> Optional<T> lastNonNull(java.util.Collection<T> c)
public static <T> java.util.List<T> nullToEmpty(java.util.List<T> list)
null
, otherwise itself is returned.list
- public static <T> java.util.Set<T> nullToEmpty(java.util.Set<T> set)
null
, otherwise itself is returned.set
- public static <T> java.util.SortedSet<T> nullToEmpty(java.util.SortedSet<T> set)
SortedSet
if the specified SortedSet is null
, otherwise itself is returned.set
- public static <T> java.util.NavigableSet<T> nullToEmpty(java.util.NavigableSet<T> set)
NavigableSet
if the specified NavigableSet is null
, otherwise itself is returned.set
- public static <K,V> java.util.Map<K,V> nullToEmpty(java.util.Map<K,V> map)
null
, otherwise itself is returned.map
- public static <K,V> java.util.SortedMap<K,V> nullToEmpty(java.util.SortedMap<K,V> map)
SortedMap
if the specified SortedMap is null
, otherwise itself is returned.map
- public static <K,V> java.util.NavigableMap<K,V> nullToEmpty(java.util.NavigableMap<K,V> map)
NavigableMap
if the specified NavigableMap is null
, otherwise itself is returned.map
- public static <T> java.util.Iterator<T> nullToEmpty(java.util.Iterator<T> iter)
Iterator
if the specified Iterator is null
, otherwise itself is returned.iter
- public static <T> java.util.ListIterator<T> nullToEmpty(java.util.ListIterator<T> iter)
ListIterator
if the specified ListIterator is null
, otherwise itself is returned.iter
- public static java.lang.String nullToEmpty(java.lang.String str)
public static boolean[] nullToEmpty(boolean[] a)
public static char[] nullToEmpty(char[] a)
public static byte[] nullToEmpty(byte[] a)
public static short[] nullToEmpty(short[] a)
public static int[] nullToEmpty(int[] a)
public static long[] nullToEmpty(long[] a)
public static float[] nullToEmpty(float[] a)
public static double[] nullToEmpty(double[] a)
public static java.lang.String[] nullToEmpty(java.lang.String[] a)
public static java.lang.Object[] nullToEmpty(java.lang.Object[] a)
public static <T> T[] nullToEmpty(java.lang.Class<T[]> arrayType, T[] a)
public static boolean isNullOrEmpty(java.lang.CharSequence s)
public static boolean isNullOrEmpty(boolean[] a)
public static boolean isNullOrEmpty(char[] a)
public static boolean isNullOrEmpty(byte[] a)
public static boolean isNullOrEmpty(short[] a)
public static boolean isNullOrEmpty(int[] a)
public static boolean isNullOrEmpty(long[] a)
public static boolean isNullOrEmpty(float[] a)
public static boolean isNullOrEmpty(double[] a)
public static boolean isNullOrEmpty(java.lang.Object[] a)
public static boolean isNullOrEmpty(java.util.Collection<?> c)
public static boolean isNullOrEmpty(java.util.Map<?,?> m)
public static boolean isNullOrEmpty(PrimitiveList list)
public static boolean isNullOrEmpty(Multiset<?> s)
public static boolean isNullOrEmpty(LongMultiset<?> s)
public static boolean isNullOrEmpty(Multimap<?,?,?> m)
public static boolean isNullOrEmpty(DataSet rs)
public static boolean isNullOrEmpty(EntityId entityId)
public static boolean isNullOrEmptyOrBlank(java.lang.CharSequence s)
public static boolean notNullOrEmpty(java.lang.CharSequence s)
public static boolean notNullOrEmpty(boolean[] a)
public static boolean notNullOrEmpty(char[] a)
public static boolean notNullOrEmpty(byte[] a)
public static boolean notNullOrEmpty(short[] a)
public static boolean notNullOrEmpty(int[] a)
public static boolean notNullOrEmpty(long[] a)
public static boolean notNullOrEmpty(float[] a)
public static boolean notNullOrEmpty(double[] a)
public static boolean notNullOrEmpty(java.lang.Object[] a)
public static boolean notNullOrEmpty(java.util.Collection<?> c)
public static boolean notNullOrEmpty(java.util.Map<?,?> m)
public static boolean notNullOrEmpty(PrimitiveList list)
public static boolean notNullOrEmpty(Multiset<?> s)
public static boolean notNullOrEmpty(LongMultiset<?> s)
public static boolean notNullOrEmpty(Multimap<?,?,?> m)
public static boolean notNullOrEmpty(DataSet rs)
public static boolean notNullOrEmpty(EntityId entityId)
public static boolean notNullOrEmptyOrBlank(java.lang.CharSequence s)
public static <T> T requireNonNull(T obj)
obj
- java.lang.NullPointerException
- if obj
is null
public static <T> T requireNonNull(T obj, java.lang.String errorMessage)
obj
- errorMessage
- java.lang.NullPointerException
- if obj
is null
public static <T extends java.lang.CharSequence> T checkNullOrEmpty(T parameter, java.lang.String msg)
parameter
- msg
- name of parameter or error messagejava.lang.IllegalArgumentException
- if the specified parameter is null or empty.public static boolean[] checkNullOrEmpty(boolean[] parameter, java.lang.String msg)
parameter
- msg
- name of parameter or error messagejava.lang.IllegalArgumentException
- if the specified parameter is null or empty.public static char[] checkNullOrEmpty(char[] parameter, java.lang.String msg)
parameter
- msg
- name of parameter or error messagejava.lang.IllegalArgumentException
- if the specified parameter is null or empty.public static byte[] checkNullOrEmpty(byte[] parameter, java.lang.String msg)
parameter
- msg
- name of parameter or error messagejava.lang.IllegalArgumentException
- if the specified parameter is null or empty.public static short[] checkNullOrEmpty(short[] parameter, java.lang.String msg)
parameter
- msg
- name of parameter or error messagejava.lang.IllegalArgumentException
- if the specified parameter is null or empty.public static int[] checkNullOrEmpty(int[] parameter, java.lang.String msg)
parameter
- msg
- name of parameter or error messagejava.lang.IllegalArgumentException
- if the specified parameter is null or empty.public static long[] checkNullOrEmpty(long[] parameter, java.lang.String msg)
parameter
- msg
- name of parameter or error messagejava.lang.IllegalArgumentException
- if the specified parameter is null or empty.public static float[] checkNullOrEmpty(float[] parameter, java.lang.String msg)
parameter
- msg
- name of parameter or error messagejava.lang.IllegalArgumentException
- if the specified parameter is null or empty.public static double[] checkNullOrEmpty(double[] parameter, java.lang.String msg)
parameter
- msg
- name of parameter or error messagejava.lang.IllegalArgumentException
- if the specified parameter is null or empty.public static <T> T[] checkNullOrEmpty(T[] parameter, java.lang.String msg)
parameter
- msg
- name of parameter or error messagejava.lang.IllegalArgumentException
- if the specified parameter is null or empty.public static <T extends PrimitiveList> T checkNullOrEmpty(T parameter, java.lang.String msg)
public static <E,T extends java.util.Collection<E>> T checkNullOrEmpty(T parameter, java.lang.String msg)
parameter
- msg
- name of parameter or error messagejava.lang.IllegalArgumentException
- if the specified parameter is null or empty.public static <K,V,T extends java.util.Map<K,V>> T checkNullOrEmpty(T parameter, java.lang.String msg)
parameter
- msg
- name of parameter or error messagejava.lang.IllegalArgumentException
- if the specified parameter is null or empty.public static <E> Multiset<E> checkNullOrEmpty(Multiset<E> parameter, java.lang.String msg)
parameter
- msg
- name of parameter or error messagejava.lang.IllegalArgumentException
- if the specified parameter is null or empty.public static <E> LongMultiset<E> checkNullOrEmpty(LongMultiset<E> parameter, java.lang.String msg)
parameter
- msg
- name of parameter or error messagejava.lang.IllegalArgumentException
- if the specified parameter is null or empty.public static <K,E,V extends java.util.Collection<E>,T extends Multimap<K,E,V>> T checkNullOrEmpty(T parameter, java.lang.String msg)
parameter
- msg
- name of parameter or error messagejava.lang.IllegalArgumentException
- if the specified parameter is null or empty.public static <T extends DataSet> T checkNullOrEmpty(T parameter, java.lang.String msg)
parameter
- msg
- name of parameter or error messagejava.lang.IllegalArgumentException
- if the specified parameter is null or empty.public static <T extends EntityId> T checkNullOrEmpty(T parameter, java.lang.String msg)
parameter
- msg
- name of parameter or error messagejava.lang.IllegalArgumentException
- if the specified parameter is null or empty.public static <T extends java.lang.CharSequence> T checkNullOrEmptyOrBlank(T parameter, java.lang.String msg)
parameter
- msg
- name of parameter or error messagejava.lang.IllegalArgumentException
- if the specified parameter is null or empty.public static void checkIndex(int index, int length)
index
is within the bounds of the range from
0
(inclusive) to length
(exclusive).
The index
is defined to be out-of-bounds if any of the
following inequalities is true:
index < 0
index >= length
length < 0
, which is implied from the former inequalitiesindex
- the indexlength
- the upper-bound (exclusive) of the rangejava.lang.IndexOutOfBoundsException
- if the index
is out-of-boundspublic static void checkFromToIndex(int fromIndex, int toIndex, int length)
fromIndex
(inclusive) to
toIndex
(exclusive) is within the bounds of range from 0
(inclusive) to length
(exclusive).
The sub-range is defined to be out-of-bounds if any of the following inequalities is true:
fromIndex < 0
fromIndex > toIndex
toIndex > length
length < 0
, which is implied from the former inequalitiesfromIndex
- the lower-bound (inclusive) of the sub-rangetoIndex
- the upper-bound (exclusive) of the sub-rangelength
- the upper-bound (exclusive) the rangejava.lang.IndexOutOfBoundsException
- if the sub-range is out-of-boundspublic static void checkFromIndexSize(int fromIndex, int size, int length)
fromIndex
(inclusive) to
fromIndex + size
(exclusive) is within the bounds of range from
0
(inclusive) to length
(exclusive).
The sub-range is defined to be out-of-bounds if any of the following inequalities is true:
fromIndex < 0
size < 0
fromIndex + size > length
, taking into account integer overflowlength < 0
, which is implied from the former inequalitiesfromIndex
- the lower-bound (inclusive) of the sub-intervalsize
- the size of the sub-rangelength
- the upper-bound (exclusive) of the rangejava.lang.IndexOutOfBoundsException
- if the sub-range is out-of-boundspublic static void checkArgument(boolean expression)
expression
- a boolean expressionjava.lang.IllegalArgumentException
- if expression
is falsepublic static void checkArgument(boolean expression, java.lang.String errorMessage)
expression
- a boolean expressionerrorMessage
- the exception message to use if the check fails; will be converted to a
string using String.valueOf(Object)
java.lang.IllegalArgumentException
- if expression
is falsepublic static void checkArgument(boolean b, java.lang.String errorMessageTemplate, boolean p)
See #checkArgument(boolean, String, Object...)
for details.
public static void checkArgument(boolean b, java.lang.String errorMessageTemplate, boolean p1, boolean p2)
See #checkArgument(boolean, String, Object...)
for details.
public static void checkArgument(boolean b, java.lang.String errorMessageTemplate, boolean p1, boolean p2, boolean p3)
See #checkArgument(boolean, String, Object...)
for details.
public static void checkArgument(boolean b, java.lang.String errorMessageTemplate, char p)
See #checkArgument(boolean, String, Object...)
for details.
public static void checkArgument(boolean b, java.lang.String errorMessageTemplate, byte p)
See #checkArgument(boolean, String, Object...)
for details.
public static void checkArgument(boolean b, java.lang.String errorMessageTemplate, short p)
See #checkArgument(boolean, String, Object...)
for details.
public static void checkArgument(boolean b, java.lang.String errorMessageTemplate, int p)
See #checkArgument(boolean, String, Object...)
for details.
public static void checkArgument(boolean b, java.lang.String errorMessageTemplate, int p1, int p2)
See #checkArgument(boolean, String, Object...)
for details.
public static void checkArgument(boolean b, java.lang.String errorMessageTemplate, int p1, int p2, int p3)
See #checkArgument(boolean, String, Object...)
for details.
public static void checkArgument(boolean b, java.lang.String errorMessageTemplate, long p)
See #checkArgument(boolean, String, Object...)
for details.
public static void checkArgument(boolean b, java.lang.String errorMessageTemplate, long p1, long p2)
See #checkArgument(boolean, String, Object...)
for details.
public static void checkArgument(boolean b, java.lang.String errorMessageTemplate, long p1, long p2, long p3)
See #checkArgument(boolean, String, Object...)
for details.
public static void checkArgument(boolean b, java.lang.String errorMessageTemplate, float p)
See #checkArgument(boolean, String, Object...)
for details.
public static void checkArgument(boolean b, java.lang.String errorMessageTemplate, float p1, float p2)
See #checkArgument(boolean, String, Object...)
for details.
public static void checkArgument(boolean b, java.lang.String errorMessageTemplate, float p1, float p2, float p3)
See #checkArgument(boolean, String, Object...)
for details.
public static void checkArgument(boolean b, java.lang.String errorMessageTemplate, double p)
See #checkArgument(boolean, String, Object...)
for details.
public static void checkArgument(boolean b, java.lang.String errorMessageTemplate, double p1, double p2)
See #checkArgument(boolean, String, Object...)
for details.
public static void checkArgument(boolean b, java.lang.String errorMessageTemplate, double p1, double p2, double p3)
See #checkArgument(boolean, String, Object...)
for details.
public static void checkArgument(boolean b, java.lang.String errorMessageTemplate, java.lang.Object p)
See #checkArgument(boolean, String, Object...)
for details.
public static void checkArgument(boolean b, java.lang.String errorMessageTemplate, java.lang.Object p1, java.lang.Object p2)
See #checkArgument(boolean, String, Object...)
for details.
public static void checkArgument(boolean b, java.lang.String errorMessageTemplate, java.lang.Object p1, java.lang.Object p2, java.lang.Object p3)
See #checkArgument(boolean, String, Object...)
for details.
public static <T extends java.lang.CharSequence> void checkArgNotNullOrEmpty(T arg, java.lang.String argNameOrErrorMsg)
arg
is null
or empty, and throws IllegalArgumentException
if it is.arg
- argNameOrErrorMsg
- java.lang.IllegalArgumentException
- if the specified arg
is null
or empty.public static void checkArgNotNullOrEmpty(boolean[] arg, java.lang.String argNameOrErrorMsg)
arg
is null
or empty, and throws IllegalArgumentException
if it is.arg
- argNameOrErrorMsg
- java.lang.IllegalArgumentException
- if the specified arg
is null
or empty.public static void checkArgNotNullOrEmpty(char[] arg, java.lang.String argNameOrErrorMsg)
arg
is null
or empty, and throws IllegalArgumentException
if it is.arg
- argNameOrErrorMsg
- java.lang.IllegalArgumentException
- if the specified arg
is null
or empty.public static void checkArgNotNullOrEmpty(byte[] arg, java.lang.String argNameOrErrorMsg)
arg
is null
or empty, and throws IllegalArgumentException
if it is.arg
- argNameOrErrorMsg
- java.lang.IllegalArgumentException
- if the specified arg
is null
or empty.public static void checkArgNotNullOrEmpty(short[] arg, java.lang.String argNameOrErrorMsg)
arg
is null
or empty, and throws IllegalArgumentException
if it is.arg
- argNameOrErrorMsg
- java.lang.IllegalArgumentException
- if the specified arg
is null
or empty.public static void checkArgNotNullOrEmpty(int[] arg, java.lang.String argNameOrErrorMsg)
arg
is null
or empty, and throws IllegalArgumentException
if it is.arg
- argNameOrErrorMsg
- java.lang.IllegalArgumentException
- if the specified arg
is null
or empty.public static void checkArgNotNullOrEmpty(long[] arg, java.lang.String argNameOrErrorMsg)
arg
is null
or empty, and throws IllegalArgumentException
if it is.arg
- argNameOrErrorMsg
- java.lang.IllegalArgumentException
- if the specified arg
is null
or empty.public static void checkArgNotNullOrEmpty(float[] arg, java.lang.String argNameOrErrorMsg)
arg
is null
or empty, and throws IllegalArgumentException
if it is.arg
- argNameOrErrorMsg
- java.lang.IllegalArgumentException
- if the specified arg
is null
or empty.public static void checkArgNotNullOrEmpty(double[] arg, java.lang.String argNameOrErrorMsg)
arg
is null
or empty, and throws IllegalArgumentException
if it is.arg
- argNameOrErrorMsg
- java.lang.IllegalArgumentException
- if the specified arg
is null
or empty.public static <T> void checkArgNotNullOrEmpty(T[] arg, java.lang.String argNameOrErrorMsg)
arg
is null
or empty, and throws IllegalArgumentException
if it is.arg
- argNameOrErrorMsg
- java.lang.IllegalArgumentException
- if the specified arg
is null
or empty.public static <T extends java.util.Collection<?>> void checkArgNotNullOrEmpty(T arg, java.lang.String argNameOrErrorMsg)
arg
is null
or empty, and throws IllegalArgumentException
if it is.arg
- argNameOrErrorMsg
- java.lang.IllegalArgumentException
- if the specified arg
is null
or empty.public static <T extends java.util.Map<?,?>> void checkArgNotNullOrEmpty(T arg, java.lang.String argNameOrErrorMsg)
arg
is null
or empty, and throws IllegalArgumentException
if it is.arg
- argNameOrErrorMsg
- java.lang.IllegalArgumentException
- if the specified arg
is null
or empty.public static void checkArgNotNegative(int arg, java.lang.String argNameOrErrorMsg)
arg
is negative, and throws IllegalArgumentException
if it is.arg
- argNameOrErrorMsg
- java.lang.IllegalArgumentException
- if the specified arg
is negative.public static void checkArgNotNegative(long arg, java.lang.String argNameOrErrorMsg)
arg
is negative, and throws IllegalArgumentException
if it is.arg
- argNameOrErrorMsg
- java.lang.IllegalArgumentException
- if the specified arg
is negative.public static void checkState(boolean expression)
expression
- a boolean expressionjava.lang.IllegalStateException
- if expression
is falsepublic static void checkState(boolean expression, java.lang.String errorMessage)
expression
- a boolean expressionerrorMessage
- the exception message to use if the check fails; will be converted to a
string using String.valueOf(Object)
java.lang.IllegalStateException
- if expression
is falsepublic static void checkState(boolean b, java.lang.String errorMessageTemplate, int p)
See #checkState(boolean, String, Object...)
for details.
public static void checkState(boolean b, java.lang.String errorMessageTemplate, int p1, int p2)
See #checkState(boolean, String, Object...)
for details.
public static void checkState(boolean b, java.lang.String errorMessageTemplate, int p1, int p2, int p3)
See #checkState(boolean, String, Object...)
for details.
public static void checkState(boolean b, java.lang.String errorMessageTemplate, double p)
See #checkState(boolean, String, Object...)
for details.
public static void checkState(boolean b, java.lang.String errorMessageTemplate, double p1, double p2)
See #checkState(boolean, String, Object...)
for details.
public static void checkState(boolean b, java.lang.String errorMessageTemplate, double p1, double p2, double p3)
See #checkState(boolean, String, Object...)
for details.
public static void checkState(boolean b, java.lang.String errorMessageTemplate, java.lang.Object p)
See #checkState(boolean, String, Object...)
for details.
public static void checkState(boolean b, java.lang.String errorMessageTemplate, java.lang.Object p1, java.lang.Object p2)
See #checkState(boolean, String, Object...)
for details.
public static void checkState(boolean b, java.lang.String errorMessageTemplate, java.lang.Object p1, java.lang.Object p2, java.lang.Object p3)
See #checkState(boolean, String, Object...)
for details.
public static boolean equals(boolean a, boolean b)
a
- b
- public static boolean equals(char a, char b)
a
- b
- public static boolean equals(byte a, byte b)
a
- b
- public static boolean equals(short a, short b)
a
- b
- public static boolean equals(int a, int b)
a
- b
- public static boolean equals(long a, long b)
a
- b
- public static boolean equals(float a, float b)
a
- b
- public static boolean equals(double a, double b)
a
- b
- public static boolean equals(java.lang.String a, java.lang.String b)
a
- b
- public static boolean equalsIgnoreCase(java.lang.String a, java.lang.String b)
a
- b
- public static boolean equals(java.lang.Object a, java.lang.Object b)
a
and b
by
Arrays.equals(Object[], Object[])
if both of them are array.a
- b
- public static boolean deepEquals(java.lang.Object a, java.lang.Object b)
a
and b
by
Arrays.equals(Object[], Object[])
if both of them are array.a
- b
- public static boolean equals(boolean[] a, boolean[] b)
a
- b
- Arrays.equals(boolean[], boolean[])
public static boolean equals(boolean[] a, int fromIndexA, boolean[] b, int fromIndexB, int len)
a
- fromIndexA
- b
- fromIndexB
- len
- public static boolean equals(char[] a, char[] b)
a
- b
- Arrays.equals(char[], char[])
public static boolean equals(char[] a, int fromIndexA, char[] b, int fromIndexB, int len)
a
- fromIndexA
- b
- fromIndexB
- len
- public static boolean equals(byte[] a, byte[] b)
a
- b
- Arrays.equals(byte[], byte[])
public static boolean equals(byte[] a, int fromIndexA, byte[] b, int fromIndexB, int len)
a
- fromIndexA
- b
- fromIndexB
- len
- public static boolean equals(short[] a, short[] b)
a
- b
- Arrays.equals(short[], short[])
public static boolean equals(short[] a, int fromIndexA, short[] b, int fromIndexB, int len)
a
- fromIndexA
- b
- fromIndexB
- len
- public static boolean equals(int[] a, int[] b)
a
- b
- Arrays.equals(int[], int[])
public static boolean equals(int[] a, int fromIndexA, int[] b, int fromIndexB, int len)
a
- fromIndexA
- b
- fromIndexB
- len
- public static boolean equals(long[] a, long[] b)
a
- b
- Arrays.equals(long[], long[])
public static boolean equals(long[] a, int fromIndexA, long[] b, int fromIndexB, int len)
a
- fromIndexA
- b
- fromIndexB
- len
- public static boolean equals(float[] a, float[] b)
a
- b
- Arrays.equals(float[], float[])
public static boolean equals(float[] a, int fromIndexA, float[] b, int fromIndexB, int len)
a
- fromIndexA
- b
- fromIndexB
- len
- public static boolean equals(double[] a, double[] b)
a
- b
- Arrays.equals(double[], double[])
public static boolean equals(double[] a, int fromIndexA, double[] b, int fromIndexB, int len)
a
- fromIndexA
- b
- fromIndexB
- len
- public static boolean equals(java.lang.Object[] a, java.lang.Object[] b)
a
- b
- Arrays.equals(Object[], Object[])
public static boolean equals(java.lang.Object[] a, int fromIndexA, java.lang.Object[] b, int fromIndexB, int len)
a
- fromIndexA
- b
- fromIndexB
- len
- public static boolean deepEquals(java.lang.Object[] a, java.lang.Object[] b)
a
- b
- Arrays.deepEquals(Object[], Object[])
public static boolean deepEquals(java.lang.Object[] a, int fromIndexA, java.lang.Object[] b, int fromIndexB, int len)
public static boolean equalsIgnoreCase(java.lang.String[] a, java.lang.String[] b)
public static boolean equalsIgnoreCase(java.lang.String[] a, int fromIndexA, java.lang.String[] b, int fromIndexB, int len)
a
- fromIndexA
- b
- fromIndexB
- len
- public static int hashCode(boolean value)
value
- public static int hashCode(char value)
value
- public static int hashCode(byte value)
value
- public static int hashCode(short value)
value
- public static int hashCode(int value)
vaue
- public static int hashCode(long value)
value
- public static int hashCode(float value)
value
- public static int hashCode(double value)
value
- public static int hashCode(java.lang.Object obj)
obj
- public static int deepHashCode(java.lang.Object obj)
obj
- public static int hashCode(boolean[] a)
a
- Arrays.hashCode(boolean[])
public static int hashCode(boolean[] a, int fromIndex, int toIndex)
public static int hashCode(char[] a)
a
- Arrays.hashCode(char[])
public static int hashCode(char[] a, int fromIndex, int toIndex)
public static int hashCode(byte[] a)
a
- Arrays.hashCode(byte[])
public static int hashCode(byte[] a, int fromIndex, int toIndex)
public static int hashCode(short[] a)
a
- Arrays.hashCode(short[])
public static int hashCode(short[] a, int fromIndex, int toIndex)
public static int hashCode(int[] a)
a
- Arrays.hashCode(int[])
public static int hashCode(int[] a, int fromIndex, int toIndex)
public static int hashCode(long[] a)
a
- Arrays.hashCode(long[])
public static int hashCode(long[] a, int fromIndex, int toIndex)
public static int hashCode(float[] a)
a
- Arrays.hashCode(float[])
public static int hashCode(float[] a, int fromIndex, int toIndex)
public static int hashCode(double[] a)
a
- Arrays.hashCode(double[])
public static int hashCode(double[] a, int fromIndex, int toIndex)
public static int hashCode(java.lang.Object[] a)
a
- Arrays.hashCode(Object[])
public static int hashCode(java.lang.Object[] a, int fromIndex, int toIndex)
public static int deepHashCode(java.lang.Object[] a)
a
- Arrays.deepHashCode(Object[])
public static int deepHashCode(java.lang.Object[] a, int fromIndex, int toIndex)
public static java.lang.String toString(boolean value)
value
- public static java.lang.String toString(char value)
value
- public static java.lang.String toString(byte value)
value
- public static java.lang.String toString(short value)
value
- public static java.lang.String toString(int value)
vaue
- public static java.lang.String toString(long value)
value
- public static java.lang.String toString(float value)
value
- public static java.lang.String toString(double value)
value
- public static java.lang.String toString(java.lang.Object obj)
obj
- public static java.lang.String deepToString(java.lang.Object obj)
obj
- public static java.lang.String toString(boolean[] a)
a
- Arrays.toString(boolean[])
public static java.lang.String toString(boolean[] a, int from, int to)
public static java.lang.String toString(char[] a)
a
- Arrays.toString(char[])
public static java.lang.String toString(char[] a, int from, int to)
public static java.lang.String toString(byte[] a)
a
- Arrays.toString(byte[])
public static java.lang.String toString(byte[] a, int from, int to)
public static java.lang.String toString(short[] a)
a
- Arrays.toString(short[])
public static java.lang.String toString(short[] a, int from, int to)
public static java.lang.String toString(int[] a)
a
- Arrays.toString(int[])
public static java.lang.String toString(int[] a, int from, int to)
public static java.lang.String toString(long[] a)
a
- Arrays.toString(long[])
public static java.lang.String toString(long[] a, int from, int to)
public static java.lang.String toString(float[] a)
a
- Arrays.toString(float[])
public static java.lang.String toString(float[] a, int from, int to)
public static java.lang.String toString(double[] a)
a
- Arrays.toString(double[])
public static java.lang.String toString(double[] a, int from, int to)
public static java.lang.String toString(java.lang.Object[] a)
a
- Arrays.toString(Object[])
public static java.lang.String toString(java.lang.Object[] a, int from, int to)
public static java.lang.String toString(java.lang.Object a, java.lang.String defaultIfNull)
public static java.lang.String deepToString(java.lang.Object[] a)
a
- Arrays.deepToString(Object[])
public static java.lang.String deepToString(java.lang.Object[] a, int from, int to)
public static java.lang.String deepToString(java.lang.Object[] a, java.lang.String defaultIfNull)
public static void reverse(boolean[] a)
Reverses the order of the given array.
a
- public static void reverse(boolean[] a, int fromIndex, int toIndex)
Reverses the order of the given array in the given range.
a
- fromIndex
- toIndex
- public static void reverse(char[] a)
Reverses the order of the given array.
a
- public static void reverse(char[] a, int fromIndex, int toIndex)
Reverses the order of the given array in the given range.
a
- fromIndex
- toIndex
- public static void reverse(byte[] a)
Reverses the order of the given array.
a
- public static void reverse(byte[] a, int fromIndex, int toIndex)
Reverses the order of the given array in the given range.
a
- fromIndex
- toIndex
- public static void reverse(short[] a)
Reverses the order of the given array.
a
- public static void reverse(short[] a, int fromIndex, int toIndex)
Reverses the order of the given array in the given range.
a
- fromIndex
- toIndex
- public static void reverse(int[] a)
Reverses the order of the given array.
a
- public static void reverse(int[] a, int fromIndex, int toIndex)
Reverses the order of the given array in the given range.
a
- fromIndex
- toIndex
- public static void reverse(long[] a)
Reverses the order of the given array.
a
- public static void reverse(long[] a, int fromIndex, int toIndex)
Reverses the order of the given array in the given range.
a
- fromIndex
- toIndex
- public static void reverse(float[] a)
Reverses the order of the given array.
a
- public static void reverse(float[] a, int fromIndex, int toIndex)
Reverses the order of the given array in the given range.
a
- fromIndex
- toIndex
- public static void reverse(double[] a)
Reverses the order of the given array.
a
- public static void reverse(double[] a, int fromIndex, int toIndex)
Reverses the order of the given array in the given range.
a
- fromIndex
- toIndex
- public static void reverse(java.lang.Object[] a)
Reverses the order of the given array.
There is no special handling for multi-dimensional arrays.
a
- public static void reverse(java.lang.Object[] a, int fromIndex, int toIndex)
Reverses the order of the given array in the given range.
a
- fromIndex
- toIndex
- public static void reverse(java.util.List<?> list)
public static void reverse(java.util.List<?> list, int fromIndex, int toIndex)
public static void reverse(java.util.Collection<?> c)
public static void rotate(boolean[] a, int distance)
public static void rotate(char[] a, int distance)
public static void rotate(byte[] a, int distance)
public static void rotate(short[] a, int distance)
public static void rotate(int[] a, int distance)
public static void rotate(long[] a, int distance)
public static void rotate(float[] a, int distance)
public static void rotate(double[] a, int distance)
public static void rotate(java.lang.Object[] a, int distance)
public static void rotate(java.util.List<?> list, int distance)
Collections.rotate(List, int)
public static void rotate(java.util.Collection<?> c, int distance)
public static void shuffle(boolean[] a)
public static void shuffle(boolean[] a, java.util.Random rnd)
public static void shuffle(char[] a)
public static void shuffle(char[] a, java.util.Random rnd)
public static void shuffle(byte[] a)
public static void shuffle(byte[] a, java.util.Random rnd)
public static void shuffle(short[] a)
public static void shuffle(short[] a, java.util.Random rnd)
public static void shuffle(int[] a)
public static void shuffle(int[] a, java.util.Random rnd)
public static void shuffle(long[] a)
public static void shuffle(long[] a, java.util.Random rnd)
public static void shuffle(float[] a)
public static void shuffle(float[] a, java.util.Random rnd)
public static void shuffle(double[] a)
public static void shuffle(double[] a, java.util.Random rnd)
public static <T> void shuffle(T[] a)
public static <T> void shuffle(T[] a, java.util.Random rnd)
public static void shuffle(java.util.List<?> list)
public static void shuffle(java.util.List<?> list, java.util.Random rnd)
Collections.shuffle(List, Random)
public static void shuffle(java.util.Collection<?> c)
public static void shuffle(java.util.Collection<?> c, java.util.Random rnd)
public static void swap(boolean[] a, int i, int j)
public static void swap(char[] a, int i, int j)
public static void swap(byte[] a, int i, int j)
public static void swap(short[] a, int i, int j)
public static void swap(int[] a, int i, int j)
public static void swap(long[] a, int i, int j)
public static void swap(float[] a, int i, int j)
public static void swap(double[] a, int i, int j)
public static void swap(java.lang.Object[] a, int i, int j)
public static void swap(java.util.List<?> list, int i, int j)
public static void fill(boolean[] a, boolean val)
public static void fill(boolean[] a, int fromIndex, int toIndex, boolean val)
public static void fill(char[] a, char val)
public static void fill(char[] a, int fromIndex, int toIndex, char val)
public static void fill(byte[] a, byte val)
public static void fill(byte[] a, int fromIndex, int toIndex, byte val)
public static void fill(short[] a, short val)
public static void fill(short[] a, int fromIndex, int toIndex, short val)
public static void fill(int[] a, int val)
public static void fill(int[] a, int fromIndex, int toIndex, int val)
public static void fill(long[] a, long val)
public static void fill(long[] a, int fromIndex, int toIndex, long val)
public static void fill(float[] a, float val)
public static void fill(float[] a, int fromIndex, int toIndex, float val)
public static void fill(double[] a, double val)
public static void fill(double[] a, int fromIndex, int toIndex, double val)
public static void fill(java.lang.Object[] a, java.lang.Object val)
public static void fill(java.lang.Object[] a, int fromIndex, int toIndex, java.lang.Object val)
public static <T> void fill(java.util.List<? super T> list, T val)
public static <T> void fill(java.util.List<? super T> list, int fromIndex, int toIndex, T val)
list
- fromIndex
- toIndex
- val
- public static void fill(java.lang.Object entity)
entity
- an entity object with getter/setter methodpublic static <T> T fill(java.lang.Class<T> entityClass)
entityClass
- entity class with getter/setter methodspublic static <T> java.util.List<T> fill(java.lang.Class<T> entityClass, int len)
entityClass
- entity class with getter/setter methodslen
- public static <T> java.util.List<T> repeat(T value, int n)
public static <T> java.util.List<T> repeatEle(java.util.Collection<T> c, int n)
Seq.nRepeat(N.asList(1, 2, 3), 2) => [1, 1, 2, 2, 3, 3]
c
- n
- public static <T> java.util.List<T> repeatAll(java.util.Collection<T> c, int n)
Seq.repeat(N.asList(1, 2, 3), 2) => [1, 2, 3, 1, 2, 3]
c
- n
- public static <T> java.util.List<T> repeatEleToSize(java.util.Collection<T> c, int size)
Seq.nRepeatToSize(N.asList(1, 2, 3), 5) => [1, 1, 2, 2, 3]
c
- size
- public static <T> java.util.List<T> repeatAllToSize(java.util.Collection<T> c, int size)
Seq.repeatToSize(N.asList(1, 2, 3), 5) => [1, 2, 3, 1, 2]
c
- size
- public static <T> void copy(java.util.List<? extends T> src, java.util.List<? super T> dest)
This method runs in linear time.
src
- The source list.dest
- The destination list.java.lang.IndexOutOfBoundsException
- if the destination list is too small
to contain the entire source List.java.lang.UnsupportedOperationException
- if the destination list's
list-iterator does not support the set operation.Collections.copy(List, List)
public static <T> void copy(java.util.List<? extends T> src, int srcPos, java.util.List<? super T> dest, int destPos, int length)
public static void copy(boolean[] src, int srcPos, boolean[] dest, int destPos, int length)
public static void copy(char[] src, int srcPos, char[] dest, int destPos, int length)
public static void copy(byte[] src, int srcPos, byte[] dest, int destPos, int length)
public static void copy(short[] src, int srcPos, short[] dest, int destPos, int length)
public static void copy(int[] src, int srcPos, int[] dest, int destPos, int length)
public static void copy(long[] src, int srcPos, long[] dest, int destPos, int length)
public static void copy(float[] src, int srcPos, float[] dest, int destPos, int length)
public static void copy(double[] src, int srcPos, double[] dest, int destPos, int length)
public static void copy(java.lang.Object[] src, int srcPos, java.lang.Object[] dest, int destPos, int length)
public static void copy(java.lang.Object src, int srcPos, java.lang.Object dest, int destPos, int length)
src
- srcPos
- dest
- destPos
- length
- is called
public static boolean[] copyOf(boolean[] original, int newLength)
original
- newLength
- Arrays.copyOf(boolean[], int)
public static char[] copyOf(char[] original, int newLength)
original
- newLength
- Arrays.copyOf(char[], int)
public static byte[] copyOf(byte[] original, int newLength)
original
- newLength
- Arrays.copyOf(byte[], int)
public static short[] copyOf(short[] original, int newLength)
original
- newLength
- Arrays.copyOf(short[], int)
public static int[] copyOf(int[] original, int newLength)
original
- newLength
- Arrays.copyOf(int[], int)
public static long[] copyOf(long[] original, int newLength)
original
- newLength
- Arrays.copyOf(long[], int)
public static float[] copyOf(float[] original, int newLength)
original
- newLength
- Arrays.copyOf(float[], int)
public static double[] copyOf(double[] original, int newLength)
original
- newLength
- Arrays.copyOf(double[], int)
public static <T> T[] copyOf(T[] original, int newLength)
original
- newLength
- Arrays.copyOf(Object[], int)
public static <T,U> T[] copyOf(U[] original, int newLength, java.lang.Class<? extends T[]> newType)
original
- newLength
- Arrays.copyOf(Object[], int, Class)
public static boolean[] copyOfRange(boolean[] original, int from, int to)
original
- from
- to
- Arrays.copyOfRange(boolean[], int, int)
public static boolean[] copyOfRange(boolean[] original, int from, int to, int step)
original
, through to
-from
, by step
.original
- from
- to
- step
- copyOfRange(int[], int, int, int)
public static char[] copyOfRange(char[] original, int from, int to)
original
- from
- to
- Arrays.copyOfRange(char[], int, int)
public static char[] copyOfRange(char[] original, int from, int to, int step)
original
, through to
-from
, by step
.original
- from
- to
- step
- copyOfRange(int[], int, int, int)
public static byte[] copyOfRange(byte[] original, int from, int to)
original
- from
- to
- Arrays.copyOfRange(byte[], int, int)
public static byte[] copyOfRange(byte[] original, int from, int to, int step)
original
, through to
-from
, by step
.original
- from
- to
- step
- copyOfRange(int[], int, int, int)
public static short[] copyOfRange(short[] original, int from, int to)
original
- from
- to
- Arrays.copyOfRange(short[], int, int)
public static short[] copyOfRange(short[] original, int from, int to, int step)
original
, through to
-from
, by step
.original
- from
- to
- step
- copyOfRange(int[], int, int, int)
public static int[] copyOfRange(int[] original, int from, int to)
original
- from
- to
- Arrays.copyOfRange(int[], int, int)
public static int[] copyOfRange(int[] original, int from, int to, int step)
original
, through to
-from
, by step
.
int[] a = { 0, 1, 2, 3, 4, 5 };
N.copyOfRange(a, 1, 5, 1)); // [1, 2, 3, 4]
N.copyOfRange(a, 1, 5, 2); // [1, 3]
N.copyOfRange(a, 5, 1, -1); // [5, 4, 3, 2]
N.copyOfRange(a, 5, 1, -2); // [5, 3]
N.copyOfRange(a, 5, -1, -1); // [5, 4, 3, 2, 1, 0]
N.copyOfRange(a, 6, -1, -1); // [5, 4, 3, 2, 1, 0]
original
- from
- to
- step
- public static long[] copyOfRange(long[] original, int from, int to)
original
- from
- to
- Arrays.copyOfRange(long[], int, int)
public static long[] copyOfRange(long[] original, int from, int to, int step)
original
, through to
-from
, by step
.original
- from
- to
- step
- copyOfRange(int[], int, int, int)
public static float[] copyOfRange(float[] original, int from, int to)
original
- from
- to
- Arrays.copyOfRange(float[], int, int)
public static float[] copyOfRange(float[] original, int from, int to, int step)
original
, through to
-from
, by step
.original
- from
- to
- step
- copyOfRange(int[], int, int, int)
public static double[] copyOfRange(double[] original, int from, int to)
original
- from
- to
- Arrays.copyOfRange(double[], int, int)
public static double[] copyOfRange(double[] original, int from, int to, int step)
original
, through to
-from
, by step
.original
- from
- to
- step
- copyOfRange(int[], int, int, int)
public static <T> T[] copyOfRange(T[] original, int from, int to)
original
- from
- to
- Arrays#copyOfRange(T[], int, int)
public static <T> T[] copyOfRange(T[] original, int from, int to, int step)
original
, through to
-from
, by step
.original
- from
- to
- step
- public static <T,U> T[] copyOfRange(U[] original, int from, int to, java.lang.Class<? extends T[]> newType)
Arrays.copyOfRange(Object[], int, int, Class)
original
- from
- to
- newType
- public static <T> T[] copyOfRange(T[] original, int from, int to, int step, java.lang.Class<? extends T[]> newType)
original
, through to
-from
, by step
.original
- from
- to
- step
- copyOfRange(int[], int, int, int)
public static <T> java.util.List<T> copyOfRange(java.util.List<T> c, int from, int to)
c
- from
- to
- Arrays#copyOfRange(T[], int, int)
public static <T> java.util.List<T> copyOfRange(java.util.List<T> c, int from, int to, int step)
original
, through to
-from
, by step
.c
- from
- to
- step
- public static java.lang.String copyOfRange(java.lang.String str, int from, int to)
str
- from
- to
- public static java.lang.String copyOfRange(java.lang.String str, int from, int to, int step)
str
- from
- to
- step
- copyOfRange(int[], int, int, int)
public static boolean[] clone(boolean[] original)
null
is returned if the input array is null
.original
- public static char[] clone(char[] original)
null
is returned if the input array is null
.original
- public static byte[] clone(byte[] original)
null
is returned if the input array is null
.original
- public static short[] clone(short[] original)
null
is returned if the input array is null
.original
- public static int[] clone(int[] original)
null
is returned if the input array is null
.original
- public static long[] clone(long[] original)
null
is returned if the input array is null
.original
- public static float[] clone(float[] original)
null
is returned if the input array is null
.original
- public static double[] clone(double[] original)
null
is returned if the input array is null
.original
- public static <T> T[] clone(T[] original)
null
is returned if the input array is null
.original
- public static boolean[][] clone(boolean[][] original)
null
is returned if the input array is null
.original
- public static char[][] clone(char[][] original)
null
is returned if the input array is null
.original
- public static byte[][] clone(byte[][] original)
null
is returned if the input array is null
.original
- public static short[][] clone(short[][] original)
null
is returned if the input array is null
.original
- public static int[][] clone(int[][] original)
null
is returned if the input array is null
.original
- public static long[][] clone(long[][] original)
null
is returned if the input array is null
.original
- public static float[][] clone(float[][] original)
null
is returned if the input array is null
.original
- public static double[][] clone(double[][] original)
null
is returned if the input array is null
.original
- public static <T> T[][] clone(T[][] original)
null
is returned if the input array is null
.original
- public static boolean[][][] clone(boolean[][][] original)
null
is returned if the input array is null
.original
- public static char[][][] clone(char[][][] original)
null
is returned if the input array is null
.original
- public static byte[][][] clone(byte[][][] original)
null
is returned if the input array is null
.original
- public static short[][][] clone(short[][][] original)
null
is returned if the input array is null
.original
- public static int[][][] clone(int[][][] original)
null
is returned if the input array is null
.original
- public static long[][][] clone(long[][][] original)
null
is returned if the input array is null
.original
- public static float[][][] clone(float[][][] original)
null
is returned if the input array is null
.original
- public static double[][][] clone(double[][][] original)
null
is returned if the input array is null
.original
- public static <T> T[][][] clone(T[][][] original)
null
is returned if the input array is null
.original
- public static void sort(boolean[] a)
public static void sort(char[] a)
public static void sort(char[] a, int fromIndex, int toIndex)
public static void sort(byte[] a)
public static void sort(byte[] a, int fromIndex, int toIndex)
public static void sort(short[] a)
public static void sort(short[] a, int fromIndex, int toIndex)
public static void sort(int[] a)
public static void sort(int[] a, int fromIndex, int toIndex)
public static void sort(long[] a)
public static void sort(long[] a, int fromIndex, int toIndex)
public static void sort(float[] a)
public static void sort(float[] a, int fromIndex, int toIndex)
public static void sort(double[] a)
public static void sort(double[] a, int fromIndex, int toIndex)
public static void sort(java.lang.Object[] a)
public static void sort(java.lang.Object[] a, int fromIndex, int toIndex)
public static <T> void sort(T[] a, java.util.Comparator<? super T> cmp)
public static <T> void sort(T[] a, int fromIndex, int toIndex, java.util.Comparator<? super T> cmp)
public static <T extends java.lang.Comparable<? super T>> void sort(java.util.List<? extends T> c)
public static <T extends java.lang.Comparable<? super T>> void sort(java.util.List<? extends T> c, int fromIndex, int toIndex)
public static <T> void sort(java.util.List<? extends T> c, java.util.Comparator<? super T> cmp)
public static <T> void sort(java.util.List<? extends T> c, int fromIndex, int toIndex, java.util.Comparator<? super T> cmp)
public static void parallelSort(char[] a)
public static void parallelSort(char[] a, int fromIndex, int toIndex)
public static void parallelSort(byte[] a)
public static void parallelSort(byte[] a, int fromIndex, int toIndex)
public static void parallelSort(short[] a)
public static void parallelSort(short[] a, int fromIndex, int toIndex)
public static void parallelSort(int[] a)
public static void parallelSort(int[] a, int fromIndex, int toIndex)
public static void parallelSort(long[] a)
public static void parallelSort(long[] a, int fromIndex, int toIndex)
public static void parallelSort(float[] a)
public static void parallelSort(float[] a, int fromIndex, int toIndex)
public static void parallelSort(double[] a)
public static void parallelSort(double[] a, int fromIndex, int toIndex)
public static void parallelSort(java.lang.Object[] a)
public static void parallelSort(java.lang.Object[] a, int fromIndex, int toIndex)
public static <T> void parallelSort(T[] a, java.util.Comparator<? super T> cmp)
public static <T> void parallelSort(T[] a, int fromIndex, int toIndex, java.util.Comparator<? super T> cmp)
public static <T extends java.lang.Comparable<? super T>> void parallelSort(java.util.List<? extends T> c)
public static <T extends java.lang.Comparable<? super T>> void parallelSort(java.util.List<? extends T> c, int fromIndex, int toIndex)
public static <T> void parallelSort(java.util.List<? extends T> c, java.util.Comparator<? super T> cmp)
public static <T> void parallelSort(java.util.List<? extends T> c, int fromIndex, int toIndex, java.util.Comparator<? super T> cmp)
public static void reverseSort(boolean[] a)
public static void reverseSort(char[] a)
public static void reverseSort(char[] a, int fromIndex, int toIndex)
public static void reverseSort(byte[] a)
public static void reverseSort(byte[] a, int fromIndex, int toIndex)
public static void reverseSort(short[] a)
public static void reverseSort(short[] a, int fromIndex, int toIndex)
public static void reverseSort(int[] a)
public static void reverseSort(int[] a, int fromIndex, int toIndex)
public static void reverseSort(long[] a)
public static void reverseSort(long[] a, int fromIndex, int toIndex)
public static void reverseSort(float[] a)
public static void reverseSort(float[] a, int fromIndex, int toIndex)
public static void reverseSort(double[] a)
public static void reverseSort(double[] a, int fromIndex, int toIndex)
public static void reverseSort(java.lang.Object[] a)
public static void reverseSort(java.lang.Object[] a, int fromIndex, int toIndex)
public static <T extends java.lang.Comparable<? super T>> void reverseSort(java.util.List<? extends T> c)
public static <T extends java.lang.Comparable<? super T>> void reverseSort(java.util.List<? extends T> c, int fromIndex, int toIndex)
public static void bucketSort(int[] a)
public static void bucketSort(int[] a, int fromIndex, int toIndex)
public static void bucketSort(long[] a)
public static void bucketSort(long[] a, int fromIndex, int toIndex)
public static void bucketSort(float[] a)
public static void bucketSort(float[] a, int fromIndex, int toIndex)
public static void bucketSort(double[] a)
public static void bucketSort(double[] a, int fromIndex, int toIndex)
public static void bucketSort(java.lang.Object[] a)
a
- public static void bucketSort(java.lang.Object[] a, int fromIndex, int toIndex)
a
- the elements in the array must implements the Comparable
interface.fromIndex
- toIndex
- public static <T> void bucketSort(T[] a, java.util.Comparator<? super T> cmp)
public static <T> void bucketSort(T[] a, int fromIndex, int toIndex, java.util.Comparator<? super T> cmp)
a
- fromIndex
- toIndex
- cmp
- public static <T extends java.lang.Comparable<T>> void bucketSort(java.util.List<T> c)
c
- public static <T extends java.lang.Comparable<T>> void bucketSort(java.util.List<T> c, int fromIndex, int toIndex)
c
- fromIndex
- toIndex
- public static <T> void bucketSort(java.util.List<? extends T> c, java.util.Comparator<? super T> cmp)
c
- cmp
- public static <T> void bucketSort(java.util.List<? extends T> c, int fromIndex, int toIndex, java.util.Comparator<? super T> cmp)
c
- fromIndex
- toIndex
- cmp
- public static int binarySearch(char[] a, char key)
Arrays.binarySearch(char[], char)
a
- key
- public static int binarySearch(char[] a, int fromIndex, int toIndex, char key)
Arrays.binarySearch(char[], int, int, char)
a
- fromIndex
- toIndex
- key
- public static int binarySearch(byte[] a, byte key)
Arrays.binarySearch(byte[], byte)
a
- key
- public static int binarySearch(byte[] a, int fromIndex, int toIndex, byte key)
Arrays.binarySearch(byte[], int, int, byte)
a
- fromIndex
- toIndex
- key
- public static int binarySearch(short[] a, short key)
Arrays.binarySearch(short[], short)
a
- key
- public static int binarySearch(short[] a, int fromIndex, int toIndex, short key)
Arrays.binarySearch(short[], int, int, short)
a
- fromIndex
- toIndex
- key
- public static int binarySearch(int[] a, int key)
Arrays.binarySearch(int[], int)
a
- key
- public static int binarySearch(int[] a, int fromIndex, int toIndex, int key)
Arrays.binarySearch(int[], int, int, int)
a
- fromIndex
- toIndex
- key
- public static int binarySearch(long[] a, long key)
Arrays.binarySearch(long[], long)
a
- key
- public static int binarySearch(long[] a, int fromIndex, int toIndex, long key)
Arrays.binarySearch(long[], int, int, long)
a
- fromIndex
- toIndex
- key
- public static int binarySearch(float[] a, float key)
Arrays.binarySearch(float[], float)
a
- key
- public static int binarySearch(float[] a, int fromIndex, int toIndex, float key)
Arrays.binarySearch(float[], int, int, float)
a
- fromIndex
- toIndex
- key
- public static int binarySearch(double[] a, double key)
Arrays.binarySearch(double[], double)
a
- key
- public static int binarySearch(double[] a, int fromIndex, int toIndex, double key)
Arrays.binarySearch(double[], int, int, double)
a
- fromIndex
- toIndex
- key
- public static int binarySearch(java.lang.Object[] a, java.lang.Object key)
Arrays.binarySearch(Object[], Object)
a
- key
- public static int binarySearch(java.lang.Object[] a, int fromIndex, int toIndex, java.lang.Object key)
Arrays.binarySearch(Object[], int, int, Object)
a
- fromIndex
- toIndex
- key
- public static <T> int binarySearch(T[] a, T key, java.util.Comparator<? super T> cmp)
Arrays.binarySearch(Object[], Object, Comparator)
a
- key
- cmp
- public static <T> int binarySearch(T[] a, int fromIndex, int toIndex, T key, java.util.Comparator<? super T> cmp)
Arrays.binarySearch(Object[], int, int, Object, Comparator)
a
- fromIndex
- toIndex
- key
- c
- public static <T extends java.lang.Comparable<? super T>> int binarySearch(java.util.List<? extends T> c, T key)
Collections.binarySearch(List, Object)
items
- key
- public static <T extends java.lang.Comparable<? super T>> int binarySearch(java.util.List<? extends T> c, int fromIndex, int toIndex, T key)
public static <T> int binarySearch(java.util.List<? extends T> c, T key, java.util.Comparator<? super T> cmp)
public static <T> int binarySearch(java.util.List<? extends T> c, int fromIndex, int toIndex, T key, java.util.Comparator<? super T> cmp)
c
- key
- fromIndex
- toIndex
- cmp
- Collections.binarySearch(List, Object, Comparator)
public static Optional<java.lang.String> substring(java.lang.String str, int inclusiveBeginIndex, int exclusiveEndIndex)
Optional
if inclusiveBeginIndex < 0 || exclusiveEndIndex < 0 || inclusiveBeginIndex > exclusiveEndIndex
,
otherwise an Optional
with String value: str.substring(exclusiveBeginIndex, exclusiveEndIndex)
is returned.str
- inclusiveBeginIndex
- exclusiveEndIndex
- public static Optional<java.lang.String> substring(java.lang.String str, int inclusiveBeginIndex)
Optional
if inclusiveBeginIndex < 0
,
otherwise an Optional
with String value: str.substring(inclusiveBeginIndex)
is returned.str
- inclusiveBeginIndex
- substring(String, int, int)
public static Optional<java.lang.String> substring(java.lang.String str, char delimiterOfInclusiveBeginIndex)
Optional
if N.isNullOrEmpty(str) || str.indexOf(delimiterOfInclusiveBeginIndex) < 0
,
otherwise an Optional
with String value: str.substring(str.indexOf(delimiterOfInclusiveBeginIndex))
is returned.str
- delimiterOfInclusiveBeginIndex
- inclusiveBeginIndex <- str.indexOf(delimiterOfInclusiveBeginIndex)
substring(String, int)
public static Optional<java.lang.String> substring(java.lang.String str, java.lang.String delimiterOfInclusiveBeginIndex)
Optional
if N.isNullOrEmpty(str) || str.indexOf(delimiterOfInclusiveBeginIndex) < 0
,
otherwise an Optional
with String value: str.substring(str.indexOf(delimiterOfInclusiveBeginIndex))
is returned.str
- delimiterOfInclusiveBeginIndex
- inclusiveBeginIndex <- str.indexOf(delimiterOfInclusiveBeginIndex)
substring(String, int)
public static Optional<java.lang.String> substring(java.lang.String str, int inclusiveBeginIndex, char delimiterOfExclusiveEndIndex)
str
- inclusiveBeginIndex
- delimiterOfExclusiveEndIndex
- exclusiveEndIndex <- str.indexOf(delimiterOfExclusiveEndIndex, inclusiveBeginIndex + 1) if inclusiveBeginIndex >= 0
substring(String, int, int)
public static Optional<java.lang.String> substring(java.lang.String str, int inclusiveBeginIndex, java.lang.String delimiterOfExclusiveEndIndex)
str
- inclusiveBeginIndex
- delimiterOfExclusiveEndIndex
- exclusiveEndIndex <- str.indexOf(delimiterOfExclusiveEndIndex, inclusiveBeginIndex + 1) if inclusiveBeginIndex >= 0
substring(String, int, int)
public static Optional<java.lang.String> substring(java.lang.String str, int inclusiveBeginIndex, IntUnaryOperator funcOfExclusiveEndIndex)
str
- inclusiveBeginIndex
- funcOfExclusiveEndIndex
- exclusiveEndIndex <- funcOfExclusiveEndIndex.applyAsInt(inclusiveBeginIndex) if inclusiveBeginIndex >= 0
substring(String, int, int)
public static Optional<java.lang.String> substring(java.lang.String str, char delimiterOfInclusiveBeginIndex, int exclusiveEndIndex)
str
- delimiterOfInclusiveBeginIndex
- inclusiveBeginIndex <- str.lastIndexOf(delimiterOfInclusiveBeginIndex, exclusiveEndIndex - 1) if exclusiveEndIndex > 0
exclusiveEndIndex
- substring(String, int, int)
public static Optional<java.lang.String> substring(java.lang.String str, java.lang.String delimiterOfInclusiveBeginIndex, int exclusiveEndIndex)
str
- delimiterOfInclusiveBeginIndex
- inclusiveBeginIndex <- str.lastIndexOf(delimiterOfInclusiveBeginIndex, exclusiveEndIndex - 1) if exclusiveEndIndex > 0
exclusiveEndIndex
- substring(String, int, int)
public static Optional<java.lang.String> substring(java.lang.String str, IntUnaryOperator funcOfInclusiveBeginIndex, int exclusiveEndIndex)
str
- funcOfInclusiveBeginIndex
- inclusiveBeginIndex <- funcOfInclusiveBeginIndex.applyAsInt(exclusiveEndIndex)) if exclusiveEndIndex > 0
exclusiveEndIndex
- substring(String, int, int)
public static Optional<java.lang.String> substringBetween(java.lang.String str, int exclusiveBeginIndex, int exclusiveEndIndex)
Optional
if exclusiveBeginIndex < 0 || exclusiveEndIndex < 0 || exclusiveBeginIndex >= exclusiveEndIndex
,
otherwise an Optional
with String value: str.substring(exclusiveBeginIndex + 1, exclusiveEndIndex)
is returned.str
- exclusiveBeginIndex
- exclusiveEndIndex
- public static Optional<java.lang.String> substringBetween(java.lang.String str, int exclusiveBeginIndex, char delimiterOfExclusiveEndIndex)
str
- exclusiveBeginIndex
- delimiterOfExclusiveEndIndex
- exclusiveEndIndex <- str.indexOf(delimiterOfExclusiveEndIndex, beginIndex + 1) if exclusiveBeginIndex >= 0
substringBetween(String, int, int)
public static Optional<java.lang.String> substringBetween(java.lang.String str, int exclusiveBeginIndex, java.lang.String delimiterOfExclusiveEndIndex)
str
- exclusiveBeginIndex
- delimiterOfExclusiveEndIndex
- exclusiveEndIndex <- str.indexOf(delimiterOfExclusiveEndIndex, beginIndex + 1) if exclusiveBeginIndex >= 0
substringBetween(String, int, int)
public static Optional<java.lang.String> substringBetween(java.lang.String str, int exclusiveBeginIndex, IntUnaryOperator funcOfExclusiveEndIndex)
str
- exclusiveBeginIndex
- funcOfExclusiveEndIndex
- exclusiveEndIndex <- funcOfExclusiveEndIndex.applyAsInt(inclusiveBeginIndex) if inclusiveBeginIndex >= 0
substringBetween(String, int, int)
public static Optional<java.lang.String> substringBetween(java.lang.String str, char delimiterOfExclusiveBeginIndex, int exclusiveEndIndex)
str
- delimiterOfExclusiveBeginIndex
- exclusiveBeginIndex <- str.lastIndexOf(delimiterOfExclusiveBeginIndex, exclusiveEndIndex - 1) if exclusiveEndIndex > 0
exclusiveEndIndex
- substringBetween(String, int, int)
public static Optional<java.lang.String> substringBetween(java.lang.String str, java.lang.String delimiterOfExclusiveBeginIndex, int exclusiveEndIndex)
str
- delimiterOfExclusiveBeginIndex
- exclusiveBeginIndex <- str.lastIndexOf(delimiterOfExclusiveBeginIndex, exclusiveEndIndex - 1) + delimiterOfExclusiveBeginIndex.length() - 1 if exclusiveEndIndex > 0
exclusiveEndIndex
- substringBetween(String, int, int)
public static Optional<java.lang.String> substringBetween(java.lang.String str, IntUnaryOperator funcOfExclusiveBeginIndex, int exclusiveEndIndex)
str
- funcOfExclusiveBeginIndex
- exclusiveBeginIndex <- funcOfExclusiveBeginIndex.applyAsInt(exclusiveEndIndex)) if exclusiveEndIndex > 0
exclusiveEndIndex
- substringBetween(String, int, int)
public static java.util.List<IntPair> findAllIndicesBetween(java.lang.String str, char prefix, char postfix)
findAllIndicesBetween("3[a2[c]]2[a]", '[', ']') = [[2, 7], [10, 11]]
str
- prefix
- postfix
- public static java.util.List<IntPair> findAllIndicesBetween(java.lang.String str, int fromIndex, int toIndex, char prefix, char postfix)
findAllIndicesBetween("3[a2[c]]2[a]", '[', ']') = [[2, 7], [10, 11]]
str
- fromIndex
- toIndex
- prefix
- postfix
- public static java.util.List<IntPair> findAllIndicesBetween(java.lang.String str, java.lang.String prefix, java.lang.String postfix)
findAllIndicesBetween("3[a2[c]]2[a]", '[', ']') = [[2, 7], [10, 11]]
str
- prefix
- postfix
- public static java.util.List<IntPair> findAllIndicesBetween(java.lang.String str, int fromIndex, int toIndex, java.lang.String prefix, java.lang.String postfix)
findAllIndicesBetween("3[a2[c]]2[a]", '[', ']') = [[2, 7], [10, 11]]
str
- fromIndex
- toIndex
- prefix
- postfix
- public static java.util.List<java.lang.String> findAllSubstringsBetween(java.lang.String str, char prefix, char postfix)
findAllIndicesBetween("3[a2[c]]2[a]", '[', ']') = [[2, 7], [10, 11]]
str
- prefix
- postfix
- public static java.util.List<java.lang.String> findAllSubstringsBetween(java.lang.String str, int fromIndex, int toIndex, char prefix, char postfix)
findAllIndicesBetween("3[a2[c]]2[a]", '[', ']') = [[2, 7], [10, 11]]
str
- fromIndex
- toIndex
- prefix
- postfix
- public static java.util.List<java.lang.String> findAllSubstringsBetween(java.lang.String str, java.lang.String prefix, java.lang.String postfix)
findAllIndicesBetween("3[a2[c]]2[a]", '[', ']') = [[2, 7], [10, 11]]
str
- prefix
- postfix
- public static java.util.List<java.lang.String> findAllSubstringsBetween(java.lang.String str, int fromIndex, int toIndex, java.lang.String prefix, java.lang.String postfix)
findAllIndicesBetween("3[a2[c]]2[a]", '[', ']') = [[2, 7], [10, 11]]
str
- fromIndex
- toIndex
- prefix
- postfix
- public static int indexOf(boolean[] a, boolean e)
public static int indexOf(boolean[] a, int fromIndex, boolean e)
a
- fromIndex
- the index from which to start the search.e
- public static int indexOf(char[] a, char e)
public static int indexOf(char[] a, int fromIndex, char e)
a
- fromIndex
- the index from which to start the search.e
- public static int indexOf(byte[] a, byte e)
public static int indexOf(byte[] a, int fromIndex, byte e)
a
- fromIndex
- the index from which to start the search.e
- public static int indexOf(short[] a, short e)
public static int indexOf(short[] a, int fromIndex, short e)
a
- fromIndex
- the index from which to start the search.e
- public static int indexOf(int[] a, int e)
public static int indexOf(int[] a, int fromIndex, int e)
a
- fromIndex
- the index from which to start the search.e
- public static int indexOf(long[] a, long e)
public static int indexOf(long[] a, int fromIndex, long e)
a
- fromIndex
- the index from which to start the search.e
- public static int indexOf(float[] a, float e)
public static int indexOf(float[] a, int fromIndex, float e)
a
- fromIndex
- the index from which to start the search.e
- public static int indexOf(double[] a, double e)
public static int indexOf(double[] a, int fromIndex, double e)
a
- fromIndex
- the index from which to start the search.e
- public static int indexOf(java.lang.Object[] a, java.lang.Object e)
public static int indexOf(java.lang.Object[] a, int fromIndex, java.lang.Object e)
a
- fromIndex
- the index from which to start the search.e
- public static int indexOf(java.util.List<?> list, java.lang.Object e)
public static int indexOf(java.util.List<?> list, int fromIndex, java.lang.Object e)
list
- fromIndex
- the index from which to start the search.e
- public static int indexOf(java.lang.String str, int targetChar)
public static int indexOf(java.lang.String str, int fromIndex, int targetChar)
public static int indexOf(java.lang.String str, java.lang.String substr)
public static int indexOf(java.lang.String str, int fromIndex, java.lang.String substr)
@SafeVarargs public static int indexOfAny(java.lang.String str, char... chs)
@SafeVarargs public static int indexOfAny(java.lang.String str, java.lang.String... substrs)
@SafeVarargs public static int indexOfAnyBut(java.lang.String str, char... chs)
public static int indexOf(java.lang.String str, java.lang.String substr, java.lang.String delimiter)
public static int indexOf(java.lang.String str, int fromIndex, java.lang.String substr, java.lang.String delimiter)
str
- fromIndex
- the index from which to start the search.substr
- delimiter
- public static int indexOfIgnoreCase(java.lang.String str, java.lang.String substr)
public static int indexOfIgnoreCase(java.lang.String str, int fromIndex, java.lang.String substr)
public static int indexOfSubList(java.util.List<?> sourceList, java.util.List<?> targetSubList)
Collections.indexOfSubList(List, List)
public static int ordinalIndexOf(java.lang.String str, java.lang.String substr, int ordinal)
Finds the n-th index within a String, handling null
.
str
- substr
- ordinal
- the n-th searchStr
to find-1
(
INDEX_NOT_FOUND
) if no match or null
or empty
string inputpublic static int lastIndexOf(boolean[] a, boolean e)
public static int lastIndexOf(boolean[] a, int fromIndex, boolean e)
a
- fromIndex
- the start index to traverse backwards frome
- public static int lastIndexOf(char[] a, char e)
public static int lastIndexOf(char[] a, int fromIndex, char e)
a
- fromIndex
- the start index to traverse backwards frome
- public static int lastIndexOf(byte[] a, byte e)
public static int lastIndexOf(byte[] a, int fromIndex, byte e)
a
- fromIndex
- the start index to traverse backwards frome
- public static int lastIndexOf(short[] a, short e)
public static int lastIndexOf(short[] a, int fromIndex, short e)
a
- fromIndex
- the start index to traverse backwards frome
- public static int lastIndexOf(int[] a, int e)
public static int lastIndexOf(int[] a, int fromIndex, int e)
a
- fromIndex
- the start index to traverse backwards frome
- public static int lastIndexOf(long[] a, long e)
public static int lastIndexOf(long[] a, int fromIndex, long e)
a
- fromIndex
- the start index to traverse backwards frome
- public static int lastIndexOf(float[] a, float e)
public static int lastIndexOf(float[] a, int fromIndex, float e)
a
- fromIndex
- the start index to traverse backwards frome
- public static int lastIndexOf(double[] a, double e)
public static int lastIndexOf(double[] a, int fromIndex, double e)
a
- fromIndex
- the start index to traverse backwards frome
- public static int lastIndexOf(java.lang.Object[] a, java.lang.Object e)
public static int lastIndexOf(java.lang.Object[] a, int fromIndex, java.lang.Object e)
a
- fromIndex
- the start index to traverse backwards frome
- public static int lastIndexOf(java.util.List<?> list, java.lang.Object e)
public static int lastIndexOf(java.util.List<?> list, int fromIndex, java.lang.Object e)
list
- fromIndex
- the start index to traverse backwards frome
- public static int lastIndexOf(java.lang.String str, int targetChar)
public static int lastIndexOf(java.lang.String str, int fromIndex, int targetChar)
ch
in the range from 0 to 0xFFFF (inclusive),
the index returned is the largest value k such that: is true. For other values of(this.charAt(k) == ch) && (k <= fromIndex)
ch
, it is the
largest value k such that: is true. In either case, if no such character occurs in this string at or before position(this.codePointAt(k) == ch) && (k <= fromIndex)
fromIndex
, then
-1
is returned.
All indices are specified in char
values (Unicode code
units).
str
- fromIndex
- the index to start the search from. There is no restriction on
the value of fromIndex
. If it is greater than or
equal to the length of this string, it has the same effect as
if it were equal to one less than the length of this string:
this entire string may be searched. If it is negative, it has
the same effect as if it were -1: -1 is returned.targetChar
- a character (Unicode code point).fromIndex
, or -1
if the
character does not occur before that point.public static int lastIndexOf(java.lang.String str, java.lang.String substr)
public static int lastIndexOf(java.lang.String str, int fromIndex, java.lang.String substr)
str
of the last occurrence of the
specified substr
, searching backward starting at the
specified index.
The returned index is the largest value k for which:
If no such value of k exists, thenk <= fromIndex && str.startsWith(substr, k)
-1
is
returned.str
- fromIndex
- substr
- @SafeVarargs public static int lastIndexOfAny(java.lang.String str, char... chs)
@SafeVarargs public static int lastIndexOfAny(java.lang.String str, java.lang.String... substrs)
public static int lastIndexOf(java.lang.String str, java.lang.String substr, java.lang.String delimiter)
public static int lastIndexOf(java.lang.String str, int fromIndex, java.lang.String substr, java.lang.String delimiter)
str
- fromIndex
- the start index to traverse backwards fromsubstr
- delimiter
- public static int lastIndexOfIgnoreCase(java.lang.String str, java.lang.String substr)
public static int lastIndexOfIgnoreCase(java.lang.String str, int fromIndex, java.lang.String substr)
public static int lastIndexOfSubList(java.util.List<?> sourceList, java.util.List<?> targetSubList)
Collections.lastIndexOfSubList(List, List)
public static int lastOrdinalIndexOf(java.lang.String str, java.lang.String substr, int ordinal)
Finds the n-th last index within a String, handling null
.
str
- substr
- ordinal
- the n-th last searchStr
to find-1
(
INDEX_NOT_FOUND
) if no match or null
or empty
string inputpublic static int occurrencesOf(boolean[] a, boolean objectToFind)
public static int occurrencesOf(char[] a, char objectToFind)
public static int occurrencesOf(byte[] a, byte objectToFind)
public static int occurrencesOf(short[] a, short objectToFind)
public static int occurrencesOf(int[] a, int objectToFind)
public static int occurrencesOf(long[] a, long objectToFind)
public static int occurrencesOf(float[] a, float objectToFind)
public static int occurrencesOf(double[] a, double objectToFind)
public static int occurrencesOf(java.lang.Object[] a, java.lang.Object objectToFind)
public static int occurrencesOf(java.util.Collection<?> c, java.lang.Object objectToFind)
c
- objectToFind
- Collections.frequency(Collection, Object)
public static boolean contains(boolean[] a, boolean objectToFind)
public static boolean contains(char[] a, char objectToFind)
public static boolean contains(byte[] a, byte objectToFind)
public static boolean contains(short[] a, short objectToFind)
public static boolean contains(int[] a, int objectToFind)
public static boolean contains(long[] a, long objectToFind)
public static boolean contains(float[] a, float objectToFind)
public static boolean contains(double[] a, double objectToFind)
public static boolean contains(java.lang.Object[] a, java.lang.Object objectToFind)
public static boolean contains(java.util.Collection<?> c, java.lang.Object e)
public static boolean contains(java.lang.String str, int targetChar)
public static boolean contains(java.lang.String str, java.lang.String substr)
@SafeVarargs public static boolean containsAny(java.lang.String str, char... chs)
@SafeVarargs public static boolean containsOnly(java.lang.String str, char... chs)
@SafeVarargs public static boolean containsNone(java.lang.String str, char... chs)
public static boolean contains(java.lang.String str, java.lang.String substr, java.lang.String delimiter)
public static boolean containsIgnoreCase(java.lang.String str, java.lang.String substr)
public static boolean containsWhitespace(java.lang.String str)
public static boolean startsWith(java.lang.String str, java.lang.String prefix)
public static boolean startsWithIgnoreCase(java.lang.String str, java.lang.String prefix)
@SafeVarargs public static boolean startsWithAny(java.lang.String str, java.lang.String... substrs)
public static boolean endsWith(java.lang.String str, java.lang.String suffix)
public static boolean endsWithIgnoreCase(java.lang.String str, java.lang.String suffix)
@SafeVarargs public static boolean endsWithAny(java.lang.String str, java.lang.String... substrs)
public static int indexOfDifference(java.lang.String a, java.lang.String b)
Compares two Strings, and returns the index at which the Stringss begin to differ.
For example,
indexOfDifference("i am a machine", "i am a robot") -> 7
N.indexOfDifference(null, null) = -1 N.indexOfDifference("", "") = -1 N.indexOfDifference("", "abc") = 0 N.indexOfDifference("abc", "") = 0 N.indexOfDifference("abc", "abc") = -1 N.indexOfDifference("ab", "abxyz") = 2 N.indexOfDifference("abcde", "abxyz") = 2 N.indexOfDifference("abcde", "xyz") = 0
a
- the first String, may be nullb
- the second String, may be null@SafeVarargs public static int indexOfDifference(java.lang.String... strs)
Compares all Strings in an array and returns the index at which the Strings begin to differ.
For example,
indexOfDifference(new String[] {"i am a machine", "i am a robot"}) -> 7
N.indexOfDifference(null) = -1 N.indexOfDifference(new String[] {}) = -1 N.indexOfDifference(new String[] {"abc"}) = -1 N.indexOfDifference(new String[] {null, null}) = -1 N.indexOfDifference(new String[] {"", ""}) = -1 N.indexOfDifference(new String[] {"", null}) = -1 N.indexOfDifference(new String[] {"abc", null, null}) = 0 N.indexOfDifference(new String[] {null, null, "abc"}) = 0 N.indexOfDifference(new String[] {"", "abc"}) = 0 N.indexOfDifference(new String[] {"abc", ""}) = 0 N.indexOfDifference(new String[] {"abc", "abc"}) = -1 N.indexOfDifference(new String[] {"abc", "a"}) = 1 N.indexOfDifference(new String[] {"ab", "abxyz"}) = 2 N.indexOfDifference(new String[] {"abcde", "abxyz"}) = 2 N.indexOfDifference(new String[] {"abcde", "xyz"}) = 0 N.indexOfDifference(new String[] {"xyz", "abcde"}) = 0 N.indexOfDifference(new String[] {"i am a machine", "i am a robot"}) = 7
strs
- array of Strings, entries may be nullpublic static java.lang.String commonPrefix(java.lang.String a, java.lang.String b)
prefix
such that
a.toString().startsWith(prefix) && b.toString().startsWith(prefix)
, taking care not to split surrogate pairs. If a
and b
have no common prefix, returns the empty string.@SafeVarargs public static java.lang.String commonPrefix(java.lang.String... strs)
public static java.lang.String commonSuffix(java.lang.String a, java.lang.String b)
suffix
such that
a.toString().endsWith(suffix) && b.toString().endsWith(suffix)
,
taking care not to split surrogate pairs. If a
and b
have
no common suffix, returns the empty string.@SafeVarargs public static java.lang.String commonSuffix(java.lang.String... strs)
public static int countMatches(java.lang.String str, char ch)
public static int countMatches(java.lang.String str, java.lang.String substr)
public static <E extends java.lang.Exception> void forEach(int startInclusive, int endExclusive, Try.IntConsumer<E> action) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <E extends java.lang.Exception> void forEach(int startInclusive, int endExclusive, int step, Try.IntConsumer<E> action) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,E extends java.lang.Exception> void forEach(int startInclusive, int endExclusive, T a, Try.ObjIntConsumer<T,E> action) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,E extends java.lang.Exception> void forEach(int startInclusive, int endExclusive, int step, T a, Try.ObjIntConsumer<T,E> action) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,E extends java.lang.Exception> void forEach(T[] a, Try.Consumer<? super T,E> action) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,E extends java.lang.Exception> void forEach(T[] a, int fromIndex, int toIndex, Try.Consumer<? super T,E> action) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,E extends java.lang.Exception> void forEach(T[] a, Try.IndexedConsumer<? super T,E> action) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,E extends java.lang.Exception> void forEach(T[] a, int fromIndex, int toIndex, Try.IndexedConsumer<? super T,E> action) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,R,E extends java.lang.Exception,E2 extends java.lang.Exception> R forEach(T[] a, R seed, Try.BiFunction<R,? super T,R,E> accumulator, Try.BiPredicate<? super R,? super T,E2> conditionToBreak) throws E extends java.lang.Exception, E2 extends java.lang.Exception
E extends java.lang.Exception
public static <T,R,E extends java.lang.Exception,E2 extends java.lang.Exception> R forEach(T[] a, int fromIndex, int toIndex, R seed, Try.BiFunction<R,? super T,R,E> accumulator, Try.BiPredicate<? super R,? super T,E2> conditionToBreak) throws E extends java.lang.Exception, E2 extends java.lang.Exception
accumulator
on each element till true
is returned by conditionToBreak
fromIndex
- toIndex
- seed
- The seed element is both the initial value of the reduction and the default result if there are no elements.accumulator
- conditionToBreak
- break if true
is return.E extends java.lang.Exception
public static <T,R,E extends java.lang.Exception,E2 extends java.lang.Exception> R forEach(T[] a, R seed, Try.IndexedBiFunction<R,? super T,R,E> accumulator, Try.BiPredicate<? super R,? super T,E2> conditionToBreak) throws E extends java.lang.Exception, E2 extends java.lang.Exception
E extends java.lang.Exception
public static <T,R,E extends java.lang.Exception,E2 extends java.lang.Exception> R forEach(T[] a, int fromIndex, int toIndex, R seed, Try.IndexedBiFunction<R,? super T,R,E> accumulator, Try.BiPredicate<? super R,? super T,E2> conditionToBreak) throws E extends java.lang.Exception, E2 extends java.lang.Exception
accumulator
on each element till true
is returned by conditionToBreak
fromIndex
- toIndex
- seed
- The seed element is both the initial value of the reduction and the default result if there are no elements.accumulator
- conditionToBreak
- break if true
is return.E extends java.lang.Exception
public static <T,C extends java.util.Collection<? extends T>,E extends java.lang.Exception> void forEach(C c, Try.Consumer<? super T,E> action) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,C extends java.util.Collection<? extends T>,E extends java.lang.Exception> void forEach(C c, int fromIndex, int toIndex, Try.Consumer<? super T,E> action) throws E extends java.lang.Exception
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.c
- fromIndex
- toIndex
- action
- E extends java.lang.Exception
public static <T,C extends java.util.Collection<? extends T>,E extends java.lang.Exception> void forEach(C c, Try.IndexedConsumer<? super T,E> action) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,C extends java.util.Collection<? extends T>,E extends java.lang.Exception> void forEach(C c, int fromIndex, int toIndex, Try.IndexedConsumer<? super T,E> action) throws E extends java.lang.Exception
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.c
- fromIndex
- toIndex
- action
- E extends java.lang.Exception
public static <T,C extends java.util.Collection<? extends T>,R,E extends java.lang.Exception,E2 extends java.lang.Exception> R forEach(C c, R seed, Try.BiFunction<R,? super T,R,E> accumulator, Try.BiPredicate<? super R,? super T,E2> conditionToBreak) throws E extends java.lang.Exception, E2 extends java.lang.Exception
E extends java.lang.Exception
public static <T,C extends java.util.Collection<? extends T>,R,E extends java.lang.Exception,E2 extends java.lang.Exception> R forEach(C c, int fromIndex, int toIndex, R seed, Try.BiFunction<R,? super T,R,E> accumulator, Try.BiPredicate<? super R,? super T,E2> conditionToBreak) throws E extends java.lang.Exception, E2 extends java.lang.Exception
accumulator
on each element till true
is returned by conditionToBreak
fromIndex
- toIndex
- seed
- The seed element is both the initial value of the reduction and the default result if there are no elements.accumulator
- conditionToBreak
- break if true
is return.E extends java.lang.Exception
public static <T,C extends java.util.Collection<? extends T>,R,E extends java.lang.Exception,E2 extends java.lang.Exception> R forEach(C c, R seed, Try.IndexedBiFunction<R,? super T,R,E> accumulator, Try.BiPredicate<? super R,? super T,E2> conditionToBreak) throws E extends java.lang.Exception, E2 extends java.lang.Exception
E extends java.lang.Exception
public static <T,C extends java.util.Collection<? extends T>,R,E extends java.lang.Exception,E2 extends java.lang.Exception> R forEach(C c, int fromIndex, int toIndex, R seed, Try.IndexedBiFunction<R,? super T,R,E> accumulator, Try.BiPredicate<? super R,? super T,E2> conditionToBreak) throws E extends java.lang.Exception, E2 extends java.lang.Exception
accumulator
on each element till true
is returned by conditionToBreak
fromIndex
- toIndex
- seed
- The seed element is both the initial value of the reduction and the default result if there are no elements.accumulator
- conditionToBreak
- break if true
is return.E extends java.lang.Exception
public static <T,U,E extends java.lang.Exception,E2 extends java.lang.Exception> void forEach(T[] a, Try.Function<? super T,? extends java.util.Collection<U>,E> flatMapper, Try.BiConsumer<? super T,? super U,E2> action) throws E extends java.lang.Exception, E2 extends java.lang.Exception
E extends java.lang.Exception
public static <T,U,E extends java.lang.Exception,E2 extends java.lang.Exception> void forEach(java.util.Collection<T> c, Try.Function<? super T,? extends java.util.Collection<U>,E> flatMapper, Try.BiConsumer<? super T,? super U,E2> action) throws E extends java.lang.Exception, E2 extends java.lang.Exception
E extends java.lang.Exception
public static <T,T2,T3,E extends java.lang.Exception,E2 extends java.lang.Exception,E3 extends java.lang.Exception> void forEach(T[] a, Try.Function<? super T,? extends java.util.Collection<T2>,E> flatMapper, Try.Function<? super T2,? extends java.util.Collection<T3>,E2> flatMapper2, Try.TriConsumer<? super T,? super T2,? super T3,E3> action) throws E extends java.lang.Exception, E2 extends java.lang.Exception, E3 extends java.lang.Exception
E extends java.lang.Exception
public static <T,T2,T3,E extends java.lang.Exception,E2 extends java.lang.Exception,E3 extends java.lang.Exception> void forEach(java.util.Collection<T> c, Try.Function<? super T,? extends java.util.Collection<T2>,E> flatMapper, Try.Function<? super T2,? extends java.util.Collection<T3>,E2> flatMapper2, Try.TriConsumer<? super T,? super T2,? super T3,E3> action) throws E extends java.lang.Exception, E2 extends java.lang.Exception, E3 extends java.lang.Exception
E extends java.lang.Exception
public static <A,B,E extends java.lang.Exception> void forEach(A[] a, B[] b, Try.BiConsumer<? super A,? super B,E> action) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <A,B,E extends java.lang.Exception> void forEach(java.util.Collection<A> a, java.util.Collection<B> b, Try.BiConsumer<? super A,? super B,E> action) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <A,B,C,E extends java.lang.Exception> void forEach(A[] a, B[] b, C[] c, Try.TriConsumer<? super A,? super B,? super C,E> action) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <A,B,C,E extends java.lang.Exception> void forEach(java.util.Collection<A> a, java.util.Collection<B> b, java.util.Collection<C> c, Try.TriConsumer<? super A,? super B,? super C,E> action) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <A,B,E extends java.lang.Exception> void forEach(A[] a, B[] b, A valueForNoneA, B valueForNoneB, Try.BiConsumer<? super A,? super B,E> action) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <A,B,E extends java.lang.Exception> void forEach(java.util.Collection<A> a, java.util.Collection<B> b, A valueForNoneA, B valueForNoneB, Try.BiConsumer<? super A,? super B,E> action) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <A,B,C,E extends java.lang.Exception> void forEach(A[] a, B[] b, C[] c, A valueForNoneA, B valueForNoneB, C valueForNoneC, Try.TriConsumer<? super A,? super B,? super C,E> action) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <A,B,C,E extends java.lang.Exception> void forEach(java.util.Collection<A> a, java.util.Collection<B> b, java.util.Collection<C> c, A valueForNoneA, B valueForNoneB, C valueForNoneC, Try.TriConsumer<? super A,? super B,? super C,E> action) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,U,E extends java.lang.Exception,E2 extends java.lang.Exception> void forEachNonNull(T[] a, Try.Function<? super T,? extends java.util.Collection<U>,E> flatMapper, Try.BiConsumer<? super T,? super U,E2> action) throws E extends java.lang.Exception, E2 extends java.lang.Exception
E extends java.lang.Exception
public static <T,U,E extends java.lang.Exception,E2 extends java.lang.Exception> void forEachNonNull(java.util.Collection<T> c, Try.Function<? super T,? extends java.util.Collection<U>,E> flatMapper, Try.BiConsumer<? super T,? super U,E2> action) throws E extends java.lang.Exception, E2 extends java.lang.Exception
E extends java.lang.Exception
public static <T,T2,T3,E extends java.lang.Exception,E2 extends java.lang.Exception,E3 extends java.lang.Exception> void forEachNonNull(T[] a, Try.Function<? super T,? extends java.util.Collection<T2>,E> flatMapper, Try.Function<? super T2,? extends java.util.Collection<T3>,E2> flatMapper2, Try.TriConsumer<? super T,? super T2,? super T3,E3> action) throws E extends java.lang.Exception, E2 extends java.lang.Exception, E3 extends java.lang.Exception
E extends java.lang.Exception
public static <T,T2,T3,E extends java.lang.Exception,E2 extends java.lang.Exception,E3 extends java.lang.Exception> void forEachNonNull(java.util.Collection<T> c, Try.Function<? super T,? extends java.util.Collection<T2>,E> flatMapper, Try.Function<? super T2,? extends java.util.Collection<T3>,E2> flatMapper2, Try.TriConsumer<? super T,? super T2,? super T3,E3> action) throws E extends java.lang.Exception, E2 extends java.lang.Exception, E3 extends java.lang.Exception
E extends java.lang.Exception
public static <E extends java.lang.Exception> BooleanList filter(boolean[] a, Try.BooleanPredicate<E> filter) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <E extends java.lang.Exception> BooleanList filter(boolean[] a, Try.BooleanPredicate<E> filter, int max) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <E extends java.lang.Exception> BooleanList filter(boolean[] a, int fromIndex, int toIndex, Try.BooleanPredicate<E> filter) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <E extends java.lang.Exception> BooleanList filter(boolean[] a, int fromIndex, int toIndex, Try.BooleanPredicate<E> filter, int max) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- filter
- max
- maximum return result.E extends java.lang.Exception
public static <E extends java.lang.Exception> CharList filter(char[] a, Try.CharPredicate<E> filter) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <E extends java.lang.Exception> CharList filter(char[] a, Try.CharPredicate<E> filter, int max) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <E extends java.lang.Exception> CharList filter(char[] a, int fromIndex, int toIndex, Try.CharPredicate<E> filter) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <E extends java.lang.Exception> CharList filter(char[] a, int fromIndex, int toIndex, Try.CharPredicate<E> filter, int max) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- filter
- max
- maximum return result.E extends java.lang.Exception
public static <E extends java.lang.Exception> ByteList filter(byte[] a, Try.BytePredicate<E> filter) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <E extends java.lang.Exception> ByteList filter(byte[] a, Try.BytePredicate<E> filter, int max) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <E extends java.lang.Exception> ByteList filter(byte[] a, int fromIndex, int toIndex, Try.BytePredicate<E> filter) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <E extends java.lang.Exception> ByteList filter(byte[] a, int fromIndex, int toIndex, Try.BytePredicate<E> filter, int max) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- filter
- max
- maximum return result.E extends java.lang.Exception
public static <E extends java.lang.Exception> ShortList filter(short[] a, Try.ShortPredicate<E> filter) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <E extends java.lang.Exception> ShortList filter(short[] a, Try.ShortPredicate<E> filter, int max) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <E extends java.lang.Exception> ShortList filter(short[] a, int fromIndex, int toIndex, Try.ShortPredicate<E> filter) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <E extends java.lang.Exception> ShortList filter(short[] a, int fromIndex, int toIndex, Try.ShortPredicate<E> filter, int max) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- filter
- max
- maximum return result.E extends java.lang.Exception
public static <E extends java.lang.Exception> IntList filter(int[] a, Try.IntPredicate<E> filter) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <E extends java.lang.Exception> IntList filter(int[] a, Try.IntPredicate<E> filter, int max) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <E extends java.lang.Exception> IntList filter(int[] a, int fromIndex, int toIndex, Try.IntPredicate<E> filter) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <E extends java.lang.Exception> IntList filter(int[] a, int fromIndex, int toIndex, Try.IntPredicate<E> filter, int max) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- filter
- max
- maximum return result.E extends java.lang.Exception
public static <E extends java.lang.Exception> LongList filter(long[] a, Try.LongPredicate<E> filter) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <E extends java.lang.Exception> LongList filter(long[] a, Try.LongPredicate<E> filter, int max) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <E extends java.lang.Exception> LongList filter(long[] a, int fromIndex, int toIndex, Try.LongPredicate<E> filter) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <E extends java.lang.Exception> LongList filter(long[] a, int fromIndex, int toIndex, Try.LongPredicate<E> filter, int max) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- filter
- max
- maximum return result.E extends java.lang.Exception
public static <E extends java.lang.Exception> FloatList filter(float[] a, Try.FloatPredicate<E> filter) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <E extends java.lang.Exception> FloatList filter(float[] a, Try.FloatPredicate<E> filter, int max) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <E extends java.lang.Exception> FloatList filter(float[] a, int fromIndex, int toIndex, Try.FloatPredicate<E> filter) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <E extends java.lang.Exception> FloatList filter(float[] a, int fromIndex, int toIndex, Try.FloatPredicate<E> filter, int max) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- filter
- max
- maximum return result.E extends java.lang.Exception
public static <E extends java.lang.Exception> DoubleList filter(double[] a, Try.DoublePredicate<E> filter) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <E extends java.lang.Exception> DoubleList filter(double[] a, Try.DoublePredicate<E> filter, int max) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <E extends java.lang.Exception> DoubleList filter(double[] a, int fromIndex, int toIndex, Try.DoublePredicate<E> filter) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <E extends java.lang.Exception> DoubleList filter(double[] a, int fromIndex, int toIndex, Try.DoublePredicate<E> filter, int max) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- filter
- max
- maximum return result.E extends java.lang.Exception
public static <T,E extends java.lang.Exception> java.util.List<T> filter(T[] a, Try.Predicate<? super T,E> filter) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,E extends java.lang.Exception> java.util.List<T> filter(T[] a, Try.Predicate<? super T,E> filter, int max) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,E extends java.lang.Exception> java.util.List<T> filter(T[] a, int fromIndex, int toIndex, Try.Predicate<? super T,E> filter) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,E extends java.lang.Exception> java.util.List<T> filter(T[] a, int fromIndex, int toIndex, Try.Predicate<? super T,E> filter, int max) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- filter
- max
- E extends java.lang.Exception
public static <T,E extends java.lang.Exception> java.util.List<T> filter(java.util.Collection<? extends T> c, Try.Predicate<? super T,E> filter) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,E extends java.lang.Exception> java.util.List<T> filter(java.util.Collection<? extends T> c, Try.Predicate<? super T,E> filter, int max) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,E extends java.lang.Exception> java.util.List<T> filter(java.util.Collection<? extends T> c, int fromIndex, int toIndex, Try.Predicate<? super T,E> filter) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,E extends java.lang.Exception> java.util.List<T> filter(java.util.Collection<? extends T> c, int fromIndex, int toIndex, Try.Predicate<? super T,E> filter, int max) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,R extends java.util.Collection<T>,E extends java.lang.Exception> R filter(T[] a, Try.Predicate<? super T,E> filter, IntFunction<R> supplier) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,R extends java.util.Collection<T>,E extends java.lang.Exception> R filter(T[] a, Try.Predicate<? super T,E> filter, int max, IntFunction<R> supplier) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,R extends java.util.Collection<T>,E extends java.lang.Exception> R filter(T[] a, int fromIndex, int toIndex, Try.Predicate<? super T,E> filter, IntFunction<R> supplier) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,R extends java.util.Collection<T>,E extends java.lang.Exception> R filter(T[] a, int fromIndex, int toIndex, Try.Predicate<? super T,E> filter, int max, IntFunction<R> supplier) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- filter
- max
- supplier
- E extends java.lang.Exception
public static <T,R extends java.util.Collection<T>,E extends java.lang.Exception> R filter(java.util.Collection<? extends T> c, Try.Predicate<? super T,E> filter, IntFunction<R> supplier) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,R extends java.util.Collection<T>,E extends java.lang.Exception> R filter(java.util.Collection<? extends T> c, Try.Predicate<? super T,E> filter, int max, IntFunction<R> supplier) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,R extends java.util.Collection<T>,E extends java.lang.Exception> R filter(java.util.Collection<? extends T> c, int fromIndex, int toIndex, Try.Predicate<? super T,E> filter, IntFunction<R> supplier) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,R extends java.util.Collection<T>,E extends java.lang.Exception> R filter(java.util.Collection<? extends T> c, int fromIndex, int toIndex, Try.Predicate<? super T,E> filter, int max, IntFunction<R> supplier) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,E extends java.lang.Exception> BooleanList mapToBoolean(T[] a, Try.ToBooleanFunction<? super T,E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,E extends java.lang.Exception> BooleanList mapToBoolean(T[] a, int fromIndex, int toIndex, Try.ToBooleanFunction<? super T,E> func) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- func
- E extends java.lang.Exception
public static <T,E extends java.lang.Exception> BooleanList mapToBoolean(java.util.Collection<? extends T> c, Try.ToBooleanFunction<? super T,E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,E extends java.lang.Exception> BooleanList mapToBoolean(java.util.Collection<? extends T> c, int fromIndex, int toIndex, Try.ToBooleanFunction<? super T,E> func) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- func
- E extends java.lang.Exception
public static <T,E extends java.lang.Exception> CharList mapToChar(T[] a, Try.ToCharFunction<? super T,E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,E extends java.lang.Exception> CharList mapToChar(T[] a, int fromIndex, int toIndex, Try.ToCharFunction<? super T,E> func) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- func
- E extends java.lang.Exception
public static <T,E extends java.lang.Exception> CharList mapToChar(java.util.Collection<? extends T> c, Try.ToCharFunction<? super T,E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,E extends java.lang.Exception> CharList mapToChar(java.util.Collection<? extends T> c, int fromIndex, int toIndex, Try.ToCharFunction<? super T,E> func) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- func
- E extends java.lang.Exception
public static <T,E extends java.lang.Exception> ByteList mapToByte(T[] a, Try.ToByteFunction<? super T,E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,E extends java.lang.Exception> ByteList mapToByte(T[] a, int fromIndex, int toIndex, Try.ToByteFunction<? super T,E> func) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- func
- E extends java.lang.Exception
public static <T,E extends java.lang.Exception> ByteList mapToByte(java.util.Collection<? extends T> c, Try.ToByteFunction<? super T,E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,E extends java.lang.Exception> ByteList mapToByte(java.util.Collection<? extends T> c, int fromIndex, int toIndex, Try.ToByteFunction<? super T,E> func) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- func
- E extends java.lang.Exception
public static <T,E extends java.lang.Exception> ShortList mapToShort(T[] a, Try.ToShortFunction<? super T,E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,E extends java.lang.Exception> ShortList mapToShort(T[] a, int fromIndex, int toIndex, Try.ToShortFunction<? super T,E> func) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- func
- E extends java.lang.Exception
public static <T,E extends java.lang.Exception> ShortList mapToShort(java.util.Collection<? extends T> c, Try.ToShortFunction<? super T,E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,E extends java.lang.Exception> ShortList mapToShort(java.util.Collection<? extends T> c, int fromIndex, int toIndex, Try.ToShortFunction<? super T,E> func) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- func
- E extends java.lang.Exception
public static <T,E extends java.lang.Exception> IntList mapToInt(T[] a, Try.ToIntFunction<? super T,E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,E extends java.lang.Exception> IntList mapToInt(T[] a, int fromIndex, int toIndex, Try.ToIntFunction<? super T,E> func) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- func
- E extends java.lang.Exception
public static <T,E extends java.lang.Exception> IntList mapToInt(java.util.Collection<? extends T> c, Try.ToIntFunction<? super T,E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,E extends java.lang.Exception> IntList mapToInt(java.util.Collection<? extends T> c, int fromIndex, int toIndex, Try.ToIntFunction<? super T,E> func) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- func
- E extends java.lang.Exception
public static <T,E extends java.lang.Exception> LongList mapToLong(T[] a, Try.ToLongFunction<? super T,E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,E extends java.lang.Exception> LongList mapToLong(T[] a, int fromIndex, int toIndex, Try.ToLongFunction<? super T,E> func) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- func
- E extends java.lang.Exception
public static <T,E extends java.lang.Exception> LongList mapToLong(java.util.Collection<? extends T> c, Try.ToLongFunction<? super T,E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,E extends java.lang.Exception> LongList mapToLong(java.util.Collection<? extends T> c, int fromIndex, int toIndex, Try.ToLongFunction<? super T,E> func) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- func
- E extends java.lang.Exception
public static <T,E extends java.lang.Exception> FloatList mapToFloat(T[] a, Try.ToFloatFunction<? super T,E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,E extends java.lang.Exception> FloatList mapToFloat(T[] a, int fromIndex, int toIndex, Try.ToFloatFunction<? super T,E> func) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- func
- E extends java.lang.Exception
public static <T,E extends java.lang.Exception> FloatList mapToFloat(java.util.Collection<? extends T> c, Try.ToFloatFunction<? super T,E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,E extends java.lang.Exception> FloatList mapToFloat(java.util.Collection<? extends T> c, int fromIndex, int toIndex, Try.ToFloatFunction<? super T,E> func) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- func
- E extends java.lang.Exception
public static <T,E extends java.lang.Exception> DoubleList mapToDouble(T[] a, Try.ToDoubleFunction<? super T,E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,E extends java.lang.Exception> DoubleList mapToDouble(T[] a, int fromIndex, int toIndex, Try.ToDoubleFunction<? super T,E> func) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- func
- E extends java.lang.Exception
public static <T,E extends java.lang.Exception> DoubleList mapToDouble(java.util.Collection<? extends T> c, Try.ToDoubleFunction<? super T,E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,E extends java.lang.Exception> DoubleList mapToDouble(java.util.Collection<? extends T> c, int fromIndex, int toIndex, Try.ToDoubleFunction<? super T,E> func) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- func
- E extends java.lang.Exception
public static <T,R,E extends java.lang.Exception> java.util.List<R> map(T[] a, Try.Function<? super T,? extends R,E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,R,E extends java.lang.Exception> java.util.List<R> map(T[] a, int fromIndex, int toIndex, Try.Function<? super T,? extends R,E> func) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- func
- E extends java.lang.Exception
public static <T,R,E extends java.lang.Exception> java.util.List<R> map(java.util.Collection<? extends T> c, Try.Function<? super T,? extends R,E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,R,E extends java.lang.Exception> java.util.List<R> map(java.util.Collection<? extends T> c, int fromIndex, int toIndex, Try.Function<? super T,? extends R,E> func) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- func
- E extends java.lang.Exception
public static <T,R,C extends java.util.Collection<R>,E extends java.lang.Exception> C map(T[] a, Try.Function<? super T,? extends R,E> func, IntFunction<C> supplier) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,R,C extends java.util.Collection<R>,E extends java.lang.Exception> C map(T[] a, int fromIndex, int toIndex, Try.Function<? super T,? extends R,E> func, IntFunction<C> supplier) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- func
- max
- supplier
- E extends java.lang.Exception
public static <T,R,C extends java.util.Collection<R>,E extends java.lang.Exception> C map(java.util.Collection<? extends T> c, Try.Function<? super T,? extends R,E> func, IntFunction<C> supplier) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,R,C extends java.util.Collection<R>,E extends java.lang.Exception> C map(java.util.Collection<? extends T> c, int fromIndex, int toIndex, Try.Function<? super T,? extends R,E> func, IntFunction<C> supplier) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- func
- max
- supplier
- E extends java.lang.Exception
public static <T,R,E extends java.lang.Exception> java.util.List<R> flatMap(T[] a, Try.Function<? super T,? extends java.util.Collection<? extends R>,E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,R,E extends java.lang.Exception> java.util.List<R> flatMap(T[] a, int fromIndex, int toIndex, Try.Function<? super T,? extends java.util.Collection<? extends R>,E> func) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- func
- E extends java.lang.Exception
public static <T,R,E extends java.lang.Exception> java.util.List<R> flatMap(java.util.Collection<? extends T> c, Try.Function<? super T,? extends java.util.Collection<? extends R>,E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,R,E extends java.lang.Exception> java.util.List<R> flatMap(java.util.Collection<? extends T> c, int fromIndex, int toIndex, Try.Function<? super T,? extends java.util.Collection<? extends R>,E> func) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- func
- E extends java.lang.Exception
public static <T,R,C extends java.util.Collection<R>,E extends java.lang.Exception> C flatMap(T[] a, Try.Function<? super T,? extends java.util.Collection<? extends R>,E> func, IntFunction<C> supplier) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,R,C extends java.util.Collection<R>,E extends java.lang.Exception> C flatMap(T[] a, int fromIndex, int toIndex, Try.Function<? super T,? extends java.util.Collection<? extends R>,E> func, IntFunction<C> supplier) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- func
- mr
- xsupplier
- E extends java.lang.Exception
public static <T,R,C extends java.util.Collection<R>,E extends java.lang.Exception> C flatMap(java.util.Collection<? extends T> c, Try.Function<? super T,? extends java.util.Collection<? extends R>,E> func, IntFunction<C> supplier) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,R,C extends java.util.Collection<R>,E extends java.lang.Exception> C flatMap(java.util.Collection<? extends T> c, int fromIndex, int toIndex, Try.Function<? super T,? extends java.util.Collection<? extends R>,E> func, IntFunction<C> supplier) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- func
- mr
- xsupplier
- E extends java.lang.Exception
public static <T,R,E extends java.lang.Exception> java.util.List<R> flattMap(T[] a, Try.Function<? super T,? extends R[],E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,R,E extends java.lang.Exception> java.util.List<R> flattMap(T[] a, int fromIndex, int toIndex, Try.Function<? super T,? extends R[],E> func) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- func
- E extends java.lang.Exception
public static <T,R,E extends java.lang.Exception> java.util.List<R> flattMap(java.util.Collection<? extends T> c, Try.Function<? super T,? extends R[],E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,R,E extends java.lang.Exception> java.util.List<R> flattMap(java.util.Collection<? extends T> c, int fromIndex, int toIndex, Try.Function<? super T,? extends R[],E> func) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- func
- E extends java.lang.Exception
public static <T,R,C extends java.util.Collection<R>,E extends java.lang.Exception> C flattMap(T[] a, Try.Function<? super T,? extends R[],E> func, IntFunction<C> supplier) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,R,C extends java.util.Collection<R>,E extends java.lang.Exception> C flattMap(T[] a, int fromIndex, int toIndex, Try.Function<? super T,? extends R[],E> func, IntFunction<C> supplier) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- func
- mr
- xsupplier
- E extends java.lang.Exception
public static <T,R,C extends java.util.Collection<R>,E extends java.lang.Exception> C flattMap(java.util.Collection<? extends T> c, Try.Function<? super T,? extends R[],E> func, IntFunction<C> supplier) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,R,C extends java.util.Collection<R>,E extends java.lang.Exception> C flattMap(java.util.Collection<? extends T> c, int fromIndex, int toIndex, Try.Function<? super T,? extends R[],E> func, IntFunction<C> supplier) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- func
- mr
- xsupplier
- E extends java.lang.Exception
public static <T extends java.lang.Number> int sumInt(T[] a)
a
- public static <T extends java.lang.Number> int sumInt(T[] a, int fromIndex, int toIndex)
a
- fromIndex
- toIndex
- public static <T,E extends java.lang.Exception> int sumInt(T[] a, Try.ToIntFunction<? super T,E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,E extends java.lang.Exception> int sumInt(T[] a, int fromIndex, int toIndex, Try.ToIntFunction<? super T,E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T extends java.lang.Number> int sumInt(java.util.Collection<? extends T> c)
c
- public static <T extends java.lang.Number> int sumInt(java.util.Collection<? extends T> c, int fromIndex, int toIndex)
c
- fromIndex
- toIndex
- public static <T,E extends java.lang.Exception> int sumInt(java.util.Collection<? extends T> c, Try.ToIntFunction<? super T,E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,E extends java.lang.Exception> int sumInt(java.util.Collection<? extends T> c, int fromIndex, int toIndex, Try.ToIntFunction<? super T,E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T extends java.lang.Number> long sumLong(T[] a)
a
- public static <T extends java.lang.Number> long sumLong(T[] a, int fromIndex, int toIndex)
a
- fromIndex
- toIndex
- public static <T,E extends java.lang.Exception> long sumLong(T[] a, Try.ToLongFunction<? super T,E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,E extends java.lang.Exception> long sumLong(T[] a, int fromIndex, int toIndex, Try.ToLongFunction<? super T,E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T extends java.lang.Number> long sumLong(java.util.Collection<? extends T> c)
c
- public static <T extends java.lang.Number> long sumLong(java.util.Collection<? extends T> c, int fromIndex, int toIndex)
c
- fromIndex
- toIndex
- public static <T,E extends java.lang.Exception> long sumLong(java.util.Collection<? extends T> c, Try.ToLongFunction<? super T,E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,E extends java.lang.Exception> long sumLong(java.util.Collection<? extends T> c, int fromIndex, int toIndex, Try.ToLongFunction<? super T,E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T extends java.lang.Number> double sumDouble(T[] a)
a
- public static <T extends java.lang.Number> double sumDouble(T[] a, int fromIndex, int toIndex)
a
- fromIndex
- toIndex
- public static <T,E extends java.lang.Exception> double sumDouble(T[] a, Try.ToDoubleFunction<? super T,E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,E extends java.lang.Exception> double sumDouble(T[] a, int fromIndex, int toIndex, Try.ToDoubleFunction<? super T,E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T extends java.lang.Number> double sumDouble(java.util.Collection<? extends T> c)
c
- public static <T extends java.lang.Number> double sumDouble(java.util.Collection<? extends T> c, int fromIndex, int toIndex)
c
- fromIndex
- toIndex
- public static <T,E extends java.lang.Exception> double sumDouble(java.util.Collection<? extends T> c, Try.ToDoubleFunction<? super T,E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,E extends java.lang.Exception> double sumDouble(java.util.Collection<? extends T> c, int fromIndex, int toIndex, Try.ToDoubleFunction<? super T,E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T extends java.lang.Number> OptionalDouble averageInt(T[] a)
a
- public static <T extends java.lang.Number> OptionalDouble averageInt(T[] a, int fromIndex, int toIndex)
a
- fromIndex
- toIndex
- public static <T,E extends java.lang.Exception> OptionalDouble averageInt(T[] a, Try.ToIntFunction<? super T,E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,E extends java.lang.Exception> OptionalDouble averageInt(T[] a, int fromIndex, int toIndex, Try.ToIntFunction<? super T,E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T extends java.lang.Number> OptionalDouble averageInt(java.util.Collection<? extends T> c)
c
- public static <T extends java.lang.Number> OptionalDouble averageInt(java.util.Collection<? extends T> c, int fromIndex, int toIndex)
c
- fromIndex
- toIndex
- public static <T,E extends java.lang.Exception> OptionalDouble averageInt(java.util.Collection<? extends T> c, Try.ToIntFunction<? super T,E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,E extends java.lang.Exception> OptionalDouble averageInt(java.util.Collection<? extends T> c, int fromIndex, int toIndex, Try.ToIntFunction<? super T,E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T extends java.lang.Number> OptionalDouble averageLong(T[] a)
a
- public static <T extends java.lang.Number> OptionalDouble averageLong(T[] a, int fromIndex, int toIndex)
a
- fromIndex
- toIndex
- public static <T,E extends java.lang.Exception> OptionalDouble averageLong(T[] a, Try.ToLongFunction<? super T,E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,E extends java.lang.Exception> OptionalDouble averageLong(T[] a, int fromIndex, int toIndex, Try.ToLongFunction<? super T,E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T extends java.lang.Number> OptionalDouble averageLong(java.util.Collection<? extends T> c)
c
- public static <T extends java.lang.Number> OptionalDouble averageLong(java.util.Collection<? extends T> c, int fromIndex, int toIndex)
c
- fromIndex
- toIndex
- public static <T,E extends java.lang.Exception> OptionalDouble averageLong(java.util.Collection<? extends T> c, Try.ToLongFunction<? super T,E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,E extends java.lang.Exception> OptionalDouble averageLong(java.util.Collection<? extends T> c, int fromIndex, int toIndex, Try.ToLongFunction<? super T,E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T extends java.lang.Number> OptionalDouble averageDouble(T[] a)
a
- public static <T extends java.lang.Number> OptionalDouble averageDouble(T[] a, int fromIndex, int toIndex)
a
- fromIndex
- toIndex
- public static <T,E extends java.lang.Exception> OptionalDouble averageDouble(T[] a, Try.ToDoubleFunction<? super T,E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,E extends java.lang.Exception> OptionalDouble averageDouble(T[] a, int fromIndex, int toIndex, Try.ToDoubleFunction<? super T,E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T extends java.lang.Number> OptionalDouble averageDouble(java.util.Collection<? extends T> c)
c
- public static <T extends java.lang.Number> OptionalDouble averageDouble(java.util.Collection<? extends T> c, int fromIndex, int toIndex)
c
- fromIndex
- toIndex
- public static <T,E extends java.lang.Exception> OptionalDouble averageDouble(java.util.Collection<? extends T> c, Try.ToDoubleFunction<? super T,E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,E extends java.lang.Exception> OptionalDouble averageDouble(java.util.Collection<? extends T> c, int fromIndex, int toIndex, Try.ToDoubleFunction<? super T,E> func) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <E extends java.lang.Exception> int count(boolean[] a, Try.BooleanPredicate<E> filter) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- filter
- E extends java.lang.Exception
public static <E extends java.lang.Exception> int count(boolean[] a, int fromIndex, int toIndex, Try.BooleanPredicate<E> filter) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- filter
- E extends java.lang.Exception
public static <E extends java.lang.Exception> int count(char[] a, Try.CharPredicate<E> filter) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- filter
- E extends java.lang.Exception
public static <E extends java.lang.Exception> int count(char[] a, int fromIndex, int toIndex, Try.CharPredicate<E> filter) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- filter
- E extends java.lang.Exception
public static <E extends java.lang.Exception> int count(byte[] a, Try.BytePredicate<E> filter) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- filter
- E extends java.lang.Exception
public static <E extends java.lang.Exception> int count(byte[] a, int fromIndex, int toIndex, Try.BytePredicate<E> filter) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- filter
- E extends java.lang.Exception
public static <E extends java.lang.Exception> int count(short[] a, Try.ShortPredicate<E> filter) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- filter
- E extends java.lang.Exception
public static <E extends java.lang.Exception> int count(short[] a, int fromIndex, int toIndex, Try.ShortPredicate<E> filter) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- filter
- E extends java.lang.Exception
public static <E extends java.lang.Exception> int count(int[] a, Try.IntPredicate<E> filter) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- filter
- E extends java.lang.Exception
public static <E extends java.lang.Exception> int count(int[] a, int fromIndex, int toIndex, Try.IntPredicate<E> filter) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- filter
- E extends java.lang.Exception
public static <E extends java.lang.Exception> int count(long[] a, Try.LongPredicate<E> filter) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- filter
- E extends java.lang.Exception
public static <E extends java.lang.Exception> int count(long[] a, int fromIndex, int toIndex, Try.LongPredicate<E> filter) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- filter
- E extends java.lang.Exception
public static <E extends java.lang.Exception> int count(float[] a, Try.FloatPredicate<E> filter) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- filter
- E extends java.lang.Exception
public static <E extends java.lang.Exception> int count(float[] a, int fromIndex, int toIndex, Try.FloatPredicate<E> filter) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- filter
- E extends java.lang.Exception
public static <E extends java.lang.Exception> int count(double[] a, Try.DoublePredicate<E> filter) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- filter
- E extends java.lang.Exception
public static <E extends java.lang.Exception> int count(double[] a, int fromIndex, int toIndex, Try.DoublePredicate<E> filter) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- filter
- E extends java.lang.Exception
public static <T,E extends java.lang.Exception> int count(T[] a, Try.Predicate<? super T,E> filter) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- filter
- E extends java.lang.Exception
public static <T,E extends java.lang.Exception> int count(T[] a, int fromIndex, int toIndex, Try.Predicate<? super T,E> filter) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- filter
- E extends java.lang.Exception
public static <T,E extends java.lang.Exception> int count(java.util.Collection<? extends T> c, Try.Predicate<? super T,E> filter) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.c
- filter
- E extends java.lang.Exception
public static <T,E extends java.lang.Exception> int count(java.util.Collection<? extends T> c, int fromIndex, int toIndex, Try.Predicate<? super T,E> filter) throws E extends java.lang.Exception
java.util.stream.Stream
is preferred for multiple phases operation.c
- fromIndex
- toIndex
- filter
- E extends java.lang.Exception
public static short[] top(short[] a, int n)
public static short[] top(short[] a, int n, java.util.Comparator<? super java.lang.Short> cmp)
public static short[] top(short[] a, int fromIndex, int toIndex, int n)
public static short[] top(short[] a, int fromIndex, int toIndex, int n, java.util.Comparator<? super java.lang.Short> cmp)
public static int[] top(int[] a, int n)
public static int[] top(int[] a, int n, java.util.Comparator<? super java.lang.Integer> cmp)
public static int[] top(int[] a, int fromIndex, int toIndex, int n)
public static int[] top(int[] a, int fromIndex, int toIndex, int n, java.util.Comparator<? super java.lang.Integer> cmp)
public static long[] top(long[] a, int n)
public static long[] top(long[] a, int n, java.util.Comparator<? super java.lang.Long> cmp)
public static long[] top(long[] a, int fromIndex, int toIndex, int n)
public static long[] top(long[] a, int fromIndex, int toIndex, int n, java.util.Comparator<? super java.lang.Long> cmp)
public static float[] top(float[] a, int n)
public static float[] top(float[] a, int n, java.util.Comparator<? super java.lang.Float> cmp)
public static float[] top(float[] a, int fromIndex, int toIndex, int n)
public static float[] top(float[] a, int fromIndex, int toIndex, int n, java.util.Comparator<? super java.lang.Float> cmp)
public static double[] top(double[] a, int n)
public static double[] top(double[] a, int n, java.util.Comparator<? super java.lang.Double> cmp)
public static double[] top(double[] a, int fromIndex, int toIndex, int n)
public static double[] top(double[] a, int fromIndex, int toIndex, int n, java.util.Comparator<? super java.lang.Double> cmp)
public static <T extends java.lang.Comparable<T>> T[] top(T[] a, int n)
public static <T> T[] top(T[] a, int n, java.util.Comparator<? super T> cmp)
public static <T extends java.lang.Comparable<T>> T[] top(T[] a, int fromIndex, int toIndex, int n)
public static <T> T[] top(T[] a, int fromIndex, int toIndex, int n, java.util.Comparator<? super T> cmp)
public static <T extends java.lang.Comparable<T>> java.util.List<T> top(java.util.Collection<? extends T> c, int n)
public static <T> java.util.List<T> top(java.util.Collection<? extends T> c, int n, java.util.Comparator<? super T> cmp)
public static <T extends java.lang.Comparable<T>> java.util.List<T> top(java.util.Collection<? extends T> c, int fromIndex, int toIndex, int n)
public static <T> java.util.List<T> top(java.util.Collection<? extends T> c, int fromIndex, int toIndex, int n, java.util.Comparator<? super T> cmp)
public static boolean[] distinct(boolean[] a)
java.util.stream.Stream
is preferred for multiple phases operation.a
- public static boolean[] distinct(boolean[] a, int fromIndex, int toIndex)
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- public static char[] distinct(char[] a)
java.util.stream.Stream
is preferred for multiple phases operation.a
- public static char[] distinct(char[] a, int fromIndex, int toIndex)
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- public static byte[] distinct(byte[] a)
java.util.stream.Stream
is preferred for multiple phases operation.a
- public static byte[] distinct(byte[] a, int fromIndex, int toIndex)
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- public static short[] distinct(short[] a)
java.util.stream.Stream
is preferred for multiple phases operation.a
- public static short[] distinct(short[] a, int fromIndex, int toIndex)
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- public static int[] distinct(int[] a)
java.util.stream.Stream
is preferred for multiple phases operation.a
- public static int[] distinct(int[] a, int fromIndex, int toIndex)
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- public static long[] distinct(long[] a)
java.util.stream.Stream
is preferred for multiple phases operation.a
- public static long[] distinct(long[] a, int fromIndex, int toIndex)
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- public static float[] distinct(float[] a)
java.util.stream.Stream
is preferred for multiple phases operation.a
- public static float[] distinct(float[] a, int fromIndex, int toIndex)
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- public static double[] distinct(double[] a)
java.util.stream.Stream
is preferred for multiple phases operation.a
- public static double[] distinct(double[] a, int fromIndex, int toIndex)
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- public static <T> T[] distinct(T[] a)
java.util.stream.Stream
is preferred for multiple phases operation.a
- public static <T> T[] distinct(T[] a, int fromIndex, int toIndex)
java.util.stream.Stream
is preferred for multiple phases operation.a
- fromIndex
- toIndex
- public static <T> java.util.List<T> distinct(java.util.Collection<? extends T> c)
java.util.stream.Stream
is preferred for multiple phases operation.c
- public static <T> java.util.List<T> distinct(java.util.Collection<? extends T> c, int fromIndex, int toIndex)
java.util.stream.Stream
is preferred for multiple phases operation.c
- fromIndex
- toIndex
- public static <T,E extends java.lang.Exception> T[] distinctBy(T[] a, Try.Function<? super T,?,E> keyExtractor) throws E extends java.lang.Exception
keyExtractor
.
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.a
- keyExtractor
- don't change value of the input parameter.E extends java.lang.Exception
public static <T,E extends java.lang.Exception> T[] distinctBy(T[] a, int fromIndex, int toIndex, Try.Function<? super T,?,E> keyExtractor) throws E extends java.lang.Exception
keyExtractor
.
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.a
- fromIndex
- toIndex
- keyExtractor
- don't change value of the input parameter.E extends java.lang.Exception
public static <T,E extends java.lang.Exception> java.util.List<T> distinctBy(java.util.Collection<? extends T> c, Try.Function<? super T,?,E> keyExtractor) throws E extends java.lang.Exception
keyExtractor
.
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.c
- keyExtractor
- don't change value of the input parameter.E extends java.lang.Exception
public static <T,E extends java.lang.Exception> java.util.List<T> distinctBy(java.util.Collection<? extends T> c, int fromIndex, int toIndex, Try.Function<? super T,?,E> keyExtractor) throws E extends java.lang.Exception
keyExtractor
.
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.c
- fromIndex
- toIndex
- keyExtractor
- don't change value of the input parameter.E extends java.lang.Exception
public static java.util.List<boolean[]> split(boolean[] a, int size)
a
- size
- public static java.util.List<boolean[]> split(boolean[] a, int fromIndex, int toIndex, int size)
a
- fromIndex
- toIndex
- size
- public static java.util.List<char[]> split(char[] a, int size)
a
- size
- public static java.util.List<char[]> split(char[] a, int fromIndex, int toIndex, int size)
a
- fromIndex
- toIndex
- size
- public static java.util.List<byte[]> split(byte[] a, int size)
a
- size
- public static java.util.List<byte[]> split(byte[] a, int fromIndex, int toIndex, int size)
a
- fromIndex
- toIndex
- size
- public static java.util.List<short[]> split(short[] a, int size)
a
- size
- public static java.util.List<short[]> split(short[] a, int fromIndex, int toIndex, int size)
a
- fromIndex
- toIndex
- size
- public static java.util.List<int[]> split(int[] a, int size)
a
- size
- public static java.util.List<int[]> split(int[] a, int fromIndex, int toIndex, int size)
a
- fromIndex
- toIndex
- size
- public static java.util.List<long[]> split(long[] a, int size)
a
- size
- public static java.util.List<long[]> split(long[] a, int fromIndex, int toIndex, int size)
a
- fromIndex
- toIndex
- size
- public static java.util.List<float[]> split(float[] a, int size)
a
- size
- public static java.util.List<float[]> split(float[] a, int fromIndex, int toIndex, int size)
a
- fromIndex
- toIndex
- size
- public static java.util.List<double[]> split(double[] a, int size)
a
- size
- public static java.util.List<double[]> split(double[] a, int fromIndex, int toIndex, int size)
a
- fromIndex
- toIndex
- size
- public static <T> java.util.List<T[]> split(T[] a, int size)
a
- size
- public static <T> java.util.List<T[]> split(T[] a, int fromIndex, int toIndex, int size)
a
- fromIndex
- toIndex
- size
- public static <T> java.util.List<java.util.List<T>> split(java.util.Collection<? extends T> c, int size)
c
- size
- public static <T> java.util.List<java.util.List<T>> split(java.util.Collection<? extends T> c, int fromIndex, int toIndex, int size)
c
- fromIndex
- toIndex
- size
- public static java.util.List<java.lang.String> split(java.lang.CharSequence str, int size)
str
- size
- public static java.util.List<java.lang.String> split(java.lang.CharSequence str, int fromIndex, int toIndex, int size)
public static boolean[] intersection(boolean[] a, boolean[] b)
a
- b
- IntList.intersection(IntList)
public static char[] intersection(char[] a, char[] b)
a
- b
- IntList.intersection(IntList)
public static byte[] intersection(byte[] a, byte[] b)
a
- b
- IntList.intersection(IntList)
public static short[] intersection(short[] a, short[] b)
a
- b
- IntList.intersection(IntList)
public static int[] intersection(int[] a, int[] b)
b
removed by occurrences.
int[] a = {0, 1, 2, 2, 3}; int[] b = {2, 5, 1}; int[] c = retainAll(a, b); // The elements c in a will b: [1, 2, 2]. int[] a = {0, 1, 2, 2, 3}; int[] b = {2, 5, 1}; int[] c = intersection(a, b); // The elements c in a will b: [1, 2].
a
- b
- IntList.intersection(IntList)
public static long[] intersection(long[] a, long[] b)
a
- b
- IntList.intersection(IntList)
public static float[] intersection(float[] a, float[] b)
a
- b
- IntList.intersection(IntList)
public static double[] intersection(double[] a, double[] b)
a
- b
- IntList.intersection(IntList)
public static <T> T[] intersection(T[] a, java.lang.Object[] b)
a
- b
- IntList.intersection(IntList)
public static <T> java.util.List<T> intersection(java.util.Collection<? extends T> a, java.util.Collection<?> b)
a
- b
- IntList.intersection(IntList)
public static boolean[] difference(boolean[] a, boolean[] b)
a
- b
- IntList.difference(IntList)
public static char[] difference(char[] a, char[] b)
a
- b
- IntList.difference(IntList)
public static byte[] difference(byte[] a, byte[] b)
a
- b
- IntList.difference(IntList)
public static short[] difference(short[] a, short[] b)
a
- b
- IntList.difference(IntList)
public static int[] difference(int[] a, int[] b)
b
removed 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].
a
- b
- IntList.difference(IntList)
public static long[] difference(long[] a, long[] b)
a
- b
- IntList.difference(IntList)
public static float[] difference(float[] a, float[] b)
a
- b
- IntList.difference(IntList)
public static double[] difference(double[] a, double[] b)
a
- b
- IntList.difference(IntList)
public static <T> T[] difference(T[] a, java.lang.Object[] b)
a
- b
- IntList.difference(IntList)
public static <T> java.util.List<T> difference(java.util.Collection<? extends T> a, java.util.Collection<?> b)
a
- b
- IntList.difference(IntList)
public static boolean[] symmetricDifference(boolean[] a, boolean[] b)
a
- b
- IntList.symmetricDifference(IntList)
public static char[] symmetricDifference(char[] a, char[] b)
a
- b
- IntList.symmetricDifference(IntList)
public static byte[] symmetricDifference(byte[] a, byte[] b)
a
- b
- IntList.symmetricDifference(IntList)
public static short[] symmetricDifference(short[] a, short[] b)
a
- b
- IntList.symmetricDifference(IntList)
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].
a
- b
- IntList.symmetricDifference(IntList)
,
difference(int[], int[])
public static long[] symmetricDifference(long[] a, long[] b)
a
- b
- IntList.symmetricDifference(IntList)
public static float[] symmetricDifference(float[] a, float[] b)
a
- b
- IntList.symmetricDifference(IntList)
public static double[] symmetricDifference(double[] a, double[] b)
a
- b
- IntList.symmetricDifference(IntList)
public static <T> T[] symmetricDifference(T[] a, T[] b)
a
- b
- IntList.symmetricDifference(IntList)
public static <T> java.util.List<T> symmetricDifference(java.util.Collection<? extends T> a, java.util.Collection<? extends T> b)
a
- b
- IntList.symmetricDifference(IntList)
public static java.lang.String concat(java.lang.String a, java.lang.String b)
a + b
a
- b
- public static java.lang.String concat(java.lang.String a, java.lang.String b, java.lang.String c)
public static java.lang.String concat(java.lang.String a, java.lang.String b, java.lang.String c, java.lang.String d)
public static java.lang.String concat(java.lang.String a, java.lang.String b, java.lang.String c, java.lang.String d, java.lang.String e)
public static java.lang.String concat(java.lang.String a, java.lang.String b, java.lang.String c, java.lang.String d, java.lang.String e, java.lang.String f)
public static java.lang.String concat(java.lang.String a, java.lang.String b, java.lang.String c, java.lang.String d, java.lang.String e, java.lang.String f, java.lang.String g)
@SafeVarargs public static java.lang.String concat(java.lang.String... a)
public static boolean[] concat(boolean[] a, boolean[] b)
a
- b
- @SafeVarargs public static boolean[] concat(boolean[]... aa)
aa
- public static char[] concat(char[] a, char[] b)
a
- b
- @SafeVarargs public static char[] concat(char[]... aa)
aa
- public static byte[] concat(byte[] a, byte[] b)
a
- b
- @SafeVarargs public static byte[] concat(byte[]... aa)
aa
- public static short[] concat(short[] a, short[] b)
a
- b
- @SafeVarargs public static short[] concat(short[]... aa)
aa
- public static int[] concat(int[] a, int[] b)
a
- b
- @SafeVarargs public static int[] concat(int[]... aa)
aa
- public static long[] concat(long[] a, long[] b)
a
- b
- @SafeVarargs public static long[] concat(long[]... aa)
aa
- public static float[] concat(float[] a, float[] b)
a
- b
- @SafeVarargs public static float[] concat(float[]... aa)
aa
- public static double[] concat(double[] a, double[] b)
a
- b
- @SafeVarargs public static double[] concat(double[]... aa)
aa
- public static <T> T[] concat(T[] a, T[] b)
a
- b
- @SafeVarargs public static <T> T[] concat(T[]... aa)
aa
- java.lang.NullPointerException
- if the specified aa
is null
.public static <T> java.util.List<T> concat(java.util.Collection<? extends T> a, java.util.Collection<? extends T> b)
@SafeVarargs public static <T> java.util.List<T> concat(java.util.Collection<? extends T>... a)
public static <T> java.util.List<T> concat(java.util.Collection<? extends java.util.Collection<? extends T>> c)
public static int replaceAll(boolean[] a, boolean oldVal, boolean newVal)
public static int replaceAll(char[] a, char oldVal, char newVal)
public static int replaceAll(byte[] a, byte oldVal, byte newVal)
public static int replaceAll(short[] a, short oldVal, short newVal)
public static int replaceAll(int[] a, int oldVal, int newVal)
public static int replaceAll(long[] a, long oldVal, long newVal)
public static int replaceAll(float[] a, float oldVal, float newVal)
public static int replaceAll(double[] a, double oldVal, double newVal)
public static <T> int replaceAll(T[] a, java.lang.Object oldVal, T newVal)
public static <T> int replaceAll(java.util.List<T> list, java.lang.Object oldVal, T newVal)
public static boolean[] add(boolean[] a, boolean element)
Copies the given array and adds the given element at the end of the new array.
a
- element
- public static char[] add(char[] a, char element)
Copies the given array and adds the given element at the end of the new array.
a
- element
- public static byte[] add(byte[] a, byte element)
Copies the given array and adds the given element at the end of the new array.
a
- element
- public static short[] add(short[] a, short element)
Copies the given array and adds the given element at the end of the new array.
a
- element
- public static int[] add(int[] a, int element)
Copies the given array and adds the given element at the end of the new array.
a
- element
- public static long[] add(long[] a, long element)
Copies the given array and adds the given element at the end of the new array.
a
- element
- public static float[] add(float[] a, float element)
Copies the given array and adds the given element at the end of the new array.
a
- element
- public static double[] add(double[] a, double element)
Copies the given array and adds the given element at the end of the new array.
a
- element
- public static java.lang.String[] add(java.lang.String[] a, java.lang.String element)
Copies the given array and adds the given element at the end of the new array.
a
- element
- public static <T> T[] add(T[] a, T element)
Copies the given array and adds the given element at the end of the new array.
a
- element
- java.lang.NullPointerException
- if the specified a
is null
.@SafeVarargs public static boolean[] addAll(boolean[] a, boolean... b)
Adds all the elements of the given arrays into a new array.
a
- the first array whose elements are added to the new array.b
- the second array whose elements are added to the new array.@SafeVarargs public static char[] addAll(char[] a, char... b)
Adds all the elements of the given arrays into a new array.
a
- the first array whose elements are added to the new array.b
- the second array whose elements are added to the new array.@SafeVarargs public static byte[] addAll(byte[] a, byte... b)
Adds all the elements of the given arrays into a new array.
a
- the first array whose elements are added to the new array.b
- the second array whose elements are added to the new array.@SafeVarargs public static short[] addAll(short[] a, short... b)
Adds all the elements of the given arrays into a new array.
a
- the first array whose elements are added to the new array.b
- the second array whose elements are added to the new array.@SafeVarargs public static int[] addAll(int[] a, int... b)
Adds all the elements of the given arrays into a new array.
a
- the first array whose elements are added to the new array.b
- the second array whose elements are added to the new array.@SafeVarargs public static long[] addAll(long[] a, long... b)
Adds all the elements of the given arrays into a new array.
a
- the first array whose elements are added to the new array.b
- the second array whose elements are added to the new array.@SafeVarargs public static float[] addAll(float[] a, float... b)
Adds all the elements of the given arrays into a new array.
a
- the first array whose elements are added to the new array.b
- the second array whose elements are added to the new array.@SafeVarargs public static double[] addAll(double[] a, double... b)
Adds all the elements of the given arrays into a new array.
a
- the first array whose elements are added to the new array.b
- the second array whose elements are added to the new array.@SafeVarargs public static java.lang.String[] addAll(java.lang.String[] a, java.lang.String... b)
Adds all the elements of the given arrays into a new array.
a
- the first array whose elements are added to the new array.b
- the second array whose elements are added to the new array.@SafeVarargs public static <T> T[] addAll(T[] a, T... b)
Adds all the elements of the given arrays into a new array.
a
- the first array whose elements are added to the new array.b
- the second array whose elements are added to the new array.java.lang.NullPointerException
- if the specified a
is null
.public static boolean[] insert(boolean[] a, int index, boolean element)
Inserts the specified element at the specified position in the array. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
This method returns a new array with the same elements of the input array plus the given element on the specified position. The component type of the returned array is always the same as that of the input array.
a
- index
- the position of the new objectelement
- the object to addpublic static char[] insert(char[] a, int index, char element)
Inserts the specified element at the specified position in the array. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
This method returns a new array with the same elements of the input array plus the given element on the specified position. The component type of the returned array is always the same as that of the input array.
a
- index
- the position of the new objectelement
- the object to addpublic static byte[] insert(byte[] a, int index, byte element)
Inserts the specified element at the specified position in the array. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
This method returns a new array with the same elements of the input array plus the given element on the specified position. The component type of the returned array is always the same as that of the input array.
a
- index
- the position of the new objectelement
- the object to addpublic static short[] insert(short[] a, int index, short element)
Inserts the specified element at the specified position in the array. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
This method returns a new array with the same elements of the input array plus the given element on the specified position. The component type of the returned array is always the same as that of the input array.
a
- index
- the position of the new objectelement
- the object to addpublic static int[] insert(int[] a, int index, int element)
Inserts the specified element at the specified position in the array. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
This method returns a new array with the same elements of the input array plus the given element on the specified position. The component type of the returned array is always the same as that of the input array.
a
- index
- the position of the new objectelement
- the object to addpublic static long[] insert(long[] a, int index, long element)
Inserts the specified element at the specified position in the array. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
This method returns a new array with the same elements of the input array plus the given element on the specified position. The component type of the returned array is always the same as that of the input array.
a
- index
- the position of the new objectelement
- the object to addpublic static float[] insert(float[] a, int index, float element)
Inserts the specified element at the specified position in the array. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
This method returns a new array with the same elements of the input array plus the given element on the specified position. The component type of the returned array is always the same as that of the input array.
a
- index
- the position of the new objectelement
- the object to addpublic static double[] insert(double[] a, int index, double element)
Inserts the specified element at the specified position in the array. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
This method returns a new array with the same elements of the input array plus the given element on the specified position. The component type of the returned array is always the same as that of the input array.
a
- index
- the position of the new objectelement
- the object to addpublic static java.lang.String[] insert(java.lang.String[] a, int index, java.lang.String element)
public static <T> T[] insert(T[] a, int index, T element)
Inserts the specified element at the specified position in the array. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
This method returns a new array with the same elements of the input array plus the given element on the specified position. The component type of the returned array is always the same as that of the input array.
a
- index
- the position of the new objectelement
- the object to addjava.lang.NullPointerException
- if the specified a
is null
.@SafeVarargs public static boolean[] insertAll(boolean[] a, int index, boolean... b)
Inserts the specified elements at the specified position in the array. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
a
- the first array whose elements are added to the new array.index
- the position of the new elements start fromb
- the second array whose elements are added to the new array.@SafeVarargs public static char[] insertAll(char[] a, int index, char... b)
Inserts the specified elements at the specified position in the array. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
a
- the first array whose elements are added to the new array.index
- the position of the new elements start fromb
- the second array whose elements are added to the new array.@SafeVarargs public static byte[] insertAll(byte[] a, int index, byte... b)
Inserts the specified elements at the specified position in the array. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
a
- the first array whose elements are added to the new array.index
- the position of the new elements start fromb
- the second array whose elements are added to the new array.@SafeVarargs public static short[] insertAll(short[] a, int index, short... b)
Inserts the specified elements at the specified position in the array. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
a
- the first array whose elements are added to the new array.index
- the position of the new elements start fromb
- the second array whose elements are added to the new array.@SafeVarargs public static int[] insertAll(int[] a, int index, int... b)
Inserts the specified elements at the specified position in the array. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
a
- the first array whose elements are added to the new array.index
- the position of the new elements start fromb
- the second array whose elements are added to the new array.@SafeVarargs public static long[] insertAll(long[] a, int index, long... b)
Inserts the specified elements at the specified position in the array. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
a
- the first array whose elements are added to the new array.index
- the position of the new elements start fromb
- the second array whose elements are added to the new array.@SafeVarargs public static float[] insertAll(float[] a, int index, float... b)
Inserts the specified elements at the specified position in the array. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
a
- the first array whose elements are added to the new array.index
- the position of the new elements start fromb
- the second array whose elements are added to the new array.@SafeVarargs public static double[] insertAll(double[] a, int index, double... b)
Inserts the specified elements at the specified position in the array. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
a
- the first array whose elements are added to the new array.index
- the position of the new elements start fromb
- the second array whose elements are added to the new array.@SafeVarargs public static java.lang.String[] insertAll(java.lang.String[] a, int index, java.lang.String... b)
@SafeVarargs public static <T> T[] insertAll(T[] a, int index, T... b)
Inserts the specified elements at the specified position in the array. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
a
- the first array whose elements are added to the new array.index
- the position of the new elements start fromb
- the second array whose elements are added to the new array.java.lang.NullPointerException
- if the specified a
is null
.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.
T
- the component type of the arraya
- index
- the position of the element to be removedpublic 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.
T
- the component type of the arraya
- index
- the position of the element to be removedpublic 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.
T
- the component type of the arraya
- index
- the position of the element to be removedpublic 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.
T
- the component type of the arraya
- index
- the position of the element to be removedpublic 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.
T
- the component type of the arraya
- index
- the position of the element to be removedpublic 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.
T
- the component type of the arraya
- index
- the position of the element to be removedpublic 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.
T
- the component type of the arraya
- index
- the position of the element to be removedpublic 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.
T
- the component type of the arraya
- index
- the position of the element to be removedpublic static <T> T[] delete(T[] 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.
T
- the component type of the arraya
- index
- the position of the element to be removed@SafeVarargs public static boolean[] deleteAll(boolean[] a, int... indices)
Removes the elements at the specified positions from the specified array. All remaining elements are shifted to the left.
This method returns a new array with the same elements of the input array except those at the specified positions. The component type of the returned array is always the same as that of the input array.
If the input array is null
, an IndexOutOfBoundsException will be
thrown, because in that case no valid index can be specified.
N.deleteAll([true, false, true], 0, 2) = [false] N.removeAll([true, false, true], 1, 2) = [true]
a
- the array to remove the element from, may not be null
indices
- the positions of the elements to be removed@SafeVarargs public static char[] deleteAll(char[] a, int... indices)
Removes the elements at the specified positions from the specified array. All remaining elements are shifted to the left.
This method returns a new array with the same elements of the input array except those at the specified positions. The component type of the returned array is always the same as that of the input array.
N.deleteAll([1], 0) = [] N.deleteAll([2, 6], 0) = [6] N.deleteAll([2, 6], 0, 1) = [] N.deleteAll([2, 6, 3], 1, 2) = [2] N.deleteAll([2, 6, 3], 0, 2) = [6] N.deleteAll([2, 6, 3], 0, 1, 2) = []
a
- indices
- the positions of the elements to be removed@SafeVarargs public static byte[] deleteAll(byte[] a, int... indices)
Removes the elements at the specified positions from the specified array. All remaining elements are shifted to the left.
This method returns a new array with the same elements of the input array except those at the specified positions. The component type of the returned array is always the same as that of the input array.
N.deleteAll([1], 0) = [] N.deleteAll([2, 6], 0) = [6] N.deleteAll([2, 6], 0, 1) = [] N.deleteAll([2, 6, 3], 1, 2) = [2] N.deleteAll([2, 6, 3], 0, 2) = [6] N.deleteAll([2, 6, 3], 0, 1, 2) = []
a
- indices
- the positions of the elements to be removed@SafeVarargs public static short[] deleteAll(short[] a, int... indices)
Removes the elements at the specified positions from the specified array. All remaining elements are shifted to the left.
This method returns a new array with the same elements of the input array except those at the specified positions. The component type of the returned array is always the same as that of the input array.
N.deleteAll([1], 0) = [] N.deleteAll([2, 6], 0) = [6] N.deleteAll([2, 6], 0, 1) = [] N.deleteAll([2, 6, 3], 1, 2) = [2] N.deleteAll([2, 6, 3], 0, 2) = [6] N.deleteAll([2, 6, 3], 0, 1, 2) = []
a
- indices
- the positions of the elements to be removed@SafeVarargs public static int[] deleteAll(int[] a, int... indices)
Removes the elements at the specified positions from the specified array. All remaining elements are shifted to the left.
This method returns a new array with the same elements of the input array except those at the specified positions. The component type of the returned array is always the same as that of the input array.
N.deleteAll([1], 0) = [] N.deleteAll([2, 6], 0) = [6] N.deleteAll([2, 6], 0, 1) = [] N.deleteAll([2, 6, 3], 1, 2) = [2] N.deleteAll([2, 6, 3], 0, 2) = [6] N.deleteAll([2, 6, 3], 0, 1, 2) = []
a
- indices
- the positions of the elements to be removedjava.lang.IndexOutOfBoundsException
- if any index is out of range (index < 0 || index >=
array.length), or if the array is null
.@SafeVarargs public static long[] deleteAll(long[] a, int... indices)
Removes the elements at the specified positions from the specified array. All remaining elements are shifted to the left.
This method returns a new array with the same elements of the input array except those at the specified positions. The component type of the returned array is always the same as that of the input array.
N.deleteAll([1], 0) = [] N.deleteAll([2, 6], 0) = [6] N.deleteAll([2, 6], 0, 1) = [] N.deleteAll([2, 6, 3], 1, 2) = [2] N.deleteAll([2, 6, 3], 0, 2) = [6] N.deleteAll([2, 6, 3], 0, 1, 2) = []
a
- the array to remove the element from, may not be null
indices
- the positions of the elements to be removed@SafeVarargs public static float[] deleteAll(float[] a, int... indices)
Removes the elements at the specified positions from the specified array. All remaining elements are shifted to the left.
This method returns a new array with the same elements of the input array except those at the specified positions. The component type of the returned array is always the same as that of the input array.
N.deleteAll([1], 0) = [] N.deleteAll([2, 6], 0) = [6] N.deleteAll([2, 6], 0, 1) = [] N.deleteAll([2, 6, 3], 1, 2) = [2] N.deleteAll([2, 6, 3], 0, 2) = [6] N.deleteAll([2, 6, 3], 0, 1, 2) = []
a
- indices
- the positions of the elements to be removed@SafeVarargs public static double[] deleteAll(double[] a, int... indices)
Removes the elements at the specified positions from the specified array. All remaining elements are shifted to the left.
This method returns a new array with the same elements of the input array except those at the specified positions. The component type of the returned array is always the same as that of the input array.
N.deleteAll([1], 0) = [] N.deleteAll([2, 6], 0) = [6] N.deleteAll([2, 6], 0, 1) = [] N.deleteAll([2, 6, 3], 1, 2) = [2] N.deleteAll([2, 6, 3], 0, 2) = [6] N.deleteAll([2, 6, 3], 0, 1, 2) = []
a
- indices
- the positions of the elements to be removed@SafeVarargs public static <T> T[] deleteAll(T[] a, int... indices)
Removes the elements at the specified positions from the specified array. All remaining elements are shifted to the left.
This method returns a new array with the same elements of the input array except those at the specified positions. The component type of the returned array is always the same as that of the input array.
N.deleteAll(["a", "b", "c"], 0, 2) = ["b"] N.deleteAll(["a", "b", "c"], 1, 2) = ["a"]
T
- the component type of the arraya
- indices
- the positions of the elements to be removedjava.lang.NullPointerException
- if the specified a
is null
.@SafeVarargs public static boolean deleteAll(java.util.List<?> list, int... indices)
list
- indices
- public static boolean[] deleteRange(boolean[] a, int fromIndex, int toIndex)
fromIndex
to toIndex
.a
- fromIndex
- toIndex
- public static char[] deleteRange(char[] a, int fromIndex, int toIndex)
fromIndex
to toIndex
.a
- fromIndex
- toIndex
- public static byte[] deleteRange(byte[] a, int fromIndex, int toIndex)
fromIndex
to toIndex
.a
- fromIndex
- toIndex
- public static short[] deleteRange(short[] a, int fromIndex, int toIndex)
fromIndex
to toIndex
.a
- fromIndex
- toIndex
- public static int[] deleteRange(int[] a, int fromIndex, int toIndex)
fromIndex
to toIndex
.a
- fromIndex
- toIndex
- public static long[] deleteRange(long[] a, int fromIndex, int toIndex)
fromIndex
to toIndex
.a
- fromIndex
- toIndex
- public static float[] deleteRange(float[] a, int fromIndex, int toIndex)
fromIndex
to toIndex
.a
- fromIndex
- toIndex
- public static double[] deleteRange(double[] a, int fromIndex, int toIndex)
fromIndex
to toIndex
.a
- fromIndex
- toIndex
- public static <T> T[] deleteRange(T[] a, int fromIndex, int toIndex)
fromIndex
to toIndex
.a
- fromIndex
- toIndex
- public static <T> boolean deleteRange(java.util.List<T> c, int fromIndex, int toIndex)
true
if the List
is updated when fromIndex < toIndex
, otherwise false
is returned when fromIndex == toIndex
.c
- fromIndex
- toIndex
- public static boolean[] remove(boolean[] a, boolean element)
Removes the first occurrence of the specified element from the specified array. All subsequent elements are shifted to the left (subtracts one from their indices). If the array doesn't contains such an element, no elements are removed from the array.
This method returns a new array with the same elements of the input array except the first occurrence of the specified element. The component type of the returned array is always the same as that of the input array.
a
- element
- the element to be removedpublic static char[] remove(char[] a, char element)
Removes the first occurrence of the specified element from the specified array. All subsequent elements are shifted to the left (subtracts one from their indices). If the array doesn't contains such an element, no elements are removed from the array.
This method returns a new array with the same elements of the input array except the first occurrence of the specified element. The component type of the returned array is always the same as that of the input array.
a
- element
- the element to be removedpublic static byte[] remove(byte[] a, byte element)
Removes the first occurrence of the specified element from the specified array. All subsequent elements are shifted to the left (subtracts one from their indices). If the array doesn't contains such an element, no elements are removed from the array.
This method returns a new array with the same elements of the input array except the first occurrence of the specified element. The component type of the returned array is always the same as that of the input array.
a
- element
- the element to be removedpublic static short[] remove(short[] a, short element)
Removes the first occurrence of the specified element from the specified array. All subsequent elements are shifted to the left (subtracts one from their indices). If the array doesn't contains such an element, no elements are removed from the array.
This method returns a new array with the same elements of the input array except the first occurrence of the specified element. The component type of the returned array is always the same as that of the input array.
a
- element
- the element to be removedpublic static int[] remove(int[] a, int element)
Removes the first occurrence of the specified element from the specified array. All subsequent elements are shifted to the left (subtracts one from their indices). If the array doesn't contains such an element, no elements are removed from the array.
This method returns a new array with the same elements of the input array except the first occurrence of the specified element. The component type of the returned array is always the same as that of the input array.
a
- element
- the element to be removedpublic static long[] remove(long[] a, long element)
Removes the first occurrence of the specified element from the specified array. All subsequent elements are shifted to the left (subtracts one from their indices). If the array doesn't contains such an element, no elements are removed from the array.
This method returns a new array with the same elements of the input array except the first occurrence of the specified element. The component type of the returned array is always the same as that of the input array.
a
- element
- the element to be removedpublic static float[] remove(float[] a, float element)
Removes the first occurrence of the specified element from the specified array. All subsequent elements are shifted to the left (subtracts one from their indices). If the array doesn't contains such an element, no elements are removed from the array.
This method returns a new array with the same elements of the input array except the first occurrence of the specified element. The component type of the returned array is always the same as that of the input array.
a
- element
- the element to be removedpublic static double[] remove(double[] a, double element)
Removes the first occurrence of the specified element from the specified array. All subsequent elements are shifted to the left (subtracts one from their indices). If the array doesn't contains such an element, no elements are removed from the array.
This method returns a new array with the same elements of the input array except the first occurrence of the specified element. The component type of the returned array is always the same as that of the input array.
a
- element
- the element to be removedpublic static <T> T[] remove(T[] a, java.lang.Object element)
Removes the first occurrence of the specified element from the specified array. All subsequent elements are shifted to the left (subtracts one from their indices). If the array doesn't contains such an element, no elements are removed from the array.
This method returns a new array with the same elements of the input array except the first occurrence of the specified element. The component type of the returned array is always the same as that of the input array.
a
- element
- the element to be removedpublic static boolean[] removeAllOccurrences(boolean[] a, boolean element)
a
- element
- public static char[] removeAllOccurrences(char[] a, char element)
a
- element
- public static byte[] removeAllOccurrences(byte[] a, byte element)
a
- element
- public static short[] removeAllOccurrences(short[] a, short element)
a
- element
- public static int[] removeAllOccurrences(int[] a, int element)
a
- element
- public static long[] removeAllOccurrences(long[] a, long element)
a
- element
- public static float[] removeAllOccurrences(float[] a, float element)
a
- element
- public static double[] removeAllOccurrences(double[] a, double element)
a
- element
- public static <T> T[] removeAllOccurrences(T[] a, java.lang.Object element)
a
- element
- public static boolean removeAllOccurrences(java.util.Collection<?> c, java.lang.Object element)
@SafeVarargs public static boolean[] removeAll(boolean[] a, boolean... elements)
a
a
- elements
- Collection.removeAll(Collection)
@SafeVarargs public static char[] removeAll(char[] a, char... elements)
a
a
- elements
- Collection.removeAll(Collection)
@SafeVarargs public static byte[] removeAll(byte[] a, byte... elements)
a
a
- elements
- Collection.removeAll(Collection)
@SafeVarargs public static short[] removeAll(short[] a, short... elements)
a
a
- elements
- Collection.removeAll(Collection)
@SafeVarargs public static int[] removeAll(int[] a, int... elements)
a
a
- elements
- Collection.removeAll(Collection)
@SafeVarargs public static long[] removeAll(long[] a, long... elements)
a
a
- elements
- Collection.removeAll(Collection)
@SafeVarargs public static float[] removeAll(float[] a, float... elements)
a
a
- elements
- Collection.removeAll(Collection)
@SafeVarargs public static double[] removeAll(double[] a, double... elements)
a
a
- elements
- Collection.removeAll(Collection)
@SafeVarargs public static <T> T[] removeAll(T[] a, java.lang.Object... elements)
a
a
- elements
- Collection.removeAll(Collection)
@SafeVarargs public static boolean removeAll(java.util.Collection<?> c, java.lang.Object... elements)
public static boolean[] removeDuplicates(boolean[] a)
public static boolean[] removeDuplicates(boolean[] a, boolean isSorted)
public static boolean[] removeDuplicates(boolean[] a, int from, int to, boolean isSorted)
public static char[] removeDuplicates(char[] a)
public static char[] removeDuplicates(char[] a, boolean isSorted)
public static char[] removeDuplicates(char[] a, int from, int to, boolean isSorted)
public static byte[] removeDuplicates(byte[] a)
public static byte[] removeDuplicates(byte[] a, boolean isSorted)
public static byte[] removeDuplicates(byte[] a, int from, int to, boolean isSorted)
public static short[] removeDuplicates(short[] a)
public static short[] removeDuplicates(short[] a, boolean isSorted)
public static short[] removeDuplicates(short[] a, int from, int to, boolean isSorted)
public static int[] removeDuplicates(int[] a)
public static int[] removeDuplicates(int[] a, boolean isSorted)
public static int[] removeDuplicates(int[] a, int from, int to, boolean isSorted)
public static long[] removeDuplicates(long[] a)
public static long[] removeDuplicates(long[] a, boolean isSorted)
public static long[] removeDuplicates(long[] a, int from, int to, boolean isSorted)
public static float[] removeDuplicates(float[] a)
public static float[] removeDuplicates(float[] a, boolean isSorted)
public static float[] removeDuplicates(float[] a, int from, int to, boolean isSorted)
public static double[] removeDuplicates(double[] a)
public static double[] removeDuplicates(double[] a, boolean isSorted)
public static double[] removeDuplicates(double[] a, int from, int to, boolean isSorted)
public static <T> T[] removeDuplicates(T[] a)
Removes all duplicates elements
N.removeElements(["a", "b", "a"]) = ["a", "b"]
T
- the component type of the arraya
- java.lang.NullPointerException
- if the specified array a
is null.public static <T> T[] removeDuplicates(T[] a, boolean isSorted)
public static <T> T[] removeDuplicates(T[] a, int from, int to, boolean isSorted)
public static boolean removeDuplicates(java.util.Collection<?> c)
c
- true
if there is one or more duplicated elements are removed. otherwise false
is returned.public static boolean removeDuplicates(java.util.Collection<?> c, boolean isSorted)
c
- isSorted
- true
if there is one or more duplicated elements are removed. otherwise false
is returned.public static boolean hasDuplicates(char[] a)
public static boolean hasDuplicates(char[] a, boolean isSorted)
public static boolean hasDuplicates(byte[] a)
public static boolean hasDuplicates(byte[] a, boolean isSorted)
public static boolean hasDuplicates(short[] a)
public static boolean hasDuplicates(short[] a, boolean isSorted)
public static boolean hasDuplicates(int[] a)
public static boolean hasDuplicates(int[] a, boolean isSorted)
public static boolean hasDuplicates(long[] a)
public static boolean hasDuplicates(long[] a, boolean isSorted)
public static boolean hasDuplicates(float[] a)
public static boolean hasDuplicates(float[] a, boolean isSorted)
public static boolean hasDuplicates(double[] a)
public static boolean hasDuplicates(double[] a, boolean isSorted)
public static <T> boolean hasDuplicates(T[] a)
public static <T> boolean hasDuplicates(T[] a, boolean isSorted)
public static boolean hasDuplicates(java.util.Collection<?> c)
public static boolean hasDuplicates(java.util.Collection<?> c, boolean isSorted)
@SafeVarargs public static int sum(char... a)
a
- public static int sum(char[] a, int from, int to)
@SafeVarargs public static int sum(byte... a)
a
- public static int sum(byte[] a, int from, int to)
@SafeVarargs public static int sum(short... a)
a
- public static int sum(short[] a, int from, int to)
@SafeVarargs public static int sum(int... a)
a
- public static int sum(int[] a, int from, int to)
@SafeVarargs public static long sum(long... a)
a
- public static long sum(long[] a, int from, int to)
@SafeVarargs public static float sum(float... a)
a
- public static float sum(float[] a, int from, int to)
@SafeVarargs public static double sum(double... a)
a
- public static double sum(double[] a, int from, int to)
@SafeVarargs public static double average(char... a)
a
- public static double average(char[] a, int from, int to)
@SafeVarargs public static double average(byte... a)
a
- public static double average(byte[] a, int from, int to)
@SafeVarargs public static double average(short... a)
a
- public static double average(short[] a, int from, int to)
@SafeVarargs public static double average(int... a)
a
- public static double average(int[] a, int from, int to)
@SafeVarargs public static double average(long... a)
a
- public static double average(long[] a, int from, int to)
@SafeVarargs public static double average(float... a)
a
- public static double average(float[] a, int from, int to)
@SafeVarargs public static double average(double... a)
a
- public static double average(double[] a, int from, int to)
public static char min(char a, char b)
Gets the minimum of two char
values.
a
- b
- public static byte min(byte a, byte b)
Gets the minimum of two byte
values.
a
- b
- public static short min(short a, short b)
Gets the minimum of two short
values.
a
- b
- public static int min(int a, int b)
Gets the minimum of two int
values.
a
- b
- public static long min(long a, long b)
Gets the minimum of two long
values.
a
- b
- public static float min(float a, float b)
Gets the minimum of two float
values.
a
- b
- public static double min(double a, double b)
Gets the minimum of two double
values.
a
- b
- public static <T extends java.lang.Comparable<? super T>> T min(T a, T b)
public static <T> T min(T a, T b, java.util.Comparator<? super T> cmp)
public static char min(char a, char b, char c)
Gets the minimum of three char
values.
a
- b
- c
- public static byte min(byte a, byte b, byte c)
Gets the minimum of three byte
values.
a
- b
- c
- public static short min(short a, short b, short c)
Gets the minimum of three short
values.
a
- b
- c
- public static int min(int a, int b, int c)
Gets the minimum of three int
values.
a
- b
- c
- public static long min(long a, long b, long c)
Gets the minimum of three long
values.
a
- b
- c
- public static float min(float a, float b, float c)
Gets the minimum of three float
values.
a
- b
- c
- public static double min(double a, double b, double c)
Gets the minimum of three double
values.
a
- b
- c
- public static <T extends java.lang.Comparable<? super T>> T min(T a, T b, T c)
public static <T> T min(T a, T b, T c, java.util.Comparator<? super T> cmp)
@SafeVarargs public static char min(char... a)
Returns the minimum value in an array.
a
- an array, must not be null or emptypublic static char min(char[] a, int from, int to)
@SafeVarargs public static byte min(byte... a)
Returns the minimum value in an array.
a
- an array, must not be null or emptypublic static byte min(byte[] a, int from, int to)
@SafeVarargs public static short min(short... a)
Returns the minimum value in an array.
a
- an array, must not be null or emptypublic static short min(short[] a, int from, int to)
@SafeVarargs public static int min(int... a)
Returns the minimum value in an array.
a
- an array, must not be null or emptypublic static int min(int[] a, int from, int to)
@SafeVarargs public static long min(long... a)
Returns the minimum value in an array.
a
- an array, must not be null or emptypublic static long min(long[] a, int from, int to)
@SafeVarargs public static float min(float... a)
Returns the minimum value in an array.
a
- an array, must not be null or emptyIEEE754rUtils for a version of this method
that handles NaN differently
public static float min(float[] a, int from, int to)
@SafeVarargs public static double min(double... a)
Returns the minimum value in an array.
a
- an array, must not be null or emptyIEEE754rUtils for a version of this
method that handles NaN differently
public static double min(double[] a, int from, int to)
public static <T extends java.lang.Comparable<? super T>> T min(T[] a)
a
- an array, must not be null or emptypublic static <T extends java.lang.Comparable<? super T>> T min(T[] a, int from, int to)
public static <T> T min(T[] a, java.util.Comparator<? super T> cmp)
a
- an array, must not be null or emptycmp
- public static <T> T min(T[] a, int from, int to, java.util.Comparator<? super T> cmp)
public static <T extends java.lang.Comparable<? super T>> T min(java.util.Collection<? extends T> c)
public static <T extends java.lang.Comparable<? super T>> T min(java.util.Collection<? extends T> c, int from, int to)
public static <T> T min(java.util.Collection<? extends T> c, java.util.Comparator<? super T> cmp)
public static <T> T min(java.util.Collection<? extends T> c, int from, int to, java.util.Comparator<? super T> cmp)
c
- from
- to
- cmp
- public static <T extends java.lang.Comparable<T>> java.util.List<T> minAll(T[] a)
public static <T> java.util.List<T> minAll(T[] a, java.util.Comparator<? super T> cmp)
public static <T extends java.lang.Comparable<T>> java.util.List<T> minAll(java.util.Collection<T> c)
public static <T> java.util.List<T> minAll(java.util.Collection<T> c, java.util.Comparator<? super T> cmp)
public static char max(char a, char b)
Gets the maximum of two char
values.
a
- b
- public static byte max(byte a, byte b)
Gets the maximum of two byte
values.
a
- b
- public static short max(short a, short b)
Gets the maximum of two short
values.
a
- b
- public static int max(int a, int b)
Gets the maximum of two int
values.
a
- b
- public static long max(long a, long b)
Gets the maximum of two long
values.
a
- b
- public static float max(float a, float b)
Gets the maximum of two float
values.
a
- b
- public static double max(double a, double b)
Gets the maximum of two double
values.
a
- b
- public static <T extends java.lang.Comparable<? super T>> T max(T a, T b)
public static <T> T max(T a, T b, java.util.Comparator<? super T> cmp)
public static char max(char a, char b, char c)
char
values.a
- b
- c
- public static byte max(byte a, byte b, byte c)
byte
values.a
- b
- c
- public static short max(short a, short b, short c)
short
values.a
- b
- c
- public static int max(int a, int b, int c)
int
values.a
- b
- c
- public static long max(long a, long b, long c)
long
values.a
- b
- c
- public static float max(float a, float b, float c)
float
values.a
- b
- c
- public static double max(double a, double b, double c)
double
values.a
- b
- c
- public static <T extends java.lang.Comparable<? super T>> T max(T a, T b, T c)
public static <T> T max(T a, T b, T c, java.util.Comparator<? super T> cmp)
@SafeVarargs public static char max(char... a)
Returns the maximum value in an array.
a
- an array, must not be null or emptypublic static char max(char[] a, int from, int to)
@SafeVarargs public static byte max(byte... a)
Returns the maximum value in an array.
a
- an array, must not be null or emptypublic static byte max(byte[] a, int from, int to)
@SafeVarargs public static short max(short... a)
Returns the maximum value in an array.
a
- an array, must not be null or emptypublic static short max(short[] a, int from, int to)
@SafeVarargs public static int max(int... a)
Returns the maximum value in an array.
a
- an array, must not be null or emptypublic static int max(int[] a, int from, int to)
@SafeVarargs public static long max(long... a)
Returns the maximum value in an array.
a
- an array, must not be null or emptypublic static long max(long[] a, int from, int to)
@SafeVarargs public static float max(float... a)
Returns the maximum value in an array.
a
- an array, must not be null or emptyIEEE754rUtils for a version of this method
that handles NaN differently
public static float max(float[] a, int from, int to)
@SafeVarargs public static double max(double... a)
Returns the maximum value in an array.
a
- an array, must not be null or emptyIEEE754rUtils for a version of this
method that handles NaN differently
public static double max(double[] a, int from, int to)
public static <T extends java.lang.Comparable<? super T>> T max(T[] a)
a
- an array, must not be null or emptyjava.lang.IllegalArgumentException
- if a
is null
or empty.public static <T extends java.lang.Comparable<? super T>> T max(T[] a, int from, int to)
public static <T> T max(T[] a, java.util.Comparator<? super T> cmp)
a
- an array, must not be null or emptycmp
- public static <T> T max(T[] a, int from, int to, java.util.Comparator<? super T> cmp)
public static <T extends java.lang.Comparable<? super T>> T max(java.util.Collection<? extends T> c)
public static <T extends java.lang.Comparable<? super T>> T max(java.util.Collection<? extends T> c, int from, int to)
public static <T> T max(java.util.Collection<? extends T> c, java.util.Comparator<? super T> cmp)
public static <T> T max(java.util.Collection<? extends T> c, int from, int to, java.util.Comparator<? super T> cmp)
c
- from
- to
- cmp
- public static <T extends java.lang.Comparable<T>> java.util.List<T> maxAll(T[] a)
public static <T> java.util.List<T> maxAll(T[] a, java.util.Comparator<? super T> cmp)
public static <T extends java.lang.Comparable<T>> java.util.List<T> maxAll(java.util.Collection<T> c)
public static <T> java.util.List<T> maxAll(java.util.Collection<T> c, java.util.Comparator<? super T> cmp)
public static char median(char a, char b, char c)
a
- b
- c
- median(int...)
public static byte median(byte a, byte b, byte c)
a
- b
- c
- median(int...)
public static short median(short a, short b, short c)
a
- b
- c
- median(int...)
public static int median(int a, int b, int c)
a
- b
- c
- median(int...)
public static long median(long a, long b, long c)
a
- b
- c
- median(int...)
public static float median(float a, float b, float c)
a
- b
- c
- median(int...)
public static double median(double a, double b, double c)
a
- b
- c
- median(int...)
public static <T extends java.lang.Comparable<? super T>> T median(T a, T b, T c)
a
- b
- c
- median(int...)
public static <T> T median(T a, T b, T c, java.util.Comparator<? super T> cmp)
a
- b
- c
- median(int...)
@SafeVarargs public static char median(char... a)
length / 2 + 1
largest value in the specified array.a
- an array, must not be null or emptymedian(int...)
public static char median(char[] a, int from, int to)
@SafeVarargs public static byte median(byte... a)
length / 2 + 1
largest value in the specified array.a
- an array, must not be null or emptymedian(int...)
public static byte median(byte[] a, int from, int to)
@SafeVarargs public static short median(short... a)
length / 2 + 1
largest value in the specified array.a
- an array, must not be null or emptymedian(int...)
public static short median(short[] a, int from, int to)
@SafeVarargs public static int median(int... a)
length / 2 + 1
largest value in the specified array.a
- an array, must not be null or emptymedian(int...)
public static int median(int[] a, int from, int to)
@SafeVarargs public static long median(long... a)
length / 2 + 1
largest value in the specified array.a
- an array, must not be null or emptymedian(int...)
public static long median(long[] a, int from, int to)
@SafeVarargs public static float median(float... a)
length / 2 + 1
largest value in the specified array.a
- an array, must not be null or emptymedian(int...)
public static float median(float[] a, int from, int to)
@SafeVarargs public static double median(double... a)
length / 2 + 1
largest value in the specified array.a
- an array, must not be null or emptymedian(int...)
public static double median(double[] a, int from, int to)
public static <T extends java.lang.Comparable<? super T>> T median(T[] a)
length / 2 + 1
largest value in the specified array.a
- an array, must not be null or emptymedian(int...)
public static <T extends java.lang.Comparable<? super T>> T median(T[] a, int from, int to)
public static <T> T median(T[] a, java.util.Comparator<? super T> cmp)
length / 2 + 1
largest value in the specified array.a
- an array, must not be null or emptymedian(int...)
public static <T> T median(T[] a, int from, int to, java.util.Comparator<? super T> cmp)
public static <T extends java.lang.Comparable<? super T>> T median(java.util.Collection<? extends T> c)
length / 2 + 1
largest value in the specified array.a
- an array, must not be null or emptymedian(int...)
public static <T extends java.lang.Comparable<? super T>> T median(java.util.Collection<? extends T> c, int from, int to)
public static <T> T median(java.util.Collection<? extends T> c, java.util.Comparator<? super T> cmp)
length / 2 + 1
largest value in the specified array.a
- an array, must not be null or emptymedian(int...)
public static <T> T median(java.util.Collection<? extends T> c, int from, int to, java.util.Comparator<? super T> cmp)
public static char kthLargest(char[] a, int k)
a
- k
- java.lang.IllegalArgumentException
- if the length of the specified array is less than k
.public static char kthLargest(char[] a, int from, int to, int k)
a
- from
- to
- k
- a[from]
to a[to]
java.lang.IllegalArgumentException
- if to - from
is less than k
.public static byte kthLargest(byte[] a, int k)
a
- k
- java.lang.IllegalArgumentException
- if the length of the specified array is less than k
.public static byte kthLargest(byte[] a, int from, int to, int k)
a
- from
- to
- k
- a[from]
to a[to]
java.lang.IllegalArgumentException
- if to - from
is less than k
.public static short kthLargest(short[] a, int k)
a
- k
- java.lang.IllegalArgumentException
- if the length of the specified array is less than k
.public static short kthLargest(short[] a, int from, int to, int k)
a
- from
- to
- k
- a[from]
to a[to]
java.lang.IllegalArgumentException
- if to - from
is less than k
.public static int kthLargest(int[] a, int k)
a
- k
- java.lang.IllegalArgumentException
- if the length of the specified array is less than k
.public static int kthLargest(int[] a, int from, int to, int k)
a
- from
- to
- k
- a[from]
to a[to]
java.lang.IllegalArgumentException
- if to - from
is less than k
.public static long kthLargest(long[] a, int k)
a
- k
- java.lang.IllegalArgumentException
- if the length of the specified array is less than k
.public static long kthLargest(long[] a, int from, int to, int k)
a
- from
- to
- k
- a[from]
to a[to]
java.lang.IllegalArgumentException
- if to - from
is less than k
.public static float kthLargest(float[] a, int k)
a
- k
- java.lang.IllegalArgumentException
- if the length of the specified array is less than k
.public static float kthLargest(float[] a, int from, int to, int k)
a
- from
- to
- k
- a[from]
to a[to]
java.lang.IllegalArgumentException
- if to - from
is less than k
.public static double kthLargest(double[] a, int k)
a
- k
- java.lang.IllegalArgumentException
- if the length of the specified array is less than k
.public static double kthLargest(double[] a, int from, int to, int k)
a
- from
- to
- k
- a[from]
to a[to]
java.lang.IllegalArgumentException
- if to - from
is less than k
.public static <T extends java.lang.Comparable<T>> T kthLargest(T[] a, int k)
a
- k
- java.lang.IllegalArgumentException
- if the length of the specified array is less than k
.public static <T extends java.lang.Comparable<T>> T kthLargest(T[] a, int from, int to, int k)
a
- from
- to
- k
- a[from]
to a[to]
java.lang.IllegalArgumentException
- if to - from
is less than k
.public static <T> T kthLargest(T[] a, int k, java.util.Comparator<? super T> cmp)
a
- k
- cmp
- java.lang.IllegalArgumentException
- if the length of the specified array is less than k
.public static <T> T kthLargest(T[] a, int from, int to, int k, java.util.Comparator<? super T> cmp)
a
- from
- to
- k
- cmp
- a[from]
to a[to]
java.lang.IllegalArgumentException
- if to - from
is less than k
.public static <T extends java.lang.Comparable<T>> T kthLargest(java.util.Collection<? extends T> c, int k)
c
- k
- java.lang.IllegalArgumentException
- if the length of the specified array is less than k
.public static <T extends java.lang.Comparable<T>> T kthLargest(java.util.Collection<? extends T> c, int from, int to, int k)
c
- from
- to
- k
- a[from]
to a[to]
java.lang.IllegalArgumentException
- if to - from
is less than k
.public static <T> T kthLargest(java.util.Collection<? extends T> c, int k, java.util.Comparator<? super T> cmp)
c
- k
- cmp
- java.lang.IllegalArgumentException
- if the length of the specified array is less than k
.public static <T> T kthLargest(java.util.Collection<? extends T> c, int from, int to, int k, java.util.Comparator<? super T> cmp)
c
- from
- to
- k
- cmp
- a[from]
to a[to]
java.lang.IllegalArgumentException
- if to - from
is less than k
.public static java.util.Map<com.landawn.abacus.util.Percentage,java.lang.Character> percentiles(char[] sortedArray)
Percentage
* length of the specified array.sortedArray
- java.lang.IllegalArgumentException
- if the specified sortedArray
is null or empty.public static java.util.Map<com.landawn.abacus.util.Percentage,java.lang.Byte> percentiles(byte[] sortedArray)
Percentage
* length of the specified array.sortedArray
- java.lang.IllegalArgumentException
- if the specified sortedArray
is null or empty.public static java.util.Map<com.landawn.abacus.util.Percentage,java.lang.Short> percentiles(short[] sortedArray)
Percentage
* length of the specified array.sortedArray
- java.lang.IllegalArgumentException
- if the specified sortedArray
is null or empty.public static java.util.Map<com.landawn.abacus.util.Percentage,java.lang.Integer> percentiles(int[] sortedArray)
Percentage
* length of the specified array.sortedArray
- java.lang.IllegalArgumentException
- if the specified sortedArray
is null or empty.public static java.util.Map<com.landawn.abacus.util.Percentage,java.lang.Long> percentiles(long[] sortedArray)
Percentage
* length of the specified array.sortedArray
- java.lang.IllegalArgumentException
- if the specified sortedArray
is null or empty.public static java.util.Map<com.landawn.abacus.util.Percentage,java.lang.Float> percentiles(float[] sortedArray)
Percentage
* length of the specified array.sortedArray
- java.lang.IllegalArgumentException
- if the specified sortedArray
is null or empty.public static java.util.Map<com.landawn.abacus.util.Percentage,java.lang.Double> percentiles(double[] sortedArray)
Percentage
* length of the specified array.sortedArray
- java.lang.IllegalArgumentException
- if the specified sortedArray
is null or empty.public static <T> java.util.Map<com.landawn.abacus.util.Percentage,T> percentiles(T[] sortedArray)
Percentage
* length of the specified array.sortedArray
- java.lang.IllegalArgumentException
- if the specified sortedArray
is null or empty.public static <T> java.util.Map<com.landawn.abacus.util.Percentage,T> percentiles(java.util.List<T> sortedList)
Percentage
* length of the specified array.sortedArray
- java.lang.IllegalArgumentException
- if the specified sortedArray
is null or empty.public static java.lang.String toJSON(java.lang.Object obj)
public static java.lang.String toJSON(java.lang.Object obj, JSONSerializationConfig config)
public static void toJSON(java.io.File file, java.lang.Object obj)
public static void toJSON(java.io.File file, java.lang.Object obj, JSONSerializationConfig config)
public static void toJSON(java.io.OutputStream os, java.lang.Object obj)
public static void toJSON(java.io.OutputStream os, java.lang.Object obj, JSONSerializationConfig config)
public static void toJSON(java.io.Writer writer, java.lang.Object obj)
public static void toJSON(java.io.Writer writer, java.lang.Object obj, JSONSerializationConfig config)
public static <T> T fromJSON(java.lang.Class<T> targetClass, java.lang.String json)
public static <T> T fromJSON(java.lang.Class<T> targetClass, java.lang.String json, JSONDeserializationConfig config)
public static <T> T fromJSON(java.lang.Class<T> targetClass, java.io.File json)
public static <T> T fromJSON(java.lang.Class<T> targetClass, java.io.File json, JSONDeserializationConfig config)
public static <T> T fromJSON(java.lang.Class<T> targetClass, java.io.InputStream json)
public static <T> T fromJSON(java.lang.Class<T> targetClass, java.io.InputStream json, JSONDeserializationConfig config)
public static <T> T fromJSON(java.lang.Class<T> targetClass, java.io.Reader json)
public static <T> T fromJSON(java.lang.Class<T> targetClass, java.io.Reader json, JSONDeserializationConfig config)
public static <T> T fromJSON(java.lang.Class<T> targetClass, java.lang.String json, int fromIndex, int toIndex)
public static <T> T fromJSON(java.lang.Class<T> targetClass, java.lang.String json, int fromIndex, int toIndex, JSONDeserializationConfig config)
public static <T> T fromJSON(com.landawn.abacus.type.Type<T> targetType, java.lang.String json)
targetType
- can be the Type
of Entity/Array/Collection/Map
.json
- public static <T> T fromJSON(com.landawn.abacus.type.Type<T> targetType, java.lang.String json, JSONDeserializationConfig config)
targetType
- can be the Type
of Entity/Array/Collection/Map
.json
- config
- public static <T> T fromJSON(com.landawn.abacus.type.Type<T> targetType, java.io.File json)
targetType
- can be the Type
of Entity/Array/Collection/Map
.json
- public static <T> T fromJSON(com.landawn.abacus.type.Type<T> targetType, java.io.File json, JSONDeserializationConfig config)
targetType
- can be the Type
of Entity/Array/Collection/Map
.json
- config
- public static <T> T fromJSON(com.landawn.abacus.type.Type<T> targetType, java.io.InputStream json)
targetType
- can be the Type
of Entity/Array/Collection/Map
.json
- public static <T> T fromJSON(com.landawn.abacus.type.Type<T> targetType, java.io.InputStream json, JSONDeserializationConfig config)
targetType
- can be the Type
of Entity/Array/Collection/Map
.json
- config
- public static <T> T fromJSON(com.landawn.abacus.type.Type<T> targetType, java.io.Reader json)
targetType
- can be the Type
of Entity/Array/Collection/Map
.json
- public static <T> T fromJSON(com.landawn.abacus.type.Type<T> targetType, java.io.Reader json, JSONDeserializationConfig config)
targetType
- can be the Type
of Entity/Array/Collection/Map
.json
- config
- public static <T> T fromJSON(com.landawn.abacus.type.Type<T> targetType, java.lang.String json, int fromIndex, int toIndex)
targetType
- can be the Type
of Entity/Array/Collection/Map
.json
- fromIndex
- toIndex
- public static <T> T fromJSON(com.landawn.abacus.type.Type<T> targetType, java.lang.String json, int fromIndex, int toIndex, JSONDeserializationConfig config)
targetType
- can be the Type
of Entity/Array/Collection/Map
.json
- fromIndex
- toIndex
- config
- public static java.lang.String toXML(java.lang.Object obj)
public static java.lang.String toXML(java.lang.Object obj, XMLSerializationConfig config)
public static void toXML(java.io.File file, java.lang.Object obj)
public static void toXML(java.io.File file, java.lang.Object obj, XMLSerializationConfig config)
public static void toXML(java.io.OutputStream os, java.lang.Object obj)
public static void toXML(java.io.OutputStream os, java.lang.Object obj, XMLSerializationConfig config)
public static void toXML(java.io.Writer writer, java.lang.Object obj)
public static void toXML(java.io.Writer writer, java.lang.Object obj, XMLSerializationConfig config)
public static <T> T fromXML(java.lang.Class<T> targetClass, java.lang.String xml)
public static <T> T fromXML(java.lang.Class<T> targetClass, java.lang.String xml, XMLDeserializationConfig config)
public static <T> T fromXML(java.lang.Class<T> targetClass, java.io.File xml)
public static <T> T fromXML(java.lang.Class<T> targetClass, java.io.File xml, XMLDeserializationConfig config)
public static <T> T fromXML(java.lang.Class<T> targetClass, java.io.InputStream xml)
public static <T> T fromXML(java.lang.Class<T> targetClass, java.io.InputStream xml, XMLDeserializationConfig config)
public static <T> T fromXML(java.lang.Class<T> targetClass, java.io.Reader xml)
public static <T> T fromXML(java.lang.Class<T> targetClass, java.io.Reader xml, XMLDeserializationConfig config)
public static <T> T fromXML(com.landawn.abacus.type.Type<T> targetType, java.lang.String xml)
targetType
- can be the Type
of Entity/Array/Collection/Map
.xml
- public static <T> T fromXML(com.landawn.abacus.type.Type<T> targetType, java.lang.String xml, XMLDeserializationConfig config)
targetType
- can be the Type
of Entity/Array/Collection/Map
.xml
- config
- public static <T> T fromXML(com.landawn.abacus.type.Type<T> targetType, java.io.File xml)
targetType
- can be the Type
of Entity/Array/Collection/Map
.xml
- public static <T> T fromXML(com.landawn.abacus.type.Type<T> targetType, java.io.File xml, XMLDeserializationConfig config)
targetType
- can be the Type
of Entity/Array/Collection/Map
.xml
- config
- public static <T> T fromXML(com.landawn.abacus.type.Type<T> targetType, java.io.InputStream xml)
targetType
- can be the Type
of Entity/Array/Collection/Map
.xml
- public static <T> T fromXML(com.landawn.abacus.type.Type<T> targetType, java.io.InputStream xml, XMLDeserializationConfig config)
targetType
- can be the Type
of Entity/Array/Collection/Map
.xml
- config
- public static <T> T fromXML(com.landawn.abacus.type.Type<T> targetType, java.io.Reader xml)
targetType
- can be the Type
of Entity/Array/Collection/Map
.xml
- public static <T> T fromXML(com.landawn.abacus.type.Type<T> targetType, java.io.Reader xml, XMLDeserializationConfig config)
targetType
- can be the Type
of Entity/Array/Collection/Map
.xml
- config
- public static java.lang.String xml2JSON(java.lang.String xml)
public static java.lang.String xml2JSON(java.lang.Class<?> cls, java.lang.String xml)
public static java.lang.String json2XML(java.lang.String json)
public static java.lang.String json2XML(java.lang.Class<?> cls, java.lang.String json)
public static void execute(Try.Runnable<? extends java.lang.Exception> cmd, int retryTimes, long retryInterval, Predicate<? super java.lang.Exception> retryCondition)
public static <T> T execute(java.util.concurrent.Callable<T> cmd, int retryTimes, long retryInterval, BiPredicate<? super T,? super java.lang.Exception> retryCondition)
public static CompletableFuture<java.lang.Void> asyncExecute(java.lang.Runnable command)
public static CompletableFuture<java.lang.Void> asyncExecute(java.lang.Runnable command, long delay)
@SafeVarargs public static java.util.List<CompletableFuture<java.lang.Void>> asyncExecute(java.lang.Runnable... commands)
public static java.util.List<CompletableFuture<java.lang.Void>> asyncExecute(java.util.List<? extends java.lang.Runnable> commands)
public static <T> CompletableFuture<T> asyncExecute(java.util.concurrent.Callable<T> command)
public static <T> CompletableFuture<T> asyncExecute(java.util.concurrent.Callable<T> command, long delay)
@SafeVarargs public static <T> java.util.List<CompletableFuture<T>> asyncExecute(java.util.concurrent.Callable<T>... commands)
public static <T> java.util.List<CompletableFuture<T>> asyncExecute(java.util.Collection<? extends java.util.concurrent.Callable<T>> commands)
public static CompletableFuture<java.lang.Void> asyncExecute(Try.Runnable<? extends java.lang.Exception> cmd, int retryTimes, long retryInterval, Predicate<? super java.lang.Exception> retryCondition)
public static <T> CompletableFuture<T> asyncExecute(java.util.concurrent.Callable<T> cmd, int retryTimes, long retryInterval, BiPredicate<? super T,? super java.lang.Exception> retryCondition)
public static <T,E extends java.lang.Exception> void parse(java.util.Iterator<? extends T> iter, Try.Consumer<? super T,E> elementParser) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,E extends java.lang.Exception,E2 extends java.lang.Exception> void parse(java.util.Iterator<? extends T> iter, Try.Consumer<? super T,E> elementParser, Try.Runnable<E2> onComplete) throws E extends java.lang.Exception, E2 extends java.lang.Exception
E extends java.lang.Exception
public static <T,E extends java.lang.Exception> void parse(java.util.Iterator<? extends T> iter, long offset, long count, Try.Consumer<? super T,E> elementParser) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,E extends java.lang.Exception,E2 extends java.lang.Exception> void parse(java.util.Iterator<? extends T> iter, long offset, long count, Try.Consumer<? super T,E> elementParser, Try.Runnable<E2> onComplete) throws E extends java.lang.Exception, E2 extends java.lang.Exception
E extends java.lang.Exception
public static <T,E extends java.lang.Exception> void parse(java.util.Iterator<? extends T> iter, long offset, long count, int processThreadNum, int queueSize, Try.Consumer<? super T,E> elementParser) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,E extends java.lang.Exception,E2 extends java.lang.Exception> void parse(java.util.Iterator<? extends T> iter, long offset, long count, int processThreadNum, int queueSize, Try.Consumer<? super T,E> elementParser, Try.Runnable<E2> onComplete) throws E extends java.lang.Exception, E2 extends java.lang.Exception
iter
- offset
- count
- processThreadNum
- new threads started to parse/process the lines/recordsqueueSize
- size of queue to save the processing records/lines loaded from source data. Default size is 1024.elementParser.
- onComplete
- onError
- E extends java.lang.Exception
public static <T,E extends java.lang.Exception> void parse(java.util.Collection<? extends java.util.Iterator<? extends T>> iterators, Try.Consumer<? super T,E> elementParser) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,E extends java.lang.Exception,E2 extends java.lang.Exception> void parse(java.util.Collection<? extends java.util.Iterator<? extends T>> iterators, Try.Consumer<? super T,E> elementParser, Try.Runnable<E2> onComplete) throws E extends java.lang.Exception, E2 extends java.lang.Exception
E extends java.lang.Exception
public static <T,E extends java.lang.Exception> void parse(java.util.Collection<? extends java.util.Iterator<? extends T>> iterators, long offset, long count, Try.Consumer<? super T,E> elementParser) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,E extends java.lang.Exception,E2 extends java.lang.Exception> void parse(java.util.Collection<? extends java.util.Iterator<? extends T>> iterators, long offset, long count, Try.Consumer<? super T,E> elementParser, Try.Runnable<E2> onComplete) throws E extends java.lang.Exception, E2 extends java.lang.Exception
E extends java.lang.Exception
public static <T,E extends java.lang.Exception> void parse(java.util.Collection<? extends java.util.Iterator<? extends T>> iterators, int readThreadNum, int processThreadNum, int queueSize, Try.Consumer<? super T,E> elementParser) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,E extends java.lang.Exception,E2 extends java.lang.Exception> void parse(java.util.Collection<? extends java.util.Iterator<? extends T>> iterators, int readThreadNum, int processThreadNum, int queueSize, Try.Consumer<? super T,E> elementParser, Try.Runnable<E2> onComplete) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,E extends java.lang.Exception> void parse(java.util.Collection<? extends java.util.Iterator<? extends T>> iterators, long offset, long count, int readThreadNum, int processThreadNum, int queueSize, Try.Consumer<? super T,E> elementParser) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,E extends java.lang.Exception,E2 extends java.lang.Exception> void parse(java.util.Collection<? extends java.util.Iterator<? extends T>> iterators, long offset, long count, int readThreadNum, int processThreadNum, int queueSize, Try.Consumer<? super T,E> elementParser, Try.Runnable<E2> onComplete) throws E extends java.lang.Exception, E2 extends java.lang.Exception
iterators
- offset
- count
- readThreadNum
- new threads started to parse/process the lines/recordsprocessThreadNum
- new threads started to parse/process the lines/recordsqueueSize
- size of queue to save the processing records/lines loaded from source data. Default size is 1024.elementParser.
- onComplete
- E extends java.lang.Exception
@Beta @Internal @Deprecated public static char[] getCharsForReadOnly(java.lang.String str)
public static java.lang.RuntimeException toRuntimeException(java.lang.Throwable e)
public static void sleep(long timeoutInMillis)
public static void sleep(long timeout, java.util.concurrent.TimeUnit unit)
public static void sleepUninterruptibly(long timeoutInMillis)
timeoutInMillis
- public static void sleepUninterruptibly(long timeout, java.util.concurrent.TimeUnit unit)
timeoutInMillis
- public static void runUninterruptibly(Try.Runnable<java.lang.InterruptedException> cmd)
cmd
- public static void runUninterruptibly(long timeoutInMillis, Try.LongConsumer<java.lang.InterruptedException> cmd)
timeoutInMillis
- cmd
- public static void runUninterruptibly(long timeout, java.util.concurrent.TimeUnit unit, Try.BiConsumer<java.lang.Long,java.util.concurrent.TimeUnit,java.lang.InterruptedException> cmd)
timeout
- unit
- cmd
- public static <T> T callUninterruptibly(Try.Callable<T,java.lang.InterruptedException> cmd)
cmd
- public static <T> T callUninterruptibly(long timeoutInMillis, Try.LongFunction<T,java.lang.InterruptedException> cmd)
timeoutInMillis
- cmd
- public static <T> T callUninterruptibly(long timeout, java.util.concurrent.TimeUnit unit, Try.BiFunction<java.lang.Long,java.util.concurrent.TimeUnit,T,java.lang.InterruptedException> cmd)
timeout
- unit
- cmd
- public static <T> T println(T obj)
obj
- obj
@SafeVarargs public static <T> T[] fprintln(java.lang.String format, T... args)
format
- args
- args
public static <T> Nullable<T> castIfAssignable(java.lang.Object val, java.lang.Class<T> targetType)
Nullable
if val
is null
while targetType
is primitive or can't be assigned to targetType
.
Please be aware that null
can be assigned to any Object
type except primitive types: boolean/char/byte/short/int/long/double
.val
- targetType
- public static <R> Nullable<R> tryOrEmpty(java.util.concurrent.Callable<R> cmd)
Nullable
with the value returned by action
or an empty Nullable
if exception happens.cmd
- public static <T,R,E extends java.lang.Exception> Nullable<R> tryOrEmpty(T seed, Try.Function<T,R,E> func)
Nullable
with the value returned by func.apply(seed)
or an empty Nullable
if exception happens.seed
- func
- public static <R,E extends java.lang.Exception> Nullable<R> ifOrEmpty(boolean b, Try.Supplier<R,E> supplier) throws E extends java.lang.Exception
Nullable
with value got from the specified supplier
if b
is true
,
otherwise returns an empty Nullable
if b
is false.b
- supplier
- E
E extends java.lang.Exception
public static <T,R,E extends java.lang.Exception> Nullable<R> ifOrEmpty(boolean b, T seed, Try.Function<T,R,E> func) throws E extends java.lang.Exception
Nullable
with value returned by func.apply(seed)
if b
is true
,
otherwise returns an empty Nullable
if b
is false.b
- seed
- func
- E
E extends java.lang.Exception
public static <E1 extends java.lang.Exception,E2 extends java.lang.Exception> void ifOrElse(boolean b, Try.Runnable<E1> actionForTrue, Try.Runnable<E2> actionForFalse) throws E1 extends java.lang.Exception, E2 extends java.lang.Exception
b
- actionForTrue
- do nothing if it's null
even b
is true.actionForFalse
- do nothing if it's null
even b
is false.E1
E2
E1 extends java.lang.Exception
public static <T,E1 extends java.lang.Exception,E2 extends java.lang.Exception> void ifOrElse(boolean b, T seed, Try.Consumer<T,E1> actionForTrue, Try.Consumer<T,E2> actionForFalse) throws E1 extends java.lang.Exception, E2 extends java.lang.Exception
b
- seed
- actionForTrue
- do nothing if it's null
even b
is true.actionForFalse
- do nothing if it's null
even b
is false.E1
E2
E1 extends java.lang.Exception
@SafeVarargs public static <T> ObjIterator<T> iterate(T[]... a)
a
- Iterators#concat(Object[]...)
@SafeVarargs public static <T> ObjIterator<T> iterate(java.util.Collection<? extends T>... a)
a
- Iterators.concat(Collection)
public static <T> ObjIterator<T> iterate(java.util.Collection<? extends java.util.Collection<? extends T>> c)
c
- Iterators.concatt(Collection)
public static boolean disjoint(java.lang.Object[] a, java.lang.Object[] b)
public static boolean disjoint(java.util.Collection<?> c1, java.util.Collection<?> c2)
true
if the two specified arrays have no elements in common.a
- b
- true
if the two specified arrays have no elements in common.Collections.disjoint(Collection, Collection)
public static <T,E extends java.lang.Exception> java.util.List<T> merge(T[] a, T[] b, Try.BiFunction<? super T,? super T,com.landawn.abacus.util.Nth,E> nextSelector) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,E extends java.lang.Exception> java.util.List<T> merge(java.util.Collection<? extends T> a, java.util.Collection<? extends T> b, Try.BiFunction<? super T,? super T,com.landawn.abacus.util.Nth,E> nextSelector) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <A,B,R,E extends java.lang.Exception> java.util.List<R> zip(A[] a, B[] b, Try.BiFunction<? super A,? super B,R,E> zipFunction) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <A,B,R,E extends java.lang.Exception> java.util.List<R> zip(java.util.Collection<A> a, java.util.Collection<B> b, Try.BiFunction<? super A,? super B,R,E> zipFunction) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <A,B,C,R,E extends java.lang.Exception> java.util.List<R> zip(A[] a, B[] b, C[] c, Try.TriFunction<? super A,? super B,? super C,R,E> zipFunction) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <A,B,C,R,E extends java.lang.Exception> java.util.List<R> zip(java.util.Collection<A> a, java.util.Collection<B> b, java.util.Collection<C> c, Try.TriFunction<? super A,? super B,? super C,R,E> zipFunction) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <A,B,R,E extends java.lang.Exception> java.util.List<R> zip(A[] a, B[] b, A valueForNoneA, B valueForNoneB, Try.BiFunction<? super A,? super B,R,E> zipFunction) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <A,B,R,E extends java.lang.Exception> java.util.List<R> zip(java.util.Collection<A> a, java.util.Collection<B> b, A valueForNoneA, B valueForNoneB, Try.BiFunction<? super A,? super B,R,E> zipFunction) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <A,B,C,R,E extends java.lang.Exception> java.util.List<R> zip(A[] a, B[] b, C[] c, A valueForNoneA, B valueForNoneB, C valueForNoneC, Try.TriFunction<? super A,? super B,? super C,R,E> zipFunction) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <A,B,C,R,E extends java.lang.Exception> java.util.List<R> zip(java.util.Collection<A> a, java.util.Collection<B> b, java.util.Collection<C> c, A valueForNoneA, B valueForNoneB, C valueForNoneC, Try.TriFunction<? super A,? super B,? super C,R,E> zipFunction) throws E extends java.lang.Exception
E extends java.lang.Exception
public static <T,L,R,E extends java.lang.Exception> Pair<java.util.List<L>,java.util.List<R>> unzip(java.util.Collection<? extends T> c, Try.BiConsumer<? super T,Pair<L,R>,E> unzip) throws E extends java.lang.Exception
c
- unzip
- the second parameter is an output parameter.E extends java.lang.Exception
public static <T,L,R,LC extends java.util.Collection<L>,RC extends java.util.Collection<R>,E extends java.lang.Exception> Pair<LC,RC> unzip(java.util.Collection<? extends T> c, Try.BiConsumer<? super T,Pair<L,R>,E> unzip, IntFunction<? extends java.util.Collection<?>> supplier) throws E extends java.lang.Exception
c
- unzip
- the second parameter is an output parameter.supplier
- E extends java.lang.Exception
public static <T,L,M,R,E extends java.lang.Exception> Triple<java.util.List<L>,java.util.List<M>,java.util.List<R>> unzipp(java.util.Collection<? extends T> c, Try.BiConsumer<? super T,Triple<L,M,R>,E> unzip) throws E extends java.lang.Exception
c
- unzip
- the second parameter is an output parameter.E extends java.lang.Exception
public static <T,L,M,R,LC extends java.util.Collection<L>,MC extends java.util.Collection<M>,RC extends java.util.Collection<R>,E extends java.lang.Exception> Triple<LC,MC,RC> unzipp(java.util.Collection<? extends T> c, Try.BiConsumer<? super T,Triple<L,M,R>,E> unzip, IntFunction<? extends java.util.Collection<?>> supplier) throws E extends java.lang.Exception
c
- unzip
- the second parameter is an output parameter.supplier
- E extends java.lang.Exception
public static <T> java.util.List<java.util.List<T>> rollup(java.util.Collection<? extends T> c)
public static <E> java.util.Set<java.util.Set<E>> powerSet(java.util.Set<E> set)
set
. For example,
powerSet(ImmutableSet.of(1, 2))
returns the set {{},
{1}, {2}, {1, 2}}
.
Elements appear in these subsets in the same iteration order as they appeared in the input set. The order in which these subsets appear in the outer set is undefined. Note that the power set of the empty set is not the empty set, but a one-element set containing the empty set.
The returned set and its constituent sets use equals
to decide
whether two elements are identical, even if the input set uses a different
concept of equivalence.
Performance notes: while the power set of a set with size n
is of size 2^n
, its memory usage is only O(n)
. When the
power set is constructed, the input set is merely copied. Only as the
power set is iterated are the individual subsets created, and these subsets
themselves occupy only a small constant amount of memory.
set
- the set of elements to construct a power set fromjava.lang.IllegalArgumentException
- if set
has more than 30 unique
elements (causing the power set size to exceed the int
range)java.lang.NullPointerException
- if set
is or contains null
public static <E> java.util.Collection<java.util.List<E>> permutations(java.util.Collection<E> elements)
Collection
of all the permutations of the specified
Collection
.
Notes: This is an implementation of the Plain Changes algorithm for permutations generation, described in Knuth's "The Art of Computer Programming", Volume 4, Chapter 7, Section 7.2.1.2.
If the input list contains equal elements, some of the generated permutations will be equal.
An empty collection has only one permutation, which is an empty list.
elements
- the original collection whose elements have to be permuted.Collection
containing all the different
permutations of the original collection.java.lang.NullPointerException
- if the specified collection is null or has any
null elements.public static <E extends java.lang.Comparable<? super E>> java.util.Collection<java.util.List<E>> orderedPermutations(java.util.Collection<E> elements)
Collection
of all the permutations of the specified
Iterable
.
Notes: This is an implementation of the algorithm for Lexicographical Permutations Generation, described in Knuth's "The Art of Computer Programming", Volume 4, Chapter 7, Section 7.2.1.2. The iteration order follows the lexicographical order. This means that the first permutation will be in ascending order, and the last will be in descending order.
Duplicate elements are considered equal. For example, the list [1, 1]
will have only one permutation, instead of two. This is why the elements
have to implement Comparable
.
An empty iterable has only one permutation, which is an empty list.
This method is equivalent to
Collections2.orderedPermutations(list, Ordering.natural())
.
elements
- the original iterable whose elements have to be permuted.Collection
containing all the different
permutations of the original iterable.java.lang.NullPointerException
- if the specified iterable is null or has any
null elements.public static <E> java.util.Collection<java.util.List<E>> orderedPermutations(java.util.Collection<E> elements, java.util.Comparator<? super E> comparator)
Collection
of all the permutations of the specified
Iterable
using the specified Comparator
for establishing
the lexicographical ordering.
Examples:
for (List<String> perm : orderedPermutations(asList("b", "c", "a"))) {
println(perm);
}
// -> ["a", "b", "c"]
// -> ["a", "c", "b"]
// -> ["b", "a", "c"]
// -> ["b", "c", "a"]
// -> ["c", "a", "b"]
// -> ["c", "b", "a"]
for (List<Integer> perm : orderedPermutations(asList(1, 2, 2, 1))) {
println(perm);
}
// -> [1, 1, 2, 2]
// -> [1, 2, 1, 2]
// -> [1, 2, 2, 1]
// -> [2, 1, 1, 2]
// -> [2, 1, 2, 1]
// -> [2, 2, 1, 1]
Notes: This is an implementation of the algorithm for Lexicographical Permutations Generation, described in Knuth's "The Art of Computer Programming", Volume 4, Chapter 7, Section 7.2.1.2. The iteration order follows the lexicographical order. This means that the first permutation will be in ascending order, and the last will be in descending order.
Elements that compare equal are considered equal and no new permutations are created by swapping them.
An empty iterable has only one permutation, which is an empty list.
elements
- the original iterable whose elements have to be permuted.comparator
- a comparator for the iterable's elements.Collection
containing all the different
permutations of the original iterable.java.lang.NullPointerException
- If the specified iterable is null, has any
null elements, or if the specified comparator is null.@SafeVarargs public static <E> java.util.List<java.util.List<E>> cartesianProduct(java.util.Collection<? extends E>... cs)
Lists.cartesianProduct(ImmutableList.of(
ImmutableList.of(1, 2),
ImmutableList.of("A", "B", "C")))
returns a list containing six lists in the following order:
ImmutableList.of(1, "A")
ImmutableList.of(1, "B")
ImmutableList.of(1, "C")
ImmutableList.of(2, "A")
ImmutableList.of(2, "B")
ImmutableList.of(2, "C")
The result is guaranteed to be in the "traditional", lexicographical order for Cartesian products that you would get from nesting for loops:
for (B b0 : lists.get(0)) {
for (B b1 : lists.get(1)) {
...
ImmutableList<B> tuple = ImmutableList.of(b0, b1, ...);
// operate on tuple
}
}
Note that if any input list is empty, the Cartesian product will also be empty. If no lists at all are provided (an empty list), the resulting Cartesian product has one element, an empty list (counter-intuitive, but mathematically consistent).
Performance notes: while the cartesian product of lists of size
m, n, p
is a list of size m x n x p
, its actual memory
consumption is much smaller. When the cartesian product is constructed, the
input lists are merely copied. Only as the resulting list is iterated are
the individual lists created, and these are not retained after iteration.
E
- any common base class shared by all axes (often just Object
)cs
- the lists to choose elements from, in the order that
the elements chosen from those lists should appear in the resulting
listsjava.lang.IllegalArgumentException
- if the size of the cartesian product would
be greater than Integer.MAX_VALUE
java.lang.NullPointerException
- if lists
, any one of the
lists
, or any element of a provided list is nullpublic static <E> java.util.List<java.util.List<E>> cartesianProduct(java.util.Collection<? extends java.util.Collection<? extends E>> cs)
Lists.cartesianProduct(ImmutableList.of(
ImmutableList.of(1, 2),
ImmutableList.of("A", "B", "C")))
returns a list containing six lists in the following order:
ImmutableList.of(1, "A")
ImmutableList.of(1, "B")
ImmutableList.of(1, "C")
ImmutableList.of(2, "A")
ImmutableList.of(2, "B")
ImmutableList.of(2, "C")
The result is guaranteed to be in the "traditional", lexicographical order for Cartesian products that you would get from nesting for loops:
for (B b0 : lists.get(0)) {
for (B b1 : lists.get(1)) {
...
ImmutableList<B> tuple = ImmutableList.of(b0, b1, ...);
// operate on tuple
}
}
Note that if any input list is empty, the Cartesian product will also be empty. If no lists at all are provided (an empty list), the resulting Cartesian product has one element, an empty list (counter-intuitive, but mathematically consistent).
Performance notes: while the cartesian product of lists of size
m, n, p
is a list of size m x n x p
, its actual memory
consumption is much smaller. When the cartesian product is constructed, the
input lists are merely copied. Only as the resulting list is iterated are
the individual lists created, and these are not retained after iteration.
E
- any common base class shared by all axes (often just Object
)cs
- the lists to choose elements from, in the order that
the elements chosen from those lists should appear in the resulting
listsjava.lang.IllegalArgumentException
- if the size of the cartesian product would
be greater than Integer.MAX_VALUE
java.lang.NullPointerException
- if lists
, any one of the lists
,
or any element of a provided list is null