org.opensha.sra.riskmaps.func
Interface FunctionAPI

All Known Implementing Classes:
DiscreteFunction, DiscreteInterpExterpFunc

public interface FunctionAPI

This API defines the basic structure of a function. A function is a mapping of values from a domain to a range where each value in the domain maps to at most one value in the range. Due to double floating point precision errors, all comparisons should be done within a reasonable tolerance for the scope of the implementing function.

 -=* CHNAGE LOG *=-
 06/19/2008 -- EMM: Original implementation.

Version:
0.0.1
Author:
Eric Martinez

Method Summary
 SetAPI getDomain()
          Gets the domain of this function.
 String getName()
          Gets the name of this function.
 SetAPI getRange()
          Gets the range of this function.
 double valueOf(double x)
          Gets the value of the function at the point x.
 

Method Detail

getName

String getName()
Gets the name of this function. All functions can be named, but do not need to be so. If the name of the function is not specified, implementations of this function should return a default string. The return value should never be null.

Returns:
The name of this function.

getDomain

SetAPI getDomain()
Gets the domain of this function. The domain of a function is the set of values that map into the range of the function. This domain may be discrete or continuous.

Returns:
The domain of the function.

getRange

SetAPI getRange()
Gets the range of this function. The range of a function is the set of values that can be reached by providing a value in the functions range.

Returns:
The range of the function.

valueOf

double valueOf(double x)
               throws IllegalArgumentException
Gets the value of the function at the point x. If the given x value is not in the domain for the function, then an IllegalArgumentException is thrown.

Parameters:
x - The input value of the function.
Returns:
The output (y-value) of the function.
Throws:
IllegalArgumentException - If the given input x value is not in the domain of the function.