this.table.length );
row++; // row always points to the row after the current list
}
public Entry next(Entry object) {
RightTuple rightTuple = ( RightTuple ) object;
RightTupleList list = null;
if ( rightTuple != null ) {
list = rightTuple.getMemory(); // assumes you do not pass in a null RightTuple
}
int length = table.length;
while ( this.row <= length ) {
// check if there is a current bucket
while ( list == null ) {
if ( this.row < length ) {
// iterate while there is no current bucket, trying each array position
list = (RightTupleList) this.table[this.row];
this.row++;
} else {
// we've scanned the whole table and nothing is left, so return null
return null;
}
if ( list != null ) {
// we have a bucket so assign the frist LeftTuple and return
rightTuple = (RightTuple) list.getFirst( );
return rightTuple;
}
}
rightTuple = (RightTuple) rightTuple.getNext();
if ( rightTuple != null ) {
// we have a next tuple so return
return rightTuple;
} else {
list = (RightTupleList) list.getNext();