Package 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 aProgressIndicator
. Has to contain a couple methods extra to the RowSequence interface to make it behave properly.- Since:
- 6 Aug 2004
- Author:
- Mark Taylor (Starlink)
-
-
Field Summary
-
Fields inherited from class uk.ac.starlink.table.WrapperRowSequence
baseSeq
-
-
Constructor Summary
Constructors Constructor Description ProgressRowSequence(StarTable table, ProgressIndicator indicator, java.lang.String stage)
Constructs a new ProgressRowSequence.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Indicates that progress is at an end.boolean
next()
Attempts to advances the current row to the next one.boolean
nextProgress()
Invokesnext()
and also updates the progress indicator.-
Methods inherited from class uk.ac.starlink.table.WrapperRowSequence
getCell, getRow, toString
-
-
-
-
Constructor Detail
-
ProgressRowSequence
public ProgressRowSequence(StarTable table, ProgressIndicator indicator, java.lang.String stage) throws java.io.IOException
Constructs a new ProgressRowSequence.- Parameters:
table
- table to get the base row sequence fromindicator
- indicator to be informed about progressstage
- string describing this stage of the process- Throws:
java.io.IOException
-
-
Method Detail
-
nextProgress
public boolean nextProgress() throws java.io.IOException, java.lang.InterruptedException
Invokesnext()
and also updates the progress indicator.- Throws:
java.io.IOException
java.lang.InterruptedException
-
next
public boolean next() throws java.io.IOException
Description copied from interface:RowSequence
Attempts to advances the current row to the next one. If true is returned the attempt has been successful, and if false is returned there are no more rows in this sequence. 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 theRowSequence.getCell(int)
orRowSequence.getRow()
methods.- Specified by:
next
in interfaceRowSequence
- Overrides:
next
in classWrapperRowSequence
- Returns:
- true iff this sequence has been advanced to the next row
- Throws:
java.io.IOException
- if there is some error
-
close
public void close() throws java.io.IOException
Indicates that progress is at an end. Must be called to end the progress indicator's stage.- Specified by:
close
in interfaceRowSequence
- Overrides:
close
in classWrapperRowSequence
- Throws:
java.io.IOException
-
-