Index: trunk/JavaHelperLib/src/de/ugoe/cs/util/ArrayTools.java
===================================================================
--- trunk/JavaHelperLib/src/de/ugoe/cs/util/ArrayTools.java	(revision 250)
+++ trunk/JavaHelperLib/src/de/ugoe/cs/util/ArrayTools.java	(revision 290)
@@ -41,3 +41,67 @@
 		return retVal;
 	}
+
+	/**
+	 * <p>
+	 * Finds the highest element in an array. If multiple elements have the
+	 * maximum value, the index of the first one is returned; null-values are
+	 * ignored. In case the parameter array is null, has length 0 or contains
+	 * only null-values, -1 is returned.
+	 * </p>
+	 * 
+	 * @param <T>
+	 * @param array
+	 *            the array
+	 * @return index of the element with the highest value, -1 in case of an
+	 *         invalid parameter
+	 */
+	@SuppressWarnings("unchecked")
+	public static <T> int findMax(Comparable<T>[] array) {
+		int maxIndex = -1;
+		T maxElement = null;
+		if (array != null) {
+			for (int i = 0; i < array.length; i++) {
+				if (array[i] != null) {
+					if (maxElement == null
+							|| array[i].compareTo(maxElement) > 0) {
+						maxElement = (T) array[i];
+						maxIndex = i;
+					}
+				}
+			}
+		}
+		return maxIndex;
+	}
+	
+	/**
+	 * <p>
+	 * Finds the lowest element in an array. If multiple elements have the
+	 * minimal value, the index of the first one is returned; null-values are
+	 * ignored. In case the parameter array is null, has length 0 or contains
+	 * only null-values, -1 is returned.
+	 * </p>
+	 * 
+	 * @param <T>
+	 * @param array
+	 *            the array
+	 * @return index of the element with the lowest value, -1 in case of an
+	 *         invalid parameter
+	 */
+	@SuppressWarnings("unchecked")
+	public static <T> int findMin(Comparable<T>[] array) {
+		int maxIndex = -1;
+		T maxElement = null;
+		if (array != null) {
+			for (int i = 0; i < array.length; i++) {
+				if (array[i] != null) {
+					if (maxElement == null
+							|| array[i].compareTo(maxElement) < 0) {
+						maxElement = (T) array[i];
+						maxIndex = i;
+					}
+				}
+			}
+		}
+		return maxIndex;
+	}
 }
