FairCom.CtreeDb
Class CTSegment

java.lang.Object
  extended by FairCom.CtreeDb.CTBase
      extended by FairCom.CtreeDb.CTSegment

public class CTSegment
extends CTBase

Objects of the CTSegment class manage index segments. The segment is part of the index; one single index may be composed of several segments. It uses CTBase as the base class, and implements the constructor/destructor allocating/freeing memory to the segment operations.

See Also:
CTBase, CTIndex, CTField

Field Summary
 
Fields inherited from class FairCom.CtreeDb.CTBase
m_handle
 
Constructor Summary
CTSegment()
          Constructor
CTSegment(CTSegment Seg)
          Copy constructor
 
Method Summary
 void finalize()
          Destructor
 CTField GetField()
          retrieve the segment field object
 java.lang.String GetFieldName()
          Method: GetFieldName Retrieve the segment field name Parameters: none Returns: Return the field name
 int GetMode()
          Retrieve the segment mode
 int GetNumber()
          Retrieve the segment index position in index segments list
 CTField GetPartialField()
          Retrieve the segment field object
 java.lang.String GetPartialFieldName()
          Method: GetPartialFieldName Retrieve the segment field name Parameters: none Returns: Return the field name
 int GetStatus()
          Retrieve the status of the segment handle.
 void MoveSegment(int newIndex)
          Moves a key segment to a location indicated by newIndex .
 void SetField(CTField field)
          Change the underlying segment field.
 void SetMode(int SegMode)
          Set the segment mode
 
Methods inherited from class FairCom.CtreeDb.CTBase
Abort, Begin, Commit, GetAutoCommit, GetHandle, GetKeepLock, GetLockMode, GetOperation, GetTransactionMode, IsLockActive, IsTransActive, IsUnicodeLib, Lock, RestoreSavePoint, SetAutoCommit, SetHandle, SetKeepLock, SetOperation, SetSavePoint, SetTransactionMode, Unlock
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CTSegment

public CTSegment()
Constructor


CTSegment

public CTSegment(CTSegment Seg)
Copy constructor

Parameters:
Seg - the CTSegment to copy.
Method Detail

finalize

public void finalize()
Destructor

Overrides:
finalize in class java.lang.Object

GetField

public CTField GetField()
                 throws CTException
retrieve the segment field object

Returns:
A CTField object representing the field used by the current segment
Throws:
CTException

GetPartialField

public CTField GetPartialField()
                        throws CTException
Retrieve the segment field object

Returns:
A CTField object representing the field used by the current segment
Throws:
CTException

GetFieldName

public java.lang.String GetFieldName()
                              throws CTException
Method: GetFieldName Retrieve the segment field name Parameters: none Returns: Return the field name

Throws:
CTException

GetPartialFieldName

public java.lang.String GetPartialFieldName()
                                     throws CTException
Method: GetPartialFieldName Retrieve the segment field name Parameters: none Returns: Return the field name

Throws:
CTException

GetMode

public int GetMode()
            throws CTException
Retrieve the segment mode

Returns:
Return the integer value of the segment mode, use the static members of SEG_MODE class for comparisions.
Throws:
CTException

SetMode

public void SetMode(int SegMode)
             throws CTException
Set the segment mode

Parameters:
SegMode - The segment mode to set, use the static members of SEG_MODE class to pass the value.
Throws:
CTException

GetNumber

public int GetNumber()
              throws CTException
Retrieve the segment index position in index segments list

Returns:
Return the index position
Throws:
CTException

GetStatus

public int GetStatus()
Retrieve the status of the segment handle. The status of the segment handle is a bit map describing one or more of the following SEGMENT_STATUS value: OLD Original segment as read from file NEW Segment added or inserted DEL Original segment deleted MOVED Original segment moved MODE Segment mode changed Use the static members of SEGMENT_STATUS class to make comparisions

Returns:
Return the index segment handle status.

MoveSegment

public void MoveSegment(int newIndex)
                 throws CTException
Moves a key segment to a location indicated by newIndex .

Parameters:
newIndex - Index of the new location of the segment.
Throws:
CTException

SetField

public void SetField(CTField field)
              throws CTException
Change the underlying segment field.

Parameters:
field - Field object.
Throws:
CTException