@Properties(inherit=javacpp.class) public class BooleanPointer extends Pointer
jboolean.
All operations take into account the position and limit, when appropriate.
Assumes sizeof(jboolean) is always 1 byte with false == 0 and true == 1.
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 |
|---|
BooleanPointer() |
BooleanPointer(boolean... array)
Allocates enough memory for the array and copies it.
|
BooleanPointer(ByteBuffer buffer)
For direct buffers, calls
Pointer(Buffer), while for buffers
backed with an array, allocates enough memory for the array and copies it. |
BooleanPointer(long size)
Allocates a native
boolean array of the given size. |
BooleanPointer(Pointer p) |
| Modifier and Type | Method and Description |
|---|---|
private void |
allocateArray(long size) |
BooleanPointer |
capacity(long capacity)
Sets the capacity and returns this.
|
boolean |
get() |
BooleanPointer |
get(boolean[] array) |
BooleanPointer |
get(boolean[] array,
int offset,
int length)
Reads a portion of the native array into a Java array.
|
boolean |
get(long i) |
BooleanPointer |
getPointer(long i)
Returns
getPointer(getClass(), i). |
BooleanPointer |
limit(long limit)
Sets the limit and returns this.
|
BooleanPointer |
position(long position)
Sets the position and returns this.
|
BooleanPointer |
put(boolean... array) |
BooleanPointer |
put(boolean b) |
BooleanPointer |
put(boolean[] array,
int offset,
int length)
Writes a portion of a Java array into the native array.
|
BooleanPointer |
put(long i,
boolean b)
Copies the
boolean 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, asBuffer, 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 BooleanPointer(boolean... array)
array - the array to copyput(boolean[])public BooleanPointer(ByteBuffer 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(boolean[])public BooleanPointer(long size)
boolean array of the given size.size - the number of boolean elements to allocatepublic BooleanPointer()
Pointer()public BooleanPointer(Pointer p)
Pointer(Pointer)private void allocateArray(long size)
public BooleanPointer 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 BooleanPointer limit(long limit)
Pointerlimit in class Pointerlimit - the new limitPointer.limit(long)public BooleanPointer capacity(long capacity)
Pointercapacity in class Pointercapacity - the new capacityPointer.capacity(long)public int sizeof()
PointerLoader.sizeof(getClass()) or -1 on error.public BooleanPointer getPointer(long i)
PointergetPointer(getClass(), i).getPointer in class Pointerpublic boolean get()
get(0)public boolean get(long i)
boolean value of a native arraypublic BooleanPointer put(boolean b)
put(0, b)public BooleanPointer put(long i, boolean b)
boolean value to the i-th element of a native array.i - the index into the arrayb - the boolean value to copypublic BooleanPointer get(boolean[] array)
get(array, 0, array.length)public BooleanPointer put(boolean... array)
put(array, 0, array.length)public BooleanPointer get(boolean[] 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 BooleanPointer put(boolean[] 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 writeCopyright © 2023. All rights reserved.