Package com.comsol.model
Interface TableBaseFeature
-
- All Superinterfaces:
ModelEntity
,PrimitiveModelEntity
,PropFeature
,ResultBaseFeature
,SelectionContainer
,SelectionEntity
- All Known Subinterfaces:
EvaluationGroupFeature
,TableFeature
public interface TableBaseFeature extends ResultBaseFeature
Base class for table features.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
clearTableData()
Remove all data in the table.java.lang.String[]
getColumnHeaders()
Get the table's column headers.double[][]
getImag()
Get the imaginary data in the table.double[]
getImagRow(int index)
Get the imaginary data in a row (0-index).int
getNRows()
Get the number of rows in the table.double[][]
getReal()
Get the real data in the table.double[]
getRealRow(int index)
Get the real data in a row (0-index).java.lang.String[]
getRowHeaders()
Get the table's row headers.java.lang.String[][]
getTableData(boolean fullPrecision)
Get the table data as a string matrix, with or without full precision.java.lang.String[]
getTableRow(int index, boolean fullPrecision)
Get the table data of one row as a string array.boolean
isComplex()
Check if the table has allocated complex data.void
removeColumn(int index)
Remove a column with a given index, if it exists.void
removeRow(int index)
Remove a row with a given index, if it exists.void
save(java.lang.String filename)
Save the table data in full precision to a text file.void
save(java.lang.String filename, boolean fullPrecision)
Save the table data to a text file.void
saveFile(java.lang.String path)
Saves to a file.void
saveFile(java.lang.String path, boolean fullPrecision, java.lang.String sheet, java.lang.String range, boolean includeHeaders, boolean overwrite)
Saves to an Excel-file in a specified range, or at a cell to start from, in a specified sheet.void
saveFile(java.lang.String path, java.lang.String sheet, java.lang.String range, boolean includeHeaders, boolean overwrite)
Saves to an Excel-file in a specified range, or at a cell to start from, in a specified sheet.void
setColumnHeaders(java.lang.String[] value)
Set the table's column headers, but leave the table's data unchanged.void
setTableData(double[][] realData)
Set the real data in the table.void
setTableData(double[][] realData, double[][] imagData)
Set the real and imaginary data in the table.-
Methods inherited from interface com.comsol.model.ModelEntity
active, author, author, comments, comments, dateCreated, dateModified, docMarker, docMarker, help, help, icon, isactive, isActive, label, label, lastModifiedBy, model, model, name, name, resetAuthor, scope, tag, tag, timeCreated, timeModified, version, version
-
Methods inherited from interface com.comsol.model.PrimitiveModelEntity
getContainer, getDisplayString, resolveModelPath
-
Methods inherited from interface com.comsol.model.PropFeature
getAllowedPropertyValues, getBoolean, getBoolean, getBoolean, getBooleanArray, getBooleanMatrix, getDouble, getDouble, getDouble, getDoubleArray, getDoubleMatrix, getEntryKeyIndex, getEntryKeys, getInt, getInt, getInt, getIntArray, getIntMatrix, getReferenceArray, getString, getString, getString, getString, getStringArray, getStringMatrix, getType, getValueType, hasProperty, hasSelection, move, move, properties, remove, remove, selection, set, set, set, set, set, set, set, set, set, set, set, set, setEntry, setEntry, setEntry, setEntry, setIndex, setIndex, setIndex, setIndex, setIndex, setIndex, setIndex, setIndex, setIndex, setIndex, setIndex, setIndex
-
Methods inherited from interface com.comsol.model.ResultBaseFeature
hasWarning, problem, problem, runCommand
-
Methods inherited from interface com.comsol.model.SelectionEntity
selection
-
-
-
-
Method Detail
-
clearTableData
void clearTableData()
Remove all data in the table.
-
getColumnHeaders
java.lang.String[] getColumnHeaders()
Get the table's column headers.- Returns:
- Vector with column headers.
-
getImag
double[][] getImag()
Get the imaginary data in the table. This method will allocate imaginary data if none. This method always uses theall
format.- Returns:
- Matrix of imaginary table data.
-
getImagRow
double[] getImagRow(int index)
Get the imaginary data in a row (0-index).- Parameters:
index
- Row index.- Returns:
- Vector of imaginary table data.
-
getNRows
int getNRows()
Get the number of rows in the table.- Returns:
- Number of rows.
-
getReal
double[][] getReal()
Get the real data in the table. This method always uses theall
format.- Returns:
- Matrix of real table data.
-
getRealRow
double[] getRealRow(int index)
Get the real data in a row (0-index).- Parameters:
index
- Row index.- Returns:
- Vector of real table data.
-
getRowHeaders
java.lang.String[] getRowHeaders()
Get the table's row headers.- Returns:
- Vector with row headers.
-
getTableData
java.lang.String[][] getTableData(boolean fullPrecision)
Get the table data as a string matrix, with or without full precision.- Parameters:
fullPrecision
-true
for full precision.- Returns:
- String matrix with data.
-
getTableRow
java.lang.String[] getTableRow(int index, boolean fullPrecision)
Get the table data of one row as a string array.- Parameters:
index
- Row index.fullPrecision
-true
for full precision.- Returns:
- String vector of table row data.
-
isComplex
boolean isComplex()
Check if the table has allocated complex data.- Returns:
true
if complex.
-
removeColumn
void removeColumn(int index)
Remove a column with a given index, if it exists.- Parameters:
index
- Column index.
-
removeRow
void removeRow(int index)
Remove a row with a given index, if it exists.- Parameters:
index
- Row index.
-
save
void save(java.lang.String filename)
Save the table data in full precision to a text file.- Parameters:
filename
- File name.
-
save
void save(java.lang.String filename, boolean fullPrecision)
Save the table data to a text file.- Parameters:
filename
- File name.fullPrecision
-true
for full precision.
-
saveFile
void saveFile(java.lang.String path)
Saves to a file.- Parameters:
path
- Path to file.
-
saveFile
void saveFile(java.lang.String path, java.lang.String sheet, java.lang.String range, boolean includeHeaders, boolean overwrite)
Saves to an Excel-file in a specified range, or at a cell to start from, in a specified sheet.- Parameters:
path
- Path to file.sheet
- The Excel-sheet to use.range
- The range, or a starting cell.includeHeaders
- True if column headers are to be written.overwrite
- True if an existing file is to be overwritten, or if an error should be cast in that instance.
-
saveFile
void saveFile(java.lang.String path, boolean fullPrecision, java.lang.String sheet, java.lang.String range, boolean includeHeaders, boolean overwrite)
Saves to an Excel-file in a specified range, or at a cell to start from, in a specified sheet.- Parameters:
path
- Path to file.fullPrecision
-true
for full precision.sheet
- The Excel-sheet to use.range
- The range, or a starting cell.includeHeaders
- True if column headers are to be written.overwrite
- True if an existing file is to be overwritten, or if an error should be cast in that instance.
-
setColumnHeaders
void setColumnHeaders(java.lang.String[] value)
Set the table's column headers, but leave the table's data unchanged.- Parameters:
value
- The column headers.
-
setTableData
void setTableData(double[][] realData)
Set the real data in the table.- Parameters:
realData
- Matrix of real table data.
-
setTableData
void setTableData(double[][] realData, double[][] imagData)
Set the real and imaginary data in the table. The latter can be null if none.- Parameters:
realData
- Matrix of real table data.imagData
- Matrix of imaginary table data.
-
-