public class VectorDataSetParser
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.util.regex.Pattern |
NAME_COLON_VALUE_PATTERN |
static java.util.regex.Pattern |
NAME_EQUAL_VALUE_PATTERN |
Modifier and Type | Method and Description |
---|---|
static int |
guessFieldCount(java.lang.String filename)
return the field count that would result in the largest number of records parsed.
|
static void |
main(java.lang.String[] args) |
static VectorDataSetParser |
newParser(int fieldCount)
creates a parser with @param fieldCount fields, named "field0,...,fieldN"
|
static VectorDataSetParser |
newParser(java.lang.String[] fieldNames)
creates a parser with the named fields.
|
VectorDataSet |
readFile(java.lang.String filename)
Parse the file using the current settings.
|
VectorDataSet |
readStream(java.io.InputStream in)
Parse the stream using the current settings.
|
void |
setPropertyPattern(java.util.regex.Pattern propertyPattern)
specify the Pattern used to recognize properties.
|
void |
setRecordCountLimit(int recordCountLimit)
limit the number of records read.
|
void |
setSkipLines(int skipLines)
skip a number of lines before trying to parse anything.
|
public static final java.util.regex.Pattern NAME_COLON_VALUE_PATTERN
public static final java.util.regex.Pattern NAME_EQUAL_VALUE_PATTERN
public static int guessFieldCount(java.lang.String filename) throws java.io.FileNotFoundException, java.io.IOException
java.io.FileNotFoundException
java.io.IOException
public static VectorDataSetParser newParser(int fieldCount)
public static VectorDataSetParser newParser(java.lang.String[] fieldNames)
public void setSkipLines(int skipLines)
public void setRecordCountLimit(int recordCountLimit)
public void setPropertyPattern(java.util.regex.Pattern propertyPattern)
public VectorDataSet readStream(java.io.InputStream in) throws java.io.IOException
java.io.IOException
public VectorDataSet readFile(java.lang.String filename) throws java.io.IOException
java.io.IOException
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception