simpledb.tx.recovery
Class LogRecordIterator

java.lang.Object
  extended by simpledb.tx.recovery.LogRecordIterator
All Implemented Interfaces:
java.util.Iterator<LogRecord>

 class LogRecordIterator
extends java.lang.Object
implements java.util.Iterator<LogRecord>

A class that provides the ability to read records from the log in reverse order. Unlike the similar class LogIterator, this class understands the meaning of the log records.

Author:
Edward Sciore

Constructor Summary
LogRecordIterator()
           
 
Method Summary
 boolean hasNext()
           
 LogRecord next()
          Constructs a log record from the values in the current basic log record.
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogRecordIterator

LogRecordIterator()
Method Detail

hasNext

public boolean hasNext()
Specified by:
hasNext in interface java.util.Iterator<LogRecord>

next

public LogRecord next()
Constructs a log record from the values in the current basic log record. The method first reads an integer, which denotes the type of the log record. Based on that type, the method calls the appropriate LogRecord constructor to read the remaining values.

Specified by:
next in interface java.util.Iterator<LogRecord>
Returns:
the next log record, or null if no more records

remove

public void remove()
Specified by:
remove in interface java.util.Iterator<LogRecord>