public class Aggregators extends Object
The methods in this class are for the most part simple factory methods for
various InvocableMap.EntryAggregator
classes, but in some cases provide additional type
safety. They also tend to make the code more readable, especially if imported
statically, so their use is strongly encouraged in lieu of direct construction
of InvocableMap.EntryAggregator
classes.
Constructor and Description |
---|
Aggregators() |
Modifier and Type | Method and Description |
---|---|
static <K,V,P,R> AsynchronousAggregator<K,V,P,R> |
asynchronous(InvocableMap.StreamingAggregator<K,V,P,R> aggregator)
Return an AsynchronousAggregator for a given streaming aggregator.
|
static <K,V,P,R> InvocableMap.EntryAggregator<K,V,R> |
asynchronous(InvocableMap.StreamingAggregator<K,V,P,R> aggregator,
int iUnitOrderId)
Return an AsynchronousAggregator for a given streaming aggregator.
|
static <K,V> InvocableMap.StreamingAggregator<K,V,?,Double> |
average(String sMethod)
Return an aggregator that calculates a average of the numeric values extracted
from a set of entries in a Map.
|
static <K,V,T> InvocableMap.StreamingAggregator<K,V,?,Double> |
average(ValueExtractor<? super T,? extends Number> extractor)
Return an aggregator that calculates a average of the numeric values extracted
from a set of entries in a Map.
|
static <K,V> InvocableMap.StreamingAggregator<K,V,?,BigDecimal> |
bigDecimalAverage(String sMethod)
Return an aggregator that calculates a average of the numeric values extracted
from a set of entries in a Map.
|
static <K,V,T> InvocableMap.StreamingAggregator<K,V,?,BigDecimal> |
bigDecimalAverage(ValueExtractor<? super T,? extends Number> extractor)
Return an aggregator that calculates a average of the numeric values extracted
from a set of entries in a Map.
|
static <K,V> InvocableMap.StreamingAggregator<K,V,?,BigDecimal> |
bigDecimalMax(String sMethod)
Return an aggregator that calculates a maximum of the numeric values extracted
from a set of entries in a Map.
|
static <K,V,T> InvocableMap.StreamingAggregator<K,V,?,BigDecimal> |
bigDecimalMax(ValueExtractor<? super T,? extends Number> extractor)
Return an aggregator that calculates a maximum of the numeric values extracted
from a set of entries in a Map.
|
static <K,V> InvocableMap.StreamingAggregator<K,V,?,BigDecimal> |
bigDecimalMin(String sMethod)
Return an aggregator that calculates a minimum of the numeric values extracted
from a set of entries in a Map.
|
static <K,V,T> InvocableMap.StreamingAggregator<K,V,?,BigDecimal> |
bigDecimalMin(ValueExtractor<? super T,? extends Number> extractor)
Return an aggregator that calculates a minimum of the numeric values extracted
from a set of entries in a Map.
|
static <K,V> InvocableMap.StreamingAggregator<K,V,?,BigDecimal> |
bigDecimalSum(String sMethod)
Return an aggregator that calculates a sum of the numeric values extracted
from a set of entries in a Map.
|
static <K,V,T> InvocableMap.StreamingAggregator<K,V,?,BigDecimal> |
bigDecimalSum(ValueExtractor<? super T,? extends Number> extractor)
Return an aggregator that calculates a sum of the numeric values extracted
from a set of entries in a Map.
|
static <K,V,T,R extends Comparable<? super R>> |
comparableMax(String sMethod)
Return an aggregator that calculates a maximum of the
Comparable values
extracted from a set of entries in a Map. |
static <K,V,T,R extends Comparable<? super R>> |
comparableMax(String sMethod,
Comparator<? super R> comparator)
Return an aggregator that calculates a maximum of the values extracted from a set
of entries in a Map.
|
static <K,V,T,R extends Comparable<? super R>> |
comparableMax(ValueExtractor<? super T,? extends R> extractor)
Return an aggregator that calculates a maximum of the
Comparable values
extracted from a set of entries in a Map. |
static <K,V,T,R extends Comparable<? super R>> |
comparableMax(ValueExtractor<? super T,? extends R> extractor,
Comparator<? super R> comparator)
Return an aggregator that calculates a maximum of the values extracted from a set
of entries in a Map.
|
static <K,V,R extends Comparable<? super R>> |
comparableMin(String sMethod)
Return an aggregator that calculates a minimum of the
Comparable values
extracted from a set of entries in a Map. |
static <K,V,R extends Comparable<? super R>> |
comparableMin(String sMethod,
Comparator<? super R> comparator)
Return an aggregator that calculates a minimum of the values extracted from a set
of entries in a Map.
|
static <K,V,T,R extends Comparable<? super R>> |
comparableMin(ValueExtractor<? super T,? extends R> extractor)
Return an aggregator that calculates a minimum of the
Comparable values
extracted from a set of entries in a Map. |
static <K,V,T,R extends Comparable<? super R>> |
comparableMin(ValueExtractor<? super T,? extends R> extractor,
Comparator<? super R> comparator)
Return an aggregator that calculates a minimum of the values extracted from a set
of entries in a Map.
|
static <K,V> InvocableMap.StreamingAggregator<K,V,?,List<?>> |
composite(InvocableMap.EntryAggregator... aAggregator)
Return an aggregator that calculates the the combined set of results from a number of aggregators.
|
static <K,V> InvocableMap.StreamingAggregator<K,V,Integer,Integer> |
count()
Return an aggregator that calculates the count of the entries in a Map.
|
static <K,V> InvocableMap.StreamingAggregator<K,V,?,Collection<V>> |
distinctValues()
Return an aggregator that calculates the set of distinct values from the entries in a Map.
|
static <K,V,R> InvocableMap.StreamingAggregator<K,V,?,Collection<R>> |
distinctValues(String sMethod)
Return an aggregator that calculates the set of distinct values extracted from the entries in a Map.
|
static <K,V,T,R> InvocableMap.StreamingAggregator<K,V,?,Collection<R>> |
distinctValues(ValueExtractor<? super T,? extends R> extractor)
Return an aggregator that calculates the set of distinct values extracted from the entries in a Map.
|
static <K,V> InvocableMap.StreamingAggregator<K,V,?,Double> |
doubleMax(String sMethod)
Return an aggregator that calculates a maximum of the numeric values extracted
from a set of entries in a Map.
|
static <K,V,T> InvocableMap.StreamingAggregator<K,V,?,Double> |
doubleMax(ValueExtractor<? super T,? extends Number> extractor)
Return an aggregator that calculates a maximum of the numeric values extracted
from a set of entries in a Map.
|
static <K,V> InvocableMap.StreamingAggregator<K,V,?,Double> |
doubleMin(String sMethod)
Return an aggregator that calculates a minimum of the numeric values extracted
from a set of entries in a Map.
|
static <K,V,T> InvocableMap.StreamingAggregator<K,V,?,Double> |
doubleMin(ValueExtractor<? super T,? extends Number> extractor)
Return an aggregator that calculates a minimum of the numeric values extracted
from a set of entries in a Map.
|
static <K,V> InvocableMap.StreamingAggregator<K,V,?,Double> |
doubleSum(String sMethod)
Return an aggregator that calculates a sum of the numeric values extracted
from a set of entries in a Map.
|
static <K,V,T> InvocableMap.StreamingAggregator<K,V,?,Double> |
doubleSum(ValueExtractor<? super T,? extends Number> extractor)
Return an aggregator that calculates a sum of the numeric values extracted
from a set of entries in a Map.
|
static <K,V,E,R> InvocableMap.StreamingAggregator<K,V,Map<E,Object>,Map<E,R>> |
grouping(InvocableMap.EntryAggregator<K,V,R> aggregator,
Filter filter,
String... asNames)
Create an instance of group aggregator based on a specified property or method
name(s) and an
InvocableMap.EntryAggregator . |
static <K,V,E,R> InvocableMap.StreamingAggregator<K,V,Map<E,Object>,Map<E,R>> |
grouping(InvocableMap.EntryAggregator<K,V,R> aggregator,
String... asNames)
Create an instance of group aggregator based on a specified property or method
name(s) and an
InvocableMap.EntryAggregator . |
static <K,V,T,E,R> |
grouping(ValueExtractor<? super T,? extends E> extractor,
InvocableMap.EntryAggregator<? super K,? super V,R> aggregator,
Filter filter)
Create an instance of group aggregator based on a specified property or method
name(s) and an
InvocableMap.EntryAggregator . |
static <K,V,T,E,R> |
grouping(ValueExtractor<? super T,? extends E> extractor,
InvocableMap.EntryAggregator<K,V,R> aggregator)
Create an instance of group aggregator based on a specified property or method
name(s) and an
InvocableMap.EntryAggregator . |
static <K,V> InvocableMap.StreamingAggregator<K,V,?,Long> |
longMax(String sMethod)
Return an aggregator that calculates a maximum of the numeric values extracted
from a set of entries in a Map.
|
static <K,V,T> InvocableMap.StreamingAggregator<K,V,?,Long> |
longMax(ValueExtractor<? super T,? extends Number> extractor)
Return an aggregator that calculates a maximum of the numeric values extracted
from a set of entries in a Map.
|
static <K,V> InvocableMap.StreamingAggregator<K,V,?,Long> |
longMin(String sMethod)
Return an aggregator that calculates a minimum of the numeric values extracted
from a set of entries in a Map.
|
static <K,V,T> InvocableMap.StreamingAggregator<K,V,?,Long> |
longMin(ValueExtractor<? super T,? extends Number> extractor)
Return an aggregator that calculates a minimum of the numeric values extracted
from a set of entries in a Map.
|
static <K,V> InvocableMap.StreamingAggregator<K,V,?,Long> |
longSum(String sMethod)
Return an aggregator that calculates a sum of the numeric values extracted
from a set of entries in a Map.
|
static <K,V,T> InvocableMap.StreamingAggregator<K,V,?,Long> |
longSum(ValueExtractor<? super T,? extends Number> extractor)
Return an aggregator that calculates a sum of the numeric values extracted
from a set of entries in a Map.
|
static <K,V,R extends Comparable<? super R>> |
reduce(String sMethod)
Return an aggregator that will return the extracted value for each entry in the map.
|
static <K,V,T,R extends Comparable<? super R>> |
reduce(ValueExtractor<? super T,? extends R> extractor)
Return an aggregator that will return the extracted value for each entry in the map.
|
static <K,V,P,R> InvocableMap.StreamingAggregator<K,V,P,R> |
script(String sLanguage,
String sName,
int characteristics,
Object... aoArgs)
Return an aggregator that is implemented in a script using the specified
language.
|
static <K,V,P,R> InvocableMap.StreamingAggregator<K,V,P,R> |
script(String sLanguage,
String sName,
Object... aoArgs)
Return an aggregator that is implemented in a script using the specified
language.
|
static <K,V,T,R extends Comparable<? super R>> |
topN(String sMethod,
Comparator<? super R> comparator,
int cResults)
Return an aggregator that calculates the top n of the values extracted from a set
of entries in a Map.
|
static <K,V,T,R extends Comparable<? super R>> |
topN(String sMethod,
int cResults)
Return an aggregator that calculates the top n of the
Comparable values
extracted from a set of entries in a Map. |
static <K,V,T,R extends Comparable<? super R>> |
topN(ValueExtractor<? super T,? extends R> extractor,
Comparator<? super R> comparator,
int cResults)
Return an aggregator that calculates the top n of the values extracted from a set
of entries in a Map.
|
static <K,V,T,R extends Comparable<? super R>> |
topN(ValueExtractor<? super T,? extends R> extractor,
int cResults)
Return an aggregator that calculates the top n of the
Comparable values
extracted from a set of entries in a Map. |
public static <K,V,P,R> AsynchronousAggregator<K,V,P,R> asynchronous(InvocableMap.StreamingAggregator<K,V,P,R> aggregator)
K
- the type of the Map entry keysV
- the type of the Map entry valuesP
- the type of the intermediate result during the parallel stageR
- the type of the value returned by the StreamingAggregatoraggregator
- the underlying streaming aggregatorpublic static <K,V,P,R> InvocableMap.EntryAggregator<K,V,R> asynchronous(InvocableMap.StreamingAggregator<K,V,P,R> aggregator, int iUnitOrderId)
aggregator
- the underlying streaming aggregatoriUnitOrderId
- the unit-of-order id for this aggregatorpublic static <K,V,T> InvocableMap.StreamingAggregator<K,V,?,Double> average(ValueExtractor<? super T,? extends Number> extractor)
K
- the type of the entry's keyV
- the type of the entry's valueT
- the type of the value to extract fromextractor
- the extractor that provides a value in the form of
any Java object that is a Number
public static <K,V> InvocableMap.StreamingAggregator<K,V,?,Double> average(String sMethod)
K
- the type of the entry's keyV
- the type of the entry's valuesMethod
- the name of the method that returns a value in the form
of any Java object that is a Number
public static <K,V,T> InvocableMap.StreamingAggregator<K,V,?,Double> doubleMax(ValueExtractor<? super T,? extends Number> extractor)
K
- the type of the entry's keyV
- the type of the entry's valueT
- the type of the value to extract fromextractor
- the extractor that provides a value in the form of
any Java object that is a Number
public static <K,V> InvocableMap.StreamingAggregator<K,V,?,Double> doubleMax(String sMethod)
K
- the type of the entry's keyV
- the type of the entry's valuesMethod
- the name of the method that returns a value in the form
of any Java object that is a Number
public static <K,V,T> InvocableMap.StreamingAggregator<K,V,?,Double> doubleMin(ValueExtractor<? super T,? extends Number> extractor)
K
- the type of the entry's keyV
- the type of the entry's valueT
- the type of the value to extract fromextractor
- the extractor that provides a value in the form of
any Java object that is a Number
public static <K,V> InvocableMap.StreamingAggregator<K,V,?,Double> doubleMin(String sMethod)
K
- the type of the entry's keyV
- the type of the entry's valuesMethod
- the name of the method that returns a value in the form
of any Java object that is a Number
public static <K,V,T> InvocableMap.StreamingAggregator<K,V,?,Double> doubleSum(ValueExtractor<? super T,? extends Number> extractor)
K
- the type of the entry's keyV
- the type of the entry's valueT
- the type of the value to extract fromextractor
- the extractor that provides a value in the form of
any Java object that is a Number
public static <K,V> InvocableMap.StreamingAggregator<K,V,?,Double> doubleSum(String sMethod)
K
- the type of the entry's keyV
- the type of the entry's valuesMethod
- the name of the method that returns a value in the form
of any Java object that is a Number
public static <K,V,T> InvocableMap.StreamingAggregator<K,V,?,Long> longMax(ValueExtractor<? super T,? extends Number> extractor)
K
- the type of the entry's keyV
- the type of the entry's valueT
- the type of the value to extract fromextractor
- the extractor that provides a value in the form of
any Java object that is a Number
public static <K,V> InvocableMap.StreamingAggregator<K,V,?,Long> longMax(String sMethod)
K
- the type of the entry's keyV
- the type of the entry's valuesMethod
- the name of the method that returns a value in the form
of any Java object that is a Number
public static <K,V,T> InvocableMap.StreamingAggregator<K,V,?,Long> longMin(ValueExtractor<? super T,? extends Number> extractor)
K
- the type of the entry's keyV
- the type of the entry's valueT
- the type of the value to extract fromextractor
- the extractor that provides a value in the form of
any Java object that is a Number
public static <K,V> InvocableMap.StreamingAggregator<K,V,?,Long> longMin(String sMethod)
K
- the type of the entry's keyV
- the type of the entry's valuesMethod
- the name of the method that returns a value in the form
of any Java object that is a Number
public static <K,V,T> InvocableMap.StreamingAggregator<K,V,?,Long> longSum(ValueExtractor<? super T,? extends Number> extractor)
K
- the type of the entry's keyV
- the type of the entry's valueT
- the type of the value to extract fromextractor
- the extractor that provides a value in the form of
any Java object that is a Number
public static <K,V> InvocableMap.StreamingAggregator<K,V,?,Long> longSum(String sMethod)
K
- the type of the entry's keyV
- the type of the entry's valuesMethod
- the name of the method that returns a value in the form
of any Java object that is a Number
public static <K,V,T> InvocableMap.StreamingAggregator<K,V,?,BigDecimal> bigDecimalAverage(ValueExtractor<? super T,? extends Number> extractor)
BigDecimal
values.K
- the type of the entry's keyV
- the type of the entry's valueT
- the type of the value to extract fromextractor
- the extractor that provides a value in the form of
any Java object that is a Number
public static <K,V> InvocableMap.StreamingAggregator<K,V,?,BigDecimal> bigDecimalAverage(String sMethod)
BigDecimal
values.K
- the type of the entry's keyV
- the type of the entry's valuesMethod
- the name of the method that returns a value in the form
of any Java object that is a Number
public static <K,V,T> InvocableMap.StreamingAggregator<K,V,?,BigDecimal> bigDecimalMax(ValueExtractor<? super T,? extends Number> extractor)
BigDecimal
values.K
- the type of the entry's keyV
- the type of the entry's valueT
- the type of the value to extract fromextractor
- the extractor that provides a value in the form of
any Java object that is a Number
public static <K,V> InvocableMap.StreamingAggregator<K,V,?,BigDecimal> bigDecimalMax(String sMethod)
BigDecimal
values.K
- the type of the entry's keyV
- the type of the entry's valuesMethod
- the name of the method that returns a value in the form
of any Java object that is a Number
public static <K,V,T> InvocableMap.StreamingAggregator<K,V,?,BigDecimal> bigDecimalMin(ValueExtractor<? super T,? extends Number> extractor)
BigDecimal
values.K
- the type of the entry's keyV
- the type of the entry's valueT
- the type of the value to extract fromextractor
- the extractor that provides a value in the form of
any Java object that is a Number
public static <K,V> InvocableMap.StreamingAggregator<K,V,?,BigDecimal> bigDecimalMin(String sMethod)
BigDecimal
values.K
- the type of the entry's keyV
- the type of the entry's valuesMethod
- the name of the method that returns a value in the form
of any Java object that is a Number
public static <K,V,T> InvocableMap.StreamingAggregator<K,V,?,BigDecimal> bigDecimalSum(ValueExtractor<? super T,? extends Number> extractor)
BigDecimal
values.K
- the type of the entry's keyV
- the type of the entry's valueT
- the type of the value to extract fromextractor
- the extractor that provides a value in the form of
any Java object that is a Number
public static <K,V> InvocableMap.StreamingAggregator<K,V,?,BigDecimal> bigDecimalSum(String sMethod)
BigDecimal
values.K
- the type of the entry's keyV
- the type of the entry's valuesMethod
- the name of the method that returns a value in the form
of any Java object that is a Number
public static <K,V,T,R extends Comparable<? super R>> InvocableMap.StreamingAggregator<K,V,?,R> comparableMax(ValueExtractor<? super T,? extends R> extractor)
Comparable
values
extracted from a set of entries in a Map. All the extracted objects will be
treated as Comparable
values.K
- the type of the entry's keyV
- the type of the entry's valueT
- the type of the value to extract fromR
- the type of the aggregation resultextractor
- the extractor that provides a value in the form of
any object that implements Comparable
interfacepublic static <K,V,T,R extends Comparable<? super R>> InvocableMap.StreamingAggregator<K,V,?,R> comparableMax(ValueExtractor<? super T,? extends R> extractor, Comparator<? super R> comparator)
Comparator
.K
- the type of the entry's keyV
- the type of the entry's valueT
- the type of the value to extract fromR
- the type of the aggregation resultextractor
- the extractor that provides an object to be comparedcomparator
- the comparator used to compare the extracted objectpublic static <K,V,T,R extends Comparable<? super R>> InvocableMap.StreamingAggregator<K,V,?,R> comparableMax(String sMethod)
Comparable
values
extracted from a set of entries in a Map. All the extracted objects will be
treated as Comparable
values.K
- the type of the entry's keyV
- the type of the entry's valueT
- the type of the value to extract fromR
- the type of the aggregation resultsMethod
- the name of the method that returns a value in the form
of any object that implements Comparable
interfacepublic static <K,V,T,R extends Comparable<? super R>> InvocableMap.StreamingAggregator<K,V,?,R> comparableMax(String sMethod, Comparator<? super R> comparator)
Comparator
.K
- the type of the entry's keyV
- the type of the entry's valueT
- the type of the value to extract fromR
- the type of the aggregation resultsMethod
- the name of the method that returns the value to be comparedcomparator
- the comparator used to compare the extracted objectpublic static <K,V,T,R extends Comparable<? super R>> InvocableMap.StreamingAggregator<K,V,?,R> comparableMin(ValueExtractor<? super T,? extends R> extractor)
Comparable
values
extracted from a set of entries in a Map. All the extracted objects will be
treated as Comparable
values.K
- the type of the entry's keyV
- the type of the entry's valueT
- the type of the value to extract fromR
- the type of the aggregation resultextractor
- the extractor that provides a value in the form of
any object that implements Comparable
interfacepublic static <K,V,T,R extends Comparable<? super R>> InvocableMap.StreamingAggregator<K,V,?,R> comparableMin(ValueExtractor<? super T,? extends R> extractor, Comparator<? super R> comparator)
Comparator
.K
- the type of the entry's keyV
- the type of the entry's valueT
- the type of the value to extract fromR
- the type of the aggregation resultextractor
- the extractor that provides an object to be comparedcomparator
- the comparator used to compare the extracted objectpublic static <K,V,R extends Comparable<? super R>> InvocableMap.StreamingAggregator<K,V,?,R> comparableMin(String sMethod)
Comparable
values
extracted from a set of entries in a Map. All the extracted objects will be
treated as Comparable
values.K
- the type of the entry's keyV
- the type of the entry's valueR
- the type of the aggregation resultsMethod
- the name of the method that returns a value in the form
of any object that implements Comparable
interfacepublic static <K,V,R extends Comparable<? super R>> InvocableMap.StreamingAggregator<K,V,?,R> comparableMin(String sMethod, Comparator<? super R> comparator)
Comparator
.K
- the type of the entry's keyV
- the type of the entry's valueR
- the type of the aggregation resultsMethod
- the name of the method that returns a value in the form
of any object that implements Comparable
interfacepublic static <K,V> InvocableMap.StreamingAggregator<K,V,Integer,Integer> count()
K
- the type of the entry's keyV
- the type of the entry's valuepublic static <K,V> InvocableMap.StreamingAggregator<K,V,?,Collection<V>> distinctValues()
K
- the type of the entry's keyV
- the type of the entry's valuepublic static <K,V,T,R> InvocableMap.StreamingAggregator<K,V,?,Collection<R>> distinctValues(ValueExtractor<? super T,? extends R> extractor)
K
- the type of the entry's keyV
- the type of the entry's valueT
- the type of the value to extract fromR
- the type of the aggregation resultextractor
- the extractor that provides a value in the form of
any Java objectpublic static <K,V,R> InvocableMap.StreamingAggregator<K,V,?,Collection<R>> distinctValues(String sMethod)
K
- the type of the entry's keyV
- the type of the entry's valueR
- the type of the aggregation resultsMethod
- the name of the method that returns a value in the form
of any Java objectpublic static <K,V> InvocableMap.StreamingAggregator<K,V,?,List<?>> composite(InvocableMap.EntryAggregator... aAggregator)
K
- the type of the entry's keyV
- the type of the entry's valueaAggregator
- an array of EntryAggregator objects; may not be nullNullPointerException
- if the aggregator array is nullpublic static <K,V,E,R> InvocableMap.StreamingAggregator<K,V,Map<E,Object>,Map<E,R>> grouping(InvocableMap.EntryAggregator<K,V,R> aggregator, String... asNames)
InvocableMap.EntryAggregator
.K
- the type of the Map entry keysV
- the type of the Map entry valuesE
- the type of the extracted valueR
- the type of the group aggregator resultaggregator
- an underlying EntryAggregatorasNames
- the property or method name(s) to extract values from. The resulting
ValueExtractor
is used to split InvocableMap entries into distinct
groups.public static <K,V,E,R> InvocableMap.StreamingAggregator<K,V,Map<E,Object>,Map<E,R>> grouping(InvocableMap.EntryAggregator<K,V,R> aggregator, Filter filter, String... asNames)
InvocableMap.EntryAggregator
.K
- the type of the Map entry keysV
- the type of the Map entry valuesE
- the type of the extracted valueR
- the type of the group aggregator resultaggregator
- an underlying EntryAggregatorfilter
- an optional Filter object that will be used to evaluate
results of each individual group aggregationasNames
- the property or method name(s) to extract values from. The resulting
ValueExtractor
is used to split InvocableMap entries into distinct
groups.public static <K,V,T,E,R> InvocableMap.StreamingAggregator<K,V,Map<E,Object>,Map<E,R>> grouping(ValueExtractor<? super T,? extends E> extractor, InvocableMap.EntryAggregator<K,V,R> aggregator)
InvocableMap.EntryAggregator
.K
- the type of the Map entry keysV
- the type of the Map entry valuesT
- the type of the value to extract fromE
- the type of the extracted valueR
- the type of the group aggregator resultextractor
- a ValueExtractor that will be used to split a set of
InvocableMap entries into distinct groupsaggregator
- an underlying EntryAggregatorpublic static <K,V,T,E,R> InvocableMap.StreamingAggregator<K,V,Map<E,Object>,Map<E,R>> grouping(ValueExtractor<? super T,? extends E> extractor, InvocableMap.EntryAggregator<? super K,? super V,R> aggregator, Filter filter)
InvocableMap.EntryAggregator
.K
- the type of the Map entry keysV
- the type of the Map entry valuesT
- the type of the value to extract fromE
- the type of the extracted valueR
- the type of the group aggregator resultextractor
- a ValueExtractor that will be used to split a set of
InvocableMap entries into distinct groupsaggregator
- an underlying EntryAggregatorfilter
- an optional Filter object used to filter out results
of individual group aggregation resultspublic static <K,V,T,R extends Comparable<? super R>> InvocableMap.StreamingAggregator<K,V,?,R[]> topN(ValueExtractor<? super T,? extends R> extractor, int cResults)
Comparable
values
extracted from a set of entries in a Map. All the extracted objects will be
treated as Comparable
values.K
- the type of the entry's keyV
- the type of the entry's valueT
- the type of the value to extract fromR
- the type of the aggregation resultextractor
- the extractor that provides a value in the form of
any object that implements Comparable
interfacecResults
- the maximum number of results to returnpublic static <K,V,T,R extends Comparable<? super R>> InvocableMap.StreamingAggregator<K,V,?,R[]> topN(ValueExtractor<? super T,? extends R> extractor, Comparator<? super R> comparator, int cResults)
Comparator
.K
- the type of the entry's keyV
- the type of the entry's valueT
- the type of the value to extract fromR
- the type of the aggregation resultextractor
- the extractor that provides an object to be comparedcomparator
- the comparator used to compare the extracted objectcResults
- the maximum number of results to returnpublic static <K,V,T,R extends Comparable<? super R>> InvocableMap.StreamingAggregator<K,V,?,R[]> topN(String sMethod, int cResults)
Comparable
values
extracted from a set of entries in a Map. All the extracted objects will be
treated as Comparable
values.K
- the type of the entry's keyV
- the type of the entry's valueT
- the type of the value to extract fromR
- the type of the aggregation resultsMethod
- the name of the method that returns a value in the form
of any object that implements Comparable
interfacecResults
- the maximum number of results to returnpublic static <K,V,T,R extends Comparable<? super R>> InvocableMap.StreamingAggregator<K,V,?,R[]> topN(String sMethod, Comparator<? super R> comparator, int cResults)
Comparator
.K
- the type of the entry's keyV
- the type of the entry's valueT
- the type of the value to extract fromR
- the type of the aggregation resultsMethod
- the name of the method that returns the value to be comparedcomparator
- the comparator used to compare the extracted objectcResults
- the maximum number of results to returnpublic static <K,V,T,R extends Comparable<? super R>> InvocableMap.StreamingAggregator<K,V,?,Map<K,R>> reduce(ValueExtractor<? super T,? extends R> extractor)
K
- the type of the entry's keyV
- the type of the entry's valueT
- the type of the value to extract fromR
- the type of the aggregation resultextractor
- the extractor that provides an value(s) to be returnedpublic static <K,V,R extends Comparable<? super R>> InvocableMap.StreamingAggregator<K,V,?,Map<K,R>> reduce(String sMethod)
K
- the type of the entry's keyV
- the type of the entry's valueR
- the type of the aggregation resultsMethod
- the name of the method to use to obtain the valuepublic static <K,V,P,R> InvocableMap.StreamingAggregator<K,V,P,R> script(String sLanguage, String sName, Object... aoArgs)
K
- the type of key that the
InvocableMap.StreamingAggregator
will receiveV
- the type of value that the
InvocableMap.StreamingAggregator
will receiveP
- the type of partial result this
InvocableMap.StreamingAggregator
will returnR
- the type of final result this
InvocableMap.StreamingAggregator
will returnsLanguage
- the string specifying one of the supported languagessName
- the name of the InvocableMap.StreamingAggregator
that needs to be evaluatedaoArgs
- the arguments to be passed to the
InvocableMap.StreamingAggregator
InvocableMap.StreamingAggregator
ScriptException
- if the script
cannot be loaded or
any errors occur during its executionIllegalArgumentException
- if the specified language is not supportedpublic static <K,V,P,R> InvocableMap.StreamingAggregator<K,V,P,R> script(String sLanguage, String sName, int characteristics, Object... aoArgs)
K
- the type of key that the
InvocableMap.StreamingAggregator
will receiveV
- the type of value that the
InvocableMap.StreamingAggregator
will receiveP
- the type of partial result this
InvocableMap.StreamingAggregator
will returnR
- the type of final result this
InvocableMap.StreamingAggregator
will returnsLanguage
- the string specifying one of the supported languagessName
- the name of the InvocableMap.StreamingAggregator
that needs to be evaluatedcharacteristics
- a bit mask representing the set of characteristics
of this aggregatoraoArgs
- the arguments to be passed to the
InvocableMap.StreamingAggregator
InvocableMap.StreamingAggregator
ScriptException
- if the script
cannot be loaded or
any errors occur during its executionIllegalArgumentException
- if the specified language is not supportedInvocableMap.StreamingAggregator.characteristics()