Package org.opensourcephysics.display
Class DataAdapter
java.lang.Object
org.opensourcephysics.display.DataAdapter
- All Implemented Interfaces:
Data
- Direct Known Subclasses:
DataFile
Data adapter class implements the Data interface for double[][] arrays.
- Author:
- Wolfgang Christian, Doug Brown
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionString[]
Gets column names.double[][]
Gets the double[][] array.double[][][]
Not used.Not used.Not used Data because is stored in 2D array.Color[]
Fill colors for columns are not specified.int
getID()
Gets the Data ID.Color[]
Lines colors for columns are not specified.getName()
Gets the name of the Data.void
setColumnNames
(String[] names) Sets the column names.void
setID
(int id) Sets the Data ID.void
Sets the name of the Data.
-
Field Details
-
colNames
-
name
-
data
protected double[][] data -
ID
protected int ID
-
-
Constructor Details
-
DataAdapter
public DataAdapter(double[][] array) Constructor DataAdapter- Parameters:
array
-
-
-
Method Details
-
getColumnNames
Gets column names. Client should assign colors. Implementation of Data interface.- Specified by:
getColumnNames
in interfaceData
- Returns:
- an array of names
-
setColumnNames
Sets the column names.- Parameters:
names
-
-
getName
Gets the name of the Data. -
setName
Sets the name of the Data. -
getData2D
public double[][] getData2D()Gets the double[][] array. Implementation of Data interface. -
getData3D
public double[][][] getData3D()Not used. Implementation of Data interface method. -
getDataList
Not used. Implementation of Data interface.- Specified by:
getDataList
in interfaceData
- Returns:
- a list of Data objects, or null if this object contains data
-
getDatasets
Not used Data because is stored in 2D array. Implementation of Data interface.- Specified by:
getDatasets
in interfaceData
- Returns:
- list of Datasets
-
getFillColors
Fill colors for columns are not specified. Client should assign colors. Implementation of Data interface.- Specified by:
getFillColors
in interfaceData
- Returns:
- a color
-
getLineColors
Lines colors for columns are not specified. Client should assign colors. Implementation of Data interface.- Specified by:
getLineColors
in interfaceData
- Returns:
- a color
-
getID
public int getID()Gets the Data ID. -
setID
public void setID(int id) Sets the Data ID.
-