uk.ac.starlink.table.formats
Class RowEvaluator

java.lang.Object
  extended by uk.ac.starlink.table.formats.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) the evaluator can refine its idea of what kind of data is represented by each column.

Since:
21 Sep 2004

Nested Class Summary
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.
 
Constructor Summary
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
 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 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
 

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

Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved.