public abstract class Operator extends java.lang.Object implements DbIterator
close,
next and hasNext. Subclasses only need to implement
open and readNext.| Modifier and Type | Field and Description |
|---|---|
private int |
estimatedCardinality |
private Tuple |
next |
private boolean |
open |
private static long |
serialVersionUID |
| Constructor and Description |
|---|
Operator() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this iterator.
|
protected abstract Tuple |
fetchNext()
Returns the next Tuple in the iterator, or null if the iteration is
finished.
|
abstract DbIterator[] |
getChildren() |
int |
getEstimatedCardinality() |
abstract TupleDesc |
getTupleDesc()
Returns the TupleDesc associated with this DbIterator.
|
boolean |
hasNext()
Returns true if the iterator has more tuples.
|
Tuple |
next()
Returns the next tuple from the operator (typically implementing by reading
from a child operator or an access method).
|
void |
open()
Opens the iterator.
|
abstract void |
setChildren(DbIterator[] children)
Set the children(child) of this operator.
|
protected void |
setEstimatedCardinality(int card) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitrewindprivate static final long serialVersionUID
private Tuple next
private boolean open
private int estimatedCardinality
public boolean hasNext()
throws DbException,
TransactionAbortedException
DbIteratorhasNext in interface DbIteratorDbExceptionTransactionAbortedExceptionpublic Tuple next() throws DbException, TransactionAbortedException, java.util.NoSuchElementException
DbIteratornext in interface DbIteratorjava.util.NoSuchElementException - if there are no more tuples.DbExceptionTransactionAbortedExceptionprotected abstract Tuple fetchNext() throws DbException, TransactionAbortedException
next
and hasNext.DbExceptionTransactionAbortedExceptionpublic void close()
close in interface DbIteratorpublic void open()
throws DbException,
TransactionAbortedException
DbIteratoropen in interface DbIteratorDbException - when there are problems opening/accessing the database.TransactionAbortedExceptionpublic abstract DbIterator[] getChildren()
public abstract void setChildren(DbIterator[] children)
children - the DbIterators which are to be set as the children(child) of
this operatorpublic abstract TupleDesc getTupleDesc()
DbIteratorgetTupleDesc in interface DbIteratorpublic int getEstimatedCardinality()
protected void setEstimatedCardinality(int card)
card - The estimated cardinality of this operator.