Java Utililty Methods Array Min Value

List of utility methods to do Array Min Value

Description

The list of methods to do Array Min Value are organized into topic(s).

Method

floatminValue(float[] arr)
Returns the smallest value in the array
if (arr.length < 0)
    return 0;
float min = arr[0];
for (int i = 1; i < arr.length; i++) {
    if (arr[i] < min) {
        min = arr[i];
return min;
intminValue(int[] array)
Returns the minimum value in the input array.
if (array.length == 0)
    throw new NoSuchElementException("Empty array");
int minValue = array[0];
for (int i = 1; i < array.length; i++)
    if (array[i] < minValue)
        minValue = array[i];
return minValue;
intminValue(int[] values)
min Value
int min = 255;
for (int i = 0; i < values.length; i++) {
    if (values[i] < min && values[i] != 0) {
        min = values[i];
return min;
longminValue(long[] array)
Returns the minimum value in the input array.
if (array.length == 0)
    throw new NoSuchElementException("Empty array");
long minValue = array[0];
for (int i = 1; i < array.length; i++) {
    if (array[i] < minValue) {
        minValue = array[i];
return minValue;
floatminX(final float[] vertices)
min X
float minX = vertices[0];
for (int i = 0; i < vertices.length / 2; i++) {
    minX = Math.min(minX, vertices[i * 2]);
return minX;