Class RandomJELRowReader


  • public abstract class RandomJELRowReader
    extends StarTableJELRowReader
    Provides JELRowReader functionality for a random access table. This abstract class adds the abstract method evaluateAtRow(gnu.jel.CompiledExpression, long); factory methods are provided to implement this in different ways according to the requirements of multi-threaded usage.
    Since:
    8 Feb 2005
    Author:
    Mark Taylor (Starlink)
    • Constructor Detail

      • RandomJELRowReader

        protected RandomJELRowReader​(uk.ac.starlink.table.StarTable table)
        Constructor.
        Parameters:
        table - table object
    • Method Detail

      • evaluateAtRow

        public abstract java.lang.Object evaluateAtRow​(gnu.jel.CompiledExpression compEx,
                                                       long lrow)
                                                throws java.lang.Throwable
        Evaluates a given compiled expression at a given row. The returned value is wrapped up as an object if the result of the expression is a primitive.
        Parameters:
        compEx - compiled expression
        lrow - row index
        Returns:
        expression result as an object
        Throws:
        java.lang.Throwable
      • createConcurrentReader

        public static RandomJELRowReader createConcurrentReader​(uk.ac.starlink.table.StarTable table)
        Returns an instance that uses the threadsafe random access methods of the supplied table. The random access methods of the returned object are synchronized, so that although it is safe for use from multiple threads, it may not be efficient.
        Parameters:
        table - supplies data
        Returns:
        row reader
      • createAccessReader

        public static RandomJELRowReader createAccessReader​(uk.ac.starlink.table.StarTable table,
                                                            uk.ac.starlink.table.RowAccess racc)
        Returns an instance that uses a RowAccess object from the table for supplying data values. This is only suitable for use from a single thread.
        Parameters:
        table - table object
        racc - row access previously obtained from table
        Returns:
        row reader
      • createAccessReader

        public static RandomJELRowReader createAccessReader​(uk.ac.starlink.table.StarTable table)
                                                     throws java.io.IOException
        Convenience method that obtains and uses a RowAccess from a given table. Note it is not possible to close the RowAccess in this case.
        Parameters:
        table - table object
        Returns:
        result of createAccessReader(table,table.getRowAccess())
        Throws:
        java.io.IOException