Package ucar.nc2.iosp
Class LayoutRegular
java.lang.Object
ucar.nc2.iosp.LayoutRegular
- All Implemented Interfaces:
Layout
Indexer into data that has a "regular" layout, like netcdf-3 and hdf5 compact and contiguous storage.
The data is contiguous, with outer dimension varying fastest.
Given a Section, this calculates the set of contiguous "chunks" of the wanted data into the stored data.
The wanted section is always a subset of the data section (see RegularSectionLayout where thats not the case).
- Since:
- Jan 3, 2008
-
Nested Class Summary
Nested classes/interfaces inherited from interface ucar.nc2.iosp.Layout
Layout.Chunk -
Constructor Summary
ConstructorsConstructorDescriptionLayoutRegular(long startPos, int elemSize, int[] varShape, Section wantSection) Constructor. -
Method Summary
-
Constructor Details
-
LayoutRegular
public LayoutRegular(long startPos, int elemSize, int[] varShape, @Nullable Section wantSection) throws InvalidRangeException Constructor.- Parameters:
startPos- starting address of the entire data array.elemSize- size of an element in bytes.varShape- shape of the entire data array.wantSection- the wanted section of data, contains a List of Range objects.- Throws:
InvalidRangeException- if ranges are misformed
-
-
Method Details
-
getTotalNelems
public long getTotalNelems()Description copied from interface:LayoutGet total number of elements in the wanted subset.- Specified by:
getTotalNelemsin interfaceLayout- Returns:
- total number of elements in the wanted subset.
-
getElemSize
public int getElemSize()Description copied from interface:LayoutGet size of each element in bytes.- Specified by:
getElemSizein interfaceLayout- Returns:
- size of each element in bytes.
-
hasNext
public boolean hasNext()Description copied from interface:LayoutIs there more to do -
next
Description copied from interface:LayoutGet the next chunk
-