@Properties(inherit=javacpp.class) public class FloatPointer extends Pointer
float.
All operations take into account the position and limit, when appropriate.Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.DeallocatorReference, Pointer.DeallocatorThread, Pointer.NativeDeallocator, Pointer.ProxyDeallocator, Pointer.ReferenceCounter| Modifier and Type | Field and Description |
|---|---|
private static Logger |
logger |
address, capacity, deallocatorThread, limit, maxBytes, maxPhysicalBytes, maxRetries, position| Constructor and Description |
|---|
FloatPointer() |
FloatPointer(float... array)
Allocates enough memory for the array and copies it.
|
FloatPointer(FloatBuffer buffer)
For direct buffers, calls
Pointer(Buffer), while for buffers
backed with an array, allocates enough memory for the array and copies it. |
FloatPointer(long size)
Allocates a native
float array of the given size. |
FloatPointer(Pointer p) |
| Modifier and Type | Method and Description |
|---|---|
private void |
allocateArray(long size) |
FloatBuffer |
asBuffer()
Same as
Pointer.asByteBuffer(), but can be overridden to return subclasses of Buffer. |
FloatPointer |
capacity(long capacity)
Sets the capacity and returns this.
|
float |
get() |
FloatPointer |
get(float[] array) |
FloatPointer |
get(float[] array,
int offset,
int length)
Reads a portion of the native array into a Java array.
|
float |
get(long i) |
FloatPointer |
getPointer(long i)
Returns
getPointer(getClass(), i). |
FloatPointer |
limit(long limit)
Sets the limit and returns this.
|
FloatPointer |
position(long position)
Sets the position and returns this.
|
FloatPointer |
put(float... array) |
FloatPointer |
put(float f) |
FloatPointer |
put(float[] array,
int offset,
int length)
Writes a portion of a Java array into the native array.
|
FloatPointer |
put(long i,
float f)
Copies the
float value to the i-th element of a native array. |
int |
sizeof()
Returns 1 for Pointer or BytePointer else
Loader.sizeof(getClass()) or -1 on error. |
address, asByteBuffer, availablePhysicalBytes, calloc, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, getDirectBufferAddress, getPointer, getPointer, getPointer, hashCode, init, interruptDeallocatorThread, isNull, isNull, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetAddress, offsetof, offsetof, parseBytes, physicalBytes, physicalBytesInaccurate, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, toString, totalBytes, totalCount, totalPhysicalBytes, withDeallocator, zeroprivate static final Logger logger
public FloatPointer(float... array)
array - the array to copyput(float[])public FloatPointer(FloatBuffer buffer)
Pointer(Buffer), while for buffers
backed with an array, allocates enough memory for the array and copies it.buffer - the Buffer to reference or copyput(float[])public FloatPointer(long size)
float array of the given size.size - the number of float elements to allocatepublic FloatPointer()
Pointer()public FloatPointer(Pointer p)
Pointer(Pointer)private void allocateArray(long size)
public FloatPointer position(long position)
Pointerarray.position(i)
statement sort of equivalent to the array[i] statement in C++.position in class Pointerposition - the new positionPointer.position(long)public FloatPointer limit(long limit)
Pointerlimit in class Pointerlimit - the new limitPointer.position(long)public FloatPointer capacity(long capacity)
Pointercapacity in class Pointercapacity - the new capacityPointer.capacity(long)public int sizeof()
PointerLoader.sizeof(getClass()) or -1 on error.public FloatPointer getPointer(long i)
PointergetPointer(getClass(), i).getPointer in class Pointerpublic float get()
get(0)public float get(long i)
float value of a native arraypublic FloatPointer put(float f)
put(0, f)public FloatPointer put(long i, float f)
float value to the i-th element of a native array.i - the index into the arrayf - the float value to copypublic FloatPointer get(float[] array)
get(array, 0, array.length)public FloatPointer put(float... array)
put(array, 0, array.length)public FloatPointer get(float[] array, int offset, int length)
array - the array to write tooffset - the offset into the array where to start writinglength - the length of data to read and writepublic FloatPointer put(float[] array, int offset, int length)
array - the array to read fromoffset - the offset into the array where to start readinglength - the length of data to read and writepublic final FloatBuffer asBuffer()
PointerPointer.asByteBuffer(), but can be overridden to return subclasses of Buffer.asBuffer in class PointerasByteBuffer().asFloatBuffer()BytePointer.asBuffer(),
ShortPointer.asBuffer(),
IntPointer.asBuffer(),
LongPointer.asBuffer(),
asBuffer(),
DoublePointer.asBuffer(),
CharPointer.asBuffer()Copyright © 2025. All rights reserved.