Package org.netxms.client
Class Table
java.lang.Object
org.netxms.client.Table
Generic class for holding data in tabular format. Table has named columns. All data stored as strings.
- 
Constructor SummaryConstructorsConstructorDescriptionTable()Create empty tableTable(NXCPMessage msg) Create table from data in NXCP message
- 
Method SummaryModifier and TypeMethodDescriptionvoidAppend all records from given table to this table.voidAdd data from additional messagesvoidaddRow()Add new rowvoidDelete all rows from table while retaining column structure.voidfillMessage(NXCPMessage msg) Fill NXCP message with table's dataTableRow[]Get all rows.getCell(int row, int column) Get table cellgetCellValue(int row, int column) Get cell value at given row and columnintGet number of columns in tableDataType[]Get data types of all columnsgetColumnDefinition(int column) Get column definitiongetColumnDisplayName(int column) Get column display nameString[]Get display names of all columnsintgetColumnIndex(String name) Get column index by namegetColumnName(int column) Get column nameGet names of all columnsgetFirstRows(int count) Get first N rows from table.getRow(int row) Get row.intGet number of rows in tableGet data origin (source).getTitle()booleanvoidSet cell valuevoidsetExtendedFormat(boolean extendedFormat) voidsetSource(DataOrigin source) Set data origin (source)voidvoidsort(Comparator<TableRow> comparator) Sort table rows using provided comparatortoString()
- 
Constructor Details- 
Tablepublic Table()Create empty table
- 
TableCreate table from data in NXCP message- Parameters:
- msg- NXCP message
 
 
- 
- 
Method Details- 
addDataFromMessageAdd data from additional messages- Parameters:
- msg- The NXCPMessage
 
- 
fillMessageFill NXCP message with table's data- Parameters:
- msg- NXCP message
 
- 
deleteAllRowspublic void deleteAllRows()Delete all rows from table while retaining column structure.
- 
sortSort table rows using provided comparator- Parameters:
- comparator- comparator for table rows
 
- 
getColumnCountpublic int getColumnCount()Get number of columns in table- Returns:
- Number of columns
 
- 
getRowCountpublic int getRowCount()Get number of rows in table- Returns:
- Number of rows
 
- 
getColumnDefinitionGet column definition- Parameters:
- column- Column index (zero-based)
- Returns:
- Column name
- Throws:
- IndexOutOfBoundsException- if column index is out of range (column < 0 || column >= getColumnCount())
 
- 
getColumnNameGet column name- Parameters:
- column- Column index (zero-based)
- Returns:
- Column name
- Throws:
- IndexOutOfBoundsException- if column index is out of range (column < 0 || column >= getColumnCount())
 
- 
getColumnDisplayNameGet column display name- Parameters:
- column- Column index (zero-based)
- Returns:
- Column name
- Throws:
- IndexOutOfBoundsException- if column index is out of range (column < 0 || column >= getColumnCount())
 
- 
getColumnIndexGet column index by name- Parameters:
- name- Column name
- Returns:
- 0-based column index or -1 if column with given name does not exist
 
- 
getColumnsGet names of all columns- Returns:
- array of column names
 
- 
getCellValueGet cell value at given row and column- Parameters:
- row- Row index (zero-based)
- column- Column index (zero-based)
- Returns:
- Data from given cell
- Throws:
- IndexOutOfBoundsException- if column index is out of range (column < 0 || column >= getColumnCount()) or row index is out of range (row < 0 || row >= getRowCount())
 
- 
getCellGet table cell- Parameters:
- row- row
- column- column
- Returns:
- table cell using giver row and column
- Throws:
- IndexOutOfBoundsException- throws error when there is no provided column or rows
 
- 
getRowGet row.- Parameters:
- row- Row index (zero-based)
- Returns:
- table row
- Throws:
- IndexOutOfBoundsException- if row index is out of range (row < 0 || row >= getRowCount())
 
- 
getAllRowsGet all rows.- Returns:
- Array of all rows in a table
 
- 
getTitle- Returns:
- the title
 
- 
setTitle- Parameters:
- title- the title to set
 
- 
toString
- 
addAllAppend all records from given table to this table. Source table must have same column set.- Parameters:
- src- source table
 
- 
addRowpublic void addRow()Add new row
- 
setCellSet cell value- Parameters:
- row- row
- col- column
- value- value to be set
 
- 
getSourceGet data origin (source).- Returns:
- data origin
 
- 
setSourceSet data origin (source)- Parameters:
- source- new data origin (source)
 
- 
getColumnDisplayNamesGet display names of all columns- Returns:
- String array with all column names
 
- 
getColumnDataTypesGet data types of all columns- Returns:
- int array with all column data types
 
- 
isExtendedFormatpublic boolean isExtendedFormat()- Returns:
- the extendedFormat
 
- 
setExtendedFormatpublic void setExtendedFormat(boolean extendedFormat) - Parameters:
- extendedFormat- the extendedFormat to set
 
- 
getFirstRowsGet first N rows from table. New table is backed by data from original table, so any changes to rows or column definitions will affect original table as well.- Parameters:
- count- number of rows to retrieve
- Returns:
- new table containing only requested rows
 
 
-