Package org.openjdk.jmc.common.item
Class Aggregators
- java.lang.Object
-
- org.openjdk.jmc.common.item.Aggregators
-
public class Aggregators extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Aggregators.AdvancedMaxAggregator<V,T extends java.lang.Comparable<T>>
This aggregator separates the attribute for which to do the ordering from the attribute to use for accessing the value.static class
Aggregators.AdvancedMinAggregator<V,T extends java.lang.Comparable<T>>
This aggregator separates the attribute for which to do the ordering from the attribute to use for accessing the value.private static class
Aggregators.AdvancedMinMaxAggregator<V,T extends java.lang.Comparable<T>>
This aggregator separates the attribute for which to do the ordering from the attribute to use for accessing the value.static class
Aggregators.AdvancedMinMaxConsumer<V,T extends java.lang.Comparable<T>>
This consumer separates the attribute for which to do the ordering from the attribute to use for accessing the value.static class
Aggregators.AggregatorBase<V,C extends IItemConsumer<C>>
private static class
Aggregators.AndOr
private static class
Aggregators.AndOrConsumer
static class
Aggregators.Avg
static class
Aggregators.AvgConsumer
private static class
Aggregators.Count
static class
Aggregators.CountConsumer
static class
Aggregators.FieldAggregatorBase<V,C extends IItemConsumer<C>>
private static class
Aggregators.FilterConsumer<C extends IItemConsumer<C>>
static class
Aggregators.MergingAggregator<V,C extends IItemConsumer<C>>
static class
Aggregators.MinMax<V extends java.lang.Comparable<V>>
static class
Aggregators.MinMaxConsumer<V extends java.lang.Comparable<V>>
private static class
Aggregators.QuantityConsumer<C>
private static class
Aggregators.SetAggregator<V,T>
static class
Aggregators.SetConsumer<T>
static class
Aggregators.Stddev
static class
Aggregators.Sum
private static class
Aggregators.SumConsumer
static class
Aggregators.Variance
static class
Aggregators.VarianceConsumer
Consumer for calculating stddev and variance in a one pass, numerically stable way.
-
Field Summary
Fields Modifier and Type Field Description private static Aggregators.Count
COUNT
-
Constructor Summary
Constructors Constructor Description Aggregators()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static IAggregator<java.lang.Boolean,?>
and(java.lang.String typeId, IAttribute<java.lang.Boolean> attribute)
static IAggregator<IQuantity,?>
avg(java.lang.String name, java.lang.String description, java.lang.String typeId, IAttribute<IQuantity> attribute)
static IAggregator<IQuantity,?>
avg(java.lang.String name, java.lang.String description, IAttribute<IQuantity> attribute)
static IAggregator<IQuantity,?>
avg(java.lang.String name, java.lang.String description, KindOfQuantity<?> ct, IAccessorFactory<IQuantity> af)
static IAggregator<IQuantity,?>
avg(java.lang.String typeId, IAttribute<IQuantity> attribute)
static IAggregator<IQuantity,?>
avg(IAttribute<IQuantity> attribute)
static IAggregator<IQuantity,Aggregators.CountConsumer>
count()
static IAggregator<IQuantity,Aggregators.CountConsumer>
count(java.lang.String name, java.lang.String description)
static IAggregator<IQuantity,?>
count(java.lang.String name, java.lang.String description, IItemFilter filter)
static IAggregator<IQuantity,?>
count(IItemFilter filter)
static IAggregator<IQuantity,?>
count(IType<?> type)
static <T> IAggregator<IQuantity,?>
countDistinct(java.lang.String name, java.lang.String description, IAccessorFactory<T> attribute)
static <T> IAggregator<java.util.Set<T>,?>
distinct(java.lang.String name, IAccessorFactory<T> attribute)
static <T> IAggregator<java.util.Set<T>,?>
distinct(IAttribute<T> attribute)
static IAggregator<java.lang.String,?>
distinctAsString(java.lang.String typeId, IAttribute<java.lang.String> attribute)
static IAggregator<java.lang.String,?>
distinctAsString(IAttribute<java.lang.String> attribute, java.lang.String delimiter)
static IAggregator<java.lang.String,?>
distinctAsString(IAttribute<java.lang.String> attribute, java.lang.String delimiter, java.lang.String name, java.lang.String description)
static <V,C extends IItemConsumer<C>>
IAggregator<V,?>filter(java.lang.String name, java.lang.String description, IAggregator<V,C> aggregator, IItemFilter filter)
static <V> IAggregator<V,?>
filter(IAggregator<V,?> aggregator, IItemFilter filter)
static <C extends IItemConsumer<C>>
IAggregator<C,C>forConsumer(IItemConsumerFactory<C> consumerFactory)
static <C extends IItemConsumer<C>>
IAggregator<C,C>forConsumer(IItemConsumerFactory<C> consumerFactory, IPredicate<IType<IItem>> acceptType)
(package private) static java.lang.String
getAvgName(java.lang.String name)
private static java.lang.String
getCountName(IType<?> type)
(package private) static java.lang.String
getMaxName(java.lang.String name, ContentType<?> ct)
(package private) static java.lang.String
getMinName(java.lang.String name, ContentType<?> ct)
static IAggregator<IQuantity,?>
getQuantityAggregator(java.lang.String name)
static IAggregator<IQuantity,?>
getQuantityAggregator(java.lang.String name, IAttribute<IQuantity> attribute)
static IAggregator<IQuantity,?>
getQuantityAggregator(java.lang.String name, IType<?> type)
(package private) static java.lang.String
getStddevName(java.lang.String name, boolean besselCorrection)
(package private) static java.lang.String
getSumName(java.lang.String name)
(package private) static java.lang.String
getVarianceName(java.lang.String name, boolean besselCorrection)
static <V extends java.lang.Comparable<V>>
IAggregator<IItem,?>itemWithMax(IAttribute<V> attribute)
static <V extends java.lang.Comparable<V>>
IAggregator<IItem,?>itemWithMin(IAttribute<V> attribute)
static <V extends java.lang.Comparable<V>>
IAggregator<V,?>max(java.lang.String name, java.lang.String description, java.lang.String typeId, IAttribute<V> attribute)
static <V extends java.lang.Comparable<V>>
IAggregator<V,?>max(java.lang.String name, java.lang.String description, IAttribute<V> attribute)
static IAggregator<IQuantity,?>
max(java.lang.String typeId, IAttribute<IQuantity> attribute)
static <V extends java.lang.Comparable<V>>
IAggregator<V,?>max(IAttribute<V> attribute)
static <V extends java.lang.Comparable<V>>
IAggregator<V,?>min(java.lang.String name, java.lang.String description, java.lang.String typeId, IAttribute<V> attribute)
static <V extends java.lang.Comparable<V>>
IAggregator<V,?>min(java.lang.String typeId, IAttribute<V> attribute)
static <V extends java.lang.Comparable<V>>
IAggregator<V,?>min(IAttribute<V> attribute)
private static <V extends java.lang.Comparable<V>>
IAggregator<IItem,?>minMaxItem(java.lang.String name, IAttribute<V> attribute, boolean max)
static IAggregator<java.lang.Boolean,?>
or(java.lang.String typeId, IAttribute<java.lang.Boolean> attribute)
static IAggregator<IQuantity,?>
stddev(java.lang.String name, java.lang.String description, IAttribute<IQuantity> attribute)
Calculates the sample standard deviation for a linear quantity attribute.static IAggregator<IQuantity,?>
stddev(IAttribute<IQuantity> attribute)
Calculates the sample standard deviation for a linear quantity attribute.private static IAggregator<IQuantity,?>
stddevInternal(java.lang.String name, java.lang.String description, IAttribute<IQuantity> attribute, boolean besselCorrection)
private static IAggregator<IQuantity,?>
stddevInternal(IAttribute<IQuantity> attribute, boolean besselCorrection)
static IAggregator<IQuantity,?>
stddevp(java.lang.String name, java.lang.String description, IAttribute<IQuantity> attribute)
Calculates the population standard deviation for a linear quantity attribute.static IAggregator<IQuantity,?>
stddevp(IAttribute<IQuantity> attribute)
Calculates the population standard deviation for a linear quantity attribute.static IAggregator<IQuantity,?>
sum(java.lang.String name, java.lang.String description, java.lang.String typeId, IAttribute<IQuantity> attribute)
static IAggregator<IQuantity,?>
sum(java.lang.String name, java.lang.String description, IAttribute<IQuantity> attribute)
static IAggregator<IQuantity,?>
sum(java.lang.String name, java.lang.String description, LinearKindOfQuantity ct, IAccessorFactory<IQuantity> af)
static IAggregator<IQuantity,?>
sum(java.lang.String typeId, IAttribute<IQuantity> attribute)
static IAggregator<IQuantity,?>
sum(IAttribute<IQuantity> attribute)
static <V1,V2,C extends IItemConsumer<C>>
IAggregator<V2,C>valueBuilderAggregator(IAggregator<V1,C> aggregator, IValueBuilder<V2,V1> valuebuilder, java.lang.String name, java.lang.String description)
static IAggregator<IQuantity,?>
variance(IAttribute<IQuantity> attribute)
Calculates the sample variance for a linear quantity attribute.private static IAggregator<IQuantity,?>
varianceInternal(IAttribute<IQuantity> attribute, boolean besselCorrection)
static IAggregator<IQuantity,?>
variancep(IAttribute<IQuantity> attribute)
Calculates the population variance for a linear quantity attribute.
-
-
-
Field Detail
-
COUNT
private static final Aggregators.Count COUNT
-
-
Method Detail
-
minMaxItem
private static <V extends java.lang.Comparable<V>> IAggregator<IItem,?> minMaxItem(java.lang.String name, IAttribute<V> attribute, boolean max)
-
itemWithMin
public static <V extends java.lang.Comparable<V>> IAggregator<IItem,?> itemWithMin(IAttribute<V> attribute)
-
itemWithMax
public static <V extends java.lang.Comparable<V>> IAggregator<IItem,?> itemWithMax(IAttribute<V> attribute)
-
filter
public static <V> IAggregator<V,?> filter(IAggregator<V,?> aggregator, IItemFilter filter)
-
filter
public static <V,C extends IItemConsumer<C>> IAggregator<V,?> filter(java.lang.String name, java.lang.String description, IAggregator<V,C> aggregator, IItemFilter filter)
-
sum
public static IAggregator<IQuantity,?> sum(IAttribute<IQuantity> attribute)
-
variance
public static IAggregator<IQuantity,?> variance(IAttribute<IQuantity> attribute)
Calculates the sample variance for a linear quantity attribute.- Parameters:
attribute
- the attribute to calculate the sample variance for- Returns:
- the variance for the attribute
-
variancep
public static IAggregator<IQuantity,?> variancep(IAttribute<IQuantity> attribute)
Calculates the population variance for a linear quantity attribute.- Parameters:
attribute
- the attribute to calculate the population variance for- Returns:
- the variance for the attribute
-
varianceInternal
private static IAggregator<IQuantity,?> varianceInternal(IAttribute<IQuantity> attribute, boolean besselCorrection)
-
stddev
public static IAggregator<IQuantity,?> stddev(IAttribute<IQuantity> attribute)
Calculates the sample standard deviation for a linear quantity attribute.- Parameters:
attribute
- the attribute to calculate the sample standard deviation for- Returns:
- the standard deviation for the attribute
-
stddev
public static IAggregator<IQuantity,?> stddev(java.lang.String name, java.lang.String description, IAttribute<IQuantity> attribute)
Calculates the sample standard deviation for a linear quantity attribute.- Parameters:
name
- aggregator namedescription
- aggregator descriptionattribute
- the attribute to calculate the sample standard deviation for- Returns:
- an aggregator that calculates the standard deviation for the attribute
-
stddevp
public static IAggregator<IQuantity,?> stddevp(IAttribute<IQuantity> attribute)
Calculates the population standard deviation for a linear quantity attribute.- Parameters:
attribute
- the attribute to calculate the population standard deviation for- Returns:
- an aggregator that calculates the standard deviation for the attribute
-
stddevp
public static IAggregator<IQuantity,?> stddevp(java.lang.String name, java.lang.String description, IAttribute<IQuantity> attribute)
Calculates the population standard deviation for a linear quantity attribute.- Parameters:
name
- aggregator namedescription
- aggregator descriptionattribute
- the attribute to calculate the population standard deviation for- Returns:
- an aggregator that calculates the standard deviation for the attribute
-
stddevInternal
private static IAggregator<IQuantity,?> stddevInternal(IAttribute<IQuantity> attribute, boolean besselCorrection)
-
stddevInternal
private static IAggregator<IQuantity,?> stddevInternal(java.lang.String name, java.lang.String description, IAttribute<IQuantity> attribute, boolean besselCorrection)
-
sum
public static IAggregator<IQuantity,?> sum(java.lang.String typeId, IAttribute<IQuantity> attribute)
-
sum
public static IAggregator<IQuantity,?> sum(java.lang.String name, java.lang.String description, IAttribute<IQuantity> attribute)
-
sum
public static IAggregator<IQuantity,?> sum(java.lang.String name, java.lang.String description, java.lang.String typeId, IAttribute<IQuantity> attribute)
-
sum
public static IAggregator<IQuantity,?> sum(java.lang.String name, java.lang.String description, LinearKindOfQuantity ct, IAccessorFactory<IQuantity> af)
-
avg
public static IAggregator<IQuantity,?> avg(IAttribute<IQuantity> attribute)
-
avg
public static IAggregator<IQuantity,?> avg(java.lang.String typeId, IAttribute<IQuantity> attribute)
-
avg
public static IAggregator<IQuantity,?> avg(java.lang.String name, java.lang.String description, IAttribute<IQuantity> attribute)
-
avg
public static IAggregator<IQuantity,?> avg(java.lang.String name, java.lang.String description, java.lang.String typeId, IAttribute<IQuantity> attribute)
-
avg
public static IAggregator<IQuantity,?> avg(java.lang.String name, java.lang.String description, KindOfQuantity<?> ct, IAccessorFactory<IQuantity> af)
-
min
public static <V extends java.lang.Comparable<V>> IAggregator<V,?> min(IAttribute<V> attribute)
-
min
public static <V extends java.lang.Comparable<V>> IAggregator<V,?> min(java.lang.String typeId, IAttribute<V> attribute)
-
min
public static <V extends java.lang.Comparable<V>> IAggregator<V,?> min(java.lang.String name, java.lang.String description, java.lang.String typeId, IAttribute<V> attribute)
-
max
public static <V extends java.lang.Comparable<V>> IAggregator<V,?> max(IAttribute<V> attribute)
-
max
public static IAggregator<IQuantity,?> max(java.lang.String typeId, IAttribute<IQuantity> attribute)
-
max
public static <V extends java.lang.Comparable<V>> IAggregator<V,?> max(java.lang.String name, java.lang.String description, IAttribute<V> attribute)
-
max
public static <V extends java.lang.Comparable<V>> IAggregator<V,?> max(java.lang.String name, java.lang.String description, java.lang.String typeId, IAttribute<V> attribute)
-
count
public static IAggregator<IQuantity,Aggregators.CountConsumer> count()
-
count
public static IAggregator<IQuantity,Aggregators.CountConsumer> count(java.lang.String name, java.lang.String description)
-
count
public static IAggregator<IQuantity,?> count(IType<?> type)
-
count
public static IAggregator<IQuantity,?> count(IItemFilter filter)
-
count
public static IAggregator<IQuantity,?> count(java.lang.String name, java.lang.String description, IItemFilter filter)
-
and
public static IAggregator<java.lang.Boolean,?> and(java.lang.String typeId, IAttribute<java.lang.Boolean> attribute)
-
or
public static IAggregator<java.lang.Boolean,?> or(java.lang.String typeId, IAttribute<java.lang.Boolean> attribute)
-
distinctAsString
public static IAggregator<java.lang.String,?> distinctAsString(java.lang.String typeId, IAttribute<java.lang.String> attribute)
-
distinctAsString
public static IAggregator<java.lang.String,?> distinctAsString(IAttribute<java.lang.String> attribute, java.lang.String delimiter)
-
distinctAsString
public static IAggregator<java.lang.String,?> distinctAsString(IAttribute<java.lang.String> attribute, java.lang.String delimiter, java.lang.String name, java.lang.String description)
-
valueBuilderAggregator
public static <V1,V2,C extends IItemConsumer<C>> IAggregator<V2,C> valueBuilderAggregator(IAggregator<V1,C> aggregator, IValueBuilder<V2,V1> valuebuilder, java.lang.String name, java.lang.String description)
-
countDistinct
public static <T> IAggregator<IQuantity,?> countDistinct(java.lang.String name, java.lang.String description, IAccessorFactory<T> attribute)
-
distinct
public static <T> IAggregator<java.util.Set<T>,?> distinct(IAttribute<T> attribute)
-
distinct
public static <T> IAggregator<java.util.Set<T>,?> distinct(java.lang.String name, IAccessorFactory<T> attribute)
-
forConsumer
public static <C extends IItemConsumer<C>> IAggregator<C,C> forConsumer(IItemConsumerFactory<C> consumerFactory)
-
forConsumer
public static <C extends IItemConsumer<C>> IAggregator<C,C> forConsumer(IItemConsumerFactory<C> consumerFactory, IPredicate<IType<IItem>> acceptType)
-
getCountName
private static java.lang.String getCountName(IType<?> type)
-
getSumName
static java.lang.String getSumName(java.lang.String name)
-
getVarianceName
static java.lang.String getVarianceName(java.lang.String name, boolean besselCorrection)
-
getStddevName
static java.lang.String getStddevName(java.lang.String name, boolean besselCorrection)
-
getAvgName
static java.lang.String getAvgName(java.lang.String name)
-
getMaxName
static java.lang.String getMaxName(java.lang.String name, ContentType<?> ct)
-
getMinName
static java.lang.String getMinName(java.lang.String name, ContentType<?> ct)
-
getQuantityAggregator
public static IAggregator<IQuantity,?> getQuantityAggregator(java.lang.String name, IAttribute<IQuantity> attribute)
-
getQuantityAggregator
public static IAggregator<IQuantity,?> getQuantityAggregator(java.lang.String name, IType<?> type)
-
getQuantityAggregator
public static IAggregator<IQuantity,?> getQuantityAggregator(java.lang.String name)
-
-