| java.lang.Object net.sf.jga.algorithms.Summarize
Summarize | public class Summarize (Code) | | Algorithms that consume input and produce a single value. The input may be
an array, collection, or iteration.
Copyright © 2006 David A. Hall
|
Method Summary | |
public static T | accumulate(T[] ts, BinaryFunctor<T, T, T> fn) | public static T | accumulate(T[] ts, T initial, BinaryFunctor<T, T, T> fn) | public static T | accumulate(Iterable<? extends T> values, BinaryFunctor<T, T, T> fn) | public static T | accumulate(Iterable<? extends T> values, T initial, BinaryFunctor<T, T, T> fn) | public static T | accumulate(Iterator<? extends T> iterator, BinaryFunctor<T, T, T> fn) | public static T | accumulate(Iterator<? extends T> iterator, T initial, BinaryFunctor<T, T, T> fn) | public static T | average(T[] ts) | public static T | average(Class<T> type, T[] ts) | public static T | average(Class<T> type, Iterable<T> ts) | public static T | average(Class<T> type, Iterator<T> ts) Returns the average of the values. | public static long | count(T[] ts, T value) | public static long | count(T[] ts, Equality<T> eq, T value) | public static long | count(T[] ts, UnaryFunctor<T, Boolean> pred) | public static long | count(Iterable<T> input) Returns the number of elements in the input. | public static long | count(Iterable<? extends T> input, T value) Returns the number of times that the given value appears in the input. | public static long | count(Iterable<? extends T> input, Equality<T> eq, T value) Returns the number of times that the given value appears in the input, using
the given equality operator. | public static long | count(Iterable<? extends T> input, UnaryFunctor<T, Boolean> pred) Returns the number of elements in the input for which the predicate is true. | public static long | count(Iterator<? extends T> iter) Returns the number of elements in the iterator. | public static long | count(Iterator<? extends T> iter, T value) Returns the number of times that the given value appears in the iterator. | public static long | count(Iterator<? extends T> iter, Equality<T> eq, T value) Returns the number of times that the given value appears in the iterator, using
the given equality operator. | public static long | count(Iterator<? extends T> iter, UnaryFunctor<T, Boolean> pred) Returns the number of elements in the iterator for which the predicate is true. | public static T | max(T[] ts, Comparator<? super T> comp) Returns the largest T value in the input, as determined by the given comparator. | public static T | max(T[] ts) Returns the largest T value in the input. | public static T | max(T[] ts, BinaryFunctor<T, T, T> fn) Returns the largest T value in the input, as determined by the given functor. | public static T | max(Iterable<? extends T> ts, Comparator<? super T> comp) Returns the largest T value in the input, as determined by the given comparator. | public static T | max(Iterable<? extends T> ts) Returns the largest T value in the input. | public static T | max(Iterable<? extends T> ts, BinaryFunctor<T, T, T> fn) Returns the largest T value in the input, as determined by the given functor. | public static T | max(Iterator<? extends T> ts, Comparator<? super T> comp) Returns the largest T value in the input, as determined by the given comparator. | public static T | max(Iterator<? extends T> ts) Returns the largest T value in the input. | public static T | max(Iterator<? extends T> ts, BinaryFunctor<T, T, T> fn) Returns the largest T value in the input, as determined by the given functor. | public static T | min(T[] ts, Comparator<? super T> comp) Returns the smallest T value in the input, as determined by the given comparator. | public static T | min(T[] ts) Returns the smallest T value in the input. | public static T | min(T[] ts, BinaryFunctor<T, T, T> fn) Returns the smallest T value in the input, as determined by the given functor. | public static T | min(Iterable<? extends T> ts, Comparator<? super T> comp) Returns the smallest T value in the input, as determined by the given comparator. | public static T | min(Iterable<? extends T> ts) Returns the smallest T value in the input. | public static T | min(Iterable<? extends T> ts, BinaryFunctor<T, T, T> fn) Returns the smallest T value in the input, as determined by the given functor. | public static T | min(Iterator<? extends T> ts, Comparator<? super T> comp) Returns the smallest T value in the input, as determined by the given comparator. | public static T | min(Iterator<? extends T> ts) Returns the smallest T value in the input. | public static T | min(Iterator<? extends T> ts, BinaryFunctor<T, T, T> fn) Returns the smallest T value in the input, as determined by the given functor. | public static T | sum(T[] ts) | public static T | sum(Class<T> type, T[] ts) | public static T | sum(Class<T> type, Iterable<? extends T> ts) | public static T | sum(Class<T> type, Iterator<? extends T> ts) Returns the sum of the values. |
average | public static T average(T[] ts)(Code) | | Returns the average of the values
|
average | public static T average(Class<T> type, T[] ts)(Code) | | Returns the average of the values
|
average | public static T average(Class<T> type, Iterable<T> ts)(Code) | | Returns the average of the values
|
average | public static T average(Class<T> type, Iterator<T> ts)(Code) | | Returns the average of the values. The iterator is entirely consumed.
|
count | public static long count(T[] ts, T value)(Code) | | Returns the number of times that the given value appears in the array
|
count | public static long count(T[] ts, Equality<T> eq, T value)(Code) | | Returns the number of times that the given value appears in the array, using
the given equality operator
|
count | public static long count(T[] ts, UnaryFunctor<T, Boolean> pred)(Code) | | Returns the number of elements in the array for which the predicate is true
|
count | public static long count(Iterable<T> input)(Code) | | Returns the number of elements in the input.
|
count | public static long count(Iterable<? extends T> input, T value)(Code) | | Returns the number of times that the given value appears in the input.
|
count | public static long count(Iterable<? extends T> input, Equality<T> eq, T value)(Code) | | Returns the number of times that the given value appears in the input, using
the given equality operator.
|
count | public static long count(Iterable<? extends T> input, UnaryFunctor<T, Boolean> pred)(Code) | | Returns the number of elements in the input for which the predicate is true.
|
count | public static long count(Iterator<? extends T> iter)(Code) | | Returns the number of elements in the iterator. The iterator is consumed entirely
by this function.
|
count | public static long count(Iterator<? extends T> iter, T value)(Code) | | Returns the number of times that the given value appears in the iterator. The
iterator is consumed entirely by this function.
|
count | public static long count(Iterator<? extends T> iter, Equality<T> eq, T value)(Code) | | Returns the number of times that the given value appears in the iterator, using
the given equality operator. The iterator is consumed entirely by this function.
|
count | public static long count(Iterator<? extends T> iter, UnaryFunctor<T, Boolean> pred)(Code) | | Returns the number of elements in the iterator for which the predicate is true. The
iterator is consumed entirely by this function.
|
max | public static T max(T[] ts, Comparator<? super T> comp)(Code) | | Returns the largest T value in the input, as determined by the given comparator.
|
max | public static T max(T[] ts)(Code) | | Returns the largest T value in the input.
|
max | public static T max(T[] ts, BinaryFunctor<T, T, T> fn)(Code) | | Returns the largest T value in the input, as determined by the given functor.
The functor is expected to return the smaller of its two arguments.
|
max | public static T max(Iterable<? extends T> ts, Comparator<? super T> comp)(Code) | | Returns the largest T value in the input, as determined by the given comparator.
|
max | public static T max(Iterable<? extends T> ts)(Code) | | Returns the largest T value in the input.
|
max | public static T max(Iterable<? extends T> ts, BinaryFunctor<T, T, T> fn)(Code) | | Returns the largest T value in the input, as determined by the given functor.
The functor is expected to return the smaller of its two arguments.
|
max | public static T max(Iterator<? extends T> ts, Comparator<? super T> comp)(Code) | | Returns the largest T value in the input, as determined by the given comparator.
The input iterator is consumed.
|
max | public static T max(Iterator<? extends T> ts)(Code) | | Returns the largest T value in the input. The input iterator is consumed.
|
max | public static T max(Iterator<? extends T> ts, BinaryFunctor<T, T, T> fn)(Code) | | Returns the largest T value in the input, as determined by the given functor.
The functor is expected to return the smaller of its two arguments.
The input iterator is consumed.
|
min | public static T min(T[] ts, Comparator<? super T> comp)(Code) | | Returns the smallest T value in the input, as determined by the given comparator.
|
min | public static T min(T[] ts)(Code) | | Returns the smallest T value in the input.
|
min | public static T min(T[] ts, BinaryFunctor<T, T, T> fn)(Code) | | Returns the smallest T value in the input, as determined by the given functor.
The functor is expected to return the smaller of its two arguments.
|
min | public static T min(Iterable<? extends T> ts, Comparator<? super T> comp)(Code) | | Returns the smallest T value in the input, as determined by the given comparator.
|
min | public static T min(Iterable<? extends T> ts)(Code) | | Returns the smallest T value in the input.
|
min | public static T min(Iterable<? extends T> ts, BinaryFunctor<T, T, T> fn)(Code) | | Returns the smallest T value in the input, as determined by the given functor.
The functor is expected to return the smaller of its two arguments.
|
min | public static T min(Iterator<? extends T> ts, Comparator<? super T> comp)(Code) | | Returns the smallest T value in the input, as determined by the given comparator.
The input iterator is consumed.
|
min | public static T min(Iterator<? extends T> ts)(Code) | | Returns the smallest T value in the input. The input iterator is consumed.
|
min | public static T min(Iterator<? extends T> ts, BinaryFunctor<T, T, T> fn)(Code) | | Returns the smallest T value in the input, as determined by the given functor.
The functor is expected to return the smaller of its two arguments.
The input iterator is consumed.
|
sum | public static T sum(T[] ts)(Code) | | Returns the sum of the values
|
sum | public static T sum(Class<T> type, T[] ts)(Code) | | Returns the sum of the values
|
sum | public static T sum(Class<T> type, Iterable<? extends T> ts)(Code) | | Returns the sum of the values
|
sum | public static T sum(Class<T> type, Iterator<? extends T> ts)(Code) | | Returns the sum of the values. The iterator is entirely consumed.
|
|
|