Package ucar.nc2.iosp

Class IndexChunker.Chunk

  • All Implemented Interfaces:
    Layout.Chunk
    Enclosing class:
    IndexChunker

    public static class IndexChunker.Chunk
    extends Object
    implements Layout.Chunk
    A chunk of data that is contiguous in both the source and destination. Everything is done in elements, not bytes. Read nelems from src at srcPos, store in destination at destPos.
    • Constructor Detail

      • Chunk

        public Chunk​(long srcElem,
                     int nelems,
                     long destElem)
    • Method Detail

      • getSrcElem

        public long getSrcElem()
        Get the position in source where to read or write
        Returns:
        position as an element count
      • getNelems

        public int getNelems()
        Description copied from interface: Layout.Chunk
        Get number of elements to transfer contiguously (Note: elements, not bytes)
        Specified by:
        getNelems in interface Layout.Chunk
      • getDestElem

        public long getDestElem()
        Description copied from interface: Layout.Chunk
        Get starting element position as a 1D element index into the destination, eg the requested array with shape "wantSection".
        Specified by:
        getDestElem in interface Layout.Chunk
        Returns:
        starting element in the array (Note: elements, not bytes)
      • getSrcPos

        public long getSrcPos()
        Description copied from interface: Layout.Chunk
        Get the position in source where to read or write: eg "file position"
        Specified by:
        getSrcPos in interface Layout.Chunk