edu.wpi.cs.DSRG.xmldb.DTDMObjects
Class DTDM_NestingWrapper

java.lang.Object
  |
  +--edu.wpi.cs.DSRG.xmldb.DTDMObjects.DTDM_NestingWrapper

public class DTDM_NestingWrapper
extends java.lang.Object

DTDM_NestingWrapper.java representing object - Nesting in ALL_DTDS_DTDM_NESTING table. API: DTDM_NestingWrapper(JDBCClient, String, String, int, int) - Get all member variables setting based on given parent_name, child_name, position, Current DTD Id, and statement of opened connection. DTDM_NestingWrapper(JDBCClient, int, int) - Get all member variables setting based on given Nesting_ID, Current DTD Id, and statement of opened connection. For Example:

	Statement stmt = this.Conn.createStatement();
	DTDM_NestingWrapper nesting = new DTDM_NestingWrapper(client, "person", "email", 1, 71);
 
	Statement stmt = this.Conn.createStatement();
	DTDM_NestingWrapper nesting = new DTDM_NestingWrapper(client, 28, 71);
 
* member variables: CurrDTDMId - Id of the current DTD miNestingID - ID of current Nesting miNestingPositon - Position of current Nesting msNestingMultiple - "true" means parent of current Nesting may have multiple children; "false" means parent of current Nesting must have no more than 1 child. msNestingOptional - "true" means parent may have no children; "false" means parent must have children. Parent_Node - Object - Item contains all the information of parent of nesting. Child_Node - Object - Item contains all the imformation of child of nesting. member functions: Load() - load the member variables based on given parent name, child name and position. Insert() - Insert current Nesting into DTDM_NestingWrapper Table. Delete() - Delete current Nesting from DTDM_NestingWrapper Table. Update() - Update current Nesting in DTDM_NestingWrapper Table based on member variables setting. Get_sibling_Nestings_In_Range(int)- get vector that contains all the sibling Nestings in range of (from_pos, to_pos) Get_sibling_Items_In_Range(int) - get vector that contains all the silbing Items in range of (from_pos, to_pos) Reposition_Related_Nesting_In_Range(int) - all the sibling Nestins in range(from_position, to_position) will be repositioned based on the given factor - Increase("+") or Decrease("-") SetNestingID(int) - set member variable miNestingID. SetNestingPosition(int) - set member variable miNestingPositon. SetNestingMultiple(String) - set member variable msNestingMultiple. SetNestingOptional(String) - set member variable msNestingOptional. SetNestingParentNode(DTDM_ItemWrapper) - set object - Item - parent of Nesting SetNestingChildNode(DTDM_ItemWrapper) - set object - Item - child of Nesting GetNestingID() - get value of member variable miNestingID. GetNestingPosition() - get value of member variable miNestingPosition. GetNestingMultiple() - get value of member variable msNestingMultiple. GetNestingOptional() - get value of member variable msNestingOptional. GetParentNode() - get object - Item - parent of Nesting GetChildNode() - get object - Item - chiild of Nesting Reset() - reset all the member variables of object - Nesting.


Field Summary
(package private)  DTDM_ItemWrapper Child_Node
           
(package private)  JDBCClient client
          Global Statement of opened connection
(package private)  java.lang.String CurrDTDMId
          Initialize the class
(package private)  int miNestingID
           
(package private)  int miNestingPosition
           
(package private)  java.lang.String msNestingMultiple
           
(package private)  java.lang.String msNestingOptional
           
(package private)  DTDM_ItemWrapper Parent_Node
           
 
Constructor Summary
DTDM_NestingWrapper(JDBCClient client, int Nesting_ID, java.lang.String currDTDM_ID)
          API 2 - Get all member variables setting based on given Nesting_ID and the statement of opened connection.
DTDM_NestingWrapper(JDBCClient client, java.lang.String Nesting_Parent, java.lang.String Nesting_Child, int Nesting_Position, java.lang.String currDTDM_ID)
          API 1 - Get all member variables setting based on given Nesting_Parent_Name, Nesting_Child_Name position and statement of opened connection.
 
