Search for the maximum element in the array.

@param <E> the type of elements in this array.

@param array array that we are searching in.

@return the maximum element in the array.
965480
public static <E extends Comparable<E>> E searchMax(E[] array) {
        if(array.length == 0) {
            throw new IllegalArgumentException("The array you provided does not have any elements");
        }
        E max = array[0];
        for(int i = 1; i < array.length; i++) {
            if(array[i].compareTo(max) > 0 ) {
                max = array[i];
            }
        }
        return max;
    }
475472
@SafeVarargs
    public static char max(final char... a) {
        N.checkArgNotNullOrEmpty(a, "The spcified array 'a' can not be null or empty");

        return max(a, 0, a.length);
    }
971024
private void obtainMaxValue(@NonNull final TypedArray typedArray) {
        int defaultValue = getContext().getResources()
                .getInteger(R.integer.seek_bar_preference_default_max_value);
        setMaxValue(typedArray
                .getInteger(R.styleable.AbstractNumericPreference_android_max, defaultValue));
    }
245323
public static int max(int[][] matrix) {
    int max = Integer.MIN_VALUE;
    for (int[] row : matrix) {
      for (int elem : row) {
        max = Math.max(max, elem);
      }
    }
    return max;
  }
591095
@SuppressWarnings("unchecked")
	public static <T> boolean hasNull(T... array) {
		if (isNotEmpty(array)) {
			for (T element : array) {
				if (null == element) {
					return true;
				}
			}
		}
		return false;
	}
1125011
private static int findNodesToRelocate(final int[] array, final int maximumLength) {
        int currentNode = array.length - 2;
        for (int currentDepth = 1; currentDepth < maximumLength - 1 && currentNode > 1; currentDepth++) {
            currentNode =  first(array, currentNode - 1, 0);
        }
        return currentNode;
    }
981858
private void obtainMaxNumber(@NonNull final TypedArray typedArray) {
        int defaultValue = getContext().getResources()
                .getInteger(R.integer.number_picker_preference_default_max_number);
        setMaxNumber(typedArray
                .getInteger(R.styleable.AbstractNumericPreference_android_max, defaultValue));
    }
695971
@SuppressWarnings("unchecked")
	public static <T> T get(Object array, int index) {
		if(null == array) {
			return null;
		}
		
		if (index < 0) {
			index += Array.getLength(array);
		}
		try {
			return (T) Array.get(array, index);
		} catch (ArrayIndexOutOfBoundsException e) {
			return null;
		}
	}
437997
public int getMaxValueIndex(double[] array) {

        int index = 0;
        double max = Integer.MIN_VALUE;

        for (int i = 0; i < array.length; i++) {
            if (array[i] > max) {
                max = array[i];
                index = i;
            }
        }

        return index;
    }
1349927
public static double searchMax(int[] intArray) {
        if(intArray.length == 0) {
            throw new IllegalArgumentException("The array you provided does not have any elements");
        }

        int max = intArray[0];

        for(int i = 1; i < intArray.length; i++) {
            if(intArray[i] > max) {
                max = intArray[i];
            }
        }

        return max;
    }
342795
public static function getMaxKeyLength(array $array)
    {
        $maxKeyLength = '0';
        foreach ($array as $key => $value) {
            $currentLength = static::getVisibleStringLength($key);

            if ($currentLength > $maxKeyLength) {
                $maxKeyLength = $currentLength;
            }
        }

        return $maxKeyLength;
    }
180818
public static float max( float []array , int offset , int length ) {
		float max = -Float.MAX_VALUE;
		for (int i = 0; i < length; i++) {
			float tmp = array[offset+i];
			if( tmp > max ) {
				max = tmp;
			}
		}
		return max;
	}
1171920
public Pair<T> max() {
        int maxCount = 0;
        TLongIntIterator iter = counts.iterator();
        long maxIndex = 0;

        while (!iter.hasNext()) {
            iter.advance();

            int count = iter.value();
            if (count > maxCount) {
                maxIndex = iter.key();
                maxCount = count;
            }
        }
        if (maxCount == 0)
            return null;
        
        int i = (int)(maxIndex >>> 32);
        int j = (int)(maxIndex & 0xfffffff);
        return new Pair<T>(elementIndices.lookup(i), 
                           elementIndices.lookup(j));
    }
22188
public static <E extends Comparable<E>> E searchMax(List<E> list) {
        if(list.size() == 0) {
            throw new IllegalArgumentException("The list you provided does not have any elements");
        }
        E max = list.get(0);

        for(int i = 1; i < list.size(); i++) {
            if(list.get(i).compareTo(max) > 0 ) {
                max = list.get(i);
            }
        }
        return max;
    }
212514
public static <T> T access(T[] array, int n) {
        int max = array.length - 1;
        if ((n < 0) || (n > max)) {
            throw new InvalidValueException(n, "n", Range.between(0, max));
        }
        return array[n];
    }
789935
public static Object getElementFromArrary(Object array, int index) {
    try {
      return Array.get(array, index);
    } catch (ArrayIndexOutOfBoundsException e) {
      return null;
    }
  }
985408
public static <E extends Comparable<E>> void sort(E[] array) {
        int index = 0;
        E value = null;
        
        for(int i = 1; i < array.length; i++) {
            index = i;
            value = array[index];

            while(index > 0 && value.compareTo(array[index - 1]) < 0) {
                array[index] = array[index - 1];
                
                index--;
            }
            
            array[index] = value;
        }
    }