simpledb.index
Interface Index

All Known Implementing Classes:
BTreeIndex, HashIndex

public interface Index

This interface contains methods to traverse an index.

Author:
Edward Sciore

Method Summary
 void beforeFirst(Constant searchkey)
          Positions the index before the first record having the specified search key.
 void close()
          Closes the index.
 void delete(Constant dataval, RID datarid)
          Deletes the index record having the specified dataval and dataRID values.
 RID getDataRid()
          Returns the dataRID value stored in the current index record.
 void insert(Constant dataval, RID datarid)
          Inserts an index record having the specified dataval and dataRID values.
 boolean next()
          Moves the index to the next record having the search key specified in the beforeFirst method.
 

Method Detail

beforeFirst

void beforeFirst(Constant searchkey)
Positions the index before the first record having the specified search key.

Parameters:
searchkey - the search key value.

next

boolean next()
Moves the index to the next record having the search key specified in the beforeFirst method. Returns false if there are no more such index records.

Returns:
false if no other index records have the search key.

getDataRid

RID getDataRid()
Returns the dataRID value stored in the current index record.

Returns:
the dataRID stored in the current index record.

insert

void insert(Constant dataval,
            RID datarid)
Inserts an index record having the specified dataval and dataRID values.

Parameters:
dataval - the dataval in the new index record.
datarid - the dataRID in the new index record.

delete

void delete(Constant dataval,
            RID datarid)
Deletes the index record having the specified dataval and dataRID values.

Parameters:
dataval - the dataval of the deleted index record
datarid - the dataRID of the deleted index record

close

void close()
Closes the index.



Copyright © 2011. All Rights Reserved.