public class OdlParser
extends java.lang.Object
Constructor and Description |
---|
OdlParser() |
Modifier and Type | Method and Description |
---|---|
static int[] |
getColumns(JSONObject record,
int startColumn,
java.lang.String name)
Return the records of the object with the name, with nested object names delimited
with a period (POSN is a vector, POSN.X is the component).
|
static QDataSet |
getDataSet(JSONObject record,
QDataSet ds,
java.lang.String name)
return the data with the given name
|
static int |
getFieldCount(JSONObject record) |
static java.lang.String |
getFormat(JSONObject record)
return the format, though it doesn't appear to work.
|
static java.lang.String[] |
getNames(JSONObject record,
java.lang.String name,
boolean includeComposite,
java.util.List<java.lang.String> result)
return a list of names which can be requested.
|
static java.lang.String |
readOdl(java.io.BufferedReader r,
JSONObject record)
read the ODL off the top of the file, returning the ODL
in a string and leaving the InputStream pointed at the
line following the ODL.
|
static QDataSet |
readStream(java.io.BufferedReader r,
JSONObject record,
ProgressMonitor monitor)
read the stream based on the spec in record.
|
public static java.lang.String readOdl(java.io.BufferedReader r, JSONObject record) throws java.io.IOException, JSONException
r
- reader for the file which starts with ODL. The reader will be left pointing at the first non-ODL line.record
- java.io.IOException
JSONException
- neverpublic static QDataSet readStream(java.io.BufferedReader r, JSONObject record, ProgressMonitor monitor) throws java.io.IOException
r
- the reader, pointed after the ODL header.record
- monitor
- java.io.IOException
public static int getFieldCount(JSONObject record)
public static java.lang.String getFormat(JSONObject record)
record
- public static java.lang.String[] getNames(JSONObject record, java.lang.String name, boolean includeComposite, java.util.List<java.lang.String> result)
record
- the node, typically then entire STS record.name
- the name of the node, "" for the root.includeComposite
- include the single-column names, for example BGSM as well as BGSM.X.result
- null or the name of a list to collect the names.public static int[] getColumns(JSONObject record, int startColumn, java.lang.String name)
record
- the JSON describing the file, or subset of the rows when startColumn is non-zero.startColumn
- starting column for the JSON.name
- of the object (POSN.X for example).