Class DataAdapter

java.lang.Object
org.opensourcephysics.display.DataAdapter
All Implemented Interfaces:
Data
Direct Known Subclasses:
DataFile

public class DataAdapter extends Object implements Data
Data adapter class implements the Data interface for double[][] arrays.
Author:
Wolfgang Christian, Doug Brown
  • Field Details

    • colNames

      protected String[] colNames
    • name

      protected String name
    • data

      protected double[][] data
    • ID

      protected int ID
  • Constructor Details

    • DataAdapter

      public DataAdapter(double[][] array)
      Constructor DataAdapter
      Parameters:
      array -
  • Method Details

    • getColumnNames

      public String[] getColumnNames()
      Gets column names. Client should assign colors. Implementation of Data interface.
      Specified by:
      getColumnNames in interface Data
      Returns:
      an array of names
    • setColumnNames

      public void setColumnNames(String[] names)
      Sets the column names.
      Parameters:
      names -
    • getName

      public String getName()
      Gets the name of the Data.
      Specified by:
      getName in interface Data
      Returns:
      the name
    • setName

      public void setName(String name)
      Sets the name of the Data.
    • getData2D

      public double[][] getData2D()
      Gets the double[][] array. Implementation of Data interface.
      Specified by:
      getData2D in interface Data
      Returns:
      double[][]
    • getData3D

      public double[][][] getData3D()
      Not used. Implementation of Data interface method.
      Specified by:
      getData3D in interface Data
      Returns:
      double[][][]
    • getDataList

      public List<Data> getDataList()
      Not used. Implementation of Data interface.
      Specified by:
      getDataList in interface Data
      Returns:
      a list of Data objects, or null if this object contains data
    • getDatasets

      public ArrayList<Dataset> getDatasets()
      Not used Data because is stored in 2D array. Implementation of Data interface.
      Specified by:
      getDatasets in interface Data
      Returns:
      list of Datasets
    • getFillColors

      public Color[] getFillColors()
      Fill colors for columns are not specified. Client should assign colors. Implementation of Data interface.
      Specified by:
      getFillColors in interface Data
      Returns:
      a color
    • getLineColors

      public Color[] getLineColors()
      Lines colors for columns are not specified. Client should assign colors. Implementation of Data interface.
      Specified by:
      getLineColors in interface Data
      Returns:
      a color
    • getID

      public int getID()
      Gets the Data ID.
      Specified by:
      getID in interface Data
      Returns:
      the ID number
    • setID

      public void setID(int id)
      Sets the Data ID.
      Specified by:
      setID in interface Data
      Parameters:
      id - the ID number