public class OrderBy extends Operator
| Modifier and Type | Field and Description |
|---|---|
private boolean |
asc |
private DbIterator |
child |
private java.util.ArrayList<Tuple> |
childTups |
private java.util.Iterator<Tuple> |
it |
private int |
orderByField |
private java.lang.String |
orderByFieldName |
private static long |
serialVersionUID |
private TupleDesc |
td |
| Constructor and Description |
|---|
OrderBy(int orderbyField,
boolean asc,
DbIterator child)
Creates a new OrderBy node over the tuples from the iterator.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this iterator.
|
protected Tuple |
fetchNext()
Operator.fetchNext implementation.
|
DbIterator[] |
getChildren() |
int |
getOrderByField() |
java.lang.String |
getOrderFieldName() |
TupleDesc |
getTupleDesc()
Returns the TupleDesc associated with this DbIterator.
|
boolean |
isASC() |
void |
open()
Opens the iterator.
|
void |
rewind()
Resets the iterator to the start.
|
void |
setChildren(DbIterator[] children)
Set the children(child) of this operator.
|
getEstimatedCardinality, hasNext, next, setEstimatedCardinalityprivate static final long serialVersionUID
private DbIterator child
private TupleDesc td
private java.util.ArrayList<Tuple> childTups
private int orderByField
private java.lang.String orderByFieldName
private java.util.Iterator<Tuple> it
private boolean asc
public OrderBy(int orderbyField,
boolean asc,
DbIterator child)
orderbyField - the field to which the sort is applied.asc - true if the sort order is ascending.child - the tuples to sort.public boolean isASC()
public int getOrderByField()
public java.lang.String getOrderFieldName()
public TupleDesc getTupleDesc()
DbIteratorgetTupleDesc in interface DbIteratorgetTupleDesc in class Operatorpublic void open()
throws DbException,
java.util.NoSuchElementException,
TransactionAbortedException
DbIteratoropen in interface DbIteratoropen in class OperatorDbException - when there are problems opening/accessing the database.java.util.NoSuchElementExceptionTransactionAbortedExceptionpublic void close()
Operatorclose in interface DbIteratorclose in class Operatorpublic void rewind()
throws DbException,
TransactionAbortedException
DbIteratorDbException - when rewind is unsupported.TransactionAbortedExceptionprotected Tuple fetchNext() throws java.util.NoSuchElementException, TransactionAbortedException, DbException
fetchNext in class Operatorjava.util.NoSuchElementExceptionTransactionAbortedExceptionDbExceptionpublic DbIterator[] getChildren()
getChildren in class Operatorpublic void setChildren(DbIterator[] children)
OperatorsetChildren in class Operatorchildren - the DbIterators which are to be set as the children(child) of
this operator