jhplot
Class SPsheet
- java.lang.Object
-
- jhplot.SPsheet
-
public class SPsheet extends java.lang.Object
A spreadsheet to display multidimensional data.
-
-
Constructor Summary
Constructors Constructor and Description SPsheet()
Show empty spreadsheetSPsheet(CSVReader reader)
Open spreadsheet and load csv fileSPsheet(DataHolder dh)
Build a spreadsheet from multidimensional data holderSPsheet(double[] a)
Build a spreadsheet from 1D arraySPsheet(double[][] a)
Build a spreadsheet from 2D arraySPsheet(F1D f1d)
Build a spreadsheet from the F1D functionSPsheet(H1D h1d)
Build a spreadsheet from the H1D histogramSPsheet(P1D p1d)
Build a spreadsheet from the P1D containerSPsheet(PND pnd)
Build a spreadsheet from the PND containerSPsheet(PNI pnd)
Build a spreadsheet from the PND container
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description void
addColumn(double[] a)
Add a column.void
addRow()
Adds row to end of tablevoid
addRow(double[] a)
Add a row from a vector.void
doc()
Show online documentation.void
fillWithVectors(java.lang.String title, java.lang.String[] names, java.lang.Double[][] arrayList)
Fill the table from the Vectorssharptools.SharpTableModel
getTableModel()
Get table model.java.lang.Object
getValueAt(int aRow, int aColumn)
This method returns the cell object at those coordinates.void
insertRow(double[] a, int row)
Inser a row at positionvoid
setCellAt(java.lang.Object input, int aRow, int aColumn)
This fill assumes that the object passes to it is already the correct object to set the value of the cell as.void
setStringAt(java.lang.String value, int aRow, int aColumn)
Set string value at a positionvoid
setValueAt(double value, int aRow, int aColumn)
Set value of a spreadsheetvoid
setValueAt(java.lang.Object aValue, int aRow, int aColumn)
This method sets the value of the cell specified with these coordinates to aValue.
-
-
-
Constructor Detail
-
SPsheet
public SPsheet()
Show empty spreadsheet
-
SPsheet
public SPsheet(double[] a)
Build a spreadsheet from 1D array- Parameters:
a
- Input array
-
SPsheet
public SPsheet(double[][] a)
Build a spreadsheet from 2D array- Parameters:
a
- Input array
-
SPsheet
public SPsheet(P1D p1d)
Build a spreadsheet from the P1D container- Parameters:
p1d
- Input container
-
SPsheet
public SPsheet(PND pnd)
Build a spreadsheet from the PND container- Parameters:
pnd
- Input container
-
SPsheet
public SPsheet(PNI pnd)
Build a spreadsheet from the PND container- Parameters:
pni
- Input container
-
SPsheet
public SPsheet(CSVReader reader) throws java.io.IOException
Open spreadsheet and load csv file- Parameters:
reader
- CSVReader- Throws:
java.io.IOException
-
SPsheet
public SPsheet(H1D h1d)
Build a spreadsheet from the H1D histogram- Parameters:
h1d
- Input histogram
-
SPsheet
public SPsheet(F1D f1d)
Build a spreadsheet from the F1D function- Parameters:
f1d
- Input function
-
SPsheet
public SPsheet(DataHolder dh)
Build a spreadsheet from multidimensional data holder- Parameters:
dh
- Input data
-
-
Method Detail
-
addRow
public void addRow()
Adds row to end of table
-
setValueAt
public void setValueAt(java.lang.Object aValue, int aRow, int aColumn)
This method sets the value of the cell specified with these coordinates to aValue. It does the parsing of string objects to see if they are numbers or formulas. If you do not want any parsing at all, use setCellAt.- Parameters:
aValue
- value to set cell toaRow
- row coordinate of cellaColumn
- column coordinate of cell
-
setCellAt
public void setCellAt(java.lang.Object input, int aRow, int aColumn)
This fill assumes that the object passes to it is already the correct object to set the value of the cell as. For a formula, it also calculate the value of the formula and records that in the cell.- Parameters:
input
- object to set the Cell value asaRow
- row of cell to setaColumn
- column of cell to set
-
fillWithVectors
public void fillWithVectors(java.lang.String title, java.lang.String[] names, java.lang.Double[][] arrayList)
Fill the table from the Vectors- Parameters:
title
- New titlenames
- Vector with namesarrayList
- Vector with the data
-
getValueAt
public java.lang.Object getValueAt(int aRow, int aColumn)
This method returns the cell object at those coordinates. It does exactly the same thing as getCellAt except that the return type is Object. It is implemented because TableModel requires this method return an Object.- Parameters:
aRow
- the row coordinateaColumn
- the column coordinate- Returns:
- the Cell
-
setValueAt
public void setValueAt(double value, int aRow, int aColumn)
Set value of a spreadsheet- Parameters:
value
- valueaRow
- rowaColumn
- column
-
setStringAt
public void setStringAt(java.lang.String value, int aRow, int aColumn)
Set string value at a position- Parameters:
value
- stringaRow
- rowaColumn
- column
-
getTableModel
public sharptools.SharpTableModel getTableModel()
Get table model.- Returns:
-
addRow
public void addRow(double[] a)
Add a row from a vector.- Parameters:
a
- input array to be added.
-
insertRow
public void insertRow(double[] a, int row)
Inser a row at position- Parameters:
a
- array of valuesrow
- position
-
addColumn
public void addColumn(double[] a)
Add a column.- Parameters:
a
- column to added.
-
doc
public void doc()
Show online documentation.
-
-
DMelt 3.0 © DataMelt by jWork.ORG