Class RowEvaluator

java.lang.Object
uk.ac.starlink.table.formats.RowEvaluator

public class RowEvaluator extends Object
Examines unknown rows (arrays of strings) to work out what they contain. By repeatedly calling submitRow(List) the evaluator can refine its idea of what kind of data is represented by each column.
Since:
21 Sep 2004
Author:
Mark Taylor (Starlink)
  • Field Details

  • Constructor Details

    • RowEvaluator

      public RowEvaluator()
      Constructs a new RowEvaluator which will work out the number of columns from the data using the standard list of decoders.
    • RowEvaluator

      public RowEvaluator(RowEvaluator.Decoder<?>[] decoders)
      Constructs a new RowEvaluator which will work out the number of columns from the data using a supplied list of decoders.

      Note the order of the supplied decoder list is significant; a type earlier in the list will be preferred over one later in the list where the data is consistent with both.

      In case of no match, a string decoder will be used, even if it does not appear in the supplied list.

      Parameters:
      decoders - list of allowed decoders
    • RowEvaluator

      public RowEvaluator(int ncol)
      Constructs a new RowEvaluator which will examine rows with a fixed number of columns using the standard list of decoders.
      Parameters:
      ncol - column count
  • Method Details

    • submitRow

      public void submitRow(List<String> row) throws TableFormatException
      Looks at a given row (list of strings) and records information about what sort of things it looks like it contains.
      Parameters:
      row - ncol-element list of strings
      Throws:
      TableFormatException - if the number of elements in row is not the same as on the first call
    • getMetadata

      public RowEvaluator.Metadata getMetadata()
      Returns information gleaned from previous submitRow calls about the kind of data that appears to be in the columns.
      Returns:
      metadata
    • getStandardDecoders

      public static RowEvaluator.Decoder<?>[] getStandardDecoders()
      Returns the standard list of decoder implementation used for identifying column types.
      Returns:
      standard decoder list