public final class RulesUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_DOUBLE_FORMAT |
static double |
E |
static double |
PI |
| Modifier and Type | Method and Description |
|---|---|
static double |
abs(double a)
Returns the absolute value of a
double value. |
static float |
abs(float a)
Returns the absolute value of a
float value. |
static int |
abs(int a)
Returns the absolute value of an
int value. |
static long |
abs(long a)
Returns the absolute value of a
long value. |
static Integer |
absMonth(Date d) |
static Integer |
absQuarter(Date d) |
static double |
acos(double a)
Returns the arc cosine of a value; the returned angle is in the range 0.0 through pi.
|
static boolean[] |
add(boolean[] array,
boolean element)
Copies the given array and adds the given element at the end of the new array.
|
static Boolean[] |
add(Boolean[] array,
Boolean element) |
static boolean[] |
add(boolean[] array,
int index,
boolean element)
Inserts the specified element at the specified position in the array.
|
static Boolean[] |
add(Boolean[] array,
int index,
Boolean element) |
static byte[] |
add(byte[] array,
byte element)
Copies the given array and adds the given element at the end of the new array.
|
static Byte[] |
add(Byte[] array,
Byte element) |
static byte[] |
add(byte[] array,
int index,
byte element)
Copies the given array and adds the given element at the end of the new array.
|
static Byte[] |
add(Byte[] array,
int index,
Byte element) |
static char[] |
add(char[] array,
char element)
Copies the given array and adds the given element at the end of the new array.
|
static char[] |
add(char[] array,
int index,
char element)
Inserts the specified element at the specified position in the array.
|
static Character[] |
add(Character[] array,
Character element) |
static Character[] |
add(Character[] array,
int index,
Character element) |
static double[] |
add(double[] array,
double element)
Copies the given array and adds the given element at the end of the new array.
|
static Double[] |
add(Double[] array,
Double element) |
static double[] |
add(double[] array,
int index,
double element)
Inserts the specified element at the specified position in the array.
|
static Double[] |
add(Double[] array,
int index,
Double element) |
static float[] |
add(float[] array,
float element)
Copies the given array and adds the given element at the end of the new array.
|
static Float[] |
add(Float[] array,
Float element) |
static float[] |
add(float[] array,
int index,
float element)
Copies the given array and adds the given element at the end of the new array.
|
static Float[] |
add(Float[] array,
int index,
Float element) |
static int[] |
add(int[] array,
int element)
Copies the given array and adds the given element at the end of the new array.
|
static int[] |
add(int[] array,
int index,
int element)
Inserts the specified element at the specified position in the array.
|
static Integer[] |
add(Integer[] array,
Integer element) |
static Integer[] |
add(Integer[] array,
int index,
Integer element) |
static long[] |
add(long[] array,
int index,
long element)
Inserts the specified element at the specified position in the array.
|
static Long[] |
add(Long[] array,
int index,
Long element) |
static long[] |
add(long[] array,
long element)
Copies the given array and adds the given element at the end of the new array.
|
static Long[] |
add(Long[] array,
Long element) |
static short[] |
add(short[] array,
int index,
short element)
Inserts the specified element at the specified position in the array.
|
static Short[] |
add(Short[] array,
int index,
Short element) |
static short[] |
add(short[] array,
short element)
Copies the given array and adds the given element at the end of the new array.
|
static Short[] |
add(Short[] array,
Short element) |
static <T> T[] |
add(T[] array,
int index,
T element)
Inserts the specified element at the specified position in the array.
|
static <T> T[] |
add(T[] array,
T element)
Copies the given array and adds the given element at the end of the new array.
|
static boolean[] |
addAll(boolean[] array1,
boolean[] array2)
Adds all the elements of the given arrays into a new array.
|
static byte[] |
addAll(byte[] array1,
byte[] array2)
Adds all the elements of the given arrays into a new array.
|
static Byte[] |
addAll(Byte[] array1,
Byte[] array2) |
static char[] |
addAll(char[] array1,
char[] array2)
Adds all the elements of the given arrays into a new array.
|
static Character[] |
addAll(Character[] array1,
Character[] array2) |
static double[] |
addAll(double[] array1,
double[] array2)
Adds all the elements of the given arrays into a new array.
|
static Double[] |
addAll(Double[] array1,
Double[] array2) |
static float[] |
addAll(float[] array1,
float[] array2)
Adds all the elements of the given arrays into a new array.
|
static Float[] |
addAll(Float[] array1,
Float[] array2) |
static int[] |
addAll(int[] array1,
int[] array2)
Adds all the elements of the given arrays into a new array.
|
static Integer[] |
addAll(Integer[] array1,
Integer[] array2) |
static long[] |
addAll(long[] array1,
long[] array2)
Adds all the elements of the given arrays into a new array.
|
static Long[] |
addAll(Long[] array1,
Long[] array2) |
static short[] |
addAll(short[] array1,
short[] array2)
Adds all the elements of the given arrays into a new array.
|
static Short[] |
addAll(Short[] array1,
Short[] array2) |
static <T> T[] |
addAll(T[] array1,
T[] array2)
Adds all the elements of the given arrays into a new array.
|
static Object[] |
addArrayElementIgnoreNull(Object[] array,
int index,
Object element)
Deprecated.
|
static Object[] |
addArrayElementIgnoreNull(Object[] array,
Object element)
Deprecated.
|
static <T> T[] |
addIgnoreNull(T[] array,
int index,
T element)
Inserts the specified element at the specified position in the array.
|
static <T> T[] |
addIgnoreNull(T[] array,
T element)
Inserts the specified element at the specified position in the array.
|
static String |
amPm(Date d)
Returns AM or PM
|
static double |
asin(double a)
Returns the arc sine of a value; the returned angle is in the range -pi/2 through pi/2.
|
static double |
atan(double a)
Returns the arc tangent of a value; the returned angle is in the range -pi/2 through pi/2.
|
static double |
atan2(double y,
double x)
Returns the angle theta from the conversion of rectangular coordinates (
x, y) to
polar coordinates (r, theta). |
static BigDecimal |
big(BigDecimal[] values,
int position)
Removes null values from array, sorts an array in descending order and returns the value at position
'position'
|
static BigInteger |
big(BigInteger[] values,
int position)
Removes null values from array, sorts an array in descending order and returns the value at position
'position'
|
static Byte |
big(byte[] values,
int position)
Removes null values from array, sorts an array in descending order and returns the value at position
'position'
|
static Byte |
big(Byte[] values,
int position)
Removes null values from array, sorts an array in descending order and returns the value at position
'position'
|
static Double |
big(double[] values,
int position)
Removes null values from array, sorts an array in descending order and returns the value at position
'position'
|
static Double |
big(Double[] values,
int position)
Removes null values from array, sorts an array in descending order and returns the value at position
'position'
|
static Float |
big(float[] values,
int position)
Removes null values from array, sorts an array in descending order and returns the value at position
'position'
|
static Float |
big(Float[] values,
int position)
Removes null values from array, sorts an array in descending order and returns the value at position
'position'
|
static Integer |
big(int[] values,
int position)
Removes null values from array, sorts an array in descending order and returns the value at position
'position'
|
static Integer |
big(Integer[] values,
int position)
Removes null values from array, sorts an array in descending order and returns the value at position
'position'
|
static Long |
big(long[] values,
int position)
Removes null values from array, sorts an array in descending order and returns the value at position
'position'
|
static Long |
big(Long[] values,
int position)
Removes null values from array, sorts an array in descending order and returns the value at position
'position'
|
static Short |
big(short[] values,
int position)
Removes null values from array, sorts an array in descending order and returns the value at position
'position'
|
static Short |
big(Short[] values,
int position)
Removes null values from array, sorts an array in descending order and returns the value at position
'position'
|
static double |
cbrt(double a)
Returns the cube root of a
double value. |
static double |
ceil(double a)
Returns the smallest (closest to negative infinity)
double value that is greater than or equal to the
argument and is equal to a mathematical integer. |
static boolean |
contains(boolean[] array,
boolean elem) |
static boolean |
contains(Boolean[] array,
Boolean elem) |
static boolean |
contains(boolean[] ary1,
boolean[] ary2) |
static boolean |
contains(Boolean[] ary1,
Boolean[] ary2) |
static boolean |
contains(byte[] array,
byte elem)
Checks if the value is in the given array.
|
static boolean |
contains(Byte[] array,
Byte elem) |
static boolean |
contains(byte[] ary1,
byte[] ary2) |
static boolean |
contains(Byte[] ary1,
Byte[] ary2) |
static boolean |
contains(char[] array,
char elem)
Checks if the value is in the given array.
|
static boolean |
contains(char[] ary1,
char[] ary2) |
static boolean |
contains(Character[] array,
Character elem) |
static boolean |
contains(Character[] ary1,
Character[] ary2) |
static boolean |
contains(CharRange[] ary1,
char[] ary2) |
static boolean |
contains(CharRange[] array,
Character elem) |
static boolean |
contains(CharRange[] ary1,
Character[] ary2) |
static boolean |
contains(Date[] array,
Date elem) |
static boolean |
contains(DateRange[] array,
Date elem) |
static boolean |
contains(DateRange[] ary1,
Date[] ary2) |
static boolean |
contains(double[] array,
double elem)
Checks if the value is in the given array.
|
static boolean |
contains(Double[] array,
Double elem) |
static boolean |
contains(double[] ary1,
double[] ary2) |
static boolean |
contains(Double[] ary1,
Double[] ary2) |
static boolean |
contains(DoubleRange[] array,
Double elem) |
static boolean |
contains(DoubleRange[] ary1,
double[] ary2) |
static boolean |
contains(DoubleRange[] ary1,
Double[] ary2) |
static boolean |
contains(float[] array,
float elem)
Checks if the value is in the given array.
|
static boolean |
contains(Float[] array,
Float elem) |
static boolean |
contains(float[] ary1,
float[] ary2) |
static boolean |
contains(Float[] ary1,
Float[] ary2) |
static boolean |
contains(int[] array,
int elem)
Checks if the value is in the given array.
|
static boolean |
contains(int[] ary1,
int[] ary2) |
static boolean |
contains(Integer[] array,
Integer elem) |
static boolean |
contains(Integer[] ary1,
Integer[] ary2) |
static boolean |
contains(IntRange[] ary1,
int[] ary2) |
static boolean |
contains(IntRange[] array,
Integer elem) |
static boolean |
contains(IntRange[] ary1,
Integer[] ary2) |
static boolean |
contains(long[] array,
long elem)
Checks if the value is in the given array.
|
static boolean |
contains(Long[] array,
Long elem) |
static boolean |
contains(long[] ary1,
long[] ary2) |
static boolean |
contains(Long[] ary1,
Long[] ary2) |
static boolean |
contains(Object[] array,
Object obj)
Checks if the object is in the given array.
|
static boolean |
contains(Object[] ary1,
Object[] ary2) |
static boolean |
contains(short[] array,
short elem)
Checks if the value is in the given array.
|
static boolean |
contains(Short[] array,
Short elem) |
static boolean |
contains(short[] ary1,
short[] ary2) |
static boolean |
contains(Short[] ary1,
Short[] ary2) |
static boolean |
contains(String[] array,
String elem) |
static boolean |
contains(String[] ary1,
String[] ary2) |
static boolean |
contains(StringRange[] array,
CharSequence elem) |
static boolean |
contains(StringRange[] ary1,
CharSequence[] ary2) |
static boolean |
contains(StringRange[] array,
String elem) |
static boolean |
contains(StringRange[] ary1,
String[] ary2) |
static <T> T |
copy(T origin) |
static double |
copySign(double magnitude,
double sign)
Returns the first floating-point argument with the sign of the second floating-point argument.
|
static float |
copySign(float magnitude,
float sign)
Returns the first floating-point argument with the sign of the second floating-point argument.
|
static double |
cos(double a)
Returns the trigonometric cosine of an angle.
|
static double |
cosh(double x)
Returns the hyperbolic cosine of a
double value. |
static String |
dateToString(Date date)
Deprecated.
|
static String |
dateToString(Date date,
String dateFormat)
Deprecated.
|
static Integer |
dayDiff(Date d1,
Date d2) |
static Integer |
dayOfMonth(Date d) |
static Integer |
dayOfWeek(Date d) |
static Integer |
dayOfYear(Date d) |
static ThrowableVoidCast.ThrowableVoid |
error(String msg) |
static double |
exp(double a)
Returns Euler's number e raised to the power of a
double value. |
static double |
expm1(double x)
Returns ex -1.
|
static Date |
firstDateOfQuarter(int absQuarter) |
static Object[] |
flatten(Object... data) |
static double |
floor(double a)
Returns the largest (closest to positive infinity)
double value that is less than or equal to the
argument and is equal to a mathematical integer. |
static String |
format(Date date)
Deprecated.
|
static String |
format(Date date,
String format)
Deprecated.
|
static String |
format(double d) |
static String |
format(double d,
String fmt) |
static Class<?> |
getCommonSuperClass(Class<?> classA,
Class<?> classB) |
static int |
getExponent(double d)
Returns the unbiased exponent used in the representation of a
double. |
static double |
getExponent(double x,
double y)
Returns sqrt(x2 +y2) without intermediate overflow or underflow.
|
static int |
getExponent(float f)
Returns the unbiased exponent used in the representation of a
float. |
static Object |
getValues(DomainOpenClass clazz) |
static Integer |
hour(Date d) |
static Integer |
hourOfDay(Date d) |
static double |
IEEEremainder(double f1,
double f2)
Computes the remainder operation on two arguments as prescribed by the IEEE 754 standard.
|
static int |
indexOf(boolean[] array,
boolean elem) |
static int |
indexOf(Boolean[] array,
Boolean elem) |
static int |
indexOf(byte[] array,
byte elem)
Finds the index of the given value in the array.
|
static int |
indexOf(Byte[] array,
Byte elem) |
static int |
indexOf(char[] array,
char elem)
Finds the index of the given value in the array.
|
static int |
indexOf(Character[] array,
Character elem) |
static int |
indexOf(double[] array,
double elem)
Finds the index of the given value in the array.
|
static int |
indexOf(Double[] array,
Double elem) |
static int |
indexOf(float[] array,
float elem)
Finds the index of the given value in the array.
|
static int |
indexOf(Float[] array,
Float elem) |
static int |
indexOf(int[] array,
int elem)
Finds the index of the given value in the array.
|
static int |
indexOf(Integer[] array,
Integer elem) |
static int |
indexOf(long[] array,
long elem)
Finds the index of the given value in the array.
|
static int |
indexOf(Long[] array,
Long elem) |
static int |
indexOf(Object[] array,
Object obj)
Finds the index of the given object in the array.
|
static int |
indexOf(short[] array,
short elem)
Finds the index of the given value in the array.
|
static int |
indexOf(Short[] array,
Short elem) |
static boolean |
instanceOf(Object o,
Class<?> clazz) |
static String[] |
intersection(String[] ary1,
String[] ary2) |
static Date |
lastDateOfQuarter(int absQuarter) |
static Integer |
lastDayOfMonth(Date d) |
static double |
log(double a)
Returns the natural logarithm (base e) of a
double value. |
static double |
log10(double a)
Returns the base 10 logarithm of a
double value. |
static double |
log1p(double x)
Returns the natural logarithm of the sum of the argument and 1.
|
static BigDecimal |
median(BigDecimal[] values)
"Method median is not implemented yet"
|
static BigDecimal |
median(BigInteger[] values)
"Method median is not implemented yet"
|
static Double |
median(byte[] values)
"Method median is not implemented yet"
|
static Double |
median(Byte[] values)
"Method median is not implemented yet"
|
static Double |
median(double[] values)
"Method median is not implemented yet"
|
static Double |
median(Double[] values)
"Method median is not implemented yet"
|
static Float |
median(float[] values)
"Method median is not implemented yet"
|
static Float |
median(Float[] values)
"Method median is not implemented yet"
|
static Double |
median(int[] values)
"Method median is not implemented yet"
|
static Double |
median(Integer[] values)
"Method median is not implemented yet"
|
static Double |
median(long[] values)
"Method median is not implemented yet"
|
static Double |
median(Long[] values)
"Method median is not implemented yet"
|
static Double |
median(short[] values)
"Method median is not implemented yet"
|
static Double |
median(Short[] values)
"Method median is not implemented yet"
|
static Integer |
minute(Date d) |
static BigDecimal |
mod(BigDecimal number,
BigDecimal divisor) |
static BigInteger |
mod(BigInteger number,
BigInteger divisor) |
static byte |
mod(byte number,
byte divisor) |
static Byte |
mod(Byte number,
Byte divisor) |
static double |
mod(double number,
double divisor) |
static Double |
mod(Double number,
Double divisor) |
static float |
mod(float number,
float divisor) |
static Float |
mod(Float number,
Float divisor) |
static Integer |
mod(Integer number,
Integer divisor) |
static int |
mod(int number,
int divisor) |
static long |
mod(long number,
long divisor) |
static Long |
mod(Long number,
Long divisor) |
static short |
mod(short number,
short divisor) |
static Short |
mod(Short number,
Short divisor) |
static Integer |
month(Date d) |
static Integer |
monthDiff(Date d1,
Date d2) |
static double |
nextAfter(double d)
Returns the floating-point value adjacent to
d in the direction of positive infinity. |
static double |
nextAfter(double start,
double direction)
Returns the floating-point number adjacent to the first argument in the direction of the second argument.
|
static float |
nextAfter(float f)
Returns the floating-point value adjacent to
f in the direction of positive infinity. |
static float |
nextAfter(float start,
float direction)
Returns the floating-point number adjacent to the first argument in the direction of the second argument.
|
static boolean |
noNulls(Object[] values) |
static void |
out(boolean output) |
static void |
out(byte output) |
static void |
out(char output) |
static void |
out(double output) |
static void |
out(float output) |
static void |
out(int output) |
static void |
out(long output) |
static void |
out(Object output) |
static void |
out(short output) |
static void |
out(String output) |
static double |
parseFormattedDouble(String s)
Deprecated.
|
static double |
parseFormattedDouble(String s,
String fmt)
Deprecated.
|
static double |
pow(byte a,
byte b)
Returns the value of the first argument raised to the power of the second argument.
|
static double |
pow(double a,
double b) |
static double |
pow(Double a,
Double b) |
static double |
pow(float a,
float b) |
static double |
pow(int a,
int b) |
static double |
pow(long a,
long b) |
static double |
pow(short a,
short b) |
static Integer |
quarter(Date d) |
static long |
quotient(BigDecimal number,
BigDecimal divisor) |
static long |
quotient(BigInteger number,
BigInteger divisor) |
static long |
quotient(byte number,
byte divisor) |
static long |
quotient(Byte number,
Byte divisor)
Returns the
|
static long |
quotient(double number,
double divisor) |
static long |
quotient(Double number,
Double divisor) |
static long |
quotient(float number,
float divisor) |
static long |
quotient(Float number,
Float divisor) |
static long |
quotient(Integer number,
Integer divisor) |
static long |
quotient(int number,
int divisor) |
static long |
quotient(long number,
long divisor) |
static long |
quotient(Long number,
Long divisor) |
static long |
quotient(short number,
short divisor) |
static long |
quotient(Short number,
Short divisor) |
static double |
random()
Returns a
double value with a positive sign, greater than or equal to 0.0 and less than
1.0. |
static boolean[] |
remove(boolean[] array,
int index)
Removes the element at the specified position from the specified array.
|
static Boolean[] |
remove(Boolean[] array,
int index) |
static byte[] |
remove(byte[] array,
int index)
Removes the element at the specified position from the specified array.
|
static Byte[] |
remove(Byte[] array,
int index) |
static char[] |
remove(char[] array,
int index)
Removes the element at the specified position from the specified array.
|
static Character[] |
remove(Character[] array,
int index) |
static double[] |
remove(double[] array,
int index)
Removes the element at the specified position from the specified array.
|
static Double[] |
remove(Double[] array,
int index) |
static float[] |
remove(float[] array,
int index)
Removes the element at the specified position from the specified array.
|
static Float[] |
remove(Float[] array,
int index) |
static int[] |
remove(int[] array,
int index)
Removes the element at the specified position from the specified array.
|
static Integer[] |
remove(Integer[] array,
int index) |
static long[] |
remove(long[] array,
int index)
Removes the element at the specified position from the specified array.
|
static Long[] |
remove(Long[] array,
int index) |
static short[] |
remove(short[] array,
int index)
Removes the element at the specified position from the specified array.
|
static Short[] |
remove(Short[] array,
int index) |
static <T> T[] |
remove(T[] array,
int index)
Removes the element at the specified position from the specified array.
|
static boolean[] |
removeElement(boolean[] array,
boolean element)
Removes the first occurrence of the specified element from the specified array.
|
static Boolean[] |
removeElement(Boolean[] array,
Boolean element) |
static byte[] |
removeElement(byte[] array,
byte element)
Removes the first occurrence of the specified element from the specified array.
|
static Byte[] |
removeElement(Byte[] array,
Byte element) |
static char[] |
removeElement(char[] array,
char element)
Removes the first occurrence of the specified element from the specified array.
|
static Character[] |
removeElement(Character[] array,
Character element) |
static double[] |
removeElement(double[] array,
double element)
Removes the first occurrence of the specified element from the specified array.
|
static Double[] |
removeElement(Double[] array,
Double element) |
static float[] |
removeElement(float[] array,
float element)
Removes the first occurrence of the specified element from the specified array.
|
static Float[] |
removeElement(Float[] array,
Float element) |
static int[] |
removeElement(int[] array,
int element)
Removes the first occurrence of the specified element from the specified array.
|
static Integer[] |
removeElement(Integer[] array,
Integer element) |
static long[] |
removeElement(long[] array,
long element)
Removes the first occurrence of the specified element from the specified array.
|
static Long[] |
removeElement(Long[] array,
Long element) |
static short[] |
removeElement(short[] array,
short element)
Removes the first occurrence of the specified element from the specified array.
|
static Short[] |
removeElement(Short[] array,
Short element) |
static <T> T[] |
removeElement(T[] array,
T element)
Removes the first occurrence of the specified element from the specified array.
|
static <T> T[] |
removeNulls(T[] array)
Return a new array without null elements
|
static double |
rint(double a)
Returns the
double value that is closest in value to the argument and is equal to a mathematical integer. |
static double |
scalb(double d,
int scaleFactor)
Return
d × 2scaleFactor rounded as if performed by a single correctly rounded
floating-point multiply to a member of the double value set. |
static float |
scalb(float f,
int scaleFactor)
Return
f × 2scaleFactor rounded as if performed by a single correctly rounded
floating-point multiply to a member of the float value set. |
static Integer |
second(Date d) |
static double |
signum(double d)
Returns the signum function of the argument; zero if the argument is zero, 1.0 if the argument is greater than
zero, -1.0 if the argument is less than zero.
|
static double |
signum(float f)
Returns the signum function of the argument; zero if the argument is zero, 1.0f if the argument is greater than
zero, -1.0f if the argument is less than zero.
|
static double |
sin(double a)
Returns the trigonometric sine of an angle.
|
static double |
sinh(double x)
Returns the hyperbolic sine of a
double value. |
static BigDecimal |
small(BigDecimal[] values,
int position)
Removes null values from array, sorts an array in ascending order and returns the value at position
'position'
|
static BigInteger |
small(BigInteger[] values,
int position)
Removes null values from array, sorts an array in ascending order and returns the value at position
'position'
|
static Byte |
small(byte[] values,
int position)
Removes null values from array, sorts an array in ascending order and returns the value at position
'position'
|
static Byte |
small(Byte[] values,
int position)
Removes null values from array, sorts an array in ascending order and returns the value at position
'position'
|
static Double |
small(double[] values,
int position)
Removes null values from array, sorts an array in ascending order and returns the value at position
'position'
|
static Double |
small(Double[] values,
int position)
Removes null values from array, sorts an array in ascending order and returns the value at position
'position'
|
static Float |
small(float[] values,
int position)
Removes null values from array, sorts an array in ascending order and returns the value at position
'position'
|
static Float |
small(Float[] values,
int position)
Removes null values from array, sorts an array in ascending order and returns the value at position
'position'
|
static Integer |
small(int[] values,
int position)
Removes null values from array, sorts an array in ascending order and returns the value at position
'position'
|
static Integer |
small(Integer[] values,
int position)
Removes null values from array, sorts an array in ascending order and returns the value at position
'position'
|
static Long |
small(long[] values,
int position)
Removes null values from array, sorts an array in ascending order and returns the value at position
'position'
|
static Long |
small(Long[] values,
int position)
Removes null values from array, sorts an array in ascending order and returns the value at position
'position'
|
static Short |
small(short[] values,
int position)
Removes null values from array, sorts an array in ascending order and returns the value at position
'position'
|
static Short |
small(Short[] values,
int position)
Removes null values from array, sorts an array in ascending order and returns the value at position
'position'
|
static byte[] |
sort(byte[] values)
Sorts the specified array into ascending numerical order.
|
static double[] |
sort(double[] values)
Sorts the specified array into ascending numerical order.
|
static float[] |
sort(float[] values)
Sorts the specified array into ascending numerical order.
|
static int[] |
sort(int[] values)
Sorts the specified array into ascending numerical order.
|
static long[] |
sort(long[] values)
Sorts the specified array into ascending numerical order.
|
static short[] |
sort(short[] values)
Sorts the specified array into ascending numerical order.
|
static <T extends Comparable<?>> |
sort(T[] values)
Sorts the specified array into ascending order, according to the natural ordering of its
elements.
|
static double |
sqrt(double a)
Returns the correctly rounded positive square root of a
double value. |
static Date |
stringToDate(String value)
Deprecated.
|
static double |
tan(double a)
Returns the trigonometric tangent of an angle.
|
static double |
tanh(double x)
Returns the hyperbolic tangent of a
double value. |
static double |
toDegrees(double angrad)
Converts an angle measured in radians to an approximately equivalent angle measured in degrees.
|
static double |
toRadians(double angdeg)
Converts an angle measured in degrees to an approximately equivalent angle measured in radians.
|
static double |
ulp(double d)
Returns the size of an ulp of the argument.
|
static float |
ulp(float f)
Returns the size of an ulp of the argument.
|
static Integer |
weekDiff(Date d1,
Date d2) |
static Integer |
weekOfMonth(Date d) |
static Integer |
weekOfYear(Date d) |
static Integer |
year(Date d) |
static Integer |
yearDiff(Date d1,
Date d2) |
public static final String DEFAULT_DOUBLE_FORMAT
public static final double E
public static final double PI
public static Byte small(Byte[] values, int position)
Removes null values from array, sorts an array in ascending order and returns the value at position 'position'
values - an array, must not be null or emptyposition - array index whose value we wand to getpublic static Short small(Short[] values, int position)
Removes null values from array, sorts an array in ascending order and returns the value at position 'position'
values - an array, must not be null or emptyposition - array index whose value we wand to getpublic static Integer small(Integer[] values, int position)
Removes null values from array, sorts an array in ascending order and returns the value at position 'position'
values - an array, must not be null or emptyposition - array index whose value we wand to getpublic static Long small(Long[] values, int position)
Removes null values from array, sorts an array in ascending order and returns the value at position 'position'
values - an array, must not be null or emptyposition - array index whose value we wand to getpublic static Float small(Float[] values, int position)
Removes null values from array, sorts an array in ascending order and returns the value at position 'position'
values - an array, must not be null or emptyposition - array index whose value we wand to getpublic static Double small(Double[] values, int position)
Removes null values from array, sorts an array in ascending order and returns the value at position 'position'
values - an array, must not be null or emptyposition - array index whose value we wand to getpublic static BigInteger small(BigInteger[] values, int position)
Removes null values from array, sorts an array in ascending order and returns the value at position 'position'
values - an array, must not be null or emptyposition - array index whose value we wand to getpublic static BigDecimal small(BigDecimal[] values, int position)
Removes null values from array, sorts an array in ascending order and returns the value at position 'position'
values - an array, must not be null or emptyposition - array index whose value we wand to getpublic static Byte small(byte[] values, int position)
Removes null values from array, sorts an array in ascending order and returns the value at position 'position'
values - an array, must not be null or emptyposition - array index whose value we wand to getpublic static Short small(short[] values, int position)
Removes null values from array, sorts an array in ascending order and returns the value at position 'position'
values - an array, must not be null or emptyposition - array index whose value we wand to getpublic static Integer small(int[] values, int position)
Removes null values from array, sorts an array in ascending order and returns the value at position 'position'
values - an array, must not be null or emptyposition - array index whose value we wand to getpublic static Long small(long[] values, int position)
Removes null values from array, sorts an array in ascending order and returns the value at position 'position'
values - an array, must not be null or emptyposition - array index whose value we wand to getpublic static Float small(float[] values, int position)
Removes null values from array, sorts an array in ascending order and returns the value at position 'position'
values - an array, must not be null or emptyposition - array index whose value we wand to getpublic static Double small(double[] values, int position)
Removes null values from array, sorts an array in ascending order and returns the value at position 'position'
values - an array, must not be null or emptyposition - array index whose value we wand to getpublic static Byte big(Byte[] values, int position)
Removes null values from array, sorts an array in descending order and returns the value at position 'position'
values - an array, must not be null or emptyposition - array index whose value we wand to getpublic static Short big(Short[] values, int position)
Removes null values from array, sorts an array in descending order and returns the value at position 'position'
values - an array, must not be null or emptyposition - array index whose value we wand to getpublic static Integer big(Integer[] values, int position)
Removes null values from array, sorts an array in descending order and returns the value at position 'position'
values - an array, must not be null or emptyposition - array index whose value we wand to getpublic static Long big(Long[] values, int position)
Removes null values from array, sorts an array in descending order and returns the value at position 'position'
values - an array, must not be null or emptyposition - array index whose value we wand to getpublic static Float big(Float[] values, int position)
Removes null values from array, sorts an array in descending order and returns the value at position 'position'
values - an array, must not be null or emptyposition - array index whose value we wand to getpublic static Double big(Double[] values, int position)
Removes null values from array, sorts an array in descending order and returns the value at position 'position'
values - an array, must not be null or emptyposition - array index whose value we wand to getpublic static BigInteger big(BigInteger[] values, int position)
Removes null values from array, sorts an array in descending order and returns the value at position 'position'
values - an array, must not be null or emptyposition - array index whose value we wand to getpublic static BigDecimal big(BigDecimal[] values, int position)
Removes null values from array, sorts an array in descending order and returns the value at position 'position'
values - an array, must not be null or emptyposition - array index whose value we wand to getpublic static Byte big(byte[] values, int position)
Removes null values from array, sorts an array in descending order and returns the value at position 'position'
values - an array, must not be null or emptyposition - array index whose value we wand to getpublic static Short big(short[] values, int position)
Removes null values from array, sorts an array in descending order and returns the value at position 'position'
values - an array, must not be null or emptyposition - array index whose value we wand to getpublic static Integer big(int[] values, int position)
Removes null values from array, sorts an array in descending order and returns the value at position 'position'
values - an array, must not be null or emptyposition - array index whose value we wand to getpublic static Long big(long[] values, int position)
Removes null values from array, sorts an array in descending order and returns the value at position 'position'
values - an array, must not be null or emptyposition - array index whose value we wand to getpublic static Float big(float[] values, int position)
Removes null values from array, sorts an array in descending order and returns the value at position 'position'
values - an array, must not be null or emptyposition - array index whose value we wand to getpublic static Double big(double[] values, int position)
Removes null values from array, sorts an array in descending order and returns the value at position 'position'
values - an array, must not be null or emptyposition - array index whose value we wand to getpublic static Double median(Byte[] values)
values - public static Double median(Short[] values)
values - public static Double median(Integer[] values)
values - public static Double median(Long[] values)
values - public static Float median(Float[] values)
values - public static Double median(Double[] values)
values - public static BigDecimal median(BigInteger[] values)
values - public static BigDecimal median(BigDecimal[] values)
values - public static Double median(byte[] values)
values - public static Double median(short[] values)
values - public static Double median(int[] values)
values - public static Double median(long[] values)
values - public static Float median(float[] values)
values - public static Double median(double[] values)
values - public static long quotient(Byte number, Byte divisor)
number - divisor - public static long quotient(BigInteger number, BigInteger divisor)
public static long quotient(BigDecimal number, BigDecimal divisor)
public static long quotient(byte number,
byte divisor)
public static long quotient(short number,
short divisor)
public static long quotient(int number,
int divisor)
public static long quotient(long number,
long divisor)
public static long quotient(float number,
float divisor)
public static long quotient(double number,
double divisor)
public static BigInteger mod(BigInteger number, BigInteger divisor)
public static BigDecimal mod(BigDecimal number, BigDecimal divisor)
public static byte mod(byte number,
byte divisor)
public static short mod(short number,
short divisor)
public static int mod(int number,
int divisor)
public static long mod(long number,
long divisor)
public static float mod(float number,
float divisor)
public static double mod(double number,
double divisor)
public static <T extends Comparable<?>> T[] sort(T[] values)
Comparable interface. Furthermore, all elements in
the array must be mutually comparable (that is, e1.compareTo(e2) must not throw a
ClassCastException for any elements e1 and e2 in the array).
This sort is guaranteed to be stable: equal elements will not be reordered as a result of the sort.
Implementation note: This implementation is a stable, adaptive, iterative mergesort that requires far fewer than
n lg(n) comparisons when the input array is partially sorted, while offering the performance of a traditional
mergesort when the input array is randomly ordered. If the input array is nearly sorted, the implementation
requires approximately n comparisons. Temporary storage requirements vary from a small constant for nearly sorted
input arrays to n/2 object references for randomly ordered input arrays.
The implementation takes equal advantage of ascending and descending order in its input array, and can take
advantage of ascending and descending order in different parts of the the same input array. It is well-suited to
merging two or more sorted arrays: simply concatenate the arrays and sort the resulting array.
The implementation was adapted from Tim Peters's list sort for Python
( TimSort). It uses techiques
from Peter McIlroy's "Optimistic Sorting and Information Theoretic Complexity", in Proceedings of the Fourth
Annual ACM-SIAM Symposium on Discrete Algorithms, pp 467-474, January 1993.values - the array to be sortedpublic static byte[] sort(byte[] values)
values - the array to be sortedpublic static short[] sort(short[] values)
values - the array to be sortedpublic static int[] sort(int[] values)
values - the array to be sortedpublic static long[] sort(long[] values)
values - the array to be sortedpublic static float[] sort(float[] values)
< relation does not provide a total order on all double values: -0.0d == 0.0d is true
and a Double.NaN value compares neither less than, greater than, nor equal to any value, even itself.
This method uses the total order imposed by the method Double.compareTo(java.lang.Double): -0.0d is treated as less
than value 0.0d and Double.NaN is considered greater than any other value and all
Double.NaN values are considered equal.
Implementation note: The sorting algorithm is a Dual-Pivot Quicksort by Vladimir Yaroslavskiy, Jon Bentley, and
Joshua Bloch. This algorithm offers O(n log(n)) performance on many data sets that cause other quicksorts to
degrade to quadratic performance, and is typically faster than traditional (one-pivot) Quicksort implementations.values - the array to be sortedpublic static double[] sort(double[] values)
< relation does not provide a total order on all double values: -0.0d == 0.0d is true
and a Double.NaN value compares neither less than, greater than, nor equal to any value, even itself.
This method uses the total order imposed by the method Double.compareTo(java.lang.Double): -0.0d is treated as less
than value 0.0d and Double.NaN is considered greater than any other value and all
Double.NaN values are considered equal.
Implementation note: The sorting algorithm is a Dual-Pivot Quicksort by Vladimir Yaroslavskiy, Jon Bentley, and
Joshua Bloch. This algorithm offers O(n log(n)) performance on many data sets that cause other quicksorts to
degrade to quadratic performance, and is typically faster than traditional (one-pivot) Quicksort implementations.- - values the array to be sortedpublic static boolean contains(Object[] array, Object obj)
Checks if the object is in the given array.
The method returns false if a null array is passed in.
array - the array to search throughobj - the object to findtrue if the array contains the objectpublic static boolean contains(int[] array,
int elem)
Checks if the value is in the given array.
The method returns false if a null array is passed in.
array - the array to search throughelem - the value to findtrue if the array contains the objectpublic static boolean contains(long[] array,
long elem)
Checks if the value is in the given array.
The method returns false if a null array is passed in.
array - the array to search throughelem - the value to findtrue if the array contains the objectpublic static boolean contains(byte[] array,
byte elem)
Checks if the value is in the given array.
The method returns false if a null array is passed in.
array - the array to search throughelem - the value to findtrue if the array contains the objectpublic static boolean contains(short[] array,
short elem)
Checks if the value is in the given array.
The method returns false if a null array is passed in.
array - the array to search throughelem - the value to findtrue if the array contains the objectpublic static boolean contains(char[] array,
char elem)
Checks if the value is in the given array.
The method returns false if a null array is passed in.
array - the array to search throughelem - the value to findtrue if the array contains the objectpublic static boolean contains(float[] array,
float elem)
Checks if the value is in the given array.
The method returns false if a null array is passed in.
array - the array to search throughelem - the value to findtrue if the array contains the objectpublic static boolean contains(double[] array,
double elem)
Checks if the value is in the given array.
The method returns false if a null array is passed in.
array - the array to search throughelem - the value to findtrue if the array contains the objectpublic static boolean contains(DoubleRange[] array, Double elem)
public static boolean contains(StringRange[] array, CharSequence elem)
public static boolean contains(StringRange[] array, String elem)
public static boolean contains(boolean[] array,
boolean elem)
public static boolean contains(int[] ary1,
int[] ary2)
public static boolean contains(byte[] ary1,
byte[] ary2)
public static boolean contains(short[] ary1,
short[] ary2)
public static boolean contains(long[] ary1,
long[] ary2)
public static boolean contains(char[] ary1,
char[] ary2)
public static boolean contains(float[] ary1,
float[] ary2)
public static boolean contains(double[] ary1,
double[] ary2)
public static boolean contains(boolean[] ary1,
boolean[] ary2)
public static boolean contains(IntRange[] ary1, int[] ary2)
public static boolean contains(DoubleRange[] ary1, Double[] ary2)
public static boolean contains(DoubleRange[] ary1, double[] ary2)
public static boolean contains(CharRange[] ary1, char[] ary2)
public static boolean contains(StringRange[] ary1, CharSequence[] ary2)
public static boolean contains(StringRange[] ary1, String[] ary2)
public static int indexOf(Object[] array, Object obj)
Finds the index of the given object in the array.
This method returns ArrayUtils.INDEX_NOT_FOUND (-1) for a null input array.
array - the array to search through for the object, may be nullobj - the object to find, may be nullArrayUtils.INDEX_NOT_FOUND (-1) if not
found or null array inputpublic static int indexOf(int[] array,
int elem)
Finds the index of the given value in the array.
This method returns ArrayUtils.INDEX_NOT_FOUND (-1) for a null input array.
array - the array to search through for the object, may be nullelem - the value to findArrayUtils.INDEX_NOT_FOUND (-1) if not
found or null array inputpublic static int indexOf(long[] array,
long elem)
Finds the index of the given value in the array.
This method returns ArrayUtils.INDEX_NOT_FOUND (-1) for a null input array.
array - the array to search through for the object, may be nullelem - the value to findArrayUtils.INDEX_NOT_FOUND (-1) if not
found or null array inputpublic static int indexOf(byte[] array,
byte elem)
Finds the index of the given value in the array.
This method returns ArrayUtils.INDEX_NOT_FOUND (-1) for a null input array.
array - the array to search through for the object, may be nullelem - the value to findArrayUtils.INDEX_NOT_FOUND (-1) if not
found or null array inputpublic static int indexOf(short[] array,
short elem)
Finds the index of the given value in the array.
This method returns ArrayUtils.INDEX_NOT_FOUND (-1) for a null input array.
array - the array to search through for the object, may be nullelem - the value to findArrayUtils.INDEX_NOT_FOUND (-1) if not
found or null array inputpublic static int indexOf(char[] array,
char elem)
Finds the index of the given value in the array.
This method returns ArrayUtils.INDEX_NOT_FOUND (-1) for a null input array.
array - the array to search through for the object, may be nullelem - the value to findArrayUtils.INDEX_NOT_FOUND (-1) if not
found or null array inputpublic static int indexOf(float[] array,
float elem)
Finds the index of the given value in the array.
This method returns ArrayUtils.INDEX_NOT_FOUND (-1) for a null input array.
array - the array to search through for the object, may be nullelem - the value to findArrayUtils.INDEX_NOT_FOUND (-1) if not
found or null array inputpublic static int indexOf(double[] array,
double elem)
Finds the index of the given value in the array.
This method returns ArrayUtils.INDEX_NOT_FOUND (-1) for a null input array.
array - the array to search through for the object, may be nullelem - the value to findArrayUtils.INDEX_NOT_FOUND (-1) if not
found or null array inputpublic static int indexOf(boolean[] array,
boolean elem)
public static boolean noNulls(Object[] values)
public static ThrowableVoidCast.ThrowableVoid error(String msg)
@Deprecated public static String format(Date date)
date - @Deprecated public static String format(Date date, String format)
date - format - @Deprecated public static String dateToString(Date date, String dateFormat)
date - dateFormat - @Deprecated public static String dateToString(Date date)
date - date to formatDateTool#dateToString;@Deprecated public static Date stringToDate(String value) throws ParseException
ParseExceptionpublic static String format(double d)
public static void out(String output)
public static void out(Object output)
public static void out(byte output)
public static void out(short output)
public static void out(int output)
public static void out(long output)
public static void out(float output)
public static void out(double output)
public static void out(char output)
public static void out(boolean output)
@Deprecated public static double parseFormattedDouble(String s) throws ParseException
ParseException@Deprecated public static double parseFormattedDouble(String s, String fmt) throws ParseException
DecimalFormat.DecimalFormat(String)
Shouldn`t be used.ParseExceptionpublic static Date firstDateOfQuarter(int absQuarter)
public static Date lastDateOfQuarter(int absQuarter)
public static <T> T[] removeNulls(T[] array)
array - whose null elements should be removedpublic static double abs(double a)
double value. If the argument is not negative, the argument is returned.
If the argument is negative, the negation of the argument is returned. Special cases:
Double.longBitsToDouble((Double.doubleToLongBits(a)<<1)>>>1)a - the argument whose absolute value is to be determinedpublic static float abs(float a)
float value. If the argument is not negative, the argument is returned.
If the argument is negative, the negation of the argument is returned. Special cases:
Float.intBitsToFloat(0x7fffffff & Float.floatToIntBits(a))a - the argument whose absolute value is to be determinedpublic static int abs(int a)
int value. If the argument is not negative, the argument is returned. If
the argument is negative, the negation of the argument is returned.
Note that if the argument is equal to the value of Integer.MIN_VALUE, the most negative representable
int value, the result is that same value, which is negative.a - the argument whose absolute value is to be determinedpublic static long abs(long a)
long value. If the argument is not negative, the argument is returned. If
the argument is negative, the negation of the argument is returned.
Note that if the argument is equal to the value of Long.MIN_VALUE , the most negative representable
long value, the result is that same value, which is negative.a - the argument whose absolute value is to be determinedpublic static double acos(double a)
a - the value whose arc cosine is to be returned.public static double asin(double a)
a - the value whose arc sine is to be returned.public static double atan(double a)
a - the value whose arc tangent is to be returned.public static double atan2(double y,
double x)
x, y) to
polar coordinates (r, theta). This method computes the phase theta by computing an arc tangent
of y/x in the range of -pi to pi. Special cases:
double value closest to
pi.
double value closest to
-pi.
double value
closest to pi/2.
double value
closest to -pi/2.
double value closest to pi/4.
double value closest to 3*pi/4.
double value closest to -pi/4.
double value closest to
-3*pi/4.
y - the ordinate coordinatex - the abscissa coordinatepublic static double cbrt(double a)
double value. For positive finite x, cbrt(-x) ==
-cbrt(x); that is, the cube root of a negative value is the negative of the cube root of that value's magnitude.
Special cases:
a - a value.a.public static double ceil(double a)
double value that is greater than or equal to the
argument and is equal to a mathematical integer. Special cases:
Math.ceil(x) is exactly the value of -Math.floor(-x).a - a value.public static double copySign(double magnitude,
double sign)
StrictMath.copySign method, this method does not require NaN
sign arguments to be treated as positive values; implementations are permitted to treat some NaN
arguments as positive and other NaN arguments as negative to allow greater performance.magnitude - the parameter providing the magnitude of the resultsign - the parameter providing the sign of the resultmagnitude and the sign of sign.public static float copySign(float magnitude,
float sign)
StrictMath.copySign method, this method does not require NaN
sign arguments to be treated as positive values; implementations are permitted to treat some NaN
arguments as positive and other NaN arguments as negative to allow greater performance.magnitude - the parameter providing the magnitude of the resultsign - the parameter providing the sign of the resultmagnitude and the sign of sign.public static double cos(double a)
a - an angle, in radians.public static double cosh(double x)
double value. The hyperbolic cosine of x is defined to be
(ex + e-x)/2 where e is Euler's number.
Special cases:
1.0.
x - The number whose hyperbolic cosine is to be returned.x.public static double exp(double a)
double value. Special cases:
a - the exponent to raise e to.a, where e is the base of the natural logarithms.public static double expm1(double x)
expm1(x) + 1 is much closer to the true result of ex than exp(x).
Special cases:
expm1 for any finite input must be greater than or equal to -1.0. Note that once the exact result
of ex - 1 is within 1/2 ulp of the limit value -1, -1.0 should be
returned.x - the exponent to raise e to in the computation of ex -1.x - 1.public static double floor(double a)
double value that is less than or equal to the
argument and is equal to a mathematical integer. Special cases:
a - a value.public static int getExponent(double d)
double. Special cases:
Double.MAX_EXPONENT + 1.
Double.MIN_EXPONENT -1.
d - a double valuepublic static int getExponent(float f)
float. Special cases:
Float.MAX_EXPONENT + 1.
Float.MIN_EXPONENT -1.
f - a float valuepublic static double getExponent(double x,
double y)
x - a valuey - a valuepublic static double IEEEremainder(double f1,
double f2)
f1 - f2 × n, where n is the
mathematical integer closest to the exact mathematical value of the quotient f1/f2, and if two
mathematical integers are equally close to f1/f2, then n is the integer that is even. If the
remainder is zero, its sign is the same as the sign of the first argument. Special cases:
f1 - the dividend.f2 - the divisor.f1 is divided by f2.public static double log(double a)
double value. Special cases:
a - a valuea, the natural logarithm of a.public static double log10(double a)
double value. Special cases:
a - a valuea.public static double log1p(double x)
x, the result
of log1p(x) is much closer to the true result of ln(1 + x) than the floating-point evaluation of
log(1.0+x).
Special cases:
x - a valuex + 1), the natural log of x + 1public static double nextAfter(double start,
double direction)
direction is returned unchanged (as implied by the requirement of
returning the second argument if the arguments compare as equal).
start is ±Double.MIN_VALUE and direction has a value such that the result
should have a smaller magnitude, then a zero with the same sign as start is returned.
start is infinite and direction has a value such that the result should have a smaller
magnitude, Double.MAX_VALUE with the same sign as start is returned.
start is equal to ± Double.MAX_VALUE and direction has a value such that
the result should have a larger magnitude, an infinity with same sign as start is returned.
start - starting floating-point valuedirection - value indicating which of start's neighbors or start should be returnedstart in the direction of direction.public static float nextAfter(float start,
float direction)
direction is returned.
start is ±Float.MIN_VALUE and direction has a value such that the result
should have a smaller magnitude, then a zero with the same sign as start is returned.
start is infinite and direction has a value such that the result should have a smaller
magnitude, Float.MAX_VALUE with the same sign as start is returned.
start is equal to ± Float.MAX_VALUE and direction has a value such that the
result should have a larger magnitude, an infinity with same sign as start is returned.
start - starting floating-point valuedirection - value indicating which of start's neighbors or start should be returnedstart in the direction of direction.public static float nextAfter(float f)
f in the direction of positive infinity. This method is
semantically equivalent to nextAfter(f,
Float.POSITIVE_INFINITY); however, a nextUp implementation may run faster than its equivalent
nextAfter call.
Special Cases:
Float.MIN_VALUE
f - starting floating-point valuepublic static double nextAfter(double d)
d in the direction of positive infinity. This method is
semantically equivalent to nextAfter(d,
Double.POSITIVE_INFINITY); however, a nextUp implementation may run faster than its equivalent
nextAfter call.
Special Cases:
Double.MIN_VALUE
d - starting floating-point valuepublic static double pow(byte a,
byte b)
double value.
ceil or, equivalently, a fixed point of the method floor. A value is a fixed point of a one-argument method if and only if the result of applying the method to the
value is equal to the value.)
The computed result must be within 1 ulp of the exact result. Results must be semi-monotonic.a - the base.b - the exponent.ab.public static double pow(short a,
short b)
public static double pow(int a,
int b)
public static double pow(long a,
long b)
public static double pow(float a,
float b)
public static double pow(double a,
double b)
public static double random()
double value with a positive sign, greater than or equal to 0.0 and less than
1.0. Returned values are chosen pseudorandomly with (approximately) uniform distribution from that range.
When this method is first called, it creates a single new pseudorandom-number generator, exactly as if by the
expression
new java.util.Random()
This new pseudorandom-number generator is used thereafter for all calls to this method and is used nowhere else.
This method is properly synchronized to allow correct use by more than one thread. However, if many threads need
to generate pseudorandom numbers at a great rate, it may reduce contention for each thread to have its own
pseudorandom-number generator.double greater than or equal to 0.0 and less than 1.0.public static double rint(double a)
double value that is closest in value to the argument and is equal to a mathematical integer.
If two double values that are mathematical integers are equally close, the result is the integer value
that is even. Special cases:
a - a double value.a that is equal to a mathematical integer.public static double scalb(double d,
int scaleFactor)
d × 2scaleFactor rounded as if performed by a single correctly rounded
floating-point multiply to a member of the double value set. See the Java Language Specification for a discussion
of floating-point value sets. If the exponent of the result is between Double.MIN_EXPONENT and
Double.MAX_EXPONENT, the answer is calculated exactly. If the exponent of the result would be larger than
Double.MAX_EXPONENT, an infinity is returned. Note that if the result is subnormal, precision may be
lost; that is, when scalb(x, n) is subnormal, scalb(scalb(x, n), -n) may not equal x. When
the result is non-NaN, the result has the same sign as d.
Special cases:
d - number to be scaled by a power of two.scaleFactor - power of 2 used to scale dd × 2scaleFactorpublic static float scalb(float f,
int scaleFactor)
f × 2scaleFactor rounded as if performed by a single correctly rounded
floating-point multiply to a member of the float value set. See the Java Language Specification for a discussion
of floating-point value sets. If the exponent of the result is between Float.MIN_EXPONENT and
Float.MAX_EXPONENT, the answer is calculated exactly. If the exponent of the result would be larger than
Float.MAX_EXPONENT, an infinity is returned. Note that if the result is subnormal, precision may be lost;
that is, when scalb(x, n) is subnormal, scalb(scalb(x, n), -n) may not equal x. When the
result is non-NaN, the result has the same sign as f.
Special cases:
f - number to be scaled by a power of two.scaleFactor - power of 2 used to scale ff × 2scaleFactorpublic static double signum(double d)
d - the floating-point value whose signum is to be returnedpublic static double signum(float f)
f - the floating-point value whose signum is to be returnedpublic static double sin(double a)
a - an angle, in radians.public static double sinh(double x)
double value. The hyperbolic sine of x is defined to be
(ex - e-x)/2 where e is Euler's number.
Special cases:
x - The number whose hyperbolic sine is to be returned.x.public static double sqrt(double a)
double value. Special cases:
double value closest to the true mathematical square root of the argument
value.a - a value.a. If the argument is NaN or less than zero, the result is NaN.public static double tan(double a)
a - an angle, in radians.public static double tanh(double x)
double value. The hyperbolic tangent of x is defined to be
(ex - e- x)/(ex + e-x), in other
words, sinh(x)/cosh(x). Note that the absolute value
of the exact tanh is always less than 1.
Special cases:
+1.0.
-1.0.
tanh for any finite input
must have an absolute value less than or equal to 1. Note that once the exact result of tanh is within 1/2 of an
ulp of the limit value of ±1, correctly signed ±1.0 should be returned.x - The number whose hyperbolic tangent is to be returned.x.public static double toDegrees(double angrad)
cos(toRadians(90.0)) to
exactly equal 0.0.angrad - an angle, in radiansangrad in degrees.public static double toRadians(double angdeg)
angdeg - an angle, in degreesangdeg in radians.public static double ulp(double d)
double value is the positive distance between
this floating-point value and the double value next larger in magnitude. Note that for non-NaN x,
ulp(-x) == ulp(x).
Special Cases:
Double.MIN_VALUE.
Double.MAX_VALUE, then the result is equal to 2971.
d - the floating-point value whose ulp is to be returnedpublic static float ulp(float f)
float value is the positive distance between this
floating-point value and the float value next larger in magnitude. Note that for non-NaN x,
ulp(-x) == ulp(x).
Special Cases:
Float.MIN_VALUE.
Float.MAX_VALUE, then the result is equal to 2104.
f - the floating-point value whose ulp is to be returnedpublic static boolean[] add(boolean[] array,
boolean element)
Copies the given array and adds the given element at the end of the new array.
The new array contains the same elements of the input array plus the given element in the last position. The component type of the new array is the same as that of the input array.
If the input array is null, a new one element array is returned whose component type is the same as
the element.
ArrayUtils.add(null, true) = [true] ArrayUtils.add([true], false) = [true, false] ArrayUtils.add([true, false], true) = [true, false, true]
array - the array to copy and add the element to, may be nullelement - the object to add at the last index of the new arraypublic static boolean[] add(boolean[] array,
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.
If the input array is null, a new one element array is returned whose component type is the same as
the element.
ArrayUtils.add(null, 0, true) = [true] ArrayUtils.add([true], 0, false) = [false, true] ArrayUtils.add([false], 1, true) = [false, true] ArrayUtils.add([true, false], 1, true) = [true, true, false]
array - the array to add the element to, may be nullindex - the position of the new objectelement - the object to addIndexOutOfBoundsException - if the index is out of range (index < 0 || index > array.length).public static byte[] add(byte[] array,
byte element)
Copies the given array and adds the given element at the end of the new array.
The new array contains the same elements of the input array plus the given element in the last position. The component type of the new array is the same as that of the input array.
If the input array is null, a new one element array is returned whose component type is the same as
the element.
ArrayUtils.add(null, 0) = [0] ArrayUtils.add([1], 0) = [1, 0] ArrayUtils.add([1, 0], 1) = [1, 0, 1]
array - the array to copy and add the element to, may be nullelement - the object to add at the last index of the new arraypublic static byte[] add(byte[] array,
int index,
byte element)
Copies the given array and adds the given element at the end of the new array.
The new array contains the same elements of the input array plus the given element in the last position. The component type of the new array is the same as that of the input array.
If the input array is null, a new one element array is returned whose component type is the same as
the element.
ArrayUtils.add(null, 0) = [0] ArrayUtils.add([1], 0) = [1, 0] ArrayUtils.add([1, 0], 1) = [1, 0, 1]
array - the array to copy and add the element to, may be nullelement - the object to add at the last index of the new arraypublic static char[] add(char[] array,
char element)
Copies the given array and adds the given element at the end of the new array.
The new array contains the same elements of the input array plus the given element in the last position. The component type of the new array is the same as that of the input array.
If the input array is null, a new one element array is returned whose component type is the same as
the element.
ArrayUtils.add(null, '0') = ['0'] ArrayUtils.add(['1'], '0') = ['1', '0'] ArrayUtils.add(['1', '0'], '1') = ['1', '0', '1']
array - the array to copy and add the element to, may be nullelement - the object to add at the last index of the new arraypublic static char[] add(char[] array,
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.
If the input array is null, a new one element array is returned whose component type is the same as
the element.
ArrayUtils.add(null, 0, 'a') = ['a'] ArrayUtils.add(['a'], 0, 'b') = ['b', 'a'] ArrayUtils.add(['a', 'b'], 0, 'c') = ['c', 'a', 'b'] ArrayUtils.add(['a', 'b'], 1, 'k') = ['a', 'k', 'b'] ArrayUtils.add(['a', 'b', 'c'], 1, 't') = ['a', 't', 'b', 'c']
array - the array to add the element to, may be nullindex - the position of the new objectelement - the object to addIndexOutOfBoundsException - if the index is out of range (index < 0 || index > array.length).public static double[] add(double[] array,
double element)
Copies the given array and adds the given element at the end of the new array.
The new array contains the same elements of the input array plus the given element in the last position. The component type of the new array is the same as that of the input array.
If the input array is null, a new one element array is returned whose component type is the same as
the element.
ArrayUtils.add(null, 0) = [0] ArrayUtils.add([1], 0) = [1, 0] ArrayUtils.add([1, 0], 1) = [1, 0, 1]
array - the array to copy and add the element to, may be nullelement - the object to add at the last index of the new arraypublic static double[] add(double[] array,
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.
If the input array is null, a new one element array is returned whose component type is the same as
the element.
ArrayUtils.add([1.1], 0, 2.2) = [2.2, 1.1] ArrayUtils.add([2.3, 6.4], 2, 10.5) = [2.3, 6.4, 10.5] ArrayUtils.add([2.6, 6.7], 0, -4.8) = [-4.8, 2.6, 6.7] ArrayUtils.add([2.9, 6.0, 0.3], 2, 1.0) = [2.9, 6.0, 1.0, 0.3]
array - the array to add the element to, may be nullindex - the position of the new objectelement - the object to addIndexOutOfBoundsException - if the index is out of range (index < 0 || index > array.length).public static float[] add(float[] array,
float element)
Copies the given array and adds the given element at the end of the new array.
The new array contains the same elements of the input array plus the given element in the last position. The component type of the new array is the same as that of the input array.
If the input array is null, a new one element array is returned whose component type is the same as
the element.
ArrayUtils.add(null, 0) = [0] ArrayUtils.add([1], 0) = [1, 0] ArrayUtils.add([1, 0], 1) = [1, 0, 1]
array - the array to copy and add the element to, may be nullelement - the object to add at the last index of the new arraypublic static float[] add(float[] array,
int index,
float element)
Copies the given array and adds the given element at the end of the new array.
The new array contains the same elements of the input array plus the given element in the last position. The component type of the new array is the same as that of the input array.
If the input array is null, a new one element array is returned whose component type is the same as
the element.
ArrayUtils.add(null, 0) = [0] ArrayUtils.add([1], 0) = [1, 0] ArrayUtils.add([1, 0], 1) = [1, 0, 1]
array - the array to copy and add the element to, may be nullelement - the object to add at the last index of the new arraypublic static int[] add(int[] array,
int element)
Copies the given array and adds the given element at the end of the new array.
The new array contains the same elements of the input array plus the given element in the last position. The component type of the new array is the same as that of the input array.
If the input array is null, a new one element array is returned whose component type is the same as
the element.
ArrayUtils.add(null, 0) = [0] ArrayUtils.add([1], 0) = [1, 0] ArrayUtils.add([1, 0], 1) = [1, 0, 1]
array - the array to copy and add the element to, may be nullelement - the object to add at the last index of the new arraypublic static int[] add(int[] array,
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.
If the input array is null, a new one element array is returned whose component type is the same as
the element.
ArrayUtils.add([1], 0, 2) = [2, 1] ArrayUtils.add([2, 6], 2, 10) = [2, 6, 10] ArrayUtils.add([2, 6], 0, -4) = [-4, 2, 6] ArrayUtils.add([2, 6, 3], 2, 1) = [2, 6, 1, 3]
array - the array to add the element to, may be nullindex - the position of the new objectelement - the object to addIndexOutOfBoundsException - if the index is out of range (index < 0 || index > array.length).public static long[] add(long[] array,
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.
If the input array is null, a new one element array is returned whose component type is the same as
the element.
ArrayUtils.add([1L], 0, 2L) = [2L, 1L] ArrayUtils.add([2L, 6L], 2, 10L) = [2L, 6L, 10L] ArrayUtils.add([2L, 6L], 0, -4L) = [-4L, 2L, 6L] ArrayUtils.add([2L, 6L, 3L], 2, 1L) = [2L, 6L, 1L, 3L]
array - the array to add the element to, may be nullindex - the position of the new objectelement - the object to addIndexOutOfBoundsException - if the index is out of range (index < 0 || index > array.length).public static long[] add(long[] array,
long element)
Copies the given array and adds the given element at the end of the new array.
The new array contains the same elements of the input array plus the given element in the last position. The component type of the new array is the same as that of the input array.
If the input array is null, a new one element array is returned whose component type is the same as
the element.
ArrayUtils.add(null, 0) = [0] ArrayUtils.add([1], 0) = [1, 0] ArrayUtils.add([1, 0], 1) = [1, 0, 1]
array - the array to copy and add the element to, may be nullelement - the object to add at the last index of the new arraypublic static <T> T[] add(T[] array,
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.
If the input array is null, a new one element array is returned whose component type is the same as
the element.
ArrayUtils.add(null, 0, null) = [null] ArrayUtils.add(null, 0, "a") = ["a"] ArrayUtils.add(["a"], 1, null) = ["a", null] ArrayUtils.add(["a"], 1, "b") = ["a", "b"] ArrayUtils.add(["a", "b"], 3, "c") = ["a", "b", "c"]
array - the array to add the element to, may be nullindex - the position of the new objectelement - the object to addIndexOutOfBoundsException - if the index is out of range (index < 0 || index > array.length).public static <T> T[] add(T[] array,
T element)
Copies the given array and adds the given element at the end of the new array.
The new array contains the same elements of the input array plus the given element in the last position. The component type of the new array is the same as that of the input array.
If the input array is null, a new one element array is returned whose component type is the same as
the element, unless the element itself is null, in which case the return type is Object[]
ArrayUtils.add(null, null) = [null] ArrayUtils.add(null, "a") = ["a"] ArrayUtils.add(["a"], null) = ["a", null] ArrayUtils.add(["a"], "b") = ["a", "b"] ArrayUtils.add(["a", "b"], "c") = ["a", "b", "c"]
array - the array to "add" the element to, may be nullelement - the object to add, may be nullpublic static short[] add(short[] array,
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.
If the input array is null, a new one element array is returned whose component type is the same as
the element.
ArrayUtils.add([1], 0, 2) = [2, 1] ArrayUtils.add([2, 6], 2, 10) = [2, 6, 10] ArrayUtils.add([2, 6], 0, -4) = [-4, 2, 6] ArrayUtils.add([2, 6, 3], 2, 1) = [2, 6, 1, 3]
array - the array to add the element to, may be nullindex - the position of the new objectelement - the object to addIndexOutOfBoundsException - if the index is out of range (index < 0 || index > array.length).public static short[] add(short[] array,
short element)
Copies the given array and adds the given element at the end of the new array.
The new array contains the same elements of the input array plus the given element in the last position. The component type of the new array is the same as that of the input array.
If the input array is null, a new one element array is returned whose component type is the same as
the element.
ArrayUtils.add(null, 0) = [0] ArrayUtils.add([1], 0) = [1, 0] ArrayUtils.add([1, 0], 1) = [1, 0, 1]
array - the array to copy and add the element to, may be nullelement - the object to add at the last index of the new arraypublic static <T> T[] addIgnoreNull(T[] array,
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.
If the input array is null, a new one element array is returned whose component type is the same as
the element.
ArrayUtils.add(null, 0, null) = [null] ArrayUtils.add(null, 0, "a") = ["a"] ArrayUtils.add(["a"], 1, null) = ["a", null] ArrayUtils.add(["a"], 1, "b") = ["a", "b"] ArrayUtils.add(["a", "b"], 3, "c") = ["a", "b", "c"]
array - the array to add the element to, may be nullindex - the position of the new objectelement - the object to addIndexOutOfBoundsException - if the index is out of range (index < 0 || index > array.length).public static <T> T[] addIgnoreNull(T[] array,
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.
If the input array is null, a new one element array is returned whose component type is the same as
the element.
ArrayUtils.add(null, 0, null) = [null] ArrayUtils.add(null, 0, "a") = ["a"] ArrayUtils.add(["a"], 1, null) = ["a", null] ArrayUtils.add(["a"], 1, "b") = ["a", "b"] ArrayUtils.add(["a", "b"], 3, "c") = ["a", "b", "c"]
array - the array to add the element to, may be nullelement - the object to addIndexOutOfBoundsException - if the index is out of range (index < 0 || index > array.length).@Deprecated public static Object[] addArrayElementIgnoreNull(Object[] array, int index, Object element)
addIgnoreNull(Object[], int, Object) instead.@Deprecated public static Object[] addArrayElementIgnoreNull(Object[] array, Object element)
addIgnoreNull(Object[], Object) instead.public static boolean[] addAll(boolean[] array1,
boolean[] array2)
Adds all the elements of the given arrays into a new array.
The new array contains all of the element of array1 followed by all of the elements
array2. When an array is returned, it is always a new array.
ArrayUtils.addAll(array1, null) = cloned copy of array1 ArrayUtils.addAll(null, array2) = cloned copy of array2 ArrayUtils.addAll([], []) = []
array1 - the first array whose elements are added to the new array.array2 - the second array whose elements are added to the new array.public static byte[] addAll(byte[] array1,
byte[] array2)
Adds all the elements of the given arrays into a new array.
The new array contains all of the element of array1 followed by all of the elements
array2. When an array is returned, it is always a new array.
ArrayUtils.addAll(array1, null) = cloned copy of array1 ArrayUtils.addAll(null, array2) = cloned copy of array2 ArrayUtils.addAll([], []) = []
array1 - the first array whose elements are added to the new array.array2 - the second array whose elements are added to the new array.public static char[] addAll(char[] array1,
char[] array2)
Adds all the elements of the given arrays into a new array.
The new array contains all of the element of array1 followed by all of the elements
array2. When an array is returned, it is always a new array.
ArrayUtils.addAll(array1, null) = cloned copy of array1 ArrayUtils.addAll(null, array2) = cloned copy of array2 ArrayUtils.addAll([], []) = []
array1 - the first array whose elements are added to the new array.array2 - the second array whose elements are added to the new array.public static double[] addAll(double[] array1,
double[] array2)
Adds all the elements of the given arrays into a new array.
The new array contains all of the element of array1 followed by all of the elements
array2. When an array is returned, it is always a new array.
ArrayUtils.addAll(array1, null) = cloned copy of array1 ArrayUtils.addAll(null, array2) = cloned copy of array2 ArrayUtils.addAll([], []) = []
array1 - the first array whose elements are added to the new array.array2 - the second array whose elements are added to the new array.public static float[] addAll(float[] array1,
float[] array2)
Adds all the elements of the given arrays into a new array.
The new array contains all of the element of array1 followed by all of the elements
array2. When an array is returned, it is always a new array.
ArrayUtils.addAll(array1, null) = cloned copy of array1 ArrayUtils.addAll(null, array2) = cloned copy of array2 ArrayUtils.addAll([], []) = []
array1 - the first array whose elements are added to the new array.array2 - the second array whose elements are added to the new array.public static int[] addAll(int[] array1,
int[] array2)
Adds all the elements of the given arrays into a new array.
The new array contains all of the element of array1 followed by all of the elements
array2. When an array is returned, it is always a new array.
ArrayUtils.addAll(array1, null) = cloned copy of array1 ArrayUtils.addAll(null, array2) = cloned copy of array2 ArrayUtils.addAll([], []) = []
array1 - the first array whose elements are added to the new array.array2 - the second array whose elements are added to the new array.public static long[] addAll(long[] array1,
long[] array2)
Adds all the elements of the given arrays into a new array.
The new array contains all of the element of array1 followed by all of the elements
array2. When an array is returned, it is always a new array.
ArrayUtils.addAll(array1, null) = cloned copy of array1 ArrayUtils.addAll(null, array2) = cloned copy of array2 ArrayUtils.addAll([], []) = []
array1 - the first array whose elements are added to the new array.array2 - the second array whose elements are added to the new array.public static <T> T[] addAll(T[] array1,
T[] array2)
Adds all the elements of the given arrays into a new array.
The new array contains all of the element of array1 followed by all of the elements
array2. When an array is returned, it is always a new array.
ArrayUtils.addAll(null, null) = null ArrayUtils.addAll(array1, null) = cloned copy of array1 ArrayUtils.addAll(null, array2) = cloned copy of array2 ArrayUtils.addAll([], []) = [] ArrayUtils.addAll([null], [null]) = [null, null] ArrayUtils.addAll(["a", "b", "c"], ["1", "2", "3"]) = ["a", "b", "c", "1", "2", "3"]
array1 - the first array whose elements are added to the new array, may be nullarray2 - the second array whose elements are added to the new array, may be nullnull if both arrays are null. The type of the new array is the
type of the first array, unless the first array is null, in which case the type is the same as the second
array.IllegalArgumentException - if the array types are incompatiblepublic static short[] addAll(short[] array1,
short[] array2)
Adds all the elements of the given arrays into a new array.
The new array contains all of the element of array1 followed by all of the elements
array2. When an array is returned, it is always a new array.
ArrayUtils.addAll(array1, null) = cloned copy of array1 ArrayUtils.addAll(null, array2) = cloned copy of array2 ArrayUtils.addAll([], []) = []
array1 - the first array whose elements are added to the new array.array2 - the second array whose elements are added to the new array.public static boolean[] remove(boolean[] array,
int index)
Removes the element at the specified position from the specified array. All subsequent elements are shifted to the left (substracts 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.
If the input array is null, an IndexOutOfBoundsException will be thrown, because in that case no
valid index can be specified.
ArrayUtils.remove([true], 0) = [] ArrayUtils.remove([true, false], 0) = [false] ArrayUtils.remove([true, false], 1) = [true] ArrayUtils.remove([true, true, false], 1) = [true, false]
array - the array to remove the element from, may not be nullindex - the position of the element to be removedIndexOutOfBoundsException - if the index is out of range (index < 0 || index >= array.length), or if the
array is null.public static byte[] remove(byte[] array,
int index)
Removes the element at the specified position from the specified array. All subsequent elements are shifted to the left (substracts 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.
If the input array is null, an IndexOutOfBoundsException will be thrown, because in that case no
valid index can be specified.
ArrayUtils.remove([true], 0) = [] ArrayUtils.remove([true, false], 0) = [false] ArrayUtils.remove([true, false], 1) = [true] ArrayUtils.remove([true, true, false], 1) = [true, false]
array - the array to remove the element from, may not be nullindex - the position of the element to be removedIndexOutOfBoundsException - if the index is out of range (index < 0 || index >= array.length), or if the
array is null.public static char[] remove(char[] array,
int index)
Removes the element at the specified position from the specified array. All subsequent elements are shifted to the left (substracts 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.
If the input array is null, an IndexOutOfBoundsException will be thrown, because in that case no
valid index can be specified.
ArrayUtils.remove(['a'], 0) = [] ArrayUtils.remove(['a', 'b'], 0) = ['b'] ArrayUtils.remove(['a', 'b'], 1) = ['a'] ArrayUtils.remove(['a', 'b', 'c'], 1) = ['a', 'c']
array - the array to remove the element from, may not be nullindex - the position of the element to be removedIndexOutOfBoundsException - if the index is out of range (index < 0 || index >= array.length), or if the
array is null.public static double[] remove(double[] array,
int index)
Removes the element at the specified position from the specified array. All subsequent elements are shifted to the left (substracts 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.
If the input array is null, an IndexOutOfBoundsException will be thrown, because in that case no
valid index can be specified.
ArrayUtils.remove([1.1], 0) = [] ArrayUtils.remove([2.5, 6.0], 0) = [6.0] ArrayUtils.remove([2.5, 6.0], 1) = [2.5] ArrayUtils.remove([2.5, 6.0, 3.8], 1) = [2.5, 3.8]
array - the array to remove the element from, may not be nullindex - the position of the element to be removedIndexOutOfBoundsException - if the index is out of range (index < 0 || index >= array.length), or if the
array is null.public static float[] remove(float[] array,
int index)
Removes the element at the specified position from the specified array. All subsequent elements are shifted to the left (substracts 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.
If the input array is null, an IndexOutOfBoundsException will be thrown, because in that case no
valid index can be specified.
ArrayUtils.remove([1.1], 0) = [] ArrayUtils.remove([2.5, 6.0], 0) = [6.0] ArrayUtils.remove([2.5, 6.0], 1) = [2.5] ArrayUtils.remove([2.5, 6.0, 3.8], 1) = [2.5, 3.8]
array - the array to remove the element from, may not be nullindex - the position of the element to be removedIndexOutOfBoundsException - if the index is out of range (index < 0 || index >= array.length), or if the
array is null.public static int[] remove(int[] array,
int index)
Removes the element at the specified position from the specified array. All subsequent elements are shifted to the left (substracts 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.
If the input array is null, an IndexOutOfBoundsException will be thrown, because in that case no
valid index can be specified.
ArrayUtils.remove([1], 0) = [] ArrayUtils.remove([2, 6], 0) = [6] ArrayUtils.remove([2, 6], 1) = [2] ArrayUtils.remove([2, 6, 3], 1) = [2, 3]
array - the array to remove the element from, may not be nullindex - the position of the element to be removedIndexOutOfBoundsException - if the index is out of range (index < 0 || index >= array.length), or if the
array is null.public static long[] remove(long[] array,
int index)
Removes the element at the specified position from the specified array. All subsequent elements are shifted to the left (substracts 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.
If the input array is null, an IndexOutOfBoundsException will be thrown, because in that case no
valid index can be specified.
ArrayUtils.remove([1], 0) = [] ArrayUtils.remove([2, 6], 0) = [6] ArrayUtils.remove([2, 6], 1) = [2] ArrayUtils.remove([2, 6, 3], 1) = [2, 3]
array - the array to remove the element from, may not be nullindex - the position of the element to be removedIndexOutOfBoundsException - if the index is out of range (index < 0 || index >= array.length), or if the
array is null.public static <T> T[] remove(T[] array,
int index)
Removes the element at the specified position from the specified array. All subsequent elements are shifted to the left (substracts 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.
If the input array is null, an IndexOutOfBoundsException will be thrown, because in that case no
valid index can be specified.
ArrayUtils.remove(["a"], 0) = [] ArrayUtils.remove(["a", "b"], 0) = ["b"] ArrayUtils.remove(["a", "b"], 1) = ["a"] ArrayUtils.remove(["a", "b", "c"], 1) = ["a", "c"]
array - the array to remove the element from, may not be nullindex - the position of the element to be removedIndexOutOfBoundsException - if the index is out of range (index < 0 || index >= array.length), or if the
array is null.public static short[] remove(short[] array,
int index)
Removes the element at the specified position from the specified array. All subsequent elements are shifted to the left (substracts 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.
If the input array is null, an IndexOutOfBoundsException will be thrown, because in that case no
valid index can be specified.
ArrayUtils.remove([1], 0) = [] ArrayUtils.remove([2, 6], 0) = [6] ArrayUtils.remove([2, 6], 1) = [2] ArrayUtils.remove([2, 6, 3], 1) = [2, 3]
array - the array to remove the element from, may not be nullindex - the position of the element to be removedIndexOutOfBoundsException - if the index is out of range (index < 0 || index >= array.length), or if the
array is null.public static boolean[] removeElement(boolean[] array,
boolean element)
Removes the first occurrence of the specified element from the specified array. All subsequent elements are shifted to the left (substracts 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.
ArrayUtils.removeElement(null, true) = null ArrayUtils.removeElement([], true) = [] ArrayUtils.removeElement([true], false) = [true] ArrayUtils.removeElement([true, false], false) = [true] ArrayUtils.removeElement([true, false, true], true) = [false, true]
array - the array to remove the element from, may be nullelement - the element to be removedpublic static byte[] removeElement(byte[] array,
byte element)
Removes the first occurrence of the specified element from the specified array. All subsequent elements are shifted to the left (substracts 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.
ArrayUtils.removeElement(null, 1) = null ArrayUtils.removeElement([], 1) = [] ArrayUtils.removeElement([1], 0) = [1] ArrayUtils.removeElement([1, 0], 0) = [1] ArrayUtils.removeElement([1, 0, 1], 1) = [0, 1]
array - the array to remove the element from, may be nullelement - the element to be removedpublic static char[] removeElement(char[] array,
char element)
Removes the first occurrence of the specified element from the specified array. All subsequent elements are shifted to the left (substracts 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.
ArrayUtils.removeElement(null, 'a') = null ArrayUtils.removeElement([], 'a') = [] ArrayUtils.removeElement(['a'], 'b') = ['a'] ArrayUtils.removeElement(['a', 'b'], 'a') = ['b'] ArrayUtils.removeElement(['a', 'b', 'a'], 'a') = ['b', 'a']
array - the array to remove the element from, may be nullelement - the element to be removedpublic static double[] removeElement(double[] array,
double element)
Removes the first occurrence of the specified element from the specified array. All subsequent elements are shifted to the left (substracts 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.
ArrayUtils.removeElement(null, 1.1) = null ArrayUtils.removeElement([], 1.1) = [] ArrayUtils.removeElement([1.1], 1.2) = [1.1] ArrayUtils.removeElement([1.1, 2.3], 1.1) = [2.3] ArrayUtils.removeElement([1.1, 2.3, 1.1], 1.1) = [2.3, 1.1]
array - the array to remove the element from, may be nullelement - the element to be removedpublic static float[] removeElement(float[] array,
float element)
Removes the first occurrence of the specified element from the specified array. All subsequent elements are shifted to the left (substracts 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.
ArrayUtils.removeElement(null, 1.1) = null ArrayUtils.removeElement([], 1.1) = [] ArrayUtils.removeElement([1.1], 1.2) = [1.1] ArrayUtils.removeElement([1.1, 2.3], 1.1) = [2.3] ArrayUtils.removeElement([1.1, 2.3, 1.1], 1.1) = [2.3, 1.1]
array - the array to remove the element from, may be nullelement - the element to be removedpublic static int[] removeElement(int[] array,
int element)
Removes the first occurrence of the specified element from the specified array. All subsequent elements are shifted to the left (substracts 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.
ArrayUtils.removeElement(null, 1) = null ArrayUtils.removeElement([], 1) = [] ArrayUtils.removeElement([1], 2) = [1] ArrayUtils.removeElement([1, 3], 1) = [3] ArrayUtils.removeElement([1, 3, 1], 1) = [3, 1]
array - the array to remove the element from, may be nullelement - the element to be removedpublic static long[] removeElement(long[] array,
long element)
Removes the first occurrence of the specified element from the specified array. All subsequent elements are shifted to the left (substracts 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.
ArrayUtils.removeElement(null, 1) = null ArrayUtils.removeElement([], 1) = [] ArrayUtils.removeElement([1], 2) = [1] ArrayUtils.removeElement([1, 3], 1) = [3] ArrayUtils.removeElement([1, 3, 1], 1) = [3, 1]
array - the array to remove the element from, may be nullelement - the element to be removedpublic static short[] removeElement(short[] array,
short element)
Removes the first occurrence of the specified element from the specified array. All subsequent elements are shifted to the left (substracts 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.
ArrayUtils.removeElement(null, 1) = null ArrayUtils.removeElement([], 1) = [] ArrayUtils.removeElement([1], 2) = [1] ArrayUtils.removeElement([1, 3], 1) = [3] ArrayUtils.removeElement([1, 3, 1], 1) = [3, 1]
array - the array to remove the element from, may be nullelement - the element to be removedpublic static <T> T[] removeElement(T[] array,
T element)
ArrayUtils.removeElement(null, "a") = null
ArrayUtils.removeElement([], "a") = []
ArrayUtils.removeElement(["a"], "b") = ["a"]
ArrayUtils.removeElement(["a", "b"], "a") = ["b"]
ArrayUtils.removeElement(["a", "b", "a"], "a") = ["b", "a"]
array - the array to remove the element from, may be nullelement - public static Object getValues(DomainOpenClass clazz)
public static <T> T copy(T origin)
Copyright © 2004–2019 OpenL Tablets. All rights reserved.