Quadcap Embeddable Database

com.quadcap.sql.BC_Cursor Class Reference

Inheritance diagram for com.quadcap.sql.BC_Cursor:

com.quadcap.sql.CursorImpl com.quadcap.sql.TupleImpl com.quadcap.sql.Cursor com.quadcap.sql.Tuple Externalizable com.quadcap.sql.Tuple com.quadcap.sql.DistinctCursor com.quadcap.sql.IndexCursor com.quadcap.sql.OrderByCursor List of all members.

Detailed Description

Cursor that implements the DISTINCT modifier by creating temporary table, where the entire row is used as the index key.

Author:
Stan Bailes

Definition at line 62 of file BC_Cursor.java.

Public Member Functions

 BC_Cursor (Session session, String name, Cursor outer) throws SQLException
 Constructor on session and cursor.

Row getRow () throws SQLException
 Cursor.getRow(): return the current table row, fetching it if necessary based on the rowId.

abstract void checkCursor () throws IOException, SQLException
 Make the row too, while you're at it...

abstract long getCurrentRowId () throws IOException, SQLException
abstract void fetchCurrentRow () throws IOException, SQLException
boolean isWritable (int column)
 Return true if the specified column is writable.

boolean absolute (int x) throws SQLException
 Position the cursor to the specified absolute row.

void beforeFirst () throws SQLException
 Position the cursor before the first row.

void afterLast () throws SQLException
 Position the cursor after the last row.

boolean next () throws SQLException
 Advance the cursor and return true if we advanced to a valid row.

boolean prev () throws SQLException
 Move the cursor back one row and return true if we moved back to a valid row.

void close () throws SQLException
 On close, we release the resources.

long getRowId ()
 Return the row id.

long size () throws SQLException
 Return the size of the index backing this cursor.

void updateRow (Row row) throws SQLException
 Replace the current cursor row with the specified row.

void deleteRow () throws SQLException
 Delete the current cursor row.


Protected Attributes

BCursor bc = null
LazyRow row = null
boolean rowValid = false
long rowId = 0


Constructor & Destructor Documentation

com.quadcap.sql.BC_Cursor.BC_Cursor Session  session,
String  name,
Cursor  outer
throws SQLException
 

Constructor on session and cursor.

Definition at line 71 of file BC_Cursor.java.


Member Function Documentation

boolean com.quadcap.sql.BC_Cursor.absolute int  x  )  throws SQLException
 

Position the cursor to the specified absolute row.

The first row is row '1', and the last row is '-1', as in JDBC.

Reimplemented from com.quadcap.sql.CursorImpl.

Definition at line 109 of file BC_Cursor.java.

References com.quadcap.sql.BC_Cursor.absolute(), com.quadcap.sql.BC_Cursor.bc, com.quadcap.sql.BC_Cursor.checkCursor(), com.quadcap.sql.BC_Cursor.getCurrentRowId(), com.quadcap.sql.BC_Cursor.rowId, and com.quadcap.sql.BC_Cursor.rowValid.

Referenced by com.quadcap.sql.BC_Cursor.absolute().

void com.quadcap.sql.BC_Cursor.afterLast  )  throws SQLException [virtual]
 

Position the cursor after the last row.

Implements com.quadcap.sql.CursorImpl.

Reimplemented in com.quadcap.sql.IndexCursor.

Definition at line 135 of file BC_Cursor.java.

References com.quadcap.sql.BC_Cursor.bc, com.quadcap.sql.BC_Cursor.checkCursor(), com.quadcap.sql.BC_Cursor.rowId, and com.quadcap.sql.BC_Cursor.rowValid.

void com.quadcap.sql.BC_Cursor.beforeFirst  )  throws SQLException [virtual]
 

Position the cursor before the first row.

Implements com.quadcap.sql.CursorImpl.

Reimplemented in com.quadcap.sql.IndexCursor.

Definition at line 124 of file BC_Cursor.java.