Method Summary
 boolean Delete()
          Delete current Nesting from ALL_DTDS_DTDM_NESTING Table.
 java.util.Vector Get_sibling_Items_In_Range(int ToPosition)
          return vector that contains all the objects - Items that are siblings of child of the current Nesting.
 java.util.Vector Get_sibling_Nestings_In_Range(int ToPosition)
          return vector that contains all the objects - Nestings that are siblings of the current Nesting
 DTDM_ItemWrapper GetChildNode()
          return object - Item that contains all the information of child of Nesting
 java.lang.String GetDTD_ID()
          return ID of current DTD_ID
 int GetNestingID()
          return ID of current Nesting
 java.lang.String GetNestingMultiple()
          return Quantifier(Multiple) of current Nesting
 java.lang.String GetNestingOptional()
          return Quantifier(Optional) of current Nesting
 int GetNestingPosition()
          return Position of current Nesting
 DTDM_ItemWrapper GetParentNode()
          return object - Item that contains all the information of parent of Nesting
 boolean Insert()
          Insert current Nesting into ALL_DTDS_DTDM_NESTING Table.
 boolean Load()
          load member variable of miNestingID, msNestingMultiple, msNestingOptional based on given Nesting_Parent_Name, Nesting_Child_Name and Position.
 boolean Reposition_Related_Nesting_In_Range(int to_position, java.lang.String sfactor)
          return boolean to show repositon successfully or not.
 void Reset()
          reset all member variables of object - Nesting
 void SetNestingChildNode(DTDM_ItemWrapper NewChildNode)
          set member variable - msNestingParentNode
 void SetNestingID(int iNewNestingID)
          set member variable - miNesting
 void SetNestingMultiple(java.lang.String sNewNestingMultiple)
          set member variable - msNestingMultiple
 void SetNestingOptional(java.lang.String sNewNestingOptional)
          set member variable - msNestingOptional
 void SetNestingParentNode(DTDM_ItemWrapper NewParentNode)
          set member variable - msNestingParentNode
 void SetNestingPosition(int iNewNestingPosition)
          set memeber variable - miNestingPositon
 boolean Shift_Siblings_Left(int start_position)
           
 boolean Shift_Siblings_Right(int start_position)
           
 boolean Update()
          Update current Nesting in ALL_DTDS_DTDM_NESTING Table
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

CurrDTDMId

java.lang.String CurrDTDMId
Initialize the class

miNestingID

int miNestingID

miNestingPosition

int miNestingPosition

msNestingMultiple

java.lang.String msNestingMultiple

msNestingOptional

java.lang.String msNestingOptional

Parent_Node

DTDM_ItemWrapper Parent_Node

Child_Node

DTDM_ItemWrapper Child_Node

client

JDBCClient client
Global Statement of opened connection
Constructor Detail

DTDM_NestingWrapper

public DTDM_NestingWrapper(JDBCClient client,
                           java.lang.String Nesting_Parent,
                           java.lang.String Nesting_Child,
                           int Nesting_Position,
                           java.lang.String currDTDM_ID)
API 1 - Get all member variables setting based on given Nesting_Parent_Name, Nesting_Child_Name position and statement of opened connection.

DTDM_NestingWrapper

public DTDM_NestingWrapper(JDBCClient client,
                           int Nesting_ID,
                           java.lang.String currDTDM_ID)
API 2 - Get all member variables setting based on given Nesting_ID and the statement of opened connection.
Method Detail

Load

public boolean Load()
load member variable of miNestingID, msNestingMultiple, msNestingOptional based on given Nesting_Parent_Name, Nesting_Child_Name and Position.

Insert

public boolean Insert()
Insert current Nesting into ALL_DTDS_DTDM_NESTING Table.

Delete

public boolean Delete()
Delete current Nesting from ALL_DTDS_DTDM_NESTING Table.

Update

public boolean Update()
Update current Nesting in ALL_DTDS_DTDM_NESTING Table

