org.python.core.buffer

## Class Base1DBuffer

- java.lang.Object
- - org.python.core.buffer.BaseBuffer
  - - org.python.core.buffer.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.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.python.core.PyBuffer

      `PyBuffer.Pointer`

  - ### Field Summary

    - ### Fields inherited from interface org.python.core.PyBUF

      `ANY_CONTIGUOUS, AS_ARRAY, C_CONTIGUOUS, CONTIG, CONTIG_RO, CONTIGUITY, F_CONTIGUOUS, FORMAT, FULL, FULL_RO, INDIRECT, IS_C_CONTIGUOUS, IS_F_CONTIGUOUS, MAX_NDIM, NAVIGATION, ND, RECORDS, RECORDS_RO, SIMPLE, STRIDED, STRIDED_RO, STRIDES, WRITABLE`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getLen()` 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.
    `boolean` | `isContiguous(char order)` Enquire whether the array is represented contiguously in the backing storage, according to C or Fortran ordering.

    - ### Methods inherited from class org.python.core.buffer.BaseBuffer

      `byteAt, byteAt, byteIndex, byteIndex, close, copyFrom, copyFrom, copyTo, copyTo, getBuf, getBuffer, getBufferAgain, getBufferSlice, getFormat, getItemsize, getNdim, getNIOByteBuffer, getObj, getPointer, getPointer, getShape, getStrides, getSuboffsets, hasArray, intAt, intAt, isReadonly, isReleased, release, storeAt, storeAt, toString`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface org.python.core.PyBuffer

      `getBufferSlice`

- - ### 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

Jython homepage