001 /*--------------------------------------------------------------------------+
002 $Id: IAggregator.java 28099 2010-06-09 13:17:22Z hummelb $
003 | |
004 | Copyright 2005-2010 Technische Universitaet Muenchen |
005 | |
006 | Licensed under the Apache License, Version 2.0 (the "License"); |
007 | you may not use this file except in compliance with the License. |
008 | You may obtain a copy of the License at |
009 | |
010 | http://www.apache.org/licenses/LICENSE-2.0 |
011 | |
012 | Unless required by applicable law or agreed to in writing, software |
013 | distributed under the License is distributed on an "AS IS" BASIS, |
014 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
015 | See the License for the specific language governing permissions and |
016 | limitations under the License. |
017 +--------------------------------------------------------------------------*/
018 package edu.tum.cs.commons.math;
019
020 import java.util.Collection;
021
022 /**
023 * Aggregtor interface.
024 *
025 * @author deissenb
026 * @author $Author: hummelb $
027 * @version $Rev: 28099 $
028 * @levd.rating GREEN Hash: 07B1BC375A02AAB32E730C81ACD72882
029 */
030 public interface IAggregator {
031
032 /**
033 * Aggregate collection of values to one value. Implementing classes may
034 * return non-normal numbers, e.g. {@link Double#NaN} for the median of an
035 * empty collections.
036 */
037 public double aggregate(Collection<? extends Number> values);
038
039 /**
040 * Get the neutral element of this aggregation operator. This may return
041 * non-normal numbers, e.g. {@link Double#NaN} or
042 * {@link Double#POSITIVE_INFINITY} .
043 */
044 public double getNeutralElement();
045
046 }