uk.ac.starlink.ttools.plot2.data
Interface UserDataReader


public interface UserDataReader

Reader that can interrogate a row sequence to return the coordinate and mask values specified by a DataSpec. It is applied to a RowSequence obtained from the DataSpec's source table.

Note this object is applied to an external RowSequence which must be advanced externally, rather than owning and advancing its own RowSequence. This is because multiple instances of this class may share the same RowSequence.

The read methods are sequential and must be presented with RowSequence and row index values appropriate for a given row in the table. Despite the presence of the row index parameters, they are not random-access methods, but the row index may be needed alongside the correctly positioned row sequence.

Instances of this object are not expected to be usable from multiple concurrent threads.

Since:
10 Feb 2013
Author:
Mark Taylor
See Also:
DataSpec

Method Summary
 boolean getMaskFlag(RowSequence rseq, long irow)
          Returns the mask flag for the current position in a row sequence.
 Object[] getUserCoordValues(RowSequence rseq, long irow, int icoord)
          Returns a user coordinate value array for a given coordinate at the current position in a row sequence.
 

Method Detail

getMaskFlag

boolean getMaskFlag(RowSequence rseq,
                    long irow)
                    throws IOException
Returns the mask flag for the current position in a row sequence.

Parameters:
rseq - row sequence positioned at the row of interest
irow - row index of the row of interest
Returns:
true iff the row of interest is included in the data set
Throws:
IOException

getUserCoordValues

Object[] getUserCoordValues(RowSequence rseq,
                            long irow,
                            int icoord)
                            throws IOException
Returns a user coordinate value array for a given coordinate at the current position in a row sequence. The returned value is an array which may be re-used, so it should not be assumed to retain its contents between calls to this method.

Parameters:
rseq - row sequence positioned at the row of interest
irow - row index of the row of interest
icoord - coordinate index to read
Returns:
array of user values (not storage values) for the specified coordinate at the row of interest
Throws:
IOException


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.