Class IntBufferAccess
java.lang.Object
net.imglib2.img.basictypeaccess.nio.AbstractBufferAccess<IntBufferAccess, IntBuffer>
net.imglib2.img.basictypeaccess.nio.IntBufferAccess
- All Implemented Interfaces:
Serializable, ArrayDataAccess<IntBufferAccess>, DataAccess, IntAccess, BufferAccess<IntBufferAccess>, VolatileAccess, VolatileIntAccess
public class IntBufferAccess
extends AbstractBufferAccess<IntBufferAccess, IntBuffer>
implements VolatileIntAccess
Access for
IntBuffer- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intprivate static final longAutomatically generatedFields inherited from class AbstractBufferAccess
buffer, DEFAULT_IS_VALID -
Constructor Summary
ConstructorsConstructorDescriptionIntBufferAccess(int numEntities) IntBufferAccess(int numEntities, boolean isValid) IntBufferAccess(ByteBuffer buffer) IntBufferAccess(ByteBuffer buffer, boolean isValid) IntBufferAccess(IntBuffer buffer) IntBufferAccess(IntBuffer buffer, boolean isValid) -
Method Summary
Modifier and TypeMethodDescription(package private) IntBufferAccessallocate(int numEntities, boolean isDirect, boolean isValid) Override abstract implementation to allow for longer non-direct Buffers since ByteBuffer is restricted to Integer.MAX_VALUE entities.(package private) IntBufferduplicateBuffer(IntBuffer buffer) Call Buffer.duplicate() Buffer.duplicate() only exists in the interface since Java 9 https://docs.oracle.com/javase/9/docs/api/java/nio/Buffer.html#duplicate--static IntBufferAccessfromByteBuffer(ByteBuffer buffer, boolean isValid) Create a new IntBufferAccess from a ByteBufferintGet number of bytes for one entity in thisBufferAccess.intgetValue(int index) getValues(AbstractIntArray<?> array) Copy values into aAbstractIntArray.getValues(AbstractIntArray<?> array, int offset, int length) Copy values into aAbstractIntArray.newInstance(ByteBuffer buffer, boolean isValid) Create a new instance from a ByteBuffernewInstance(IntBuffer buffer, boolean isValid) Create a new instance of this class given a Buffer of the same type.voidsetValue(int index, int value) setValues(AbstractIntArray<?> array) Copy values from aAbstractIntArray.setValues(AbstractIntArray<?> array, int offset, int length) Copy values from aAbstractIntArray.setValues(IntBufferAccess access) Copy values from another IntBufferAccess.Methods inherited from class AbstractBufferAccess
allocate, allocateByteBuffer, createArray, createView, getArrayLength, getCurrentStorageArray, isDirect, isReadOnly, isValidMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface DataAccess
createViewMethods inherited from interface VolatileAccess
isValid
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDAutomatically generated- See Also:
-
NUM_BYTES_PER_ENTITY
private static final int NUM_BYTES_PER_ENTITY- See Also:
-
-
Constructor Details
-
IntBufferAccess
-
IntBufferAccess
public IntBufferAccess(int numEntities, boolean isValid) -
IntBufferAccess
-
IntBufferAccess
-
IntBufferAccess
public IntBufferAccess(int numEntities) -
IntBufferAccess
-
IntBufferAccess
public IntBufferAccess()
-
-
Method Details
-
getValue
-
setValue
-
getNumBytesPerEntity
public int getNumBytesPerEntity()Description copied from interface:BufferAccessGet number of bytes for one entity in thisBufferAccess. This usually retrieves a static field.- Specified by:
getNumBytesPerEntityin interfaceBufferAccess<IntBufferAccess>- Returns:
- number of bytes
-
newInstance
Description copied from interface:BufferAccessCreate a new instance from a ByteBuffer- Specified by:
newInstancein interfaceBufferAccess<IntBufferAccess>- Parameters:
buffer-isValid-- Returns:
-
newInstance
Description copied from class:AbstractBufferAccessCreate a new instance of this class given a Buffer of the same type.- Specified by:
newInstancein classAbstractBufferAccess<IntBufferAccess, IntBuffer>- Parameters:
buffer-isValid-- Returns:
-
duplicateBuffer
Description copied from class:AbstractBufferAccessCall Buffer.duplicate() Buffer.duplicate() only exists in the interface since Java 9 https://docs.oracle.com/javase/9/docs/api/java/nio/Buffer.html#duplicate--- Specified by:
duplicateBufferin classAbstractBufferAccess<IntBufferAccess, IntBuffer>- Returns:
-
allocate
Override abstract implementation to allow for longer non-direct Buffers since ByteBuffer is restricted to Integer.MAX_VALUE entities.- Overrides:
allocatein classAbstractBufferAccess<IntBufferAccess, IntBuffer>- Parameters:
numEntities-isDirect-isValid-- Returns:
-
fromByteBuffer
Create a new IntBufferAccess from a ByteBuffer- Parameters:
buffer-isValid-- Returns:
-
getValues
Copy values into aAbstractIntArray.- Parameters:
array-- Returns:
- See Also:
-
getValues
Copy values into aAbstractIntArray.- Parameters:
array-offset-length-- Returns:
- See Also:
-
setValues
Copy values from aAbstractIntArray.- Parameters:
array-- Returns:
- See Also:
-
setValues
Copy values from aAbstractIntArray.- Parameters:
array-offset-length-- Returns:
- See Also:
-
setValues
Copy values from another IntBufferAccess.- Parameters:
access-- Returns:
-