org.das2.qds.util.DataSetBuilder

allows dataset of unknown length to be built. Presently, this only builds QUBES, but should allow for geometry changes. TODO: consider using WritableDataSet interface. The guessRecCount parameter is the initial number of allocated records, and is also the extension when this number of records is passed. The final physical dataset size is not affected by this, because the data is copied.


UNRESOLVED_PROP_QDATASET


getLength

getLength( ) → int

return the number of records added to the builder.

Returns:

the number of records added to the builder.

search for examples view on GitHub view source


getRecordElements

getRecordElements( ) → int

return the number of elements in each record.

Returns:

the number of elements in each record.

search for examples view on GitHub view source


nextRecord

nextRecord( ) → void

This must be called each time a record is complete. Note this currently advances to the next record and at this point the next record exists. In other words, the last call to nextRecord is not required. This logic may change, so that any fields written would be dropped unless nextRecord is called to commit the record. When -1 is used for the indexes of the streaming dimension, then this will increment the internal counter. TODO: Check for unspecified entries.

Returns:

void (returns nothing)

See Also:

nextRecord(java.lang.Object...) which inserts all values at once.


search for examples view on GitHub view source


nextRecords

nextRecords( QDataSet ds ) → void

add each of the records of ds to the builder. This is somewhat equivalent to:

 
 for d in ds: dsb.nextRecord(d)
 
 
(Note the above only works when ds is rank 1.) Though this is equivalent, this is provided because a future implementation may peek at the dataset to transfer data more efficiently.

Parameters

ds - dataset with rank N, where N is the rank of this builder.

Returns:

void (returns nothing)

search for examples view on GitHub view source


putUnresolvedProperty

putUnresolvedProperty( String type, String pname, String svalue ) → void

mark the property as unresolved, for reference later. This was added for the QStream reader, which doesn't resolve

Parameters

type - the property type, if qdataset this is resolved with dataSetResolver.
pname - the property name ("gain")
svalue - the arbitrary reference ("gain_04")

Returns:

void (returns nothing)

search for examples view on GitHub view source


resolveProperty

resolveProperty( String svalue, Object value ) → void

we now know the value, so resolve any unresolved properties containing the string representation. Note the entry is left in the unresolved properties.

Parameters

svalue - the string reference
value - the object value

Returns:

void (returns nothing)

search for examples view on GitHub view source


setDataSetResolver

setDataSetResolver( org.das2.qds.util.DataSetBuilder.DataSetResolver dataSetResolver ) → void

add dataset resolved.

Parameters

dataSetResolver -

Returns:

void (returns nothing)

search for examples view on GitHub view source


setName

setName( int i, String name ) → void

set the name (valid Jython identifier) for the column.

Parameters

i - the column number
name - the name (valid Jython identifier) for the column.

Returns:

void (returns nothing)

search for examples view on GitHub view source