Class Base1DBuffer

  • All Implemented Interfaces:
    java.lang.AutoCloseable, BufferProtocol, PyBUF, PyBuffer
    Direct Known Subclasses:
    BaseArrayBuffer, BaseNIOBuffer

    public abstract class Base1DBuffer
    extends BaseBuffer
    Base implementation of the Buffer API appropriate to 1-dimensional arrays, of any item size, independent of the storage implementation. The description of BaseBuffer mostly applies.
    • Method Detail

      • getLen

        public int getLen()
        Description copied from interface: PyBUF
        The total number of bytes represented by the view, which will be the product of the elements of the shape array, and the item size in bytes.
        Specified by:
        getLen in interface PyBUF
        Overrides:
        getLen in class BaseBuffer
        Returns:
        the total number of bytes represented.
      • isContiguous

        public boolean isContiguous​(char order)
        Enquire whether the array is represented contiguously in the backing storage, according to C or Fortran ordering. A one-dimensional contiguous array is both.

        Specialised in BaseArrayBuffer to one dimension.

        Specified by:
        isContiguous in interface PyBUF
        Overrides:
        isContiguous in class BaseBuffer
        Parameters:
        order - 'C', 'F' or 'A', as the storage order is C, Fortran or either.
        Returns:
        true iff the array is stored contiguously in the order specified