ucar.nc2
Class RegularIndexer
java.lang.Object
ucar.nc2.Indexer
ucar.nc2.RegularIndexer
public class RegularIndexer
- extends Indexer
Indexer into a regular array.
This calculates byte lengths and offsets of the wanted data into the entire data.
Assumes that the data is stored "regularly", like netcdf arrays and hdf5 continuous storage.
Also handles netcdf3 record dimensions.
- Version:
- $Revision: 51 $ $Date: 2006-07-12 17:13:13Z $
- Author:
- caron
|
Constructor Summary |
RegularIndexer(int[] varShape,
int elemSize,
long startPos,
java.util.List section,
int recSize)
Constructor. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RegularIndexer
public RegularIndexer(int[] varShape,
int elemSize,
long startPos,
java.util.List section,
int recSize)
throws InvalidRangeException
- Constructor.
- Parameters:
varShape - shape of the entire data array.elemSize - size of on element in bytes.startPos - starting address of the entire data array.section - the wanted section of data: List of Range objects,
corresponding to each Dimension, else null means all.recSize - if > 0, then size of outer stride in bytes, else ignored
- Throws:
InvalidRangeException - is ranges are misformed
getWantShape
public int[] getWantShape()
getTotalNelems
public int getTotalNelems()
- Specified by:
getTotalNelems in class Indexer
- Returns:
- total number of elements in the wanted subset.
getElemSize
public int getElemSize()
- Specified by:
getElemSize in class Indexer
- Returns:
- size of each element in bytes.
hasNext
public boolean hasNext()
- Specified by:
hasNext in class Indexer
- Returns:
- true if theres more to do
next
public Indexer.Chunk next()
- Specified by:
next in class Indexer
- Returns:
- next chunk