References com.quadcap.sql.BC_Cursor.bc, com.quadcap.sql.BC_Cursor.checkCursor(), com.quadcap.sql.BC_Cursor.rowId, and com.quadcap.sql.BC_Cursor.rowValid.

Referenced by com.quadcap.sql.OrderByCursor.OrderByCursor().

abstract void com.quadcap.sql.BC_Cursor.checkCursor  )  throws IOException, SQLException [pure virtual]
 

Make the row too, while you're at it...

Implemented in com.quadcap.sql.DistinctCursor, com.quadcap.sql.IndexCursor, and com.quadcap.sql.OrderByCursor.

Referenced by com.quadcap.sql.BC_Cursor.absolute(), com.quadcap.sql.BC_Cursor.afterLast(), com.quadcap.sql.BC_Cursor.beforeFirst(), com.quadcap.sql.BC_Cursor.next(), and com.quadcap.sql.BC_Cursor.prev().

void com.quadcap.sql.BC_Cursor.close  )  throws SQLException [virtual]
 

On close, we release the resources.

Implements com.quadcap.sql.CursorImpl.

Reimplemented in com.quadcap.sql.DistinctCursor, and com.quadcap.sql.OrderByCursor.

Definition at line 177 of file BC_Cursor.java.

References com.quadcap.sql.BC_Cursor.bc, and com.quadcap.sql.BC_Cursor.row.

Referenced by com.quadcap.sql.IndexConstraint.add(), and com.quadcap.sql.ImportedKeyConstraint.add().

void com.quadcap.sql.BC_Cursor.deleteRow  )  throws SQLException [virtual]
 

Delete the current cursor row.

Implements com.quadcap.sql.CursorImpl.

Reimplemented in com.quadcap.sql.IndexCursor.

Definition at line 208 of file BC_Cursor.java.

abstract void com.quadcap.sql.BC_Cursor.fetchCurrentRow  )  throws IOException, SQLException [pure virtual]
 

Implemented in com.quadcap.sql.DistinctCursor, com.quadcap.sql.IndexCursor, and com.quadcap.sql.OrderByCursor.

Referenced by com.quadcap.sql.BC_Cursor.getRow().

abstract long com.quadcap.sql.BC_Cursor.getCurrentRowId  )  throws IOException, SQLException [pure virtual]
 

Implemented in com.quadcap.sql.DistinctCursor, com.quadcap.sql.IndexCursor, and com.quadcap.sql.OrderByCursor.

Referenced by com.quadcap.sql.BC_Cursor.absolute(), com.quadcap.sql.BC_Cursor.next(), and com.quadcap.sql.BC_Cursor.prev().

Row com.quadcap.sql.BC_Cursor.getRow  )  throws SQLException [virtual]
 

Cursor.getRow(): return the current table row, fetching it if necessary based on the rowId.

Implements com.quadcap.sql.CursorImpl.

Definition at line 81 of file BC_Cursor.java.

References com.quadcap.sql.BC_Cursor.fetchCurrentRow(), com.quadcap.sql.BC_Cursor.row, com.quadcap.sql.BC_Cursor.rowId, and com.quadcap.sql.BC_Cursor.rowValid.

Referenced by com.quadcap.sql.IndexConstraint.add(), com.quadcap.sql.ImportedKeyConstraint.add(), and com.quadcap.sql.IndexCursor.deleteRow().

long com.quadcap.sql.BC_Cursor.getRowId  ) 
 

Return the row id.

Reimplemented from com.quadcap.sql.CursorImpl.

Definition at line 189 of file BC_Cursor.java.

References com.quadcap.sql.BC_Cursor.rowId.

Referenced by com.quadcap.sql.IndexConstraint.add(), and com.quadcap.sql.ImportedKeyConstraint.add().

boolean com.quadcap.sql.BC_Cursor.isWritable int  column  )  [virtual]
 

Return true if the specified column is writable.

Parameters:
column the (one-based) column number
Exceptions:
SQLException may be thrown

Implements com.quadcap.sql.CursorImpl.

