org.opensha.commons.data.function
Class EvenlyDiscrFuncWithParams

java.lang.Object
  extended by org.opensha.commons.data.function.AbstractXY_DataSet
      extended by org.opensha.commons.data.function.AbstractDiscretizedFunc
          extended by org.opensha.commons.data.function.EvenlyDiscretizedFunc
              extended by org.opensha.commons.data.function.EvenlyDiscrFuncWithParams
All Implemented Interfaces:
Serializable, Iterable<Point2D>, DiscretizedFunc, FuncWithParams, XY_DataSet, Named, PlotElement, XMLSaveable

public class EvenlyDiscrFuncWithParams
extends EvenlyDiscretizedFunc
implements FuncWithParams

Title: EvenlyDiscrFuncWithParams

Description: Subclass of the EvenlyDiscretizedFunc that also includes a ParameterList of paramters associated with the function. Not much different but provides methods for dealing with the parameter list and overides such methods as toString(), equals(), etc. These extra methods are put in an interface FuncWithParamsAPI. Therefore this class implements that interface as well as the DiscretizedFuncAPI.

In the case of the IMRTesterApplet the parameters represent the input argument values that went into calculating the IMR.

Version:
1.0
Author:
Steven W. Rock
See Also:
EvenlyDiscretizedFunc, FuncWithParams, AbstractDiscretizedFunc, DiscretizedFuncAPIFunc, ParameterList, Serialized Form

Field Summary
protected  ParameterList list
          This parameter list is the set of parameters that went into calculation this DiscretizedFunction.
 
Fields inherited from class org.opensha.commons.data.function.EvenlyDiscretizedFunc
C, D, delta, first, maxX, minX, num, points
 
Fields inherited from class org.opensha.commons.data.function.AbstractDiscretizedFunc
tolerance, XML_METADATA_NAME, XML_METADATA_POINT_NAME, XML_METADATA_POINTS_NAME
 
Fields inherited from class org.opensha.commons.data.function.AbstractXY_DataSet
info, name, xAxisName, yAxisName
 
Constructor Summary
EvenlyDiscrFuncWithParams(double min, int num, double delta)
           
EvenlyDiscrFuncWithParams(double min, int num, double delta, ParameterList list)
           
 
Method Summary
 EvenlyDiscretizedFunc deepClone()
          Returns a copy of this and all points in this DiscretizedFunction.
 boolean equalParameterNames(FuncWithParams function)
          Returns true if the second function has the same named parameters in it's list, values may be different.
 boolean equalParameterNamesAndValues(FuncWithParams function)
          Returns true if two DefaultXYDiscretizedFunction2D have the same independent parameters; name and value.
 boolean equals(FuncWithParams function)
          Determines if two functions are the same with respect to the parameters that were used to calculate the function, NOT THAT EACH POINT IS THE SAME.
 String getInfo()
          Returns the info of this function.
 ParameterList getParameterList()
          This parameter list is the set of parameters that went into calculation this DiscretizedFunction.
 String getParametersString()
          Returns name/value pairs, separated with commas, as one string, usefule for legends, etc.
 void setParameterList(ParameterList list)
          Set the parameter list from an external source
 String toString()
          Returns all the parameters associated with the function as one string with no new lines, of the format:
 
Methods inherited from class org.opensha.commons.data.function.EvenlyDiscretizedFunc
add, add, areAllXValuesInteger, clear, equalXAndYValues, equalXValues, get, getAllInterpolatedX, getClosestXIndex, getClosestY, getDelta, getFirstInterpolatedX_afterXindex, getFirstInterpolatedX_inLogXLogYDomain, getFirstInterpolatedX, getIndex, getInterpolatedY_inLogXLogYDomain, getInterpolatedY_inLogYDomain, getInterpolatedY, getMaxX, getMaxY, getMetadataString, getMinX, getMinY, getNum, getPointsIterator, getX, getXIndex, getXindexForMaxY, getY, getY, hasPoint, hasPoint, set, set, set, set, set, withinTolerance
 
