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.
DataSetBuilder( int rank )
Create a new builder for a rank 0 dataset.
DataSetBuilder( int rank, int guessRecCount )
Create a new builder for a rank 1 dataset.
guessRecCount is the guess of dim0 size. Bad guesses will simply result in an extra array copy.
DataSetBuilder( int rank, int guessRecCount, int dim1 )
Create a new builder for a rank 2 dataset.
guessRecCount is the guess of dim0 size. Bad guesses will simply result in an extra array copy.
DataSetBuilder( int rank, int guessRecCount, int dim1, int dim2 )
Create a new builder for a rank 3 dataset.
guessRecCount is the guess of dim0 size. Bad guesses will simply result in an extra array copy.
DataSetBuilder( int rank, int guessRecCount, int dim1, int dim2, int dim3 )
Create a new builder for a rank 4 dataset.
guessRecCount is the guess of dim0 size. Bad guesses will simply result in an extra array copy.
UNRESOLVED_PROP_QDATASET
PROP_VALIDMIN
PROP_VALIDMAX
addPropertyChangeListener
addPropertyChangeListener( java.beans.PropertyChangeListener l ) → void
Adds a PropertyChangeListener to the listener list.
Parameters
l - The listener to add.
Returns:
void (returns nothing)
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
getDataSet
getDataSet( ) → DDataSet
returns the result dataset, concatenating all the datasets it has built thus far, including the partial record.
See https://sourceforge.net/p/autoplot/bugs/1469/ which considers if the partial record should be included. Clients should
always call nextRecord on all completed records in case the logic changes. See also the AsciiParser, which has special
code for handling the partial record.
Returns:
the result dataset
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
getFillValue
getFillValue( ) → double
Getter for property fillValue.
Returns:
Value of property fillValue.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
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 on old javadoc]
[view source]
getProperties
getProperties( ) → Map
get a map of all the properties set thus far.
Returns:
a java.util.Map
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
getRecCount
getRecCount( ) → int
return the number of records accepted into this builder, and the length of the dataset
if getDataSet is called.
Returns:
the number of records accepted into this builder
[search for examples]
[view on GitHub]
[view on old javadoc]
[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 on old javadoc]
[view source]
getUnits
getUnits( int i ) → Units
get the units for the column.
Parameters
i - an int
Returns:
the units or null.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
getValidMax
getValidMax( ) → double
Returns:
double
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
getValidMin
getValidMin( ) → double
Returns:
double
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
getValue
getValue( int index0 ) → double
for index0==-1, return the last value entered into the rank 1 dataset.
Parameters
index0 - an int
Returns:
a double
[search for examples]
[view on GitHub]
[view on old javadoc]
[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 on old javadoc]
[view source]
nextRecord( double[] values ) → void
nextRecord( java.lang.Object[] values ) → void
nextRecord( org.das2.datum.DatumVector v ) → void
nextRecord( QDataSet v ) → void
nextRecord( double v ) → void
nextRecord( String s ) → void
nextRecord( Datum v ) → void
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 on old javadoc]
[view source]
putProperty
putProperty( String string, Object o ) → void
add the property to the dataset
Parameters
string - name like QDataSet.UNITS
o - the value
Returns:
void (returns nothing)
[search for examples]
[view on GitHub]
[view on old javadoc]
[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 on old javadoc]
[view source]
putValue
putValue( int index0, double d ) → void
insert a value into the builder.
Parameters
index0 - The index to insert the data, or if -1, ignore and nextRecord() should be used.
d - the value to insert.
Returns:
void (returns nothing)
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
putValue( int index0, int index1, double d ) → void
putValue( int index0, int index1, int index2, double d ) → void
putValue( int index0, int index1, int index2, int index3, double d ) → void
putValue( int index0, Datum d ) → void
putValue( int index0, int index1, Datum d ) → void
putValue( int index0, int index1, int index2, Datum d ) → void
putValue( int index0, int index1, int index2, int index3, Datum d ) → void
putValue( int index0, QDataSet d ) → void
putValue( int index0, int index1, QDataSet d ) → void
putValue( int index0, int index1, int index2, QDataSet d ) → void
putValue( int index0, int index1, int index2, int index3, QDataSet d ) → void
putValue( int index0, String s ) → void
putValue( int index0, int index1, String s ) → void
putValues
putValues( int index0, QDataSet values, int count ) → void
copy the elements from one DDataSet into the builder (which can be done with
a system call), ignoring dataset geometry. TODO: since the element count
allows for putting multiple records in at once, an index out of bounds may
occur after the last record of current is written.
This should only be used to insert one record (with multiple values) at a time.
Note this does not increment the current index, and nextRecord must be called to move to the next index.
Parameters
index0 - The index to put the values, or -1 for the current position.
values - rank 1 dataset.
count - the number of elements to copy
Returns:
void (returns nothing)
See Also:
nextRecords(QDataSet) to insert multiple records at once.
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
rank
rank( ) → int
return the rank of the dataset we are building.
Returns:
the rank of the dataset we are building
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
removePropertyChangeListener
removePropertyChangeListener( java.beans.PropertyChangeListener l ) → void
Removes a PropertyChangeListener from the listener list.
Parameters
l - The listener to remove.
Returns:
void (returns nothing)
[search for examples]
[view on GitHub]
[view on old javadoc]
[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 on old javadoc]
[view source]
setDataSetResolver
setDataSetResolver( org.das2.qds.util.DataSetBuilder.DataSetResolver dataSetResolver ) → void
add dataset resolved.
Parameters
dataSetResolver - a DataSetBuilder.DataSetResolver
Returns:
void (returns nothing)
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
setFillValue
setFillValue( double fillValue ) → void
Setter for property fillValue.
Parameters
fillValue - New value of property fillValue.
Returns:
void (returns nothing)
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
setLabel
setLabel( int i, String label ) → void
set the label (short, descriptive label for human consumption)
for the column, for rank 2 bundle datasets.
Parameters
i - the column number
label - the label for the column
Returns:
void (returns nothing)
[search for examples]
[view on GitHub]
[view on old javadoc]
[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 on old javadoc]
[view source]
setUnits
setUnits( Units u ) → void
set the units for the dataset.
Parameters
u - an Units
Returns:
void (returns nothing)
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
setUnits( int i, Units u ) → void
setValidMax
setValidMax( double validMax ) → void
set the valid max property.
Parameters
validMax - a double
Returns:
void (returns nothing)
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
setValidMin
setValidMin( double validMin ) → void
Parameters
validMin - a double
Returns:
void (returns nothing)
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]
toString
toString( ) → String
Returns:
java.lang.String
[search for examples]
[view on GitHub]
[view on old javadoc]
[view source]