## org.das2.qds.util.OdlParser

Tool for parsing ODL found at the top of .STS files.

## OdlParser( )

## getColumns

getColumns( JSONObject record, int startColumn, String name ) → int[]

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). This will return a two-element int array indicating the position: [start,endExclusive] for vectors, [col,col] for scalars or a vector component, or [-1,-1] when the name is not found. Zero is the first column.

### Parameters

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

### Returns:

[start,endExclusive] for vectors, [col,col] for scalars or a vector component, or [-1,-1] when the name is not found.
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## getDataSet

getDataSet( JSONObject record, QDataSet ds, String name ) → QDataSet

return the data with the given name

### Parameters

record - a JSONObject
ds - a QDataSet
name - a String

### Returns:

a QDataSet
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## getFieldCount

getFieldCount( JSONObject record ) → int

### Parameters

record - a JSONObject

### Returns:

int
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## getFormat

getFormat( JSONObject record ) → String

return the format, though it doesn't appear to work.

### Parameters

record - a JSONObject

### Returns:

a String
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## getNames

getNames( JSONObject record, String name, boolean includeComposite, java.util.List result ) → String[]

return a list of names which can be requested.

### Parameters

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.

### Returns:

a String[]
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## readOdl

readOdl( java.io.BufferedReader r, JSONObject record ) → String

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.

### Parameters

r - reader for the file which starts with ODL. The reader will be left pointing at the first non-ODL line.
record - a JSONObject

### Returns:

the ODL header.
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## readStream

readStream( java.io.BufferedReader r, JSONObject record, ProgressMonitor monitor ) → QDataSet

read the stream based on the spec in record.

### Parameters

r - the reader, pointed after the ODL header.
record - a JSONObject
monitor - a ProgressMonitor

### Returns:

a QDataSet
[search for examples] [view on GitHub] [view on old javadoc] [view source]