public class Table extends Object
Constructor and Description |
---|
Table()
Create empty table
|
Table(org.netxms.base.NXCPMessage msg)
Create table from data in NXCP message
|
Modifier and Type | Method and Description |
---|---|
void |
addAll(Table src)
Append all records from given table to this table.
|
void |
addDataFromMessage(org.netxms.base.NXCPMessage msg)
Add data from additional messages
|
void |
addRow()
Add new row
|
void |
fillMessage(org.netxms.base.NXCPMessage msg)
Fill NXCP message with table's data
|
TableRow[] |
getAllRows()
Get all rows.
|
TableCell |
getCell(int row,
int column) |
String |
getCellValue(int row,
int column)
Get cell value at given row and column
|
int |
getColumnCount()
Get number of columns in table
|
int[] |
getColumnDataTypes()
Get display names of all columns
|
TableColumnDefinition |
getColumnDefinition(int column)
Get column definition
|
String |
getColumnDisplayName(int column)
Get column display name
|
String[] |
getColumnDisplayNames()
Get display names of all columns
|
int |
getColumnFormat(int column)
Deprecated.
|
int |
getColumnIndex(String name)
Get column index by name
|
String |
getColumnName(int column)
Get column name
|
TableColumnDefinition[] |
getColumns()
Get names of all columns
|
TableRow |
getRow(int row)
Get row.
|
int |
getRowCount()
Get number of rows in table
|
int |
getSource() |
String |
getTitle() |
boolean |
isExtendedFormat() |
void |
setCell(int row,
int col,
String value)
Set cell value
|
void |
setExtendedFormat(boolean extendedFormat) |
void |
setSource(int source) |
void |
setTitle(String title) |
String |
toString() |
public Table()
public Table(org.netxms.base.NXCPMessage msg)
msg
- NXCP messagepublic void addDataFromMessage(org.netxms.base.NXCPMessage msg)
msg
- public void fillMessage(org.netxms.base.NXCPMessage msg)
msg
- NXCP messagepublic int getColumnCount()
public int getRowCount()
public TableColumnDefinition getColumnDefinition(int column) throws IndexOutOfBoundsException
column
- Column index (zero-based)IndexOutOfBoundsException
- if column index is out of range (column < 0 || column >= getColumnCount())public String getColumnName(int column) throws IndexOutOfBoundsException
column
- Column index (zero-based)IndexOutOfBoundsException
- if column index is out of range (column < 0 || column >= getColumnCount())public String getColumnDisplayName(int column) throws IndexOutOfBoundsException
column
- Column index (zero-based)IndexOutOfBoundsException
- if column index is out of range (column < 0 || column >= getColumnCount())@Deprecated public int getColumnFormat(int column) throws IndexOutOfBoundsException
column
- Column index (zero-based)IndexOutOfBoundsException
- if column index is out of range (column < 0 || column >= getColumnCount())public int getColumnIndex(String name)
name
- Column namepublic TableColumnDefinition[] getColumns()
public String getCellValue(int row, int column) throws IndexOutOfBoundsException
row
- Row index (zero-based)column
- Column index (zero-based)IndexOutOfBoundsException
- if column index is out of range (column < 0 || column >= getColumnCount())
or row index is out of range (row < 0 || row >= getRowCount())public TableCell getCell(int row, int column) throws IndexOutOfBoundsException
row
- column
- IndexOutOfBoundsException
public TableRow getRow(int row) throws IndexOutOfBoundsException
row
- Row index (zero-based)IndexOutOfBoundsException
- if row index is out of range (row < 0 || row >= getRowCount())public TableRow[] getAllRows()
public String getTitle()
public void setTitle(String title)
title
- the title to setpublic void addAll(Table src)
src
- source tablepublic void addRow()
public void setCell(int row, int col, String value)
row
- col
- value
- public int getSource()
public void setSource(int source)
source
- the source to setpublic String[] getColumnDisplayNames()
public int[] getColumnDataTypes()
public boolean isExtendedFormat()
public void setExtendedFormat(boolean extendedFormat)
extendedFormat
- the extendedFormat to setCopyright © 2016. All rights reserved.