|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.qi4j.api.util.Functions
public class Functions
Utility functions. Combine these with methods in Iterables, for example. See FunctionsTest for usages.
Constructor Summary | |
---|---|
Functions()
|
Method Summary | ||
---|---|---|
static
|
comparator(Function<T,Comparable> comparableFunction)
Creates a comparator that takes a function as input. |
|
static
|
count(Specification<T> specification)
Count the number of items in an iterable that matches a given specification. |
|
static
|
indexOf(Specification<T> specification)
Find out the index of an item matching a given specification in an iterable. |
|
static
|
indexOf(T item,
Iterable<T> iterable)
Find out the index of an item in an iterable. |
|
static Function<Number,Integer> |
intSum()
|
|
static Function<Number,Long> |
longSum()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Functions()
Method Detail |
---|
public static Function<Number,Long> longSum()
public static Function<Number,Integer> intSum()
public static <T> Function<T,Integer> count(Specification<T> specification)
T
- specification
-
public static <T> Function<T,Integer> indexOf(Specification<T> specification)
T
- specification
-
public static <T> int indexOf(T item, Iterable<T> iterable)
T
- item
- iterable
-
public static <T> Comparator<T> comparator(Function<T,Comparable> comparableFunction)
T
- comparableFunction
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |