Package uk.ac.starlink.ttools.plot2.data
Class TableCachedData
java.lang.Object
uk.ac.starlink.ttools.plot2.data.TableCachedData
Supplies selected mask and coordinate data relating to a single table.
- Since:
- 10 Dec 2020
- Author:
- Mark Taylor
-
Constructor Summary
ConstructorsConstructorDescriptionTableCachedData
(long nrow, List<Supplier<CachedReader>> maskCols, List<Supplier<CachedReader>> coordCols) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionReturns a list of objects supplying coordinate data.Returns a list of objects supplying mask data.long
Returns the row count for this object's table.static TableCachedData
readDataPar
(uk.ac.starlink.table.StarTable table, MaskSpec[] maskSpecs, CoordSpec[] coordSpecs, CachedColumnFactory colFact, uk.ac.starlink.table.RowRunner rowRunner) Populates and returns a TableCachedData instance by reading from a given table in a parallel fashion.static TableCachedData
readDataSeq
(uk.ac.starlink.table.StarTable table, MaskSpec[] maskSpecs, CoordSpec[] coordSpecs, CachedColumnFactory colFact) Populates and returns a TableCachedData instance by reading from a given table in a sequential fashion.
-
Constructor Details
-
TableCachedData
public TableCachedData(long nrow, List<Supplier<CachedReader>> maskCols, List<Supplier<CachedReader>> coordCols) Constructor. Note all the mask and coord specs are assumed to refer to the same table.- Parameters:
nrow
- number of rows available from readersmaskCols
- list of mask column reader supplierscoordCols
- list of coordinate column reader suppliers
-
-
Method Details
-
getRowCount
public long getRowCount()Returns the row count for this object's table.- Returns:
- row count
-
getMaskColumns
Returns a list of objects supplying mask data.- Returns:
- list of mask column reader suppliers
-
getCoordColumns
Returns a list of objects supplying coordinate data.- Returns:
- list of coord column reader suppliers
-
readDataSeq
@Slow public static TableCachedData readDataSeq(uk.ac.starlink.table.StarTable table, MaskSpec[] maskSpecs, CoordSpec[] coordSpecs, CachedColumnFactory colFact) throws IOException, InterruptedException Populates and returns a TableCachedData instance by reading from a given table in a sequential fashion.- Parameters:
table
- input tablemaskSpecs
- mask specifications relating to tablecoordSpecs
- coord specifications relating to tablecolFact
- creates storage- Returns:
- populated TableCachedData
- Throws:
IOException
InterruptedException
-
readDataPar
@Slow public static TableCachedData readDataPar(uk.ac.starlink.table.StarTable table, MaskSpec[] maskSpecs, CoordSpec[] coordSpecs, CachedColumnFactory colFact, uk.ac.starlink.table.RowRunner rowRunner) throws IOException Populates and returns a TableCachedData instance by reading from a given table in a parallel fashion.Use with care: The ordering of the elements in the result is not guaranteed to be the same as the input iteration ordering. Also, the returned object is less efficient for iteration than that returned by the sequential implementation.
- Parameters:
table
- input tablemaskSpecs
- mask specifications relating to tablecoordSpecs
- coord specifications relating to tablecolFact
- creates storagerowRunner
- row runner- Returns:
- populated TableCachedData
- Throws:
IOException
-