Package ucar.nc2.iosp

Class LayoutSegmented

  • All Implemented Interfaces:
    Layout

    public class LayoutSegmented
    extends Object
    implements Layout
    LayoutSegmented has data stored in segments. Assume that each segment size is a multiple of elemSize. Used by HDF4.
    • Constructor Detail

      • LayoutSegmented

        public LayoutSegmented​(long[] segPos,
                               int[] segSize,
                               int elemSize,
                               int[] srcShape,
                               Section wantSection)
                        throws InvalidRangeException
        Constructor.
        Parameters:
        segPos - starting address of each segment.
        segSize - number of bytes in each segment. Assume multiple of elemSize
        elemSize - size of an element in bytes.
        srcShape - shape of the entire data array.
        wantSection - the wanted section of data
        Throws:
        InvalidRangeException - if ranges are misformed
    • Method Detail

      • getTotalNelems

        public long getTotalNelems()
        Description copied from interface: Layout
        Get total number of elements in the wanted subset.
        Specified by:
        getTotalNelems in interface Layout
      • getElemSize

        public int getElemSize()
        Description copied from interface: Layout
        Get size of each element in bytes.
        Specified by:
        getElemSize in interface Layout
      • hasNext

        public boolean hasNext()
        Description copied from interface: Layout
        Is there more to do?
        Specified by:
        hasNext in interface Layout
      • next

        public Layout.Chunk next()
        Description copied from interface: Layout
        Get the next chunk, not null if hasNext() is true.
        Specified by:
        next in interface Layout