relop
Class IndexScan

java.lang.Object
  extended by relop.Iterator
      extended by relop.IndexScan

public class IndexScan
extends Iterator

Wrapper for bucket scan, an index access method.


Field Summary
 
Fields inherited from class relop.Iterator
schema
 
Constructor Summary
IndexScan(Schema schema, HashIndex index, HeapFile file)
          Constructs an index scan, given the hash index and schema.
 
Method Summary
 void close()
          Closes the iterator, releasing any resources (i.e.
 void explain(int depth)
          Gives a one-line explaination of the iterator, repeats the call on any child iterators, and increases the indent depth along the way.
 SearchKey getLastKey()
          Gets the key of the last tuple returned.
 Tuple getNext()
          Gets the next tuple in the iteration.
 int getNextHash()
          Returns the hash value for the bucket containing the next tuple, or maximum number of buckets if none.
 boolean hasNext()
          Returns true if there are more tuples, false otherwise.
 boolean isOpen()
          Returns true if the iterator is open; false otherwise.
 void restart()
          Restarts the iterator, i.e.
 
Methods inherited from class relop.Iterator
execute, finalize, indent
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndexScan

public IndexScan(Schema schema,
                 HashIndex index,
                 HeapFile file)
Constructs an index scan, given the hash index and schema.

Method Detail

explain

public void explain(int depth)
Gives a one-line explaination of the iterator, repeats the call on any child iterators, and increases the indent depth along the way.

Specified by:
explain in class Iterator

restart

public void restart()
Restarts the iterator, i.e. as if it were just constructed.

Specified by:
restart in class Iterator

isOpen

public boolean isOpen()
Returns true if the iterator is open; false otherwise.

Specified by:
isOpen in class Iterator

close

public void close()
Closes the iterator, releasing any resources (i.e. pinned pages).

Specified by:
close in class Iterator

hasNext

public boolean hasNext()
Returns true if there are more tuples, false otherwise.

Specified by:
hasNext in class Iterator

getNext

public Tuple getNext()
Gets the next tuple in the iteration.

Specified by:
getNext in class Iterator
Throws:
java.lang.IllegalStateException - if no more tuples

getLastKey

public SearchKey getLastKey()
Gets the key of the last tuple returned.


getNextHash

public int getNextHash()
Returns the hash value for the bucket containing the next tuple, or maximum number of buckets if none.