Package org.python.core.buffer
Class Base1DBuffer
java.lang.Object
org.python.core.buffer.BaseBuffer
org.python.core.buffer.Base1DBuffer
- All Implemented Interfaces:
AutoCloseable
,BufferProtocol
,PyBUF
,PyBuffer
- Direct Known Subclasses:
BaseArrayBuffer
,BaseNIOBuffer
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
Modifier and TypeMethodDescriptionint
getLen()
The total number of bytes represented by the view, which will be the product of the elements of theshape
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 Details
-
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 theshape
array, and the item size in bytes.- Specified by:
getLen
in interfacePyBUF
- Overrides:
getLen
in classBaseBuffer
- 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 interfacePyBUF
- Overrides:
isContiguous
in classBaseBuffer
- 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
-