Class DataFunction

All Implemented Interfaces:
Data, Drawable, LogMeasurable, Measurable, FunctionEditor.FObject

public class DataFunction extends Dataset implements FunctionEditor.FObject
This is a dataset whose values are determined by a multivariable function evaluated with input constants and linked datasets.
Author:
Douglas Brown
  • Constructor Details

    • DataFunction

      public DataFunction(DatasetManager input)
      Constructs a DataFunction for the specified input data.
      Parameters:
      input - the input data
    • DataFunction

      public DataFunction(DatasetManager input, String name, String expression)
      Constructs a DataFunction for the specified input data, name and expression.
      Parameters:
      input - the input data
      name -
      expression -
  • Method Details

    • setExpression

      public void setExpression(String e)
      Sets the expression.
      Parameters:
      e - the expression string
    • setExpression

      public void setExpression(String e, String[] vnames)
      Sets the expression.
      Parameters:
      e - the expression string
    • getExpression

      public String getExpression()
      Gets the expression.
      Returns:
      the expression string
    • setYColumnName

      public void setYColumnName(String name)
      Sets the y-column name (ie the function name).
      Parameters:
      name - the name
    • getInputString

      public String 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.
      Overrides:
      append in class Dataset
    • 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.
      Overrides:
      append in class 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.
      Overrides:
      append in class Dataset
    • 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.
      Overrides:
      append in class Dataset
    • clear

      public void clear()
      Description copied from class: Dataset
      Clear all data from this Dataset.
      Overrides:
      clear in class Dataset
    • getLoader

      public static XML.ObjectLoader getLoader()
      Returns the XML.ObjectLoader for this class.
      Returns:
      the object loader