Class DoublePtr

All Implemented Interfaces:
Iterable<DoublePtr>

public final class DoublePtr
extends Struct<DoublePtr>
Points to a double value (double * in C).
  • Constructor Details

    • DoublePtr

      public DoublePtr()
      Creates a new DoublePtr with a value of 0.0.
    • DoublePtr

      public DoublePtr​(double value)
      Creates a new DoublePtr and initializes it with the specified value.
      Parameters:
      value - the value.
  • Method Details

    • get

      public double get()
      Returns the current value.
      Returns:
      the value.
    • set

      public void set​(double value)
      Sets the value.
      Parameters:
      value - the new value.
    • asDoubleBuffer

      public DoubleBuffer asDoubleBuffer​(int n)
      Returns a DoubleBuffer which reads and writes to the same memory location pointed to by this DoublePtr.
      Parameters:
      n - the maximum number of doubles the DoubleBuffer can read/write. This will be the DoubleBuffer's capacity.
      Returns:
      the DoubleBuffer.
    • toDoubleArray

      public double[] toDoubleArray​(int n)
      Copies n doubles from the memory pointed to by this DoublePtr to a new double[] instance.
      Parameters:
      n - the number of doubles to copy.
      Returns:
      the double[].
    • get

      public void get​(double[] dst)
      Copies dst.length doubles from the memory pointed to by this DoublePtr to dst.
      Parameters:
      dst - the destination.
    • get

      public void get​(double[] dst, int offset, int count)
      Copies count doubles from the memory pointed to by this DoublePtr to dst starting at offset offset.
      Parameters:
      dst - the destination.
      offset - the offset within the destination array to start copying to.
      count - the number of elements to copy.
    • set

      public void set​(double[] src)
      Copies src.length doubles from src to the memory pointed to by this DoublePtr.
      Parameters:
      src - the source.
    • set

      public void set​(double[] src, int offset, int count)
      Copies count doubles from src starting at offset offset to the memory pointed to by this DoublePtr.
      Parameters:
      src - the source.
      offset - the offset within the source array to start copying from.
      count - the number of elements to copy.