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

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

java.lang.Object
  extended by com.lapetus_ltd._2009.xml.types.XLptsDriverInterfaceType
      extended by com.lapetus_ltd.api.db.xml.types.TLptsDriverInterfaceType

public class TLptsDriverInterfaceType
extends XLptsDriverInterfaceType

Class Description : Stores the functions and parameters of a configured driver interface.

This class is the wrapper for the XLptsDriverInterfaceType.
It is used by TLptsDriverLoaderType to store the information for the functions and parameters that
make up the interface of the driver to the GUI and application.

This information is stored in the xml file called driver.loader.xml, which is loaded at startup.
The driver information is used by the connection class TLptsConnection to initiate a connection.

$LastChangedRevision: 1190 $
$LastChangedDate:: 2010-11-17 13:21:35#$


Field Summary
 
Fields inherited from class com.lapetus_ltd._2009.xml.types.XLptsDriverInterfaceType
functionName, parameterListItem, title
 
Constructor Summary
TLptsDriverInterfaceType()
           Constructs the interface type, XLptsDriverInterfaceType.
TLptsDriverInterfaceType(XLptsDriverInterfaceType driverInterfaceType)
           Copies the information from another XLptsDriverInterfaceType, including all functions and parameters.
 
Method Summary
 void addParameterListItem(XLptsFunctionParameterType functionParameterType)
           Adds the function and parameter information to the interface.
 boolean equals(java.lang.Object obj)
           Check for equal TLptsDriverInterfaceType objects.
 java.util.List<XLptsFunctionParameterType> getParameterListItem()
           Gets a copy of the function parameter list.
 int getParameterListItemSize()
           Returns the size of the actual list.
 void removeParameterListItem(XLptsFunctionParameterType functionParameterType)
           Removes the function and parameter information from the interface.
 
Methods inherited from class com.lapetus_ltd._2009.xml.types.XLptsDriverInterfaceType
getFunctionName, getTitle, setFunctionName, setTitle
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TLptsDriverInterfaceType

public TLptsDriverInterfaceType()

Constructs the interface type, XLptsDriverInterfaceType.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : Never.

Notes : Default Constructor set title and functionName as empty string, and initialize the parameter list.

Example :

 

TLptsDriverType driverItem = new TLptsDriverType();

TLptsDriverInterfaceType driverInterfaceType = new TLptsDriverInterfaceType(); driverInterfaceType.setTitle("ServerName"); driverInterfaceType.setFunctionName("setServerName");

TLptsFunctionParameterType functionParameterType = new TLptsFunctionParameterType(); functionParameterType.setName("Server Name"); functionParameterType.setType(XLptsProgramParameterType.STRING); functionParameterType.setValue("192.168.1.2"); driverInterfaceType.addParameterListItem(functionParameterType); driverItem.addInterfaceListItem(driverInterfaceType);


TLptsDriverInterfaceType

public TLptsDriverInterfaceType(XLptsDriverInterfaceType driverInterfaceType)

Copies the information from another XLptsDriverInterfaceType, including all functions and parameters.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : Never.

Notes : Use this Constructor to set TLptsDriverInterfaceType from another XLptsDriverInterfaceType"

Example :

 

TLptsDriverType driverItem = new TLptsDriverType();

TLptsDriverInterfaceType driverInterfaceType = new TLptsDriverInterfaceType(); driverInterfaceType.setTitle("ServerName"); driverInterfaceType.setFunctionName("setServerName");

TLptsFunctionParameterType functionParameterType = new TLptsFunctionParameterType(); functionParameterType.setName("Server Name"); functionParameterType.setType(XLptsProgramParameterType.STRING); functionParameterType.setValue("192.168.1.2"); driverInterfaceType.addParameterListItem(functionParameterType); driverItem.addInterfaceListItem(driverInterfaceType);

Parameters:
driverInterfaceType - The driver interface type to copy.
Method Detail

