@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.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 |
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, hashCode, init, isNull, isNull, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetof, parseBytes, physicalBytes, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, toString, totalBytes, totalPhysicalBytes, withDeallocator, zero
private static final Logger logger
public BooleanPointer(boolean... array)
array
- the array to copyput(boolean[])
public BooleanPointer(ByteBuffer buffer)
Pointer.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.Pointer()
public BooleanPointer(Pointer p)
Pointer.Pointer(Pointer)
private void allocateArray(long size)
public BooleanPointer position(long position)
Pointer
array.position(i)
statement sort of equivalent to the array[i]
statement in C++.position
in class Pointer
position
- the new positionPointer.position(long)
public BooleanPointer limit(long limit)
Pointer
limit
in class Pointer
limit
- the new limitPointer.limit(long)
public BooleanPointer capacity(long capacity)
Pointer
capacity
in class Pointer
capacity
- the new capacityPointer.capacity(long)
public int sizeof()
Pointer
Loader.sizeof(getClass())
or -1 on error.public 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 © 2020. All rights reserved.