001/*-------------------------------------------------------------------------+ 002| | 003| Copyright 2005-2011 The ConQAT Project | 004| | 005| Licensed under the Apache License, Version 2.0 (the "License"); | 006| you may not use this file except in compliance with the License. | 007| You may obtain a copy of the License at | 008| | 009| http://www.apache.org/licenses/LICENSE-2.0 | 010| | 011| Unless required by applicable law or agreed to in writing, software | 012| distributed under the License is distributed on an "AS IS" BASIS, | 013| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 014| See the License for the specific language governing permissions and | 015| limitations under the License. | 016+-------------------------------------------------------------------------*/ 017package org.conqat.lib.commons.math; 018 019/** 020 * Enumeration for different aggregation strategies. 021 */ 022public enum EAggregationStrategy { 023 /** Sum aggregation, see {@link SumAggregator}. */ 024 SUM(new SumAggregator()), 025 026 /** Maximum aggregation, see {@link MaxAggregator}. */ 027 MAX(new MaxAggregator()), 028 029 /** Minimum aggregation, see {@link MinAggregator}. */ 030 MIN(new MinAggregator()), 031 032 /** Mean aggregation, see {@link MeanAggregator}. */ 033 MEAN(new MeanAggregator()), 034 035 /** Median aggregation, see {@link PercentileAggregator}. */ 036 MEDIAN(new PercentileAggregator(50)), 037 038 /** Percentile-25 aggregation, see {@link PercentileAggregator}. */ 039 PERCENTILE25(new PercentileAggregator(25)), 040 041 /** Percentile-75 aggregation, see {@link PercentileAggregator}. */ 042 PERCENTILE75(new PercentileAggregator(75)), 043 044 /** Population variance */ 045 POPULATION_VARIANCE(new VarianceAggregator(false)), 046 047 /** Sample variance */ 048 SAMPLE_VARIANCE(new VarianceAggregator(true)), 049 050 /** Population standard deviation */ 051 POPULATION_STD_DEV(new StdDevAggregator(false)), 052 053 /** Sample standard deviation */ 054 SAMPLE_STD_DEV(new StdDevAggregator(true)); 055 056 /** The aggregator used for this strategy. */ 057 private final IAggregator aggregator; 058 059 /** Create strategy. */ 060 private EAggregationStrategy(IAggregator aggregator) { 061 this.aggregator = aggregator; 062 } 063 064 /** Get aggregator. */ 065 public IAggregator getAggregator() { 066 return aggregator; 067 } 068}