simpledb.multibuffer
Class ChunkScan

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

public class ChunkScan
extends Object
implements Scan

The class for the chunk operator.

Author:
Edward Sciore

Constructor Summary
ChunkScan(TableInfo ti, int startbnum, int endbnum, Transaction tx)
          Creates a chunk consisting of the specified pages.
 
Method Summary
 void beforeFirst()
          Positions the scan before its first record.
 void close()
          Closes the scan and its subscans, if any.
 int getInt(String fldname)
          Returns the value of the specified integer field in the current record.
 String getString(String fldname)
          Returns the value of the specified string field in the current record.
 Constant getVal(String fldname)
          Returns the value of the specified field in the current record.
 boolean hasField(String fldname)
          Returns true if the scan has the specified field.
 boolean next()
          Moves to the next record in the current block of the chunk.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChunkScan

public ChunkScan(TableInfo ti,
                 int startbnum,
                 int endbnum,
                 Transaction tx)
Creates a chunk consisting of the specified pages.

Parameters:
ti - the metadata for the chunked table
startbnum - the starting block number
endbnum - the ending block number
tx - the current transaction
Method Detail

beforeFirst

public void beforeFirst()
Description copied from interface: Scan
Positions the scan before its first record.

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

next

public boolean next()
Moves to the next record in the current block of the chunk. If there are no more records, then make the next block be current. If there are no more blocks in the chunk, return false.

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

close

public void close()
Description copied from interface: Scan
Closes the scan and its subscans, if any.

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

getVal

public Constant getVal(String fldname)
Description copied from interface: Scan
Returns the value of the specified field in the current record. The value is expressed as a Constant.

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)
Description copied from interface: Scan
Returns the value of the specified integer field in the current record.

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)
Description copied from interface: Scan
Returns the value of the specified string field in the current record.

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)
Description copied from interface: Scan
Returns true if the scan has the specified field.

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.