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(java.util.List<java.lang.String>) the evaluator can refine its idea of what kind of data is represented by each column.
Since:
21 Sep 2004
Author:
Mark Taylor (Starlink)
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Interface for an object that can turn a string into a cell content object.
    static class 
    Helper class used to group quantities which describe what the data types found in the columns of a table are.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Pattern
    Regular expression for ISO 8601 dates.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a new RowEvaluator which will work out the number of columns from the data.
    RowEvaluator(int ncol)
    Constructs a new RowEvaluator which will examine rows with a fixed number of columns.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns information gleaned from previous submitRow calls about the kind of data that appears to be in the columns.
    void
    Looks at a given row (list of strings) and records information about what sort of things it looks like it contains.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • ISO8601_REGEX

      public static final Pattern ISO8601_REGEX
      Regular expression for ISO 8601 dates.
  • Constructor Details

    • RowEvaluator

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

      public RowEvaluator(int ncol)
      Constructs a new RowEvaluator which will examine rows with a fixed number of columns.
      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