Class RowEvaluator


  • public class RowEvaluator
    extends java.lang.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  RowEvaluator.Decoder
      Interface for an object that can turn a string into a cell content object.
      static class  RowEvaluator.Metadata
      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 java.util.regex.Pattern ISO8601_REGEX
      Regular expression for ISO 8601 dates.
    • Constructor Summary

      Constructors 
      Constructor Description
      RowEvaluator()
      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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      RowEvaluator.Metadata getMetadata()
      Returns information gleaned from previous submitRow calls about the kind of data that appears to be in the columns.
      void submitRow​(java.util.List<java.lang.String> row)
      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 Detail

      • ISO8601_REGEX

        public static final java.util.regex.Pattern ISO8601_REGEX
        Regular expression for ISO 8601 dates.
    • Constructor Detail

      • 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 Detail

      • submitRow

        public void submitRow​(java.util.List<java.lang.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