public class
DoublePointer
extends
Pointer
The peer class to native pointers and arrays of
double
.
All operations take into account the position and limit, when appropriate.
Author:
Samuel Audet
DoublePointer
(
DoubleBuffer
buffer)
For direct buffers, calls
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)
Methods inherited from class org.bytedeco.javacpp.
Pointer
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
,
zero
DoublePointer
public DoublePointer(double... array)
Allocates enough memory for the array and copies it.
Parameters:
array
- the array to copy
See Also:
put(double[])
DoublePointer
public DoublePointer(DoubleBuffer buffer)
For direct buffers, calls
Pointer(Buffer)
, while for buffers
backed with an array, allocates enough memory for the array and copies it.
Parameters:
buffer
- the Buffer to reference or copy
See Also:
put(double[])
DoublePointer
public DoublePointer(long size)
Allocates a native
double
array of the given size.
Parameters:
size
- the number of
double
elements to allocate
position
public DoublePointer position(long position)
Description copied from class:
Pointer
Sets the position and returns this. That makes the
array.position(i)
statement sort of equivalent to the
array[i]
statement in C++.
Overrides:
position
in class
Pointer
Parameters:
position
- the new position
Returns:
See Also:
Pointer.position(long)
public DoublePointer limit(long limit)
Description copied from class:
Pointer
Sets the limit and returns this.
Used to limit the size of an operation on this object.
Overrides:
limit
in class
Pointer
Parameters:
limit
- the new limit
Returns:
See Also:
Pointer.limit(long)
capacity
public DoublePointer capacity(long capacity)
Description copied from class:
Pointer
Sets the capacity and returns this.
Should not be called more than once after allocation.
Overrides:
capacity
in class
Pointer
Parameters:
capacity
- the new capacity
Returns:
See Also:
Pointer.capacity(long)
public int sizeof()
Description copied from class:
Pointer
Returns 1 for Pointer or BytePointer else
Loader.sizeof(getClass())
or -1 on error.
Overrides:
sizeof
in class
Pointer
getPointer
public DoublePointer getPointer(long i)
Description copied from class:
Pointer
Returns
getPointer(getClass(), i)
.
Overrides:
getPointer
in class
Pointer
public DoublePointer put(long i,
double d)
Copies the
double
value to the i-th element of a native array.
Parameters:
i
- the index into the array
d
- the
double
value to copy
Returns:
Parameters:
array
- the array to write to
offset
- the offset into the array where to start writing
length
- the length of data to read and write
Returns:
Parameters:
array
- the array to read from
offset
- the offset into the array where to start reading
length
- the length of data to read and write
Returns:
public final DoubleBuffer asBuffer()
Description copied from class:
Pointer
Overrides:
asBuffer
in class
Pointer
Returns:
asByteBuffer().asDoubleBuffer()
See Also:
BytePointer.asBuffer()
,
ShortPointer.asBuffer()
,
IntPointer.asBuffer()
,
LongPointer.asBuffer()
,
FloatPointer.asBuffer()
,
asBuffer()
,
CharPointer.asBuffer()