org.n52.math.testforms
Class GenericAlgorithms

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList<Algorithm>
              extended by org.n52.math.testforms.GenericAlgorithms
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<Algorithm>, java.util.Collection<Algorithm>, java.util.List<Algorithm>, java.util.RandomAccess, AlgorithmN, AlgorithmOnList

public class GenericAlgorithms
extends java.util.ArrayList<Algorithm>
implements AlgorithmOnList

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
GenericAlgorithms()
           
 
Method Summary
 double[] calculate(double[] params)
          Calculates the results of the AlgorithmN for the values in params.
 Algorithm getAlgorithm(int index)
          returns the requested Algorithm
 int getNrAlgorithms()
           
 int getNrParams()
           
 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 class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Constructor Detail

GenericAlgorithms

public GenericAlgorithms()
Method Detail

calculate

public double[] calculate(double[] params)
Description copied from interface: AlgorithmN
Calculates the results of the AlgorithmN for the values in params.

Specified by:
calculate in interface AlgorithmN
Returns:
the result

getNrParams

public int getNrParams()
Specified by:
getNrParams in interface AlgorithmOnList
Returns:
the number of parameters. This is the maximum of all the algorithms

getParamName

public java.lang.String getParamName(int paramNr)
                              throws java.lang.IndexOutOfBoundsException
Description copied from interface: AlgorithmOnList
returns the Name of the parameter. All Algorithms are supposed to use the same names

Specified by:
getParamName in interface AlgorithmOnList
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

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

Specified by:
getParamDescription in interface AlgorithmOnList
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

public int getNrAlgorithms()
Specified by:
getNrAlgorithms in interface AlgorithmOnList
Returns:
the number of Algorithms

getAlgorithm

public Algorithm getAlgorithm(int index)
Description copied from interface: AlgorithmOnList
returns the requested Algorithm

Specified by:
getAlgorithm in interface AlgorithmOnList
Returns:
the Algorithm