Class RMtable

java.lang.Object
  |
  +--RMtable
All Implemented Interfaces:
java.io.Serializable

public class RMtable
extends java.lang.Object
implements java.io.Serializable

This class contains the collection of RM objects in a table.

See Also:
Serialized Form

Field Summary
 java.util.Vector Rows
           
 
Constructor Summary
RMtable(Database mySchema)
          RMtable constructor Initializes table name, abbreviation, row count and allocates space for the row objects in the table
 
Method Summary
 void delete_row_log(RC oldRow)
          This method is used to log the call to delete row
 void dumpTable(java.io.BufferedWriter output)
          Writes the contents of the table row by row to a given output stream.
 java.lang.String getAbbrev()
          Gets the abbreviation for the table
 RM getFirstRow()
          Get the first row in the table
 RM getLastRow()
          Get the last row in the table
 java.lang.String getName()
          Gets the name of the table
 RM getNextRow(RM thisrow)
          Given a row in the table, returns the next row
 RM getPrevRow(RM thisrow)
          Given a row in the table, returns the previous row
 int getRowcount()
          Gets the number of rows in table
 Database getTheSchema()
           
 void insert_row_log(RM newRow)
          This method is used to log the call to insert row
 boolean insertRow(RM newRow)
          Inserts a new row in the table.
 boolean removeRow(RC oldRow)
          Deletes a row from the table.
 void setTheSchema(Database value)
          Attaches the table to a particular database schema
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Rows

public java.util.Vector Rows
Constructor Detail

RMtable

public RMtable(Database mySchema)
RMtable constructor Initializes table name, abbreviation, row count and allocates space for the row objects in the table

Method Detail

getName

public java.lang.String getName()
Gets the name of the table

Returns:
a String containing the table name

getAbbrev

public java.lang.String getAbbrev()
Gets the abbreviation for the table

Returns:
a String containing the table name

getRowcount

public int getRowcount()
Gets the number of rows in table

Returns:
an integer containing the number of rows

getFirstRow

public RM getFirstRow()
Get the first row in the table

Returns:
a RM which is that row

getLastRow

public RM getLastRow()
Get the last row in the table

Returns:
a RM which is that row

getNextRow

public RM getNextRow(RM thisrow)
Given a row in the table, returns the next row

Returns:
the next row, null if the row does not exist or if the current row is the last row.

getPrevRow

public RM getPrevRow(RM thisrow)
Given a row in the table, returns the previous row

Returns:
the next row, null if the row does not exist or if the current row is the first row.

insertRow

public boolean insertRow(RM newRow)
Inserts a new row in the table. Expects that the new row's linkRow method will be called to link the new row to its sibling rows in turn


insert_row_log

public void insert_row_log(RM newRow)
This method is used to log the call to insert row


removeRow

public boolean removeRow(RC oldRow)
Deletes a row from the table. Expects that the old row's unlinkRow method will be called to unlink the old row from its sibling rows in turn


delete_row_log

public void delete_row_log(RC oldRow)
This method is used to log the call to delete row


dumpTable

public void dumpTable(java.io.BufferedWriter output)
               throws java.io.IOException
Writes the contents of the table row by row to a given output stream.

Throws:
IOException - if an error writing is encountered
java.io.IOException

getTheSchema

public Database getTheSchema()
Returns:
the Database object this table belongs to

setTheSchema

public void setTheSchema(Database value)
Attaches the table to a particular database schema