public class TypeInferencer
extends java.lang.Object
ParserFactory, but while that class only
supports one data field at a time, TypeInferencer maintains a collection
of ParserFactory instances to infer type for multiple data columns
simultaneously.ParserFactory| Modifier and Type | Field and Description |
|---|---|
java.util.ArrayList |
m_factories |
ParserFactory |
m_template |
| Constructor and Description |
|---|
TypeInferencer()
Create a new TypeInferencer using the default ParserFactory
settings, thus the default parsers and parser ordering will be used.
|
TypeInferencer(ParserFactory template)
Create a new TypeInferenced using the input ParserFactory as a
template for the desired parsers to check and parser ordering
to use.
|
| Modifier and Type | Method and Description |
|---|---|
DataParser |
getParser(int column)
Get the top-ranking candidate data parser for the given column index.
|
java.lang.Class |
getType(int column)
Get the data type for the highest ranking candidate parser
still in the running for the given column index.
|
void |
sample(int column,
java.lang.String value)
Sample the given text string for the given data column index.
|
public ParserFactory m_template
public java.util.ArrayList m_factories
public TypeInferencer()
public TypeInferencer(ParserFactory template)
template - the template ParserFactory to use for included
parsers and their precedence.public void sample(int column,
java.lang.String value)
column - the data column index of the samplevalue - the text string samplepublic java.lang.Class getType(int column)
column - the data column indexpublic DataParser getParser(int column)
column - the data column index