relop
Class Iterator

java.lang.Object
  extended by relop.Iterator

public abstract class Iterator
extends java.lang.Object

Minibase Iterators

Query execution is driven by a tree of relational operators, all of which are implemented as iterators. Results are requested by successive "get next tuple" calls on the root of the tree, which in turn makes similar calls to child iterators throughout the tree. Intermediate nodes (i.e. join iterators) drive the leaf-level nodes (i.e. file or index scan iterators).


Constructor Summary
Iterator()
           
 
Method Summary
abstract  void close()
          Closes the iterator, releasing any resources (i.e.
 int execute()
          Prints the schema, gets and prints all tuples, and closes the iterator.
abstract  void explain(int depth)
          Gives a one-line explanation of the iterator, repeats the call on any child iterators, and increases the indent depth along the way.
protected  void finalize()
          Called by the garbage collector when there are no more references to the object; closes the iterator if it's still open.
abstract  relop.Tuple getNext()
          Gets the next tuple in the iteration.
 relop.Schema getSchema()
           
abstract  boolean hasNext()
          Returns true if there are more tuples, false otherwise.
protected  void indent(int depth)
          Outputs the indentation for the given depth.
abstract  boolean isOpen()
          Returns true if the iterator is open; false otherwise.
abstract  void restart()
          Restarts the iterator, i.e.
 void setSchema(relop.Schema schema)
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Iterator

public Iterator()
Method Detail

explain

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


indent

protected void indent(int depth)
Outputs the indentation for the given depth.


restart

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


isOpen

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


close

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


hasNext

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


getNext

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

Throws:
java.lang.IllegalStateException - if no more tuples

execute

public int execute()
Prints the schema, gets and prints all tuples, and closes the iterator.

Returns:
number of tuples processed

finalize

protected void finalize()
                 throws java.lang.Throwable
Called by the garbage collector when there are no more references to the object; closes the iterator if it's still open.

Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable

setSchema

public void setSchema(relop.Schema schema)

getSchema

public relop.Schema getSchema()