Methods inherited from class org.opensha.commons.data.function.AbstractDiscretizedFunc
calcSumOfY_Vals, equals, fromXMLMetadata, getTolerance, loadFuncFromSimpleFile, loadFuncFromSimpleFile, scale, setTolerance, toXMLMetadata, toXMLMetadata, writeSimpleFuncFile, writeSimpleFuncFile
 
Methods inherited from class org.opensha.commons.data.function.AbstractXY_DataSet
getClosestX, getDatasetsToPlot, getName, getPlotNumColorList, getXAxisName, getXValuesIterator, getYAxisName, getYValuesIterator, iterator, setInfo, setName, setXAxisName, setYAxisName, xValues, yValues
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.opensha.commons.data.function.XY_DataSet
getClosestX, getXAxisName, getXValuesIterator, getYAxisName, getYValuesIterator, setInfo, setName, setXAxisName, setYAxisName, xValues, yValues
 
Methods inherited from interface org.opensha.commons.gui.plot.PlotElement
getDatasetsToPlot, getPlotNumColorList
 
Methods inherited from interface org.opensha.commons.data.Named
getName
 
Methods inherited from interface java.lang.Iterable
iterator
 

Field Detail

list

protected ParameterList list
This parameter list is the set of parameters that went into calculation this DiscretizedFunction. Useful for determining if two data sets are the same, i.e. have the same x/y axis and the same set of independent parameters. Bypasses the more numerically intensive task of comparing each Point2D of two DiscretizedFunction2D.

Constructor Detail

EvenlyDiscrFuncWithParams

public EvenlyDiscrFuncWithParams(double min,
                                 int num,
                                 double delta)

EvenlyDiscrFuncWithParams

public EvenlyDiscrFuncWithParams(double min,
                                 int num,
                                 double delta,
                                 ParameterList list)
Method Detail

getParameterList

public ParameterList getParameterList()
This parameter list is the set of parameters that went into calculation this DiscretizedFunction. Useful for determining if two data sets are the same, i.e. have the same x/y axis and the same set of independent parameters. Bypasses the more numerically intensive task of comparing each Point2D of two DiscretizedFunction2D.

Specified by:
getParameterList in interface FuncWithParams

setParameterList

public void setParameterList(ParameterList list)
Set the parameter list from an external source

Specified by:
setParameterList in interface FuncWithParams

getParametersString

public String getParametersString()
Returns name/value pairs, separated with commas, as one string, usefule for legends, etc.

Specified by:
getParametersString in interface FuncWithParams

getInfo

public String getInfo()
Description copied from class: AbstractXY_DataSet
Returns the info of this function.

Specified by:
getInfo in interface XY_DataSet
Specified by:
getInfo in interface PlotElement
Overrides:
getInfo in class AbstractXY_DataSet
Returns:

equalParameterNamesAndValues

public boolean equalParameterNamesAndValues(FuncWithParams function)
Returns true if two DefaultXYDiscretizedFunction2D have the same independent parameters; name and value.

Specified by:
equalParameterNamesAndValues in interface FuncWithParams

equalParameterNames

public boolean equalParameterNames(FuncWithParams function)
Returns true if the second function has the same named parameters in it's list, values may be different.

Specified by:
equalParameterNames in interface FuncWithParams

deepClone

public EvenlyDiscretizedFunc deepClone()
Returns a copy of this and all points in this DiscretizedFunction. Also clones each parameter in the parameter list.

Specified by:
deepClone in interface DiscretizedFunc
Specified by:
deepClone in interface XY_DataSet
Overrides:
deepClone in class EvenlyDiscretizedFunc

equals

public boolean equals(FuncWithParams function)
Determines if two functions are the same with respect to the parameters that were used to calculate the function, NOT THAT EACH POINT IS THE SAME. This is used by the DiscretizedFunction2DAPIList to determine if it should add a new function to the list.


toString

public String toString()
Returns all the parameters associated with the function as one string with no new lines, of the format:

name = value, name2 = value2, etc.

Specified by:
toString in interface XY_DataSet
Overrides:
toString in class EvenlyDiscretizedFunc