Class Groupings
java.lang.Object
org.moeaframework.analysis.stream.Groupings
Collection of grouping functions, to be used with
DataStream.groupBy(Function) or
Partition.groupBy(Function).-
Method Summary
Modifier and TypeMethodDescriptionbucket(double width) Buckets a double stream into groups with similar values.bucket(int width) Buckets an integer stream into groups with similar values.bucket(long width) Buckets a long stream into groups with similar values.Buckets an double-valued parameter into groups with similar values.Buckets an integer-valued parameter into groups with similar values.Buckets a long-valued parameter into groups with similar values.static <T> Function<T,T> Groups items by their exact value.exactValue(Parameter<T> parameter) Groups items by their exact parameter value.static <T,L, R> Function<T, org.apache.commons.lang3.tuple.Pair<L, R>> Group items by combining two grouping functions.round()Groups numeric values by their rounded value.Groups numeric values by their rounded value.
-
Method Details
-
pair
public static <T,L, Function<T,R> org.apache.commons.lang3.tuple.Pair<L, pairR>> (Function<T, L> left, Function<T, R> right) Group items by combining two grouping functions.- Type Parameters:
T- the type of each valueL- the type of the left keyR- the type of the right key- Parameters:
left- the left grouping functionright- the right grouping function- Returns:
- the grouping function
-
exactValue
Groups items by their exact parameter value.- Type Parameters:
T- the type of the parameter- Parameters:
parameter- the parameter- Returns:
- the grouping function
-
exactValue
Groups items by their exact value.- Type Parameters:
T- the type of each value- Returns:
- the grouping function
-
bucket
Buckets an integer-valued parameter into groups with similar values.- Parameters:
parameter- the integer-valued parameterwidth- the width of the bucket- Returns:
- the grouping function
-
bucket
Buckets a long-valued parameter into groups with similar values.- Parameters:
parameter- the long-valued parameterwidth- the width of the bucket- Returns:
- the grouping function
-
bucket
Buckets an double-valued parameter into groups with similar values.- Parameters:
parameter- the double-valued parameterwidth- the width of the bucket- Returns:
- the grouping function
-
bucket
Buckets an integer stream into groups with similar values.- Parameters:
width- the width of the bucket- Returns:
- the grouping function
-
bucket
Buckets a long stream into groups with similar values.- Parameters:
width- the width of the bucket- Returns:
- the grouping function
-
bucket
Buckets a double stream into groups with similar values.- Parameters:
width- the width of the bucket- Returns:
- the grouping function
-
round
Groups numeric values by their rounded value.- Parameters:
parameter- the parameter- Returns:
- the grouping function
-
round
Groups numeric values by their rounded value.- Returns:
- the grouping function
-