addParameterListItem

public void addParameterListItem(XLptsFunctionParameterType functionParameterType)

Adds the function and parameter information to the interface.

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 getParameterListItem and
then adding does not have any affect.

Example :

 

TLptsDriverType driverItem = new TLptsDriverType();

TLptsDriverInterfaceType driverInterfaceType = new TLptsDriverInterfaceType(); driverInterfaceType.setTitle("ServerName"); driverInterfaceType.setFunctionName("setServerName");

TLptsFunctionParameterType functionParameterType = new TLptsFunctionParameterType(); functionParameterType.setName("Server Name"); functionParameterType.setType(XLptsProgramParameterType.STRING); functionParameterType.setValue("192.168.1.2"); driverInterfaceType.addParameterListItem(functionParameterType); driverItem.addInterfaceListItem(driverInterfaceType);

Parameters:
functionParameterType - the function parameter type to add in list.

equals

public boolean equals(java.lang.Object obj)

Check for equal TLptsDriverInterfaceType objects.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : n/a

Notes : Use this to compare two TLptsDriverInterfaceType objects by title and functionName.

Example :

 

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

getParameterListItem

public java.util.List<XLptsFunctionParameterType> getParameterListItem()

Gets a copy of the function parameter list.

Thread Safe : Yes

Spawns its own Thread : No

May Return NULL : Never. Always returns a list, but it may be empty.

Notes : Do not use the result to add to this list. ie. getParameterListItem().add(xxx);
A call like that will have not affect. Use addParameterListItem instead.

Example :

 

public void setCombos(TLptsDriverInterfaceType dit) { if(dit.getParameterListItemSize()>0) for (XLptsFunctionParameterType fpt : dit.getParameterListItem()) { comboName.addItem(fpt.getName()); comboType.addItem(fpt.getType()); comboValue.addItem(fpt.getValue()); } }

public void deleteButtonActionPerformed() { if(dit.getParameterListItemSize()>0) for (XLptsFunctionParameterType fpt : dit.getParameterListItem()) { if(fpt.getName().equals(comboName.getSelecteditem().toString())) { dit.removeParameterListItem(fpt); break; } } }

Overrides:
getParameterListItem in class XLptsDriverInterfaceType

getParameterListItemSize

public int getParameterListItemSize()

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 getParameterListItem().size() as it is not efficient.

Example :

 

public void setCombos(TLptsDriverInterfaceType dit) { if(dit.getParameterListItemSize()>0) for (XLptsFunctionParameterType fpt : dit.getParameterListItem()) { comboName.addItem(fpt.getName()); comboType.addItem(fpt.getType()); comboValue.addItem(fpt.getValue()); } }

public void deleteButtonActionPerformed() { if(dit.getParameterListItemSize()>0) for (XLptsFunctionParameterType fpt : dit.getParameterListItem()) { if(fpt.getName().equals(comboName.getSelecteditem().toString())) { dit.removeParameterListItem(fpt); break; } } }

Returns:
Returns the number of connections.

removeParameterListItem

public void removeParameterListItem(XLptsFunctionParameterType functionParameterType)

Removes the function and parameter information from the interface.

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 getParameterListItem and
then removing does not have any affect.

Example :

 

public void setCombos(TLptsDriverInterfaceType dit) { if(dit.getParameterListItemSize()>0) for (XLptsFunctionParameterType fpt : dit.getParameterListItem()) { comboName.addItem(fpt.getName()); comboType.addItem(fpt.getType()); comboValue.addItem(fpt.getValue()); } }

public void deleteButtonActionPerformed() { if(dit.getParameterListItemSize()>0) for (XLptsFunctionParameterType fpt : dit.getParameterListItem()) { if(fpt.getName().equals(comboName.getSelecteditem().toString())) { dit.removeParameterListItem(fpt); break; } } }

Parameters:
functionParameterType - the function parameter type to remove from list.


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