uk.ac.starlink.table.join
Class ProgressRowSequence

java.lang.Object
  |
  +--uk.ac.starlink.table.WrapperRowSequence
        |
        +--uk.ac.starlink.table.join.ProgressRowSequence
All Implemented Interfaces:
RowSequence

public class ProgressRowSequence
extends WrapperRowSequence

RowSequence which logs progress to a ProgressIndicator. Has to contain a couple methods extra to the RowSequence interface to make it behave properly.

Since:
6 Aug 2004

Field Summary
 
Fields inherited from class uk.ac.starlink.table.WrapperRowSequence
baseSeq
 
Constructor Summary
ProgressRowSequence(StarTable table, ProgressIndicator indicator, String stage)
          Constructs a new ProgressRowSequence.
 
Method Summary
 void close()
          Indicates that progress is at an end.
 void next()
          Advances the current row to the next one.
 void nextProgress()
          Invokes next() and also updates the progress indicator.
 
Methods inherited from class uk.ac.starlink.table.WrapperRowSequence
getCell, getRow, hasNext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProgressRowSequence

public ProgressRowSequence(StarTable table,
                           ProgressIndicator indicator,
                           String stage)
                    throws IOException
Constructs a new ProgressRowSequence.

Parameters:
table - table to get the base row sequence from
indicator - indicator to be informed about progress
stage - string describing this stage of the process
Method Detail

nextProgress

public void nextProgress()
                  throws IOException,
                         InterruptedException
Invokes next() and also updates the progress indicator.

IOException
InterruptedException

next

public void next()
          throws IOException
Description copied from interface: RowSequence
Advances the current row to the next one. Since the initial position of a RowSequence is before the first row, this method must be called before current row data can be accessed using the RowSequence.getCell(int) or RowSequence.getRow() methods. An unchecked exception such as NoSuchElementException will be thrown if RowSequence.hasNext() returns false.

Specified by:
next in interface RowSequence
Overrides:
next in class WrapperRowSequence
Throws:
IOException - if there is some error in the positioning

close

public void close()
           throws IOException
Indicates that progress is at an end. Must be called to end the progress indicator's stage.

Specified by:
close in interface RowSequence
Overrides:
close in class WrapperRowSequence
IOException

Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved.