public class Floats extends Object
Modifier and Type | Field and Description |
---|---|
static Comparator<float[]> |
ARRAY_COMPARATOR |
static Comparator<Float> |
COMPARATOR |
static Float[] |
EMPTY_ARRAY |
static Float[][] |
EMPTY_ARRAY_2D |
static Float[][][] |
EMPTY_ARRAY_3D |
static float[] |
EMPTY_PRIMITIVE_ARRAY |
static float[][] |
EMPTY_PRIMITIVE_ARRAY_2D |
static float[][][] |
EMPTY_PRIMITIVE_ARRAY_3D |
protected static FloatParser |
PARSER |
static Random |
RANDOM |
Modifier | Constructor and Description |
---|---|
protected |
Floats()
Prevents the construction of
Floats . |
Modifier and Type | Method and Description |
---|---|
static Float[] |
asArray(float... array)
Returns an array of
Float converted from the specified float array. |
static Float[][] |
asArray2D(float[]... array2D)
Returns a 2D array of
Float converted from the specified 2D float array. |
static Float[][][] |
asArray3D(float[][]... array3D)
Returns a 3D array of
Float converted from the specified 3D float array. |
static ExtendedLinkedList<Float> |
asLinkedList(float... array)
|
static <T> ExtendedLinkedList<Float> |
asLinkedList(T... array)
|
static ExtendedList<Float> |
asList(float... array)
|
static <T> ExtendedList<Float> |
asList(T... array)
|
static <T> float[] |
asPrimitiveArray(T... array)
Returns a
float array converted from the specified T array. |
static <T> float[] |
asPrimitiveArray(T[]... array2D)
Returns a
float array converted from the specified 2D T array. |
static <T> float[] |
asPrimitiveArray(T[][]... array3D)
Returns a
float array converted from the specified 3D T array. |
static <T> float[][] |
asPrimitiveArray2D(T[]... array2D)
Returns a 2D
float array converted from the specified 2D T array. |
static <T> float[][][] |
asPrimitiveArray3D(T[][]... array3D)
Returns a 3D
float array converted from the specified 3D T array. |
static ExtendedHashSet<Float> |
asSet(float... array)
|
static <T> ExtendedHashSet<Float> |
asSet(T... array)
|
static float[] |
clone(float... array)
Returns a clone of the specified
float array, or null if it is null . |
static float[][] |
clone(float[]... array2D)
Clones the specified 2D
float array. |
static float[][][] |
clone(float[][][] array3D)
Clones the specified 3D
float array. |
static Float[] |
collectionToArray(Collection<?> collection)
Returns an array of
Float converted from the specified Collection . |
static ExtendedLinkedList<Float> |
collectionToLinkedList(Collection<?> collection)
|
static ExtendedList<Float> |
collectionToList(Collection<?> collection)
|
static float[] |
collectionToPrimitiveArray(Collection<?> collection)
Returns a
float array converted from the specified Collection . |
static ExtendedHashSet<Float> |
collectionToSet(Collection<?> collection)
|
static int |
compare(float[] a,
float[] b)
Compares the specified
float arrays for order. |
static int |
compare(float a,
float b)
Compares the specified
float values for order. |
static float[] |
concat(float[] a,
float... b)
Returns a
float array containing all the elements of the specified float
arrays. |
static float[] |
concat(float a,
float... b)
Returns a
float array containing the specified float value and all the
elements of the specified float array. |
static boolean |
contains(float[] array,
float token)
Tests whether the specified
float array contains the specified float token. |
static boolean |
containsAny(float[] array,
float... tokens)
Tests whether the specified
float array contains any of the specified float
tokens. |
static float |
convert(double value)
Returns a
float value converted from the specified double value. |
static Float |
convert(Object object)
|
static int |
count(float[][] array2D)
Returns the number of elements in the specified 2D
float array. |
static int |
count(float[][][] array3D)
Returns the number of elements in the specified 3D
float array. |
static int |
count(float[][][] array3D,
float... tokens)
Returns the number of occurrences of the specified
float tokens in the specified 3D
float array. |
static int |
count(float[][][] array3D,
float token)
Returns the number of occurrences of the specified
float token in the specified 3D
float array. |
static int |
count(float[][] array2D,
float... tokens)
Returns the number of occurrences of the specified
float tokens in the specified 2D
float array. |
static int |
count(float[][] array2D,
float token)
Returns the number of occurrences of the specified
float token in the specified 2D
float array. |
static int |
count(float[] array,
float... tokens)
Returns the number of occurrences of the specified
float tokens in the specified
float array. |
static int |
count(float[] array,
float token)
Returns the number of occurrences of the specified
float token in the specified
float array. |
static float[] |
createRandomSequence(int length)
Creates a random
float array of the specified length. |
static float[] |
createRandomSequence(int length,
float from,
float to)
Creates a
float array of the specified length containing pseudorandom, uniformly
distributed float values between the specified bounds. |
static float[] |
createSequence(int length)
Creates a
float array of the specified length containing the sequence of numbers
starting with 0f and spaced by 1f . |
static float[] |
createSequence(int length,
float from)
Creates a
float array of the specified length containing the sequence of numbers
starting with from and spaced by 1f . |
static float[] |
createSequence(int length,
float from,
float step)
Creates a
float array of the specified length containing the sequence of numbers
starting with from and spaced by step . |
static boolean |
equals(float[][][] a,
float[][][] b)
Tests whether
a is equal to b . |
static boolean |
equals(float[][][] a,
float[][][] b,
float tolerance)
Tests whether
a is equal to b within tolerance . |
static boolean |
equals(float[][] a,
float[][] b)
Tests whether
a is equal to b . |
static boolean |
equals(float[][] a,
float[][] b,
float tolerance)
Tests whether
a is equal to b within tolerance . |
static boolean |
equals(float[] a,
float[] b)
Tests whether
a is equal to b . |
static boolean |
equals(float[] a,
float[] b,
float tolerance)
Tests whether
a is equal to b within tolerance . |
static boolean |
equals(float a,
float b)
Tests whether
a is equal to b . |
static boolean |
equals(float a,
float b,
float tolerance)
Tests whether
a is equal to b within tolerance . |
static float[][][] |
fill(float[][][] array3D,
float value) |
static float[][] |
fill(float[][] array2D,
float value) |
static float[] |
fill(float[] array,
float value) |
static float[] |
filter(float[] array,
int... indices)
Returns a
float array containing all the elements of the specified float
array at the specified indices. |
static float[][] |
filterAll(float[] array,
int[]... indices)
Returns a 2D
float array containing all the elements of the specified float
array at all the specified indices. |
static int |
findFirstIndex(float[] array,
float token) |
static int |
findFirstIndex(float[] array,
float token,
int from) |
static int |
findFirstIndex(float[] array,
float token,
int from,
int to) |
static int |
findLastIndex(float[] array,
float token) |
static int |
findLastIndex(float[] array,
float token,
int from) |
static int |
findLastIndex(float[] array,
float token,
int from,
int to) |
static String |
format(float value)
Returns the formatted representative
String of the specified float value. |
static String |
formatPercent(float value)
Returns the percentage representative
String of the specified float value. |
static float |
getDecimalPart(float value) |
static int |
hashCode(float... array)
Returns the hash code value for the specified
float array. |
static int |
hashCodeWith(int depth,
float... array)
Returns the hash code value for the specified
float array at the specified depth. |
static boolean |
is(Object object)
|
static boolean |
isBetween(float[] array,
float[] from,
float[] to)
Tests whether the specified
float array is between the specified lower and upper
bound float arrays (with null considered as the minimum value). |
static boolean |
isBetween(float[] array,
float[] from,
float[] to,
boolean isUpperInclusive)
Tests whether the specified
float array is between the specified lower and upper
bound float arrays (with null considered as the minimum value). |
static boolean |
isBetween(float[] array,
float[] from,
float[] to,
boolean isLowerInclusive,
boolean isUpperInclusive)
Tests whether the specified
float array is between the specified lower and upper
bound float arrays (with null considered as the minimum value). |
static boolean |
isBetween(float value,
float from,
float to)
Tests whether the specified
float value is between the specified float lower
and upper bounds. |
static boolean |
isBetween(float value,
float from,
float to,
boolean isUpperInclusive)
Tests whether the specified
float value is between the specified float lower
and upper bounds. |
static boolean |
isBetween(float value,
float from,
float to,
boolean isLowerInclusive,
boolean isUpperInclusive)
Tests whether the specified
float value is between the specified float lower
and upper bounds. |
static boolean |
isEmpty(float[] array)
Tests whether the specified
float array is non-null and empty. |
static boolean |
isFinite(float value)
Tests whether the specified
float value is finite. |
static boolean |
isFrom(Class<?> c)
|
static boolean |
isNonEmpty(float[] array)
Tests whether the specified
float array is non-null and non-empty. |
static boolean |
isNullOrEmpty(float[] array)
Tests whether the specified
float array is null or empty. |
static boolean |
isPrimitiveArray(Object object)
Tests whether the specified
Object is an instance of float array. |
static boolean |
isPrimitiveArrayFrom(Class<?> c)
Tests whether the specified
Class is assignable to a float array. |
static boolean |
isPrimitiveFrom(Class<?> c)
Tests whether the specified
Class is assignable to a float value. |
static float |
middle(float value)
Returns the middle of the specified
float value. |
static float |
middle(float from,
float to)
Returns the middle of the specified
float lower and upper bounds. |
static float |
random()
Returns a pseudorandom, uniformly distributed
float value between 0f and
1f . |
static float |
random(float from,
float to)
Returns a pseudorandom, uniformly distributed
float value between the specified
bounds. |
static float[] |
remove(float[] array,
int index)
Removes the element at the specified index from the specified
float array. |
static float[] |
removeAll(float[] array,
float value)
Removes all the occurrences of the specified
float value from the specified
float array. |
static float[] |
repeat(float element,
int length)
Creates a
float array of the specified length with the specified float
element. |
static void |
reverse(float... array) |
static void |
reverse(float[] array,
int fromIndex,
int toIndex) |
static void |
shuffle(float... array)
Shuffles the specified
float array. |
static void |
shuffle(float[] array,
int fromIndex,
int toIndex)
Shuffles the specified
float array between the specified indices. |
static void |
swap(float[] array,
int i,
int j) |
static float[] |
take(float[]... array2D) |
static float[] |
take(float[][]... array3D) |
static float[] |
take(float[][][] array3D,
int fromRow,
int rowCount) |
static float[] |
take(float[][][] array3D,
int fromRow,
int rowCount,
int fromColumn,
int columnCount) |
static float[] |
take(float[][][] array3D,
int fromRow,
int rowCount,
int fromColumn,
int columnCount,
int fromDepth,
int depthCount) |
static float[] |
take(float[][] array2D,
int fromRow,
int rowCount) |
static float[] |
take(float[][] array2D,
int fromRow,
int rowCount,
int fromColumn,
int columnCount) |
static float[] |
take(float[] array,
int fromIndex,
int length) |
static int[] |
tally(float[] array,
float[] boundaries) |
static int |
tally(float value,
float[] boundaries) |
static Float[] |
toArray(float[] array)
Returns an array of
Float converted from the specified float array. |
static Float[][] |
toArray2D(float[][] array2D)
Returns a 2D array of
Float converted from the specified 2D float array. |
static Float[][][] |
toArray3D(float[][][] array3D)
Returns a 3D array of
Float converted from the specified 3D float array. |
static ExtendedLinkedList<Float> |
toLinkedList(float[] array)
|
static <T> ExtendedLinkedList<Float> |
toLinkedList(T[] array)
|
static ExtendedList<Float> |
toList(float[] array)
|
static <T> ExtendedList<Float> |
toList(T[] array)
|
static <T> float |
toPrimitive(T object)
Returns a
float value converted from the specified T object. |
static float[] |
toPrimitiveArray(float... array)
Returns a
float array converted from the specified float array. |
static float[] |
toPrimitiveArray(float[]... array2D)
Returns a
float array converted from the specified 2D float array. |
static float[] |
toPrimitiveArray(float[][]... array3D)
Returns a
float array converted from the specified 3D float array. |
static <T> float[] |
toPrimitiveArray(T[] array)
Returns a
float array converted from the specified T array. |
static <T> float[] |
toPrimitiveArray(T[][] array2D)
Returns a
float array converted from the specified 2D T array. |
static <T> float[] |
toPrimitiveArray(T[][][] array3D)
Returns a
float array converted from the specified 3D T array. |
static float[][] |
toPrimitiveArray2D(float[][] array2D) |
static float[][] |
toPrimitiveArray2D(float[][][] array3D) |
static float[][] |
toPrimitiveArray2D(float[] array,
int rowCount) |
static <T> float[][] |
toPrimitiveArray2D(T[][] array2D)
Returns a 2D
float array converted from the specified 2D T array. |
static float[][][] |
toPrimitiveArray3D(float[][][] array3D) |
static float[][][] |
toPrimitiveArray3D(float[][] array2D,
int columnCount) |
static float[][][] |
toPrimitiveArray3D(float[] array,
int rowCount,
int columnCount) |
static <T> float[][][] |
toPrimitiveArray3D(T[][][] array3D)
Returns a 3D
float array converted from the specified 3D T array. |
static ExtendedHashSet<Float> |
toSet(float[] array)
|
static <T> ExtendedHashSet<Float> |
toSet(T[] array)
|
static String |
toString(float... array)
Returns a representative
String of the specified float array. |
static String |
toStringWith(float[] array,
char delimiter)
Returns a representative
String of the specified float array joined with the
specified char delimiter. |
static String |
toStringWith(float[] array,
ObjectToStringMapper wrapper)
|
static String |
toStringWith(float[] array,
String delimiter)
|
static String |
toStringWith(float[] array,
String delimiter,
ObjectToStringMapper wrapper)
|
static float[][] |
transpose(float[]... array2D)
Returns the transpose of the specified 2D
float array. |
static float[] |
transpose(int rowCount,
float... array)
Returns the transpose of the specified
float array. |
public static final float[] EMPTY_PRIMITIVE_ARRAY
public static final float[][] EMPTY_PRIMITIVE_ARRAY_2D
public static final float[][][] EMPTY_PRIMITIVE_ARRAY_3D
public static final Float[] EMPTY_ARRAY
public static final Float[][] EMPTY_ARRAY_2D
public static final Float[][][] EMPTY_ARRAY_3D
protected static final FloatParser PARSER
public static final Comparator<Float> COMPARATOR
public static final Comparator<float[]> ARRAY_COMPARATOR
public static volatile Random RANDOM
protected Floats()
Floats
.public static float getDecimalPart(float value)
public static int compare(float a, float b)
float
values for order. Returns a negative integer, 0
or a positive integer as a
is less than, equal to or greater than b
.
a
- the float
value to compare for orderb
- the other float
value to compare against for order
0
or a positive integer as a
is less than, equal
to or greater than b
public static int compare(float[] a, float[] b)
float
arrays for order. Returns a negative integer, 0
or a positive integer as a
is less than, equal to or greater than b
(with
null
considered as the minimum value).
a
- the float
array to compare for order (may be null
)b
- the other float
array to compare against for order (may be null
)
0
or a positive integer as a
is less than, equal
to or greater than b
public static float convert(double value)
float
value converted from the specified double
value.
value
- the double
value to convert
float
value converted from the specified double
valuepublic static <T> float toPrimitive(T object)
float
value converted from the specified T
object.
T
- the type of the object to convertobject
- the T
object to convert
float
value converted from the specified T
objectpublic static float[] toPrimitiveArray(float... array)
float
array converted from the specified float
array.
array
- the float
array to convert
float
array converted from the specified float
arraypublic static float[] toPrimitiveArray(float[]... array2D)
float
array converted from the specified 2D float
array.
array2D
- the 2D float
array to convert
float
array converted from the specified 2D float
arraypublic static float[] toPrimitiveArray(float[][]... array3D)
float
array converted from the specified 3D float
array.
array3D
- the 3D float
array to convert
float
array converted from the specified 3D float
arraypublic static <T> float[] toPrimitiveArray(T[] array)
float
array converted from the specified T
array.
T
- the component type of the array to convertarray
- the T
array to convert
float
array converted from the specified T
arraypublic static <T> float[] asPrimitiveArray(T... array)
float
array converted from the specified T
array.
T
- the component type of the array to convertarray
- the T
array to convert
float
array converted from the specified T
arraypublic static <T> float[] toPrimitiveArray(T[][] array2D)
float
array converted from the specified 2D T
array.
T
- the component type of the array to convertarray2D
- the 2D T
array to convert
float
array converted from the specified 2D T
arraypublic static <T> float[] asPrimitiveArray(T[]... array2D)
float
array converted from the specified 2D T
array.
T
- the component type of the array to convertarray2D
- the 2D T
array to convert
float
array converted from the specified 2D T
arraypublic static <T> float[] toPrimitiveArray(T[][][] array3D)
float
array converted from the specified 3D T
array.
T
- the component type of the array to convertarray3D
- the 3D T
array to convert
float
array converted from the specified 3D T
arraypublic static <T> float[] asPrimitiveArray(T[][]... array3D)
float
array converted from the specified 3D T
array.
T
- the component type of the array to convertarray3D
- the 3D T
array to convert
float
array converted from the specified 3D T
arraypublic static float[][] toPrimitiveArray2D(float[] array, int rowCount)
public static float[][] toPrimitiveArray2D(float[][] array2D)
public static float[][] toPrimitiveArray2D(float[][][] array3D)
public static <T> float[][] toPrimitiveArray2D(T[][] array2D)
float
array converted from the specified 2D T
array.
T
- the component type of the array to convertarray2D
- the 2D T
array to convert
float
array converted from the specified 2D T
arraypublic static <T> float[][] asPrimitiveArray2D(T[]... array2D)
float
array converted from the specified 2D T
array.
T
- the component type of the array to convertarray2D
- the 2D T
array to convert
float
array converted from the specified 2D T
arraypublic static float[][][] toPrimitiveArray3D(float[] array, int rowCount, int columnCount)
public static float[][][] toPrimitiveArray3D(float[][] array2D, int columnCount)
public static float[][][] toPrimitiveArray3D(float[][][] array3D)
public static <T> float[][][] toPrimitiveArray3D(T[][][] array3D)
float
array converted from the specified 3D T
array.
T
- the component type of the array to convertarray3D
- the 3D T
array to convert
float
array converted from the specified 3D T
arraypublic static <T> float[][][] asPrimitiveArray3D(T[][]... array3D)
float
array converted from the specified 3D T
array.
T
- the component type of the array to convertarray3D
- the 3D T
array to convert
float
array converted from the specified 3D T
arraypublic static float[] collectionToPrimitiveArray(Collection<?> collection)
float
array converted from the specified Collection
.
collection
- the Collection
to convert
float
array converted from the specified Collection
public static Float[] toArray(float[] array)
Float
converted from the specified float
array.
array
- the float
array to convert
Float
converted from the specified float
arraypublic static Float[] asArray(float... array)
Float
converted from the specified float
array.
array
- the float
array to convert
Float
converted from the specified float
arraypublic static Float[][] toArray2D(float[][] array2D)
Float
converted from the specified 2D float
array.
array2D
- the 2D float
array to convert
Float
converted from the specified 2D float
arraypublic static Float[][] asArray2D(float[]... array2D)
Float
converted from the specified 2D float
array.
array2D
- the 2D float
array to convert
Float
converted from the specified 2D float
arraypublic static Float[][][] toArray3D(float[][][] array3D)
Float
converted from the specified 3D float
array.
array3D
- the 3D float
array to convert
Float
converted from the specified 3D float
arraypublic static Float[][][] asArray3D(float[][]... array3D)
Float
converted from the specified 3D float
array.
array3D
- the 3D float
array to convert
Float
converted from the specified 3D float
arraypublic static Float[] collectionToArray(Collection<?> collection)
Float
converted from the specified Collection
.
collection
- the Collection
to convert
Float
converted from the specified Collection
public static ExtendedList<Float> toList(float[] array)
array
- the float
array to convert
ExtendedList
of Float
converted from the specified float
arraypublic static ExtendedList<Float> asList(float... array)
array
- the float
array to convert
ExtendedList
of Float
converted from the specified float
arraypublic static ExtendedLinkedList<Float> toLinkedList(float[] array)
array
- the float
array to convert
ExtendedLinkedList
of Float
converted from the specified
float
arraypublic static ExtendedLinkedList<Float> asLinkedList(float... array)
array
- the float
array to convert
ExtendedLinkedList
of Float
converted from the specified
float
arraypublic static <T> ExtendedList<Float> toList(T[] array)
T
- the component type of the array to convertarray
- the T
array to convert
ExtendedList
of Float
converted from the specified T
arraypublic static <T> ExtendedList<Float> asList(T... array)
T
- the component type of the array to convertarray
- the T
array to convert
ExtendedList
of Float
converted from the specified T
arraypublic static <T> ExtendedLinkedList<Float> toLinkedList(T[] array)
T
- the component type of the array to convertarray
- the T
array to convert
ExtendedLinkedList
of Float
converted from the specified T
arraypublic static <T> ExtendedLinkedList<Float> asLinkedList(T... array)
T
- the component type of the array to convertarray
- the T
array to convert
ExtendedLinkedList
of Float
converted from the specified T
arraypublic static ExtendedList<Float> collectionToList(Collection<?> collection)
collection
- the Collection
to convert
ExtendedList
of Float
converted from the specified
Collection
public static ExtendedLinkedList<Float> collectionToLinkedList(Collection<?> collection)
collection
- the Collection
to convert
ExtendedLinkedList
of Float
converted from the specified
Collection
public static ExtendedHashSet<Float> toSet(float[] array)
array
- the float
array to convert
ExtendedHashSet
of Float
converted from the specified
float
arraypublic static ExtendedHashSet<Float> asSet(float... array)
array
- the float
array to convert
ExtendedHashSet
of Float
converted from the specified
float
arraypublic static <T> ExtendedHashSet<Float> toSet(T[] array)
T
- the component type of the array to convertarray
- the T
array to convert
ExtendedHashSet
of Float
converted from the specified T
arraypublic static <T> ExtendedHashSet<Float> asSet(T... array)
T
- the component type of the array to convertarray
- the T
array to convert
ExtendedHashSet
of Float
converted from the specified T
arraypublic static ExtendedHashSet<Float> collectionToSet(Collection<?> collection)
collection
- the Collection
to convert
ExtendedHashSet
of Float
converted from the specified
Collection
public static String format(float value)
String
of the specified float
value.
value
- a float
value
String
of the specified float
valuepublic static String formatPercent(float value)
String
of the specified float
value.
value
- a float
value
String
of the specified float
valuepublic static float[] createSequence(int length)
float
array of the specified length containing the sequence of numbers
starting with 0f
and spaced by 1f
.
length
- the length of the sequence to create
float
array of the specified length containing the sequence of numbers
starting with 0f
and spaced by 1f
public static float[] createSequence(int length, float from)
float
array of the specified length containing the sequence of numbers
starting with from
and spaced by 1f
.
length
- the length of the sequence to createfrom
- the first value of the sequence to create
float
array of the specified length containing the sequence of numbers
starting with from
and spaced by 1f
public static float[] createSequence(int length, float from, float step)
float
array of the specified length containing the sequence of numbers
starting with from
and spaced by step
.
length
- the length of the sequence to createfrom
- the first value of the sequence to createstep
- the interval between the values of the sequence to create
float
array of the specified length containing the sequence of numbers
starting with from
and spaced by step
public static float[] createRandomSequence(int length)
float
array of the specified length.
length
- the length of the random sequence to create
float
array of the specified lengthpublic static float[] createRandomSequence(int length, float from, float to)
float
array of the specified length containing pseudorandom, uniformly
distributed float
values between the specified bounds.
length
- the length of the random sequence to createfrom
- the float
lower bound of the random sequence to create (inclusive)to
- the float
upper bound of the random sequence to create (exclusive)
float
array of the specified length containing pseudorandom, uniformly
distributed float
values between the specified boundspublic static float random()
float
value between 0f
and
1f
.
float
value between 0f
and
1f
public static float random(float from, float to)
float
value between the specified
bounds.
from
- the float
lower bound of the value to generate (inclusive)to
- the float
upper bound of the value to generate (exclusive)
float
value between the specified
boundspublic static float[] repeat(float element, int length)
float
array of the specified length with the specified float
element.
element
- the float
element of the float
array to createlength
- the length of the float
array to create
float
array of the specified length with the specified float
elementpublic static float[] concat(float a, float... b)
float
array containing the specified float
value and all the
elements of the specified float
array.
a
- a float
valueb
- another float
array (may be null
)
float
array containing the specified float
value and all the
elements of the specified float
arraypublic static float[] concat(float[] a, float... b)
float
array containing all the elements of the specified float
arrays.
a
- a float
array (may be null
)b
- another float
array (may be null
)
float
array containing all the elements of the specified float
arrayspublic static int count(float[][] array2D)
float
array.
array2D
- the 2D float
array to count from (may be null
)
float
arraypublic static int count(float[][][] array3D)
float
array.
array3D
- the 3D float
array to count from (may be null
)
float
arraypublic static int count(float[] array, float token)
float
token in the specified
float
array.
array
- the float
array to count from (may be null
)token
- the float
token to count
float
token in the specified
float
arraypublic static int count(float[][] array2D, float token)
float
token in the specified 2D
float
array.
array2D
- the 2D float
array to count from (may be null
)token
- the float
token to count
float
token in the specified 2D
float
arraypublic static int count(float[][][] array3D, float token)
float
token in the specified 3D
float
array.
array3D
- the 3D float
array to count from (may be null
)token
- the float
token to count
float
token in the specified 3D
float
arraypublic static int count(float[] array, float... tokens)
float
tokens in the specified
float
array.
array
- the float
array to count from (may be null
)tokens
- the float
tokens to count (may be null
)
float
tokens in the specified
float
arraypublic static int count(float[][] array2D, float... tokens)
float
tokens in the specified 2D
float
array.
array2D
- the 2D float
array to count from (may be null
)tokens
- the float
tokens to count (may be null
)
float
tokens in the specified 2D
float
arraypublic static int count(float[][][] array3D, float... tokens)
float
tokens in the specified 3D
float
array.
array3D
- the 3D float
array to count from (may be null
)tokens
- the float
tokens to count (may be null
)
float
tokens in the specified 3D
float
arraypublic static float[] fill(float[] array, float value)
public static float[][] fill(float[][] array2D, float value)
public static float[][][] fill(float[][][] array3D, float value)
public static float[] filter(float[] array, int... indices)
float
array containing all the elements of the specified float
array at the specified indices.
array
- the float
array to filter fromindices
- the indices to filter
float
array containing all the elements of the specified float
array at the specified indicespublic static float[][] filterAll(float[] array, int[]... indices)
float
array containing all the elements of the specified float
array at all the specified indices.
array
- the float
array to filter fromindices
- the array of indices to filter
float
array containing all the elements of the specified float
array at all the specified indicespublic static float middle(float value)
float
value.
value
- a float
value
float
valuepublic static float middle(float from, float to)
float
lower and upper bounds.
from
- a float
valueto
- another float
value
float
lower and upper boundspublic static float[] remove(float[] array, int index)
float
array.
array
- the float
array to remove fromindex
- the index of the element to remove
float
array without the element at the specified indexpublic static float[] removeAll(float[] array, float value)
float
value from the specified
float
array.
array
- the float
array to remove fromvalue
- the float
value to remove (may be null
)
float
array without the specified float
valuepublic static void reverse(float... array)
public static void reverse(float[] array, int fromIndex, int toIndex)
public static void shuffle(float... array)
float
array.
array
- the float
array to shufflepublic static void shuffle(float[] array, int fromIndex, int toIndex)
float
array between the specified indices.
array
- the float
array to shufflefromIndex
- the index to start shuffling from (inclusive)toIndex
- the index to finish shuffling at (exclusive)public static void swap(float[] array, int i, int j)
public static float[] take(float[] array, int fromIndex, int length)
public static float[] take(float[]... array2D)
public static float[] take(float[][] array2D, int fromRow, int rowCount)
public static float[] take(float[][] array2D, int fromRow, int rowCount, int fromColumn, int columnCount)
public static float[] take(float[][]... array3D)
public static float[] take(float[][][] array3D, int fromRow, int rowCount)
public static float[] take(float[][][] array3D, int fromRow, int rowCount, int fromColumn, int columnCount)
public static float[] take(float[][][] array3D, int fromRow, int rowCount, int fromColumn, int columnCount, int fromDepth, int depthCount)
public static int tally(float value, float[] boundaries)
public static int[] tally(float[] array, float[] boundaries)
public static float[] transpose(int rowCount, float... array)
float
array.
rowCount
- the number of rows of the float
arrayarray
- a float
array
float
arraypublic static float[][] transpose(float[]... array2D)
float
array.
array2D
- the 2D float
array to convert
float
arraypublic static int findFirstIndex(float[] array, float token)
public static int findFirstIndex(float[] array, float token, int from)
public static int findFirstIndex(float[] array, float token, int from, int to)
public static int findLastIndex(float[] array, float token)
public static int findLastIndex(float[] array, float token, int from)
public static int findLastIndex(float[] array, float token, int from, int to)
public static boolean is(Object object)
public static boolean isFrom(Class<?> c)
public static boolean isPrimitiveFrom(Class<?> c)
Class
is assignable to a float
value.
public static boolean isPrimitiveArray(Object object)
Object
is an instance of float
array.
public static boolean isPrimitiveArrayFrom(Class<?> c)
Class
is assignable to a float
array.
public static boolean isFinite(float value)
float
value is finite.
value
- the float
value to test
true
if the specified float
value is finite, false
otherwisepublic static boolean isNullOrEmpty(float[] array)
float
array is null
or empty.
array
- the float
array to test (may be null
)
true
if the specified float
array is null
or empty,
false
otherwisepublic static boolean isEmpty(float[] array)
float
array is non-null
and empty.
array
- the float
array to test (may be null
)
true
if the specified float
array is non-null
and empty,
false
otherwisepublic static boolean isNonEmpty(float[] array)
float
array is non-null
and non-empty.
array
- the float
array to test (may be null
)
true
if the specified float
array is non-null
and non-empty,
false
otherwisepublic static boolean isBetween(float value, float from, float to)
float
value is between the specified float
lower
and upper bounds.
value
- the float
value to testfrom
- the float
lower bound to test against (inclusive)to
- the float
upper bound to test against (exclusive)
true
if the specified float
value is between the specified
float
lower and upper bounds, false
otherwisepublic static boolean isBetween(float value, float from, float to, boolean isUpperInclusive)
float
value is between the specified float
lower
and upper bounds.
value
- the float
value to testfrom
- the float
lower bound to test against (inclusive)to
- the float
upper bound to test againstisUpperInclusive
- the flag specifying whether the upper bound is inclusive
true
if the specified float
value is between the specified
float
lower and upper bounds, false
otherwisepublic static boolean isBetween(float value, float from, float to, boolean isLowerInclusive, boolean isUpperInclusive)
float
value is between the specified float
lower
and upper bounds.
value
- the float
value to testfrom
- the float
lower bound to test againstto
- the float
upper bound to test againstisLowerInclusive
- the flag specifying whether the lower bound is inclusiveisUpperInclusive
- the flag specifying whether the upper bound is inclusive
true
if the specified float
value is between the specified
float
lower and upper bounds, false
otherwisepublic static boolean isBetween(float[] array, float[] from, float[] to)
float
array is between the specified lower and upper
bound float
arrays (with null
considered as the minimum value).
array
- the float
array to test (may be null
)from
- the lower bound float
array to test against (inclusive) (may be
null
)to
- the upper bound float
array to test against (exclusive) (may be
null
)
true
if the specified float
array is between the specified lower and
upper bound float
arrays, false
otherwisepublic static boolean isBetween(float[] array, float[] from, float[] to, boolean isUpperInclusive)
float
array is between the specified lower and upper
bound float
arrays (with null
considered as the minimum value).
array
- the float
array to test (may be null
)from
- the lower bound float
array to test against (inclusive) (may
be null
)to
- the upper bound float
array to test against (may be
null
)isUpperInclusive
- the flag specifying whether the upper bound is inclusive
true
if the specified float
array is between the specified lower and
upper bound float
arrays, false
otherwisepublic static boolean isBetween(float[] array, float[] from, float[] to, boolean isLowerInclusive, boolean isUpperInclusive)
float
array is between the specified lower and upper
bound float
arrays (with null
considered as the minimum value).
array
- the float
array to test (may be null
)from
- the lower bound float
array to test against (may be
null
)to
- the upper bound float
array to test against (may be
null
)isLowerInclusive
- the flag specifying whether the lower bound is inclusiveisUpperInclusive
- the flag specifying whether the upper bound is inclusive
true
if the specified float
array is between the specified lower and
upper bound float
arrays, false
otherwisepublic static boolean contains(float[] array, float token)
float
array contains the specified float
token.
array
- the float
array to test (may be null
)token
- the float
token to test for presence
true
if the specified float
array contains the specified
float
token, false
otherwisepublic static boolean containsAny(float[] array, float... tokens)
float
array contains any of the specified float
tokens.
array
- the float
array to test (may be null
)tokens
- the float
tokens to test for presence
true
if the specified float
array contains any of the specified
float
tokens, false
otherwisepublic static float[] clone(float... array)
float
array, or null
if it is null
.
array
- the float
array to clone (may be null
)
float
array, or null
if it is null
public static float[][] clone(float[]... array2D)
float
array.
array2D
- the 2D float
array to clone (may be null
)
float
array, or null
if it is
null
public static float[][][] clone(float[][][] array3D)
float
array.
array3D
- the 3D float
array to clone (may be null
)
float
array, or null
if it is
null
public static boolean equals(float a, float b)
a
is equal to b
.
a
- the float
value to compare for equalityb
- the other float
value to compare against for equality
true
if a
is equal to b
, false
otherwisepublic static boolean equals(float a, float b, float tolerance)
a
is equal to b
within tolerance
.
a
- the float
value to compare for equalityb
- the other float
value to compare against for equalitytolerance
- the tolerance level
true
if a
is equal to b
within tolerance
,
false
otherwisepublic static boolean equals(float[] a, float[] b)
a
is equal to b
.
a
- the float
array to compare for equality (may be null
)b
- the other float
array to compare against for equality (may be null
)
true
if a
is equal to b
, false
otherwisepublic static boolean equals(float[] a, float[] b, float tolerance)
a
is equal to b
within tolerance
.
a
- the float
array to compare for equality (may be null
)b
- the other float
array to compare against for equality (may be
null
)tolerance
- the tolerance level
true
if a
is equal to b
within tolerance
,
false
otherwisepublic static boolean equals(float[][] a, float[][] b)
a
is equal to b
.
a
- the 2D float
array to compare for equality (may be null
)b
- the other 2D float
array to compare against for equality (may be
null
)
true
if a
is equal to b
, false
otherwisepublic static boolean equals(float[][] a, float[][] b, float tolerance)
a
is equal to b
within tolerance
.
a
- the 2D float
array to compare for equality (may be null
)b
- the other 2D float
array to compare against for equality (may be
null
)tolerance
- the tolerance level
true
if a
is equal to b
within tolerance
,
false
otherwisepublic static boolean equals(float[][][] a, float[][][] b)
a
is equal to b
.
a
- the 3D float
array to compare for equality (may be null
)b
- the other 3D float
array to compare against for equality (may be
null
)
true
if a
is equal to b
, false
otherwisepublic static boolean equals(float[][][] a, float[][][] b, float tolerance)
a
is equal to b
within tolerance
.
a
- the 3D float
array to compare for equality (may be null
)b
- the other 3D float
array to compare against for equality (may be
null
)tolerance
- the tolerance level
true
if a
is equal to b
within tolerance
,
false
otherwisepublic static int hashCode(float... array)
float
array.
array
- the float
array to hash (may be null
)
float
arraypublic static int hashCodeWith(int depth, float... array)
float
array at the specified depth.
depth
- the depth to hash atarray
- the float
array to hash (may be null
)
float
array at the specified depthpublic static String toString(float... array)
String
of the specified float
array.
array
- the float
array to convert
String
of the specified float
arraypublic static String toStringWith(float[] array, char delimiter)
String
of the specified float
array joined with the
specified char
delimiter.
array
- a float
arraydelimiter
- the char
delimiter
String
of the specified float
array joined with the
specified char
delimiterpublic static String toStringWith(float[] array, ObjectToStringMapper wrapper)
array
- a float
arraywrapper
- an ObjectToStringMapper
String
of the specified float
array wrapped by
wrapper
public static String toStringWith(float[] array, String delimiter, ObjectToStringMapper wrapper)
String
of the specified float
array joined with the
specified delimiting String
and wrapped by wrapper
.
array
- a float
arraydelimiter
- the delimiting String
wrapper
- an ObjectToStringMapper
String
of the specified float
array joined with the
specified delimiting String
and wrapped by wrapper
Copyright © 2013–2022. All rights reserved.