Here you can find the source of min(byte[] values)
Parameter | Description |
---|---|
values | the array to search |
public static final byte min(byte[] values)
//package com.java2s; //License from project: Open Source License public class Main { /** Get the minimum value in an array subset * @param values the array to search * @return the minimum value found in the array subset specified *//* www .j ava 2 s . co m*/ public static final byte min(byte[] values) { return min(values, 0, values.length); } /** Get the minimum value in an array subset * @param values the array to search * @param offset the offset into the array at which to start searching * @param length the number of values to search * @return the minimum value found in the array subset specified */ public static final byte min(byte[] values, int offset, int length) { byte min = Byte.MAX_VALUE; int offLen = offset + length; for (int i = offset; i < offLen; i++) { if (min > values[i]) { min = values[i]; } } return min; } /** Get the minimum value in an array subset * @param values the array to search * @return the minimum value found in the array subset specified */ public static final short min(short[] values) { return min(values, 0, values.length); } /** Get the minimum value in an array subset * @param values the array to search * @param offset the offset into the array at which to start searching * @param length the number of values to search * @return the minimum value found in the array subset specified */ public static final short min(short[] values, int offset, int length) { short min = Short.MAX_VALUE; int offLen = offset + length; for (int i = offset; i < offLen; i++) { if (min > values[i]) { min = values[i]; } } return min; } /** Get the minimum value in an array subset * @param values the array to search * @return the minimum value found in the array subset specified */ public static final char min(char[] values) { return min(values, 0, values.length); } /** Get the minimum value in an array subset * @param values the array to search * @param offset the offset into the array at which to start searching * @param length the number of values to search * @return the minimum value found in the array subset specified */ public static final char min(char[] values, int offset, int length) { char min = Character.MAX_VALUE; int offLen = offset + length; for (int i = offset; i < offLen; i++) { if (min > values[i]) { min = values[i]; } } return min; } /** Get the minimum value in an array subset * @param values the array to search * @return the minimum value found in the array subset specified */ public static final int min(int[] values) { return min(values, 0, values.length); } /** Get the minimum value in an array subset * @param values the array to search * @param offset the offset into the array at which to start searching * @param length the number of values to search * @return the minimum value found in the array subset specified */ public static final int min(int[] values, int offset, int length) { int min = Integer.MAX_VALUE; int offLen = offset + length; for (int i = offset; i < offLen; i++) { if (min > values[i]) { min = values[i]; } } return min; } /** Get the minimum value in an array subset * @param values the array to search * @return the minimum value found in the array subset specified */ public static final long min(long[] values) { return min(values, 0, values.length); } /** Get the minimum value in an array subset * @param values the array to search * @param offset the offset into the array at which to start searching * @param length the number of values to search * @return the minimum value found in the array subset specified */ public static final long min(long[] values, int offset, int length) { long min = Long.MAX_VALUE; int offLen = offset + length; for (int i = offset; i < offLen; i++) { if (min > values[i]) { min = values[i]; } } return min; } /** Get the minimum value in an array subset * @param values the array to search * @return the minimum value found in the array subset specified */ public static final float min(float[] values) { return min(values, 0, values.length); } /** Get the minimum value in an array subset * @param values the array to search * @param offset the offset into the array at which to start searching * @param length the number of values to search * @return the minimum value found in the array subset specified */ public static final float min(float[] values, int offset, int length) { float min = Float.MAX_VALUE; int offLen = offset + length; for (int i = offset; i < offLen; i++) { if (min > values[i]) { min = values[i]; } } return min; } /** Get the minimum value in an array subset * @param values the array to search * @return the minimum value found in the array subset specified */ public static final double min(double[] values) { return min(values, 0, values.length); } /** Get the minimum value in an array subset * @param values the array to search * @param offset the offset into the array at which to start searching * @param length the number of values to search * @return the minimum value found in the array subset specified */ public static final double min(double[] values, int offset, int length) { double min = Double.MAX_VALUE; int offLen = offset + length; for (int i = offset; i < offLen; i++) { if (min > values[i]) { min = values[i]; } } return min; } }