|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.opensha.commons.data.function.AbstractXY_DataSet
org.opensha.commons.data.function.AbstractDiscretizedFunc
public abstract class AbstractDiscretizedFunc
Title: DiscretizedFunc
Description: Abstract implementation of the DiscretizedFuncAPI. Performs standard simple or default functions so that subclasses don't have to keep reimplementing the same function bodies.
A Discretized Function is a collection of x and y values grouped together as the points that describe a function. A discretized form of a function is the only ways computers can represent functions. Instead of having y=x^2, you would have a sample of possible x and y values.
The basic functions this abstract class implements are:
| Field Summary | |
|---|---|
protected static String |
C
Class name used for debbuging |
protected static boolean |
D
if true print out debugging statements |
protected double |
tolerance
The tolerance allowed in specifying a x-value near a real x-value, so that the real x-value is used. |
static String |
XML_METADATA_NAME
|
static String |
XML_METADATA_POINT_NAME
|
static String |
XML_METADATA_POINTS_NAME
|
| Fields inherited from class org.opensha.commons.data.function.AbstractXY_DataSet |
|---|
info, name, xAxisName, yAxisName |
| Constructor Summary | |
|---|---|
AbstractDiscretizedFunc()
|
|
| Method Summary | |
|---|---|
double |
calcSumOfY_Vals()
|
boolean |
equals(Object obj)
Default equals for all Discretized Functions. |
static AbstractDiscretizedFunc |
fromXMLMetadata(Element funcElem)
|
double |
getTolerance()
Returns the tolerance of this function. |
static ArbitrarilyDiscretizedFunc |
loadFuncFromSimpleFile(InputStream is)
|
static ArbitrarilyDiscretizedFunc |
loadFuncFromSimpleFile(String fileName)
|
void |
scale(double val)
Scales (multiplies) the y-values of this function by the esupplied value. |
void |
setTolerance(double newTolerance)
Sets the tolerance of this function. |
Element |
toXMLMetadata(Element root)
|
Element |
toXMLMetadata(Element root,
String elementName)
|
static void |
writeSimpleFuncFile(DiscretizedFunc func,
File outFile)
|
static void |
writeSimpleFuncFile(DiscretizedFunc func,
String fileName)
|
| Methods inherited from class org.opensha.commons.data.function.AbstractXY_DataSet |
|---|
areAllXValuesInteger, getClosestX, getClosestY, getInfo, getName, getXAxisName, getXValuesIterator, getYAxisName, getYValuesIterator, iterator, setInfo, setName, setXAxisName, setYAxisName, xValues, yValues |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.opensha.commons.data.function.DiscretizedFunc |
|---|
deepClone, getFirstInterpolatedX_inLogXLogYDomain, getFirstInterpolatedX, getIndex, getInterpolatedY_inLogXLogYDomain, getInterpolatedY_inLogYDomain, getInterpolatedY, getXIndex, getY |
| Methods inherited from interface org.opensha.commons.data.function.XY_DataSet |
|---|
areAllXValuesInteger, get, getClosestX, getClosestY, getInfo, getMaxX, getMaxY, getMetadataString, getMinX, getMinY, getNum, getX, getXAxisName, getXValuesIterator, getY, getYAxisName, getYValuesIterator, hasPoint, hasPoint, set, set, set, setInfo, setName, setXAxisName, setYAxisName, toString, xValues, yValues |
| Methods inherited from interface org.opensha.commons.data.Named |
|---|
getName |
| Methods inherited from interface java.lang.Iterable |
|---|
iterator |
| Field Detail |
|---|
protected static final String C
protected static final boolean D
public static final String XML_METADATA_NAME
public static final String XML_METADATA_POINTS_NAME
public static final String XML_METADATA_POINT_NAME
protected double tolerance
| Constructor Detail |
|---|
public AbstractDiscretizedFunc()
| Method Detail |
|---|
public double getTolerance()
getTolerance in interface DiscretizedFunc
public void setTolerance(double newTolerance)
throws InvalidRangeException
setTolerance in interface DiscretizedFuncInvalidRangeExceptionpublic boolean equals(Object obj)
equals in class Objectpublic Element toXMLMetadata(Element root)
toXMLMetadata in interface XMLSaveable
public Element toXMLMetadata(Element root,
String elementName)
public static AbstractDiscretizedFunc fromXMLMetadata(Element funcElem)
public static void writeSimpleFuncFile(DiscretizedFunc func,
String fileName)
throws IOException
IOException
public static void writeSimpleFuncFile(DiscretizedFunc func,
File outFile)
throws IOException
IOException
public static ArbitrarilyDiscretizedFunc loadFuncFromSimpleFile(String fileName)
throws FileNotFoundException,
IOException
FileNotFoundException
IOException
public static ArbitrarilyDiscretizedFunc loadFuncFromSimpleFile(InputStream is)
throws FileNotFoundException,
IOException
FileNotFoundException
IOExceptionpublic double calcSumOfY_Vals()
public void scale(double val)
DiscretizedFunc
scale in interface DiscretizedFunc
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||