Reimplemented in com.quadcap.sql.IndexCursor.

Definition at line 107 of file BC_Cursor.java.

boolean com.quadcap.sql.BC_Cursor.next  )  throws SQLException [virtual]
 

Advance the cursor and return true if we advanced to a valid row.

Implements com.quadcap.sql.CursorImpl.

Reimplemented in com.quadcap.sql.IndexCursor.

Definition at line 146 of file BC_Cursor.java.

References com.quadcap.sql.BC_Cursor.bc, com.quadcap.sql.BC_Cursor.checkCursor(), com.quadcap.sql.BC_Cursor.getCurrentRowId(), com.quadcap.sql.BC_Cursor.rowId, and com.quadcap.sql.BC_Cursor.rowValid.

boolean com.quadcap.sql.BC_Cursor.prev  )  throws SQLException
 

Move the cursor back one row and return true if we moved back to a valid row.

Reimplemented from com.quadcap.sql.CursorImpl.

Reimplemented in com.quadcap.sql.IndexCursor.

Definition at line 161 of file BC_Cursor.java.

References com.quadcap.sql.BC_Cursor.bc, com.quadcap.sql.BC_Cursor.checkCursor(), com.quadcap.sql.BC_Cursor.getCurrentRowId(), com.quadcap.sql.BC_Cursor.rowId, and com.quadcap.sql.BC_Cursor.rowValid.

long com.quadcap.sql.BC_Cursor.size  )  throws SQLException
 

Return the size of the index backing this cursor.

Implements com.quadcap.sql.Cursor.

Definition at line 196 of file BC_Cursor.java.

References com.quadcap.sql.BC_Cursor.bc.

void com.quadcap.sql.BC_Cursor.updateRow Row  row  )  throws SQLException [virtual]
 

Replace the current cursor row with the specified row.

Implements com.quadcap.sql.CursorImpl.

Reimplemented in com.quadcap.sql.IndexCursor.

Definition at line 204 of file BC_Cursor.java.

References com.quadcap.sql.BC_Cursor.updateRow().

Referenced by com.quadcap.sql.BC_Cursor.updateRow().


Member Data Documentation

BCursor com.quadcap.sql.BC_Cursor.bc = null [protected]
 

Definition at line 63 of file BC_Cursor.java.

Referenced by com.quadcap.sql.BC_Cursor.absolute(), com.quadcap.sql.BC_Cursor.afterLast(), com.quadcap.sql.BC_Cursor.beforeFirst(), com.quadcap.sql.BC_Cursor.close(), com.quadcap.sql.BC_Cursor.next(), com.quadcap.sql.BC_Cursor.prev(), and com.quadcap.sql.BC_Cursor.size().

LazyRow com.quadcap.sql.BC_Cursor.row = null [protected]
 

Definition at line 64 of file BC_Cursor.java.

Referenced by com.quadcap.sql.BC_Cursor.close(), and com.quadcap.sql.BC_Cursor.getRow().

long com.quadcap.sql.BC_Cursor.rowId = 0 [protected]
 

Definition at line 66 of file BC_Cursor.java.

Referenced by com.quadcap.sql.BC_Cursor.absolute(), com.quadcap.sql.BC_Cursor.afterLast(), com.quadcap.sql.BC_Cursor.beforeFirst(), com.quadcap.sql.BC_Cursor.getRow(), com.quadcap.sql.BC_Cursor.getRowId(), com.quadcap.sql.BC_Cursor.next(), and com.quadcap.sql.BC_Cursor.prev().

boolean com.quadcap.sql.BC_Cursor.rowValid = false [protected]
 

Definition at line 65 of file BC_Cursor.java.

Referenced by com.quadcap.sql.BC_Cursor.absolute(), com.quadcap.sql.BC_Cursor.afterLast(), com.quadcap.sql.BC_Cursor.beforeFirst(), com.quadcap.sql.BC_Cursor.getRow(), com.quadcap.sql.BC_Cursor.next(), and com.quadcap.sql.BC_Cursor.prev().