|
||||||||||
| 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.DefaultXY_DataSet
public class DefaultXY_DataSet
Container for a data set of (X,Y) values. Internally, value pairs are stored
as Point2Ds.
| Field Summary |
|---|
| Fields inherited from class org.opensha.commons.data.function.AbstractXY_DataSet |
|---|
info, name, xAxisName, yAxisName |
| Fields inherited from interface org.opensha.commons.metadata.XMLSaveable |
|---|
XML_METADATA_NAME |
| Constructor Summary | |
|---|---|
DefaultXY_DataSet()
Initializes a new, empty data set. |
|
DefaultXY_DataSet(double[] x,
double[] y)
Initializes a new data set with the supplied arrays of x and y data |
|
DefaultXY_DataSet(List<Double> x,
List<Double> y)
Initializes a new data set with the supplied Lists of x and
y data |
|
| Method Summary | |
|---|---|
XY_DataSet |
deepClone()
This function returns a new copy of this list, including copies of all the points. |
boolean |
equals(Object obj)
|
Point2D |
get(int index)
Returns the nth (x,y) point in the Function by index, or null if no such point exists |
double |
getMaxX()
return the maximum x value along the x-axis |
double |
getMaxY()
return the maximum y value along the y-axis |
String |
getMetadataString()
prints out the state of the list, such as number of points, the value of each point, etc. |
double |
getMinX()
return the minimum x value along the x-axis. |
double |
getMinY()
return the minimum y value along the y-axis |
int |
getNum()
returns the number of points in this function list |
double |
getX(int index)
Returns the x-value given an index |
double |
getY(int index)
Returns the y-value given an index |
boolean |
hasPoint(double x,
double y)
Determine wheither a point exists in the list, as determined by it's x-value within tolerance. |
boolean |
hasPoint(Point2D point)
Determine wheither a point exists in the list, as determined by it's x-value within tolerance. |
void |
set(double x,
double y)
Creates a new DataPoint, then either adds it if it doesn't exist, or replaces an existing one, within tolerance |
void |
set(int index,
double y)
Replaces a DataPoint y-value at the specifed index. |
void |
set(Point2D point)
Either adds a new DataPoint, or replaces an existing one, within tolerance |
String |
toString()
Standard java function, usually used for debugging, prints out the state of the list, such as number of points, the value of each point, etc. |
Element |
toXMLMetadata(Element root)
|
Element |
toXMLMetadata(Element root,
String elName)
|
| Methods inherited from class org.opensha.commons.data.function.AbstractXY_DataSet |
|---|
areAllXValuesInteger, getClosestX, getClosestY, getDatasetsToPlot, getInfo, 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 |
| Constructor Detail |
|---|
public DefaultXY_DataSet()
public DefaultXY_DataSet(List<Double> x,
List<Double> y)
Lists of x and
y data
x - valuesy - values
NullPointerException - if either data list is null
IllegalArgumentException - if either data list is empty
public DefaultXY_DataSet(double[] x,
double[] y)
x - valuesy - values| Method Detail |
|---|
public XY_DataSet deepClone()
XY_DataSetSince this is a clone, you can modify it without changing the original.
public boolean equals(Object obj)
equals in class Objectpublic Point2D get(int index)
XY_DataSet
public double getMaxX()
XY_DataSet
public double getMaxY()
XY_DataSet
public double getMinX()
XY_DataSet
public double getMinY()
XY_DataSet
public int getNum()
XY_DataSet
public double getX(int index)
XY_DataSet
public double getY(int index)
XY_DataSet
public boolean hasPoint(Point2D point)
XY_DataSet
public boolean hasPoint(double x,
double y)
XY_DataSet
public void set(Point2D point)
throws Point2DException
XY_DataSet
Point2DException
public void set(double x,
double y)
throws Point2DException
XY_DataSet
Point2DException
public void set(int index,
double y)
XY_DataSet
public Element toXMLMetadata(Element root)
public Element toXMLMetadata(Element root,
String elName)
public String toString()
toString in interface XY_DataSettoString in class Objectpublic String getMetadataString()
XY_DataSet
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||