List of utility methods to do List Average
double | getAverage(List get Average double avg = 0; for (T i : numbers) avg += i.doubleValue(); return avg / numbers.size(); |
int | getAverageColour(List get Average Colour int r = 0; int g = 0; int b = 0; int a = 0; int col; int count = colours.size(); for (int i = 0; i < count; i++) { col = colours.get(i); ... |
long | getAverageDuration(List get Average Duration long sum = 0; for (Long l : durations) { sum = sum + l; long avg = 0; if (durations.size() > 0) { avg = (long) (sum / durations.size()); return avg; |
long | getAverageInterval(List Calculates the average difference between the last n timestamp intervals of the input array. long result = 0; int start = tapTimestamps.size() - (n + 1); if (start < 0) { start = 0; n = tapTimestamps.size() - 1; if (n == 0) { return 0; ... |
long | getStandardDeviation(List get Standard Deviation if (longList == null || longList.isEmpty()) { return devByZero; double sd = 0.0d; for (long l : longList) { sd += Math.pow(l - average, 2); sd = Math.sqrt(sd / (double) longList.size()); ... |