public D4Cursor compileSequence ( DapVariable var , DapSequence dapseq , D4Cursor container ) throws DapException { int pos = getPos ( this . databuffer ) ; D4Cursor seq = new D4Cursor ( Scheme . SEQUENCE , this . dsp , var , container ) . setOffset ( pos ) ; List < DapVariable > dfields = dapseq . getFields ( ) ; // Get the count of the number of records long nrecs = getCount ( this . databuffer ) ; for ( int r = 0 ; r < nrecs ; r ++ ) { pos = getPos ( this . databuffer ) ; D4Cursor rec = ( D4Cursor ) new D4Cursor ( D4Cursor . Scheme . RECORD , this . dsp , var , container ) . setOffset ( pos ) . setRecordIndex ( r ) ; for ( int m = 0 ; m < dfields . size ( ) ; m ++ ) { DapVariable dfield = dfields . get ( m ) ; D4Cursor dvfield = compileVar ( dfield , rec ) ; rec . addField ( m , dvfield ) ; assert dfield . getParent ( ) != null ; } seq . addRecord ( rec ) ; } return seq ; }
Compile a sequence as a set of records .