Package org.opensourcephysics.display
Class DataFunction
java.lang.Object
org.opensourcephysics.display.DataTable.DataModel
org.opensourcephysics.display.Dataset
org.opensourcephysics.display.DataFunction
- All Implemented Interfaces:
Data
,Drawable
,LogMeasurable
,Measurable
,FunctionEditor.FObject
This is a dataset whose values are determined by a multivariable function
evaluated with input constants and linked datasets.
- Author:
- Douglas Brown
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
A class to save and load DataFunction data in an XMLControl.Nested classes/interfaces inherited from class org.opensourcephysics.display.Dataset
Dataset.Model
-
Field Summary
Fields inherited from class org.opensourcephysics.display.Dataset
AREA, BAR, CIRCLE, columnID, CUSTOM, customMarker, datasetID, errorBars, generalPath, id, index, maxPoints, maxPointsMultiplier, model, NO_MARKER, PIXEL, POST, shift, sorted, SQUARE, update, visible, xColumnDescription, xmax, xmaxLogscale, xmin, xminLogscale, xpoints, yColumnDescription, ymax, ymaxLogscale, ymin, yminLogscale, ypoints
-
Constructor Summary
ConstructorsConstructorDescriptionDataFunction
(DatasetManager input) Constructs a DataFunction for the specified input data.DataFunction
(DatasetManager input, String name, String expression) Constructs a DataFunction for the specified input data, name and expression. -
Method Summary
Modifier and TypeMethodDescriptionvoid
append
(double[] x, double[] y) Appends (x,y) arrays to the Dataset.void
append
(double[] x, double[] y, double[] dx, double[] dy) Appends arrays of data points and uncertainties to the Dataset.void
append
(double x, double y) Overrides Dataset methods.void
append
(double x, double y, double dx, double dy) Appends a data point and its uncertainty to the Dataset.void
clear()
Clear all data from this Dataset.Gets the expression.Gets the current input string.static XML.ObjectLoader
Returns the XML.ObjectLoader for this class.void
Refreshes the data points.void
Sets the expression.void
setExpression
(String e, String[] vnames) Sets the expression.void
setYColumnName
(String name) Sets the y-column name (ie the function name).Methods inherited from class org.opensourcephysics.display.Dataset
append, convertTableColumnIndex, countColumnsVisible, draw, drawable, drawClip, drawData, drawScatterPlot, findDataSet, getColumnCount, getColumnID, getColumnName, getColumnNames, getData2D, getData3D, getDataList, getDatasets, getEdgeColor, getFillColor, getFillColors, getID, getIndex, getLineColor, getLineColors, getMarkerShape, getMarkerSize, getMean, getName, getNaNCount, getPoints, getRowCount, getShift, getTranslateInstance, getValidXPoints, getValidYPoints, getValueAt, getVisible, getX, getXColumnDescription, getXColumnName, getXMax, getXMaxLogscale, getXMin, getXMinLogscale, getXPoints, getXPointsRaw, getY, getYColumnDescription, getYColumnName, getYMax, getYMaxLogscale, getYMin, getYMinLogscale, getYPoints, getYPointsRaw, getYShifted, insertionSort, isConnected, isMeasured, isShifted, isSorted, isXColumnVisible, isYColumnVisible, loadDatasets, read, recalculatePath, set, setColumnID, setConnected, setCustomMarker, setID, setLineColor, setMarkerColor, setMarkerColor, setMarkerColor, setMarkerShape, setMarkerSize, setMaximumPoints, setName, setShift, setShifted, setShiftedValue, setSorted, setStride, setVisible, setXColumnDescription, setXColumnVisible, setXYColumnNames, setXYColumnNames, setYColumnDescription, setYColumnVisible, toBoolArray, toString, write
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.opensourcephysics.display.Drawable
isInteractive
-
Constructor Details
-
DataFunction
Constructs a DataFunction for the specified input data.- Parameters:
input
- the input data
-
DataFunction
Constructs a DataFunction for the specified input data, name and expression.- Parameters:
input
- the input dataname
-expression
-
-
-
Method Details
-
setExpression
Sets the expression.- Parameters:
e
- the expression string
-
setExpression
Sets the expression.- Parameters:
e
- the expression string
-
getExpression
Gets the expression.- Returns:
- the expression string
-
setYColumnName
Sets the y-column name (ie the function name).- Parameters:
name
- the name
-
getInputString
Gets the current input string. If the last attempt to set the function was unsuccessful, this is different from the function string.- Returns:
- the input string
-
refreshFunctionData
public void refreshFunctionData()Refreshes the data points. -
append
public void append(double x, double y) Overrides Dataset methods. DataFunction manages its own data. -
append
public void append(double x, double y, double dx, double dy) Description copied from class:Dataset
Appends a data point and its uncertainty to the Dataset. -
append
public void append(double[] x, double[] y) Description copied from class:Dataset
Appends (x,y) arrays to the Dataset. Any y value of Double.NaN is treated as null in plots and tables. -
append
public void append(double[] x, double[] y, double[] dx, double[] dy) Description copied from class:Dataset
Appends arrays of data points and uncertainties to the Dataset. -
clear
public void clear()Description copied from class:Dataset
Clear all data from this Dataset. -
getLoader
Returns the XML.ObjectLoader for this class.- Returns:
- the object loader
-