org.n52.math
Interface Algorithms

All Superinterfaces:
java.util.Collection<Algorithm>, java.lang.Iterable<Algorithm>, java.util.List<Algorithm>
All Known Implementing Classes:
GenericAlgorithms

public interface Algorithms
extends java.util.List<Algorithm>

List of algorithms with the same signature.

Concept discussed between Jan Hendrikse, Willem Nieuwenhuis and Wim Koolhoven on 23-08-05.

Author:
Wim Koolhoven

Method Summary
 double[] calculate(double[] params)
          Calculates the results of the Algorithms for these parameters.
 Algorithm getAlgorithm(int index)
          returns the requested Algorithm
 int getNrAlgorithms()
          returns the number of Algorithms
 int getNrParams()
          returns the number of parameters.
 java.lang.String getParamDescription(int paramNr)
          may return a Description of the parameter.
 java.lang.String getParamName(int paramNr)
          returns the Name of the parameter.
 
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray
 

Method Detail

calculate

double[] calculate(double[] params)
Calculates the results of the Algorithms for these parameters. Calling the Algorithms multiple times with the same params has to be consistent

Parameters:
params - the Array has to have as many elements as specified with getNrParams()
Returns:
the result
Throws:
java.lang.RuntimeException

getNrParams

int getNrParams()
returns the number of parameters. This is the maximum of all the algorithms


getParamName

java.lang.String getParamName(int paramNr)
                              throws java.lang.IndexOutOfBoundsException
returns the Name of the parameter. All Algorithms are supposed to use the same names

Parameters:
paramNr - starts counting at 0
Returns:
the Name of parameter paramNr
Throws:
java.lang.IndexOutOfBoundsException - when paramNr is negative or larger or equal to {#getNrParams()}

getParamDescription

java.lang.String getParamDescription(int paramNr)
                                     throws java.lang.IndexOutOfBoundsException
may return a Description of the parameter. Intended to give the end user more information. All Algorithms are supposed to use the same description

Parameters:
paramNr - starts counting at 0
Returns:
the Name of parameter paramNr
Throws:
java.lang.IndexOutOfBoundsException - when paramNr is negative or larger or equal to {#getNrParams()}

getNrAlgorithms

int getNrAlgorithms()
returns the number of Algorithms


getAlgorithm

Algorithm getAlgorithm(int index)
returns the requested Algorithm

Parameters:
index -
Returns:
the Algorithm