Get_sibling_Nestings_In_Range

public java.util.Vector Get_sibling_Nestings_In_Range(int ToPosition)
return vector that contains all the objects - Nestings that are siblings of the current Nesting
Parameters:
int - toposition - decide the range. usually it is (miNestingPositon, ToPosition).
Returns:
Vector of object - Nestings.

Get_sibling_Items_In_Range

public java.util.Vector Get_sibling_Items_In_Range(int ToPosition)
return vector that contains all the objects - Items that are siblings of child of the current Nesting.
Parameters:
int - ToPosition - decide the range(miNestingPosition, ToPosition)
Returns:
Vector of object - Items.

Reposition_Related_Nesting_In_Range

public boolean Reposition_Related_Nesting_In_Range(int to_position,
                                                   java.lang.String sfactor)
return boolean to show repositon successfully or not. All the sibling Nestins in range(from_position, to_position) will be repositioned based on the given factor - Increase("+") or Decrease("-")
Parameters:
int - to_position to decide the range for repositioning. range is (miNestingPosition, to_position)
java.lang.String - sfactor - how to repositioning. Increase or Decrease.
Returns:
boolean - reposition successfully or not

Shift_Siblings_Right

public boolean Shift_Siblings_Right(int start_position)

Shift_Siblings_Left

public boolean Shift_Siblings_Left(int start_position)

SetNestingID

public void SetNestingID(int iNewNestingID)
set member variable - miNesting
Parameters:
int - iNewNestingID - New Nesting ID to set member variable
Returns:
None

SetNestingPosition

public void SetNestingPosition(int iNewNestingPosition)
set memeber variable - miNestingPositon
Parameters:
int - iNewNestingPosition - New Nesting Position to set member variable
Returns:
None

SetNestingMultiple

public void SetNestingMultiple(java.lang.String sNewNestingMultiple)
set member variable - msNestingMultiple
Parameters:
String - sNewNestingMultiple - New Nesting Multiple to set member variable
Returns:
None

SetNestingOptional

public void SetNestingOptional(java.lang.String sNewNestingOptional)
set member variable - msNestingOptional
Parameters:
String - sNewNestingOptional - New Nesting Optional to set member variable
Returns:
None

SetNestingParentNode

public void SetNestingParentNode(DTDM_ItemWrapper NewParentNode)
set member variable - msNestingParentNode
Parameters:
DTDM_ItemWrapper - ParentNode - New Parent of Nesting to set member variable
Returns:
None

SetNestingChildNode

public void SetNestingChildNode(DTDM_ItemWrapper NewChildNode)
set member variable - msNestingParentNode
Parameters:
DTDM_ItemWrapper - ChildNode - New Child of Nesting to set member variable
Returns:
None

GetNestingID

public int GetNestingID()
return ID of current Nesting
Parameters:
None -  
Returns:
int - member variable miNestingID

GetDTD_ID

public java.lang.String GetDTD_ID()
return ID of current DTD_ID
Parameters:
None -  
Returns:
int - member variable DTD_ID

GetNestingPosition

public int GetNestingPosition()
return Position of current Nesting
Parameters:
None -  
Returns:
int - member variable miNestingPosition

GetNestingMultiple

public java.lang.String GetNestingMultiple()
return Quantifier(Multiple) of current Nesting
Parameters:
None -  
Returns:
java.lang.String - member variable msNestingMultiple

GetNestingOptional

public java.lang.String GetNestingOptional()
return Quantifier(Optional) of current Nesting
Parameters:
None -  
Returns:
java.lang.String - member variable msNestingOptional

GetParentNode

public DTDM_ItemWrapper GetParentNode()
return object - Item that contains all the information of parent of Nesting
Parameters:
None -  
Returns:
Object(Item) - member variable Parent_Node

GetChildNode

public DTDM_ItemWrapper GetChildNode()
return object - Item that contains all the information of child of Nesting
Parameters:
None -  
Returns:
Object(Item) - member variable Child_Node

Reset

public void Reset()
reset all member variables of object - Nesting