public class DynamicParserTable extends java.lang.Object implements IDynamicTable, java.io.Serializable
DynamicParserTable
provides services to handle data tables.Modifier and Type | Field and Description |
---|---|
static int |
COLUMNS_UNSPECIFIED |
Constructor and Description |
---|
DynamicParserTable() |
DynamicParserTable(Element table)
Creates a table from the information in the XML.
|
DynamicParserTable(java.lang.String name)
Creates a table with the specifed name.
|
DynamicParserTable(java.lang.String name,
int columns)
Creates a table with the specifed name and number of columns.
|
DynamicParserTable(java.lang.String name,
int columns,
int rows)
Creates a table with the specifed name, number of columns, and number of rows.
|
DynamicParserTable(java.lang.String name,
java.lang.String[][] data)
Creates a table from the information in the string array.
|
Modifier and Type | Method and Description |
---|---|
void |
addData(java.util.ArrayList<java.lang.Object> data)
Add to some rows to the data.
|
int |
appendRow()
Appends another row to the table.
|
java.lang.Boolean |
getBoolean(int index)
Returns true if the contents of the specifed cell are the word "true" or if the contents are a boolean true.
|
java.lang.Object |
getCell(int row,
int col)
Returns cell contents
|
int |
getColumnCount()
Gets the number of columns in the table
|
java.lang.Double |
getDouble(int index)
Returns the Double value of the specified cell.
|
java.lang.Float |
getFloat(int index)
Returns the Float value of the specified cell.
|
int |
getIndex()
Returns index of tablesData
|
java.lang.Integer |
getInt(int index)
Returns the Integer value of the specified cell.
|
java.lang.String |
getlabel()
Returns unique label that represent the row
|
java.lang.Long |
getLong(int index)
Returns the Long value of the specified cell.
|
int |
getRowCount()
Gets the number of rows in the table
|
java.lang.String |
getString(int index)
Returns the String representation of the data in the specified cell in the current row.
|
java.util.ArrayList |
getTableData()
Returns data - result of statement(table)
|
java.lang.String |
getTableName()
Gets the name of this table
|
boolean |
incIndex()
Points the index to the next row.
|
void |
removeAllRows()
Removes all therows from the table
|
boolean |
resetIndex()
Sets the index to point to the first row.
|
void |
setCell(int row,
int col,
java.lang.Object newValue)
Sets a new value for a specified cell
This function only works if the cell has the requested row number (otherwise
the row must be first added by appendRow).
|
void |
setdata(java.util.ArrayList<java.util.ArrayList<java.lang.Object>> data)
Sets the tables data
|
void |
setIndex(int index)
Set index
|
java.lang.String |
toString()
Returns a String containing the data from all cells.
|
java.lang.String |
toXml()
Returns an XML String containing the data from all cells.
|
public static final int COLUMNS_UNSPECIFIED
public DynamicParserTable()
public DynamicParserTable(java.lang.String name)
name
- The name of the tablepublic DynamicParserTable(java.lang.String name, int columns)
name
- The name of the tablecolumns
- The number of columnspublic DynamicParserTable(java.lang.String name, int columns, int rows)
name
- The name of the tablecolumns
- The number of columnsrows
- The number of rowspublic DynamicParserTable(Element table)
table
- The xml elementpublic DynamicParserTable(java.lang.String name, java.lang.String[][] data)
name
- the table namedata
- The table datapublic int appendRow()
IDynamicTable
appendRow
in interface IDynamicTable
public int getRowCount()
IDynamicTable
getRowCount
in interface IDynamicTable
public int getColumnCount()
IDynamicTable
getColumnCount
in interface IDynamicTable
public java.lang.Object getCell(int row, int col)
IDynamicTable
getCell
in interface IDynamicTable
row
- Cell's row number (0..Rows()-1)col
- Cell's column number (0..Columns()-1)public void setCell(int row, int col, java.lang.Object newValue)
IDynamicTable
setCell
in interface IDynamicTable
row
- The row number for the cellcol
- The column number for the cellnewValue
- The new value to be put in the cellpublic java.lang.String getTableName()
IDynamicTable
getTableName
in interface IDynamicTable
public int getIndex()
IDynamicTable
getIndex
in interface IDynamicTable
public java.lang.String getlabel()
IDynamicTable
getlabel
in interface IDynamicTable
public java.util.ArrayList getTableData()
IDynamicTable
getTableData
in interface IDynamicTable
public void setIndex(int index)
IDynamicTable
setIndex
in interface IDynamicTable
index
- cpublic void setdata(java.util.ArrayList<java.util.ArrayList<java.lang.Object>> data)
IDynamicTable
setdata
in interface IDynamicTable
data
- cpublic void addData(java.util.ArrayList<java.lang.Object> data)
IDynamicTable
addData
in interface IDynamicTable
data
- xpublic void removeAllRows()
IDynamicTable
removeAllRows
in interface IDynamicTable
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public java.lang.String toXml()
public boolean incIndex()
public boolean resetIndex()
public java.lang.String getString(int index) throws java.lang.Exception
index
- the column numberjava.lang.Exception
public java.lang.Boolean getBoolean(int index) throws java.lang.Exception
getBoolean
is not case-sensitive for the string "true".java.lang.Exception
public java.lang.Integer getInt(int index) throws java.lang.Exception
java.lang.Exception
- if the cell contents cannot be interpreted as an Integer.public java.lang.Long getLong(int index) throws java.lang.Exception
java.lang.Exception
- if the cell contents cannot be interpreted as a Long.public java.lang.Float getFloat(int index) throws java.lang.Exception
java.lang.Exception
- if the cell contents cannot be interpreted as a Float.public java.lang.Double getDouble(int index) throws java.lang.Exception
java.lang.Exception
- if the cell contents cannot be interpreted as a Double.Documentation Feedback
Copyright 2012 Micro Focus or one of its affiliates.