|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.jga.algorithms.Summarize
public class Summarize
Algorithms that consume input and produce a single value. The input may be an array, collection, or iteration.
Copyright © 2006 David A. Hall
Constructor Summary | |
---|---|
Summarize()
|
Method Summary | ||
---|---|---|
static
|
accumulate(java.lang.Iterable<? extends T> values,
BinaryFunctor<T,T,T> fn)
|
|
static
|
accumulate(java.lang.Iterable<? extends T> values,
T init,
BinaryFunctor<T,T,T> fn)
|
|
static
|
accumulate(java.util.Iterator<? extends T> iterator,
BinaryFunctor<T,T,T> fn)
|
|
static
|
accumulate(java.util.Iterator<? extends T> iterator,
T init,
BinaryFunctor<T,T,T> fn)
|
|
static
|
accumulate(T[] ts,
BinaryFunctor<T,T,T> fn)
|
|
static
|
accumulate(T[] ts,
T initial,
BinaryFunctor<T,T,T> fn)
|
|
static
|
average(java.lang.Class<T> type,
java.lang.Iterable<T> ts)
Returns the average of the values |
|
static
|
average(java.lang.Class<T> type,
java.util.Iterator<T> ts)
Returns the average of the values. |
|
static
|
average(java.lang.Class<T> type,
T[] ts)
Returns the average of the values |
|
static
|
average(T[] ts)
Returns the average of the values |
|
static
|
count(java.lang.Iterable<? extends T> input)
Returns the number of elements in the input. |
|
static
|
count(java.lang.Iterable<? extends T> input,
Equality<T> eq,
T value)
Deprecated. - switching the order of arguments to be consistent with Find |
|
static
|
count(java.lang.Iterable<? extends T> input,
T value)
Returns the number of times that the given value appears in the input. |
|
static
|
count(java.lang.Iterable<? extends T> input,
T value,
java.util.Comparator<? super T> comp)
Returns the number of times that the given value appears in the input, using the given Comparator. |
|
static
|
count(java.lang.Iterable<? extends T> input,
T value,
Equality<T> eq)
Returns the number of times that the given value appears in the input, using the given equality operator. |
|
static
|
count(java.lang.Iterable<? extends T> input,
UnaryFunctor<T,java.lang.Boolean> pred)
Returns the number of elements in the input for which the predicate is true. |
|
static
|
count(java.util.Iterator<? extends T> iter)
Returns the number of elements in the iterator. |
|
static
|
count(java.util.Iterator<? extends T> iter,
Equality<T> eq,
T value)
Deprecated. - switching the order of arguments to be consistent with Find |
|
static
|
count(java.util.Iterator<? extends T> iter,
T value)
Returns the number of times that the given value appears in the iterator. |
|
static
|
count(java.util.Iterator<? extends T> iter,
T value,
java.util.Comparator<? super T> comp)
Returns the number of times that the given value appears in the iterator, using the given equality operator. |
|
static
|
count(java.util.Iterator<? extends T> iter,
T value,
Equality<T> eq)
Returns the number of times that the given value appears in the iterator, using the given equality operator. |
|
static
|
count(java.util.Iterator<? extends T> iter,
UnaryFunctor<T,java.lang.Boolean> pred)
Returns the number of elements in the iterator for which the predicate is true. |
|
static
|
count(T[] ts,
Equality<T> eq,
T value)
Deprecated. - switching the order of arguments to be consistent with Find |
|
static
|
count(T[] ts,
T value)
Returns the number of times that the given value appears in the array |
|
static
|
count(T[] ts,
T value,
java.util.Comparator<? super T> comp)
Returns the number of times that the given value appears in the array, using the given Comparator |
|
static
|
count(T[] ts,
T value,
Equality<T> eq)
Returns the number of times that the given value appears in the array, using the given equality operator |
|
static
|
count(T[] ts,
UnaryFunctor<T,java.lang.Boolean> pred)
Returns the number of elements in the array for which the predicate is true |
|
static
|
forEach(java.lang.Iterable<? extends T> c,
UnaryFunctor<T,R> fn)
|
|
static
|
forEach(java.util.Iterator<? extends T> iter,
UnaryFunctor<T,R> fn)
|
|
static
|
forEach(T[] ts,
UnaryFunctor<T,R> fn)
|
|
static
|
lookup(java.lang.Iterable<? extends T> ts,
T value)
Returns the first item in the input that equals the given value using the equals() method or null if no such item exists |
|
static
|
lookup(java.lang.Iterable<? extends T> ts,
T value,
java.util.Comparator<? super T> comp)
Returns the first item in the input that equals the given value using the given comparator or null if no such item exists |
|
static
|
lookup(java.lang.Iterable<? extends T> ts,
T value,
Equality<T> eq)
Returns the first item in the input that equals the given value using the given Equality operator or null if no such item exists |
|
static
|
lookup(java.lang.Iterable<? extends T> ts,
UnaryFunctor<T,java.lang.Boolean> fn)
Returns the first item that in the input for which the given functor returns TRUE, or null if no such item exists |
|
static
|
lookup(java.util.Iterator<? extends T> ts,
T value)
Returns the first item in the input that equals the given value using the equals() method or null if no such item exists |
|
static
|
lookup(java.util.Iterator<? extends T> ts,
T value,
java.util.Comparator<? super T> comp)
Returns the first item in the input that equals the given value using the given comparator or null if no such item exists |
|
static
|
lookup(java.util.Iterator<? extends T> ts,
T value,
Equality<T> eq)
Returns the first item in the input that equals the given value using the given Equality operator or null if no such item exists |
|
static
|
lookup(java.util.Iterator<? extends T> ts,
UnaryFunctor<T,java.lang.Boolean> fn)
Returns the first value that meets the selection criteria, or null |
|
static
|
lookup(T[] ts,
T value)
Returns the first item in the array that equals the given value using the equals() method or null if no such item exists |
|
static
|
lookup(T[] ts,
T value,
java.util.Comparator<? super T> comp)
Returns the first item in the array that equals the given value using the given comparator or null if no such item exists |
|
static
|
lookup(T[] ts,
T value,
Equality<T> eq)
Returns the first item in the array that equals the given value using the given Equality operator or null if no such item exists |
|
static
|
lookup(T[] ts,
UnaryFunctor<T,java.lang.Boolean> fn)
Returns the first item that in the array for which the given functor returns TRUE, or null if no such item exists |
|
static
|
max(java.lang.Iterable<? extends T> ts)
Returns the largest T value in the input. |
|
static
|
max(java.lang.Iterable<? extends T> ts,
BinaryFunctor<T,T,T> fn)
Returns the largest T value in the input, as determined by the given functor. |
|
static
|
max(java.lang.Iterable<? extends T> ts,
java.util.Comparator<? super T> comp)
Returns the largest T value in the input, as determined by the given comparator. |
|
static
|
max(java.util.Iterator<? extends T> ts)
Returns the largest T value in the input. |
|
static
|
max(java.util.Iterator<? extends T> ts,
BinaryFunctor<T,T,T> fn)
Returns the largest T value in the input, as determined by the given functor. |
|
static
|
max(java.util.Iterator<? extends T> ts,
java.util.Comparator<? super T> comp)
Returns the largest T value in the input, as determined by the given comparator. |
|
static
|
max(T[] ts)
Returns the largest T value in the input. |
|
static
|
max(T[] ts,
BinaryFunctor<T,T,T> fn)
Returns the largest T value in the input, as determined by the given functor. |
|
static
|
max(T[] ts,
java.util.Comparator<? super T> comp)
Returns the largest T value in the input, as determined by the given comparator. |
|
static
|
min(java.lang.Iterable<? extends T> ts)
Returns the smallest T value in the input. |
|
static
|
min(java.lang.Iterable<? extends T> ts,
BinaryFunctor<T,T,T> fn)
Returns the smallest T value in the input, as determined by the given functor. |
|
static
|
min(java.lang.Iterable<? extends T> ts,
java.util.Comparator<? super T> comp)
Returns the smallest T value in the input, as determined by the given comparator. |
|
static
|
min(java.util.Iterator<? extends T> ts)
Returns the smallest T value in the input. |
|
static
|
min(java.util.Iterator<? extends T> ts,
BinaryFunctor<T,T,T> fn)
Returns the smallest T value in the input, as determined by the given functor. |
|
static
|
min(java.util.Iterator<? extends T> ts,
java.util.Comparator<? super T> comp)
Returns the smallest T value in the input, as determined by the given comparator. |
|
static
|
min(T[] ts)
Returns the smallest T value in the input. |
|
static
|
min(T[] ts,
BinaryFunctor<T,T,T> fn)
Returns the smallest T value in the input, as determined by the given functor. |
|
static
|
min(T[] ts,
java.util.Comparator<? super T> comp)
Returns the smallest T value in the input, as determined by the given comparator. |
|
static
|
sum(java.lang.Class<T> type,
java.lang.Iterable<? extends T> ts)
Returns the sum of the values |
|
static
|
sum(java.lang.Class<T> type,
java.util.Iterator<? extends T> ts)
Returns the sum of the values. |
|
static
|
sum(java.lang.Class<T> type,
T[] ts)
Returns the sum of the values |
|
static
|
sum(T[] ts)
Returns the sum of the values |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Summarize()
Method Detail |
---|
public static <T> long count(T[] ts, T value)
public static <T> long count(T[] ts, T value, java.util.Comparator<? super T> comp)
public static <T> long count(T[] ts, Equality<T> eq, T value)
public static <T> long count(T[] ts, T value, Equality<T> eq)
public static <T> long count(T[] ts, UnaryFunctor<T,java.lang.Boolean> pred)
public static <T> long count(java.lang.Iterable<? extends T> input)
public static <T> long count(java.lang.Iterable<? extends T> input, T value)
public static <T> long count(java.lang.Iterable<? extends T> input, T value, java.util.Comparator<? super T> comp)
public static <T> long count(java.lang.Iterable<? extends T> input, Equality<T> eq, T value)
public static <T> long count(java.lang.Iterable<? extends T> input, T value, Equality<T> eq)
public static <T> long count(java.lang.Iterable<? extends T> input, UnaryFunctor<T,java.lang.Boolean> pred)
public static <T> long count(java.util.Iterator<? extends T> iter)
public static <T> long count(java.util.Iterator<? extends T> iter, T value)
public static <T> long count(java.util.Iterator<? extends T> iter, T value, java.util.Comparator<? super T> comp)
public static <T> long count(java.util.Iterator<? extends T> iter, Equality<T> eq, T value)
public static <T> long count(java.util.Iterator<? extends T> iter, T value, Equality<T> eq)
public static <T> long count(java.util.Iterator<? extends T> iter, UnaryFunctor<T,java.lang.Boolean> pred)
public static <T> T min(T[] ts, java.util.Comparator<? super T> comp)
public static <T extends java.lang.Comparable<? super T>> T min(T[] ts)
public static <T> T min(T[] ts, BinaryFunctor<T,T,T> fn)
public static <T> T min(java.lang.Iterable<? extends T> ts, java.util.Comparator<? super T> comp)
public static <T extends java.lang.Comparable<? super T>> T min(java.lang.Iterable<? extends T> ts)
public static <T> T min(java.lang.Iterable<? extends T> ts, BinaryFunctor<T,T,T> fn)
public static <T> T min(java.util.Iterator<? extends T> ts, java.util.Comparator<? super T> comp)
public static <T extends java.lang.Comparable<? super T>> T min(java.util.Iterator<? extends T> ts)
public static <T> T min(java.util.Iterator<? extends T> ts, BinaryFunctor<T,T,T> fn)
public static <T> T max(T[] ts, java.util.Comparator<? super T> comp)
public static <T extends java.lang.Comparable<? super T>> T max(T[] ts)
public static <T> T max(T[] ts, BinaryFunctor<T,T,T> fn)
public static <T> T max(java.lang.Iterable<? extends T> ts, java.util.Comparator<? super T> comp)
public static <T extends java.lang.Comparable<? super T>> T max(java.lang.Iterable<? extends T> ts)
public static <T> T max(java.lang.Iterable<? extends T> ts, BinaryFunctor<T,T,T> fn)
public static <T> T max(java.util.Iterator<? extends T> ts, java.util.Comparator<? super T> comp)
public static <T extends java.lang.Comparable<? super T>> T max(java.util.Iterator<? extends T> ts)
public static <T> T max(java.util.Iterator<? extends T> ts, BinaryFunctor<T,T,T> fn)
public static <T extends java.lang.Number> T sum(T[] ts)
public static <T extends java.lang.Number> T sum(java.lang.Class<T> type, T[] ts)
public static <T extends java.lang.Number> T sum(java.lang.Class<T> type, java.lang.Iterable<? extends T> ts)
public static <T extends java.lang.Number> T sum(java.lang.Class<T> type, java.util.Iterator<? extends T> ts)
public static <T> T accumulate(T[] ts, BinaryFunctor<T,T,T> fn)
public static <T> T accumulate(T[] ts, T initial, BinaryFunctor<T,T,T> fn)
public static <T> T accumulate(java.lang.Iterable<? extends T> values, BinaryFunctor<T,T,T> fn)
public static <T> T accumulate(java.lang.Iterable<? extends T> values, T init, BinaryFunctor<T,T,T> fn)
public static <T> T accumulate(java.util.Iterator<? extends T> iterator, BinaryFunctor<T,T,T> fn)
public static <T> T accumulate(java.util.Iterator<? extends T> iterator, T init, BinaryFunctor<T,T,T> fn)
public static <T,R> UnaryFunctor<T,R> forEach(T[] ts, UnaryFunctor<T,R> fn)
public static <T,R> UnaryFunctor<T,R> forEach(java.lang.Iterable<? extends T> c, UnaryFunctor<T,R> fn)
public static <T,R> UnaryFunctor<T,R> forEach(java.util.Iterator<? extends T> iter, UnaryFunctor<T,R> fn)
public static <T extends java.lang.Number> T average(T[] ts)
public static <T extends java.lang.Number> T average(java.lang.Class<T> type, T[] ts)
public static <T extends java.lang.Number> T average(java.lang.Class<T> type, java.lang.Iterable<T> ts)
public static <T extends java.lang.Number> T average(java.lang.Class<T> type, java.util.Iterator<T> ts)
public static <T> T lookup(T[] ts, T value)
public static <T> T lookup(T[] ts, T value, java.util.Comparator<? super T> comp)
public static <T> T lookup(T[] ts, T value, Equality<T> eq)
public static <T> T lookup(T[] ts, UnaryFunctor<T,java.lang.Boolean> fn)
public static <T> T lookup(java.lang.Iterable<? extends T> ts, T value)
public static <T> T lookup(java.lang.Iterable<? extends T> ts, T value, java.util.Comparator<? super T> comp)
public static <T> T lookup(java.lang.Iterable<? extends T> ts, T value, Equality<T> eq)
public static <T> T lookup(java.lang.Iterable<? extends T> ts, UnaryFunctor<T,java.lang.Boolean> fn)
public static <T> T lookup(java.util.Iterator<? extends T> ts, T value)
public static <T> T lookup(java.util.Iterator<? extends T> ts, T value, java.util.Comparator<? super T> comp)
public static <T> T lookup(java.util.Iterator<? extends T> ts, T value, Equality<T> eq)
public static <T> T lookup(java.util.Iterator<? extends T> ts, UnaryFunctor<T,java.lang.Boolean> fn)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |