ucar.nc2.iosp
Class RegularSectionLayout

java.lang.Object
  extended by ucar.nc2.iosp.Indexer
      extended by ucar.nc2.iosp.RegularSectionLayout

Deprecated. see LayoutTiled

public class RegularSectionLayout
extends Indexer

Assume that the data is stored divided into sections, described by dataSection. All the data within a dataSection is stored contiguously, in a regular layout. Assume dataSection strides must be = 1, that is the stored data is not strided.

The user asks for some section, wantSection (may have strides). For each dataSection that intersects wantSection, a RegularSectionLayout is created, which figures out the optimal access pattern, based on reading contiguous runs of data. Each RegularSectionLayout handles only one dataSection.

Both dataSection and wantSection refer to the variable's overall shape.

Author:
caron

Nested Class Summary
 
Nested classes/interfaces inherited from class ucar.nc2.iosp.Indexer
Indexer.Chunk
 
Constructor Summary
RegularSectionLayout(long startFilePos, int elemSize, Section dataSection, Section wantSection)
          Deprecated. Constructor.
 
Method Summary
static Indexer factory(long startFilePos, int elemSize, Section dataSection, Section wantSection)
          Deprecated. This factory allows us to optimize special cases.
 int getElemSize()
          Deprecated.  
 long getTotalNelems()
          Deprecated.  
 boolean hasNext()
          Deprecated.  
 Indexer.Chunk next()
          Deprecated. Get the next chunk
 java.lang.String toString()
          Deprecated.  
 
Methods inherited from class ucar.nc2.iosp.Indexer
printa, printa
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RegularSectionLayout

public RegularSectionLayout(long startFilePos,
                            int elemSize,
                            Section dataSection,
                            Section wantSection)
                     throws InvalidRangeException
Deprecated. 
Constructor. Assume varSection.intersects(wantSection).

Parameters:
startFilePos - starting address of the dataSection
elemSize - size of an element in bytes.
dataSection - the section of data we actually have. must have all ranges with stride = 1.
wantSection - the wanted section of data, it will be intersected with dataSection. dataSection.intersects(wantSection) must be true
Throws:
InvalidRangeException - if ranges are malformed
Method Detail

factory

public static Indexer factory(long startFilePos,
                              int elemSize,
                              Section dataSection,
                              Section wantSection)
                       throws InvalidRangeException
Deprecated. 
This factory allows us to optimize special cases.

Parameters:
startFilePos - starting address of the dataSection
elemSize - size of an element in bytes.
dataSection - the section of data we actually have. must have all ranges with stride = 1.
wantSection - the wanted section of data, it will be intersected with dataSection. dataSection.intersects(wantSection) must be true
Returns:
an Indexer to handle this case
Throws:
InvalidRangeException - if ranges are malformed

getTotalNelems

public long getTotalNelems()
Deprecated. 
Specified by:
getTotalNelems in class Indexer
Returns:
total number of elements in the wanted subset.

getElemSize

public int getElemSize()
Deprecated. 
Specified by:
getElemSize in class Indexer
Returns:
size of each element in bytes.

hasNext

public boolean hasNext()
Deprecated. 
Specified by:
hasNext in class Indexer
Returns:
true if theres more to do

next

public Indexer.Chunk next()
Deprecated. 
Description copied from class: Indexer
Get the next chunk

Specified by:
next in class Indexer
Returns:
next chunk, or null if !hasNext()

toString

public java.lang.String toString()
Deprecated. 
Overrides:
toString in class java.lang.Object