package org.autoplot.cdf;
import org.das2.qds.AbstractDataSet;
import org.das2.qds.DataSetOps;
import org.das2.qds.DataSetUtil;
import org.das2.qds.QDataSet;
/**
* QDataSet implementation that appends datasets together to make them
* look like one long dataset.
* Each dataset must have the same qube. This is for efficiency.
*
* limitations:
* - doesn't check DEPEND_1 when checking qube.
*
* @author jbf
*/
public class SegmentedBufferDataSet extends AbstractDataSet {
private final int rank;
private final int[] segStart;
private final int[] segStop;
private int currentSegment= 0;
private QDataSet[] segments;
protected SegmentedBufferDataSet( int rank, QDataSet[] segments ) {
this.rank= rank;
this.segStart= new int[segments.length];
this.segStop= new int[segments.length];
this.segStart[0]= 0;
int[] tqube=null;
for ( int i=0;i=segStop[currentSegment] ) {
currentSegment++;
}
if ( currentSegment==segStart.length ) {
currentSegment=0;
throw new IndexOutOfBoundsException( String.format( "%d is too high", idx0 ) );
}
while ( currentSegment>0 && idx0