public class DoublePointer extends Pointer
double.
All operations take into account the position and limit, when appropriate.Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.DeallocatorReference, Pointer.DeallocatorThread, Pointer.NativeDeallocatoraddress, capacity, deallocatorThread, limit, maxBytes, maxPhysicalBytes, maxRetries, position| Constructor and Description |
|---|
DoublePointer() |
DoublePointer(double... array)
Allocates enough memory for the array and copies it.
|
DoublePointer(DoubleBuffer buffer)
For direct buffers, calls
Pointer.Pointer(Buffer), while for buffers
backed with an array, allocates enough memory for the array and copies it. |
DoublePointer(long size)
Allocates a native
double array of the given size. |
DoublePointer(Pointer p) |
| Modifier and Type | Method and Description |
|---|---|
private void |
allocateArray(long size) |
DoubleBuffer |
asBuffer()
Same as
Pointer.asByteBuffer(), but can be overridden to return subclasses of Buffer. |
DoublePointer |
capacity(long capacity)
Sets the capacity and returns this.
|
double |
get() |
DoublePointer |
get(double[] array) |
DoublePointer |
get(double[] array,
int offset,
int length)
Reads a portion of the native array into a Java array.
|
double |
get(long i) |
DoublePointer |
limit(long limit)
Sets the limit and returns this.
|
DoublePointer |
position(long position)
Sets the position and returns this.
|
DoublePointer |
put(double... array) |
DoublePointer |
put(double d) |
DoublePointer |
put(double[] array,
int offset,
int length)
Writes a portion of a Java array into the native array.
|
DoublePointer |
put(long i,
double d)
Copies the
double value to the i-th element of a native array. |
address, asByteBuffer, availablePhysicalBytes, calloc, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, hashCode, init, isNull, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetof, parseBytes, physicalBytes, position, put, realloc, setNull, sizeof, toString, totalBytes, totalPhysicalBytes, withDeallocator, zeropublic DoublePointer(double... array)
array - the array to copyput(double[])public DoublePointer(DoubleBuffer 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(double[])public DoublePointer(long size)
double array of the given size.size - the number of double elements to allocatepublic DoublePointer()
Pointer.Pointer()public DoublePointer(Pointer p)
Pointer.Pointer(Pointer)private void allocateArray(long size)
public DoublePointer 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 DoublePointer limit(long limit)
Pointerlimit in class Pointerlimit - the new limitPointer.limit(long)public DoublePointer capacity(long capacity)
Pointercapacity in class Pointercapacity - the new capacityPointer.capacity(long)public double get()
get(0)public double get(long i)
double value of a native arraypublic DoublePointer put(double d)
put(0, d)public DoublePointer put(long i, double d)
double value to the i-th element of a native array.i - the index into the arrayd - the double value to copypublic DoublePointer get(double[] array)
get(array, 0, array.length)public DoublePointer put(double... array)
put(array, 0, array.length)public DoublePointer get(double[] 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 DoublePointer put(double[] 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 DoubleBuffer asBuffer()
PointerPointer.asByteBuffer(), but can be overridden to return subclasses of Buffer.asBuffer in class PointerasByteBuffer().asDoubleBuffer()BytePointer.asBuffer(),
ShortPointer.asBuffer(),
IntPointer.asBuffer(),
LongPointer.asBuffer(),
FloatPointer.asBuffer(),
asBuffer(),
CharPointer.asBuffer()Copyright © 2017. All rights reserved.