simpledb.multibuffer
Class MultiBufferProductScan

java.lang.Object
  extended by simpledb.multibuffer.MultiBufferProductScan
All Implemented Interfaces:
Scan

public class MultiBufferProductScan
extends Object
implements Scan

The Scan class for the muti-buffer version of the product operator.

Author:
Edward Sciore

Constructor Summary
MultiBufferProductScan(Scan lhsscan, TableInfo ti, Transaction tx)
          Creates the scan class for the product of the LHS scan and a table.
 
Method Summary
 void beforeFirst()
          Positions the scan before the first record.
 void close()
          Closes the current scans.
 int getInt(String fldname)
          Returns the integer value of the specified field.
 String getString(String fldname)
          Returns the string value of the specified field.
 Constant getVal(String fldname)
          Returns the value of the specified field.
 boolean hasField(String fldname)
          Returns true if the specified field is in either of the underlying scans.
 boolean next()
          Moves to the next record in the current scan.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiBufferProductScan

public MultiBufferProductScan(Scan lhsscan,
                              TableInfo ti,
                              Transaction tx)
Creates the scan class for the product of the LHS scan and a table.

Parameters:
lhsscan - the LHS scan
ti - the metadata for the RHS table
tx - the current transaction
Method Detail

beforeFirst

public void beforeFirst()
Positions the scan before the first record. That is, the LHS scan is positioned at its first record, and the RHS scan is positioned before the first record of the first chunk.

Specified by:
beforeFirst in interface Scan
See Also:
Scan.beforeFirst()

next

public boolean next()
Moves to the next record in the current scan. If there are no more records in the current chunk, then move to the next LHS record and the beginning of that chunk. If there are no more LHS records, then move to the next chunk and begin again.

Specified by:
next in interface Scan
Returns:
false if there is no next record
See Also:
Scan.next()

close

public void close()
Closes the current scans.

Specified by:
close in interface Scan
See Also:
Scan.close()

getVal

public Constant getVal(String fldname)
Returns the value of the specified field. The value is obtained from whichever scan contains the field.

Specified by:
getVal in interface Scan
Parameters:
fldname - the name of the field
Returns:
the value of that field, expressed as a Constant.
See Also:
Scan.getVal(java.lang.String)

getInt

public int getInt(String fldname)
Returns the integer value of the specified field. The value is obtained from whichever scan contains the field.

Specified by:
getInt in interface Scan
Parameters:
fldname - the name of the field
Returns:
the field's integer value in the current record
See Also:
Scan.getInt(java.lang.String)

getString

public String getString(String fldname)
Returns the string value of the specified field. The value is obtained from whichever scan contains the field.

Specified by:
getString in interface Scan
Parameters:
fldname - the name of the field
Returns:
the field's string value in the current record
See Also:
Scan.getString(java.lang.String)

hasField

public boolean hasField(String fldname)
Returns true if the specified field is in either of the underlying scans.

Specified by:
hasField in interface Scan
Parameters:
fldname - the name of the field
Returns:
true if the scan has that field
See Also:
Scan.hasField(java.lang.String)


Copyright © 2011. All Rights Reserved.