public class EnhancementFunctionFactory
extends java.lang.Object
EnhancementFunctionFactory
creates enhancement
functions using a simple set of specifications. This is useful
when receiving input from the user or a file, and the input must be
used to create a function.Constructor and Description |
---|
EnhancementFunctionFactory() |
Modifier and Type | Method and Description |
---|---|
static EnhancementFunction |
convert(EnhancementFunction source,
java.lang.String functionType)
Converts an enhancement function to a new function type.
|
static EnhancementFunction |
create(java.lang.String functionType,
double[] range)
Creates a new enhancement function based on a set of
specifications.
|
public static EnhancementFunction create(java.lang.String functionType, double[] range)
functionType
- the type of function desired. Supported
function types are 'linear', 'log', and 'stepN' where N is the
number of steps in the function, for example 'step10'. Each type
may be extended with '-reverse' to indicate a reversal of the
range, ie: equivalent to calling EnhancementFunction.setReverse(boolean)
after creation.range
- the function range as [min, max].java.lang.IllegalArgumentException
- if the function type is not supported.public static EnhancementFunction convert(EnhancementFunction source, java.lang.String functionType)
source
- the source function to be converted.functionType
- the new function type to convert to, either 'linear',
'log', or 'stepN' where N is the step count.java.lang.IllegalArgumentException
- if the function type is not supported.create(java.lang.String, double[])