com.hp.ucmdb.discovery.library.clients.agents
Class DynamicParserTable

java.lang.Object
  extended by com.hp.ucmdb.discovery.library.clients.agents.DynamicParserTable
All Implemented Interfaces:
java.io.Serializable

public class DynamicParserTable
extends java.lang.Object
implements java.io.Serializable

DynamicParserTable provides services to handle data tables.

See Also:
Serialized Form

Field Summary
static int COLUMNS_UNSPECIFIED
           
 
Constructor Summary
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.
 
Method Summary
 void addData(java.util.ArrayList<java.lang.Object> data)
           
 int appendRow()
           
 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)
           
 int getColumnCount()
           
 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()
           
 java.lang.Integer getInt(int index)
          Returns the Integer value of the specified cell.
 java.lang.String getlabel()
           
 java.lang.Long getLong(int index)
          Returns the Long value of the specified cell.
 int getRowCount()
           
 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()
           
 java.lang.String getTableName()
           
 boolean incIndex()
          Points the index to the next row.
 void removeAllRows()
           
 boolean resetIndex()
          Sets the index to point to the first row.
 void setCell(int row, int col, java.lang.Object newValue)
           
 void setdata(java.util.ArrayList<java.util.ArrayList<java.lang.Object>> data)
           
 void setIndex(int 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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COLUMNS_UNSPECIFIED

public static final int COLUMNS_UNSPECIFIED
See Also:
Constant Field Values
Constructor Detail

DynamicParserTable

public DynamicParserTable()

DynamicParserTable

public DynamicParserTable(java.lang.String name)
Creates a table with the specifed name.

Parameters:
name - The name of the table

DynamicParserTable

public DynamicParserTable(java.lang.String name,
                          int columns)
Creates a table with the specifed name and number of columns.

Parameters:
name - The name of the table
columns - The number of columns

DynamicParserTable

public DynamicParserTable(java.lang.String name,
                          int columns,
                          int rows)
Creates a table with the specifed name, number of columns, and number of rows.

Parameters:
name - The name of the table
columns - The number of columns
rows - The number of rows

DynamicParserTable

public DynamicParserTable(Element table)
Creates a table from the information in the XML.

Parameters:
table - The xml element

DynamicParserTable

public DynamicParserTable(java.lang.String name,
                          java.lang.String[][] data)
Creates a table from the information in the string array.

Parameters:
name - the table name
data - The table data
Method Detail

appendRow

public int appendRow()

getRowCount

public int getRowCount()

getColumnCount

public int getColumnCount()

getCell

public java.lang.Object getCell(int row,
                                int col)

setCell

public void setCell(int row,
                    int col,
                    java.lang.Object newValue)

getTableName

public java.lang.String getTableName()

getIndex

public int getIndex()

getlabel

public java.lang.String getlabel()

getTableData

public java.util.ArrayList getTableData()

setIndex

public void setIndex(int index)

setdata

public void setdata(java.util.ArrayList<java.util.ArrayList<java.lang.Object>> data)

addData

public void addData(java.util.ArrayList<java.lang.Object> data)

removeAllRows

public void removeAllRows()

toString

public java.lang.String toString()
Returns a String containing the data from all cells.

Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

toXml

public java.lang.String toXml()
Returns an XML String containing the data from all cells.


incIndex

public boolean incIndex()
Points the index to the next row.

Returns:
false if incrementing the index points past the end of the data

resetIndex

public boolean resetIndex()
Sets the index to point to the first row.


getString

public java.lang.String getString(int index)
                           throws java.lang.Exception
Returns the String representation of the data in the specified cell in the current row.

Parameters:
index - the column number
Throws:
java.lang.Exception

getBoolean

public java.lang.Boolean getBoolean(int index)
                             throws java.lang.Exception
Returns true if the contents of the specifed cell are the word "true" or if the contents are a boolean true. getBoolean is not case-sensitive for the string "true".

Throws:
java.lang.Exception

getInt

public java.lang.Integer getInt(int index)
                         throws java.lang.Exception
Returns the Integer value of the specified cell.

Throws:
java.lang.Exception - if the cell contents cannot be interpreted as an Integer.

getLong

public java.lang.Long getLong(int index)
                       throws java.lang.Exception
Returns the Long value of the specified cell.

Throws:
java.lang.Exception - if the cell contents cannot be interpreted as a Long.

getFloat

public java.lang.Float getFloat(int index)
                         throws java.lang.Exception
Returns the Float value of the specified cell.

Throws:
java.lang.Exception - if the cell contents cannot be interpreted as a Float.

getDouble

public java.lang.Double getDouble(int index)
                           throws java.lang.Exception
Returns the Double value of the specified cell.

Throws:
java.lang.Exception - if the cell contents cannot be interpreted as a Double.


Documentation Feedback
Copyright 2010 Hewlett-Packard Development Company, L.P.