jsystem.extensions.analyzers.tabletext
Class Table
java.lang.Object
jsystem.extensions.analyzers.tabletext.Table
- public class Table
- extends Object
Table is used to analyze tables that are recieved from cli.
The table string should be in the following format:
Header1 Header2
------- -------
key1 value1
key2 value2
Constructor Summary |
Table(String stringTable)
Create a table instance from a cli string input. |
Table
public Table(String stringTable)
throws Exception
- Create a table instance from a cli string input.
- Parameters:
stringTable
- the string to be analyze into table structure
- Throws:
Exception
getNumberOfRows
public int getNumberOfRows()
getNumberOfColumns
public int getNumberOfColumns()
getCell
public String getCell(int row,
int col)
getRow
public String[] getRow(int row)
getFirstRowIndex
public int getFirstRowIndex(String headerField,
String cellValue)
throws Exception
- Throws:
Exception
getColumn
public String[] getColumn(int col)
getAllLinesWithFields
public String[][] getAllLinesWithFields(String[] fields)
findFieldInRow
public int findFieldInRow(String fieldName,
int lineIndex)
getHeaders
public String[] getHeaders()
throws Exception
- Throws:
Exception
getHeaderFieldIndex
public int getHeaderFieldIndex(String fieldName)
throws Exception
- Throws:
Exception
toString
public String toString()