org.das2.qds.ArrayDataSet

A number of static methods were initially defined in DDataSet, then copied into FDataSet and others when they were made. This super implementation will parent all such datasets and provide common methods.


about

about( ) → void

print some info about this ArrayDataSet.

Returns:

void (returns nothing)

search for examples view on GitHub view source


append

append( org.das2.qds.ArrayDataSet ds ) → void

append the dataset with the same geometry but different number of records (zeroth dim) to this. An IllegalArgumentException is thrown when there is not enough room. See grow(newRecCount). Not thread safe--we need to go through and make it so...

Parameters

ds -

Returns:

void (returns nothing)

search for examples view on GitHub view source


canAppend

canAppend( org.das2.qds.ArrayDataSet ds ) → boolean

return true if the dataset can be appended. Note this assumes that the same length, etc. This just checks that we have the number of spare records in the backing store.

Parameters

ds - the dataset to test

Returns:

true if the dataset can be appended.

search for examples view on GitHub view source


createRank0

createRank0( java.lang.Class c ) → ArrayDataSet

create a rank 0 dataset of the class, which can be double.class, float.class, long.class, int.class, short.class and byte.class

Parameters

c - the primitive class of each element.

Returns:

the ArrayDataSet

search for examples view on GitHub view source


flattenArray

flattenArray( Object array, int[] qube ) → Object

Returns:

java.lang.Object

search for examples view on GitHub view source


getComponentType

getComponentType( ) → Class

return the component type of the backing array, such as double.class.

Returns:

the component type of the backing array.

See Also:

create(java.lang.Class, int[])


search for examples view on GitHub view source


grow

grow( int newRecCount ) → void

grow the internal store so that append may be used to resize the dataset.

Parameters

newRecCount - new number of records, which includes the old records.

Returns:

void (returns nothing)

See Also:

putLength(int)


search for examples view on GitHub view source


guessBackingStore

guessBackingStore( QDataSet ds ) → Class

guess the type of the backing store, returning double.class if it cannot be determined. TODO: Why not long.class?

Parameters

ds - the dataset

Returns:

the backing store class, one of double.class, float.class, int.class, short.class, or byte.class.

See Also:

copy(QDataSet) copy


search for examples view on GitHub view source


jvmMemory

jvmMemory( ) → int

returns the size of the dataset in bytes.

Returns:

the size of the dataset in bytes.

See Also:

org.das2.qds.buffer.BufferDataSet which stores data outside of the JVM. which stores data outside of the JVM.


search for examples view on GitHub view source


maybeCopy

maybeCopy( QDataSet ds ) → ArrayDataSet

Copy the dataset to an ArrayDataSet only if the dataset is not already an ArrayDataSet that is mutable.

Parameters

ds - the dataset to copy, which may be an ArrayDataSet

Returns:

an ArrayDataSet.

search for examples view on GitHub view source


monotonicSubset

monotonicSubset( org.das2.qds.ArrayDataSet ds ) → ArrayDataSet

ensure that there are no non-monotonic or repeat records, by removing the first N-1 records of N repeated records.

Parameters

ds - ArrayDataSet, which must be writable.

Returns:

dataset, possibly with records removed.

search for examples view on GitHub view source


monotonicSubset2

monotonicSubset2( org.das2.qds.ArrayDataSet ds ) → ArrayDataSet

ensure that there are no non-monotonic or repeat records, by starting at the middle of the dataset and finding the monotonic subsection. The input need not be writable.

Parameters

ds - ArrayDataSet, which must be writable.

Returns:

dataset, possibly with records removed.

search for examples view on GitHub view source


putLength

putLength( int len ) → void

Shorten the dataset by changing it's dim 0 length parameter. The same backing array is used, so the element that remain will be the same. This can only be used to shorten datasets, see grow to lengthen.

Parameters

len - new number of records

Returns:

void (returns nothing)

See Also:

grow(int)


search for examples view on GitHub view source