@Test public void testMinSingleValue() { assertEquals(singleValue[0], Double.valueOf(SampleStats.min(singleValue, true))); }
public static double min(Double[] values, boolean ignoreNaN) { if (values == null || values.length == 0) { return Double.NaN; } else if (values.length == 1) { return values[0]; } SortedSet<Double> set = CollectionFactory.sortedSet(); set.addAll(Arrays.asList(values)); if (ignoreNaN) set.remove(Double.NaN); return set.first(); }
SampleStats { public static double min(Double[] values, boolean ignoreNaN) { if (values == null || values.length == 0) { return Double.NaN; } else if (values.length == 1) { return values[0]; } SortedSet<Double> set = CollectionFactory.sortedSet(); set.addAll(Arrays.asList(values)); if (ignoreNaN) set.remove(Double.NaN); return set.first(); } }
SampleStats { public static double min(Double[] values, boolean ignoreNaN) { if (values == null || values.length == 0) { return Double.NaN; } else if (values.length == 1) { return values[0]; } SortedSet<Double> set = CollectionFactory.sortedSet(); set.addAll(Arrays.asList(values)); if (ignoreNaN) set.remove(Double.NaN); return set.first(); }  }
SampleStats { public static double min(Double[] values, boolean ignoreNaN) { if (values == null || values.length == 0) { return Double.NaN; } else if (values.length == 1) { return values[0]; } SortedSet<Double> set = CollectionFactory.sortedSet(); set.addAll(Arrays.asList(values)); if (ignoreNaN) set.remove(Double.NaN); return set.first(); }  static double max(Double[] values, boolean ignoreNaN); static double mean(Double[] values, boolean ignoreNaN); static double min(Double[] values, boolean ignoreNaN); @SuppressWarnings("empty-statement") static double median(Double[] values, boolean ignoreNaN); @SuppressWarnings("empty-statement") static double mode(Double[] values, boolean ignoreNaN); static double range(Double[] values, boolean ignoreNaN); static double variance(Double[] values, boolean ignoreNaN); static double sdev(Double[] values, boolean ignoreNaN); static double sum(Double[] values, boolean ignoreNaN); }
SampleStats { public static double min(Double[] values, boolean ignoreNaN) { if (values == null || values.length == 0) { return Double.NaN; } else if (values.length == 1) { return values[0]; } SortedSet<Double> set = CollectionFactory.sortedSet(); set.addAll(Arrays.asList(values)); if (ignoreNaN) set.remove(Double.NaN); return set.first(); }  static double max(Double[] values, boolean ignoreNaN); static double mean(Double[] values, boolean ignoreNaN); static double min(Double[] values, boolean ignoreNaN); @SuppressWarnings("empty-statement") static double median(Double[] values, boolean ignoreNaN); @SuppressWarnings("empty-statement") static double mode(Double[] values, boolean ignoreNaN); static double range(Double[] values, boolean ignoreNaN); static double variance(Double[] values, boolean ignoreNaN); static double sdev(Double[] values, boolean ignoreNaN); static double sum(Double[] values, boolean ignoreNaN);  }