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

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

java.lang.Object
  extended by com.lapetus_ltd._2009.xml.types.XLptsDBStatementGroupType
      extended by com.lapetus_ltd.api.db.xml.types.TLptsDBStatementGroupType

public class TLptsDBStatementGroupType
extends XLptsDBStatementGroupType

Class Description : This class initialises XLptsDBStatementGroupType, which holds all the statements in the system.

This class has a list of XLptsDBStatementType, which is the super data class for TLptsStatement.
As such it is used by the TLptsFactoryStatement so store and control the statements in the system.
The implementing application should never need to use this as the function exist in TLptsFactoryStatement for manipulation of this class's information.

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


Field Summary
 
Fields inherited from class com.lapetus_ltd._2009.xml.types.XLptsDBStatementGroupType
id, statementListItem, title, version
 
Constructor Summary
TLptsDBStatementGroupType()
           This constructor initiates the Connection Group.
TLptsDBStatementGroupType(XLptsDBStatementGroupType statementGroupType)
           This constructor copies the statement group information from an existing XLptsDBStatementGroupType.
 
Method Summary
 void addStatementListItem(XLptsDBStatementType statementType)
           Adds the statement to the statement list.
 void clearStatementListItem()
           Clears the statement list.
 boolean equals(java.lang.Object obj)
           Check for equality with another TLptsDBConnectionGroupType object.
 java.util.List<XLptsDBStatementType> getStatementListItem()
           Returns a copy of the actual list.
 int getStatementListItemSize()
           Returns the size of the actual list.
 void removeStatementListItem(XLptsDBStatementType statementType)
           Removes the statement from the statement list.
 
Methods inherited from class com.lapetus_ltd._2009.xml.types.XLptsDBStatementGroupType
getId, getTitle, getVersion, setId, setTitle, setVersion
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TLptsDBStatementGroupType

public TLptsDBStatementGroupType()

This constructor initiates the Connection Group.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : Never.

Notes : Default Constructor set id and initialize the statement list and the connection list.

Example :


 TLptsDBConnectionGroupType connectionGroupType = new TLptsDBConnectionGroupType();

 


TLptsDBStatementGroupType

public TLptsDBStatementGroupType(XLptsDBStatementGroupType statementGroupType)

This constructor copies the statement group information from an existing XLptsDBStatementGroupType.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : Never.

Notes :

Example :


 public void example(XLptsDBConnectionGroupType statementGroupType)
 {
   TLptsDBConnectionGroupType cgt = new TLptsDBConnectionGroupType(statementGroupType);
 }

 

Parameters:
statementGroupType - the class object to copy.
Method Detail

addStatementListItem

public void addStatementListItem(XLptsDBStatementType statementType)

Adds the statement to the statement list.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : n/a

Notes : Use this to add to the list. Getting the list with getStatementListItem and then adding does not have any affect.

Example :


 TLptsDBConnectionGroupType cgt = new TLptsDBConnectionGroupType();
 TLptsStatement statement = new TLptsStatement(connection);
 cgt.addStatementListItem(statement);

 

Parameters:
statementType - the statement to add in the list.

clearStatementListItem

public void clearStatementListItem()

Clears the statement list.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : n/a

Notes : Use this to clear the list. Getting the list with getStatementListItem and then clearing does not have any affect.

Example :


 TLptsDBConnectionGroupType cgt = new TLptsDBConnectionGroupType();
 if(cgt.getStatementListItemSize() > 0)
   cgt.clearStatementListItem();

 


equals

public boolean equals(java.lang.Object obj)

Check for equality with another TLptsDBConnectionGroupType object.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : n/a

Notes :

Example :


 TLptsDBConnectionGroupType cgt1 = new TLptsDBConnectionGroupType();
 TLptsDBConnectionGroupType cgt2 = new TLptsDBConnectionGroupType();
 return cgt1.equals(cgt2);

 

Overrides:
equals in class java.lang.Object
Parameters:
obj - the connection group type
Returns:
true if they are equal, else false.

getStatementListItem

public java.util.List<XLptsDBStatementType> getStatementListItem()

Returns a copy of the actual list.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : Never. The result may be an empty list.

Notes : Do not add to this list as there is no result. Use the addStatementListItem function.

Example :


 TLptsDBConnectionGroupType cgt = new TLptsDBConnectionGroupType();
 TLptsStatement statement = new TLptsStatement(connection);
 for(XLptsDBStatementType stmt : cgt.getStatementListItem())
   if(statement.getTitle().equals(stmt.getTitle()))
     break;

 

Overrides:
getStatementListItem in class XLptsDBStatementGroupType
Returns:
Returns a list of connections of this group.

getStatementListItemSize

public int getStatementListItemSize()

Returns the size of the actual list.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : Never. The result may be an empty list.

Notes : Do not use getStatementListItem().size() as it is slow.

Example :


 TLptsDBConnectionGroupType cgt = new TLptsDBConnectionGroupType();
 if(cgt.getStatementListItemSize() > 0)
   return true;
 else
   return false;

 

Returns:
Returns the number of statements.

removeStatementListItem

public void removeStatementListItem(XLptsDBStatementType statementType)

Removes the statement from the statement list.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : n/a

Notes : Use this to remove from the list. Getting the list with getStatementListItem and then removing does not have any affect.

Example :


 TLptsDBConnectionGroupType cgt = new TLptsDBConnectionGroupType();
 String statementTitle = "statement";
 for(XLptsDBStatementType stmt : cgt.getStatementListItem())
   if(stmt.getTitle().equals(statementTitle))
   {
     cgt.removeStatementListItem(stmt);
     break;
   }

 

Parameters:
statementType - the statement to remove from list.


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