Copyright 2009,2010, Lapetus Systems Ltd. (All rights reserved)

com.lapetus_ltd.api.db.xml.types
Class TLptsXmlRowSetTableType

java.lang.Object
  extended by com.lapetus_ltd._2009.xml.types.XLptsXmlRowSetTableType
      extended by com.lapetus_ltd.api.db.xml.types.TLptsXmlRowSetTableType

public class TLptsXmlRowSetTableType
extends XLptsXmlRowSetTableType

Class Description : This class is the wrapper for the xml row table class (XLptsXmlRowSetTableType).
It contains a table name, the column names and a list of rows.

Refer to TLptsXmlRowSetType for a full example of how to use this and the other related
classes so that all the levels of information can be populated correctly.

$LastChangedRevision: 1165 $
$LastChangedDate:: 2010-11-03 10:37:03#$


Field Summary
 
Fields inherited from class com.lapetus_ltd._2009.xml.types.XLptsXmlRowSetTableType
columnNamesListItem, name, rowListItem
 
Constructor Summary
TLptsXmlRowSetTableType()
          Default constructor for the XLptsXmlRowSetTableType object.
TLptsXmlRowSetTableType(java.lang.String tableName, java.util.List<java.lang.String> columnNames)
          Constructs a XLptsXmlRowSetTableType object from the table name and column names.
TLptsXmlRowSetTableType(XLptsXmlRowSetTableType rowSetTableType)
          
Constructor for the XLptsXmlRowSetTableType object.
 
Method Summary
 void addColumnNamesListItem(java.lang.String columnName)
          Adds a name to the column name list.
 void addRowListItem(XLptsXmlRowSetSingleRowType singleRowType)
          Adds to the row list of this table.
 void clearColumnNamesListItem()
          Clears the list of column names.
 void clearRowListItem()
          Clears (deletes) all the rows of this table.
 java.util.List<java.lang.String> getColumnNamesListItem()
          Gets the list of column names for this table.
 int getColumnNamesListItemSize()
          Gets the size of the column name list.
 java.util.List<XLptsXmlRowSetSingleRowType> getRowListItem()
          Gets the list of single rows for this table.
 int getRowListItemSize()
          Gets the size of the row list.
 void removeColumnNamesListItem(java.lang.String columnName)
          Removes an item from the column name list.
 void removeRowListItem(XLptsXmlRowSetSingleRowType singleRowType)
          .
 
Methods inherited from class com.lapetus_ltd._2009.xml.types.XLptsXmlRowSetTableType
getName, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TLptsXmlRowSetTableType

public TLptsXmlRowSetTableType()
Default constructor for the XLptsXmlRowSetTableType object.


TLptsXmlRowSetTableType

public TLptsXmlRowSetTableType(java.lang.String tableName,
                               java.util.List<java.lang.String> columnNames)
Constructs a XLptsXmlRowSetTableType object from the table name and column names.

Parameters:
tableName - The table name of the new table.
columnNames - The column names of the new table.

TLptsXmlRowSetTableType

public TLptsXmlRowSetTableType(XLptsXmlRowSetTableType rowSetTableType)

Constructor for the XLptsXmlRowSetTableType object.
Use this to copy an existing XLptsXmlRowSetTableType.

Parameters:
rowSetTableType - The table object to use for instantiating a new object.
Method Detail

addColumnNamesListItem

public void addColumnNamesListItem(java.lang.String columnName)
Adds a name to the column name list.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : N/A

Notes :

Example :


 TLptsXmlRowSetSingleRowType rowSetSingleRowType = new TLptsXmlRowSetSingleRowType();
 XLptsXmlRowSetTableType rst = new XLptsXmlRowSetTableType();
 rst.setName("MyTable");
 rst.addColumnNamesListItem("Column 1");
 rst.addColumnNamesListItem("Column 2");
 rst.addColumnNamesListItem("Column 3");
 rowSetSingleRowType.addSubTableListItem(rst);

 

Parameters:
columnName - The name to add.

addRowListItem

public void addRowListItem(XLptsXmlRowSetSingleRowType singleRowType)
Adds to the row list of this table.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : N/A

Notes :

Example :


  List objectList1 = new LinkedList();
  objectList1.add("My String for column 1 - Level 1");
  objectList1.add(123);

  List byteList1 = new LinkedList();
  byteList1.add(TLptsBytesUtil.string2Bytes("My String for column 1 - Level 1"));
  byteList1.add(TLptsBytesUtil.int2Bytes(123));

  List sqlTypeList = new LinkedList();
  sqlTypeList.add(java.sql.Types.VARCHAR);
  sqlTypeList.add(java.sql.Types.INTEGER);

  TLptsXmlRowSetSingleRowType row = new TLptsXmlRowSetSingleRowType(1,
                                                                    objectList1,
                                                                    sqlTypeList,
                                                                    byteList1 );

  addRowListItem(row);

 

