public class RowEvaluator extends Object
submitRow(java.util.List<java.lang.String>)
the evaluator can refine its
idea of what kind of data is represented by each column.Modifier and Type | Class and Description |
---|---|
static class |
RowEvaluator.Decoder<T>
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.
|
Modifier and Type | Field and Description |
---|---|
static RowEvaluator.Decoder<Void> |
BLANK_DECODER
Decoder for values that are all blank.
|
static RowEvaluator.Decoder<Boolean> |
BOOLEAN_DECODER
Decoder for booleans.
|
static RowEvaluator.Decoder<String> |
DATE_DECODER
Decoder for ISO-8601 dates.
|
static RowEvaluator.Decoder<String> |
DMS_DECODER
Decoder for DMS sexagesimal strings.
|
static RowEvaluator.Decoder<Double> |
DOUBLE_DECODER
Decoder for doubles.
|
static RowEvaluator.Decoder<Float> |
FLOAT_DECODER
Decoder for floats.
|
static RowEvaluator.Decoder<String> |
HMS_DECODER
Decoder for HMS sexagesimal strings.
|
static RowEvaluator.Decoder<Integer> |
INTEGER_DECODER
Decoder for integers.
|
static Pattern |
ISO8601_REGEX
Regular expression for ISO 8601 dates.
|
static RowEvaluator.Decoder<Long> |
LONG_DECODER
Decoder for longs.
|
static RowEvaluator.Decoder<Short> |
SHORT_DECODER
Decoder for shorts.
|
static RowEvaluator.Decoder<String> |
STRING_DECODER
Decoder for any old string.
|
Constructor and Description |
---|
RowEvaluator()
Constructs a new RowEvaluator which will work out the number of
columns from the data using the standard list of decoders.
|
RowEvaluator(int ncol)
Constructs a new RowEvaluator which will examine rows with a
fixed number of columns using the standard list of decoders.
|
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.
|
Modifier and Type | Method and Description |
---|---|
RowEvaluator.Metadata |
getMetadata()
Returns information gleaned from previous
submitRow
calls about the kind of data that appears to be in the columns. |
static RowEvaluator.Decoder<?>[] |
getStandardDecoders()
Returns the standard list of decoder implementation used for
identifying column types.
|
void |
submitRow(List<String> row)
Looks at a given row (list of strings) and records information about
what sort of things it looks like it contains.
|
public static final Pattern ISO8601_REGEX
public static final RowEvaluator.Decoder<Void> BLANK_DECODER
public static final RowEvaluator.Decoder<Boolean> BOOLEAN_DECODER
public static final RowEvaluator.Decoder<Short> SHORT_DECODER
public static final RowEvaluator.Decoder<Integer> INTEGER_DECODER
public static final RowEvaluator.Decoder<Long> LONG_DECODER
public static final RowEvaluator.Decoder<Float> FLOAT_DECODER
public static final RowEvaluator.Decoder<Double> DOUBLE_DECODER
public static final RowEvaluator.Decoder<String> DATE_DECODER
public static final RowEvaluator.Decoder<String> HMS_DECODER
public static final RowEvaluator.Decoder<String> DMS_DECODER
public static final RowEvaluator.Decoder<String> STRING_DECODER
public RowEvaluator()
public RowEvaluator(RowEvaluator.Decoder<?>[] 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.
decoders
- list of allowed decoderspublic RowEvaluator(int ncol)
ncol
- column countpublic void submitRow(List<String> row) throws TableFormatException
row
- ncol
-element list of stringsTableFormatException
- if the number of elements in
row
is not the same as on the first callpublic RowEvaluator.Metadata getMetadata()
submitRow
calls about the kind of data that appears to be in the columns.public static RowEvaluator.Decoder<?>[] getStandardDecoders()
Copyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.