simpledb.log
Class LogIterator

java.lang.Object
  extended by simpledb.log.LogIterator
All Implemented Interfaces:
java.util.Iterator<BasicLogRecord>

 class LogIterator
extends java.lang.Object
implements java.util.Iterator<BasicLogRecord>

A class that provides the ability to move through the records of the log file in reverse order.

Author:
Edward Sciore

Constructor Summary
LogIterator(Block blk)
          Creates an iterator for the records in the log file, positioned after the last log record.
 
Method Summary
 boolean hasNext()
          Determines if the current log record is the earliest record in the log file.
 BasicLogRecord next()
          Moves to the next log record in reverse order.
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogIterator

LogIterator(Block blk)
Creates an iterator for the records in the log file, positioned after the last log record. This constructor is called exclusively by LogMgr.iterator().

Method Detail

hasNext

public boolean hasNext()
Determines if the current log record is the earliest record in the log file.

Specified by:
hasNext in interface java.util.Iterator<BasicLogRecord>
Returns:
true if there is an earlier record

next

public BasicLogRecord next()
Moves to the next log record in reverse order. If the current log record is the earliest in its block, then the method moves to the next oldest block, and returns the log record from there.

Specified by:
next in interface java.util.Iterator<BasicLogRecord>
Returns:
the next earliest log record

remove

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