Parameters:
singleRowType - The single row to add to this table.

clearColumnNamesListItem

public void clearColumnNamesListItem()
Clears the list of column names.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : N/A

Notes :

Example :


 TLptsXmlRowSetTableType table = new TLptsXmlRowSetTableType();
 table.setName("MyTable");
 table.addColumnNamesListItem("Column Oops 1");
 table.addColumnNamesListItem("Column Oops 2");
 table.addColumnNamesListItem("Column Oops 3");
 table.clearColumnNamesListItem();

 


clearRowListItem

public void clearRowListItem()
Clears (deletes) all the rows of this table.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : N/A

Notes :

Example :


  System.out.println("BOSS : How many rows are in this table?");
  System.out.println("Employee : We have " + getRowListItemSize() + " in that table boss");
  System.out.println("BOSS : What! You must be kidding me. We need cut-backs. Get rid of them!");
  System.out.println("Employee : ok boss.");
  clearRowListItem();
 
 


getColumnNamesListItem

public java.util.List<java.lang.String> getColumnNamesListItem()
Gets the list of column names for this table.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : Never, an empty list is returned in the worst case.

Notes : Do not add to or remove from this list, as there is no affect to the actual list.

Example :


 TLptsXmlRowSetSingleRowType rowSetSingleRowType = new TLptsXmlRowSetSingleRowType();
 for (XLptsXmlRowSetTableType rst : rowSetSingleRowType.getSubTableListItem())
 {
   System.out.println("Columns for child table " + rst.getName() + ": ");
   for (String column : rst.getColumnNamesListItem())
     System.out.print();
 }

 

Overrides:
getColumnNamesListItem in class XLptsXmlRowSetTableType
Returns:
A copy of the list of column names.

getColumnNamesListItemSize

public int getColumnNamesListItemSize()
Gets the size of the column name list.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : N/A

Notes :

Example :


 TLptsXmlRowSetTableType table = new TLptsXmlRowSetTableType();
 table.setName("MyTable");
 table.addColumnNamesListItem("Column 1");
 table.addColumnNamesListItem("Column 2");
 table.addColumnNamesListItem("Column 3");
 System.out.println("MyTable has " + table.getColumnNamesListItemSize() + " columns");
 
 

Returns:
The number of columns names in this table.

getRowListItem

public java.util.List<XLptsXmlRowSetSingleRowType> getRowListItem()
Gets the list of single rows for this table.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : Never, an empty list is returned in the worst case.

Notes : Do not add to or remove from this list, as there is no affect to the actual list.

Example :


 for (XLptsXmlRowSetSingleRowType rowSetSingleRowType : getRowListItem())
   for (XLptsXmlRowSetRowObjectType rsot : rowSetSingleRowType.getRowObjectListItem())
     System.out.println(rsot.getString());

 

Overrides:
getRowListItem in class XLptsXmlRowSetTableType
Returns:
The list of rows.

getRowListItemSize

public int getRowListItemSize()
Gets the size of the row list.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : N/A

Notes :

Example :


  System.out.println("We have " + getRowListItemSize() + " rows in this table");
 
 

Returns:
the size of the row list.

removeColumnNamesListItem

public void removeColumnNamesListItem(java.lang.String columnName)
Removes an item from the column name list.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : N/A

Notes :

Example :


 TLptsXmlRowSetTableType table = new TLptsXmlRowSetTableType();
 table.setName("MyTable");
 table.addColumnNamesListItem("Column 1");
 table.addColumnNamesListItem("Column 2");
 table.addColumnNamesListItem("Column Oops");
 table.addColumnNamesListItem("Column 3");

 table.removeColumnNamesListItem("Column Oops");

 

Parameters:
columnName - The column name to be removed.

removeRowListItem

public void removeRowListItem(XLptsXmlRowSetSingleRowType singleRowType)
.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : N/A

Notes :

Example :


  for (XLptsXmlRowSetSingleRowType singleRowType : getRowListItem())
    if (singleRowType.getRowNumber()==5)
      removeRowListItem(singleRowType); // this is not necessarily the 5th row

 

Parameters:
singleRowType - The row to remove from the list.


Copyright 2009,2010, Lapetus Systems Ltd. (All rights reserved)