Class CharBufferAccess
java.lang.Object
net.imglib2.img.basictypeaccess.nio.AbstractBufferAccess<CharBufferAccess, CharBuffer>
net.imglib2.img.basictypeaccess.nio.CharBufferAccess
- All Implemented Interfaces:
Serializable, ArrayDataAccess<CharBufferAccess>, CharAccess, DataAccess, BufferAccess<CharBufferAccess>, VolatileAccess, VolatileCharAccess
public class CharBufferAccess
extends AbstractBufferAccess<CharBufferAccess, CharBuffer>
implements VolatileCharAccess
Access for
CharBuffer- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intprivate static final longAutomatically generatedFields inherited from class AbstractBufferAccess
buffer, DEFAULT_IS_VALID -
Constructor Summary
ConstructorsConstructorDescriptionCharBufferAccess(int numEntities) CharBufferAccess(int numEntities, boolean isValid) CharBufferAccess(ByteBuffer buffer) CharBufferAccess(ByteBuffer buffer, boolean isValid) CharBufferAccess(CharBuffer buffer) CharBufferAccess(CharBuffer buffer, boolean isValid) -
Method Summary
Modifier and TypeMethodDescription(package private) CharBufferAccessallocate(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) CharBufferduplicateBuffer(CharBuffer 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 CharBufferAccessfromByteBuffer(ByteBuffer buffer, boolean isValid) Create a new CharBufferAccess from a ByteBufferintGet number of bytes for one entity in thisBufferAccess.chargetValue(int index) getValues(AbstractCharArray<?> array) Copy values into aAbstractCharArray.getValues(AbstractCharArray<?> array, int offset, int length) Copy values into aAbstractCharArray.newInstance(ByteBuffer buffer, boolean isValid) Create a new instance from a ByteBuffernewInstance(CharBuffer buffer, boolean isValid) Create a new instance of this class given a Buffer of the same type.voidsetValue(int index, char value) setValues(AbstractCharArray<?> array) Copy values from aAbstractCharArray.setValues(AbstractCharArray<?> array, int offset, int length) Copy values from aAbstractCharArray.setValues(CharBufferAccess access) Copy values from another CharBufferAccess.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
-
CharBufferAccess
-
CharBufferAccess
public CharBufferAccess(int numEntities, boolean isValid) -
CharBufferAccess
-
CharBufferAccess
-
CharBufferAccess
public CharBufferAccess(int numEntities) -
CharBufferAccess
-
CharBufferAccess
public CharBufferAccess()
-
-
Method Details
-
getValue
public char getValue(int index) - Specified by:
getValuein interfaceCharAccess
-
setValue
public void setValue(int index, char value) - Specified by:
setValuein interfaceCharAccess
-
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<CharBufferAccess>- Returns:
- number of bytes
-
newInstance
Description copied from interface:BufferAccessCreate a new instance from a ByteBuffer- Specified by:
newInstancein interfaceBufferAccess<CharBufferAccess>- 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<CharBufferAccess, CharBuffer>- 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<CharBufferAccess, CharBuffer>- Returns:
-
allocate
Override abstract implementation to allow for longer non-direct Buffers since ByteBuffer is restricted to Integer.MAX_VALUE entities.- Overrides:
allocatein classAbstractBufferAccess<CharBufferAccess, CharBuffer>- Parameters:
numEntities-isDirect-isValid-- Returns:
-
fromByteBuffer
Create a new CharBufferAccess from a ByteBuffer- Parameters:
buffer-isValid-- Returns:
-
getValues
Copy values into aAbstractCharArray.- Parameters:
array-- Returns:
- See Also:
-
getValues
Copy values into aAbstractCharArray.- Parameters:
array-offset-length-- Returns:
- See Also:
-
setValues
Copy values from aAbstractCharArray.- Parameters:
array-- Returns:
- See Also:
-
setValues
Copy values from aAbstractCharArray.- Parameters:
array-offset-length-- Returns:
- See Also:
-
setValues
Copy values from another CharBufferAccess.- Parameters:
access-- Returns:
-