Documentation of 'kcl.waterloo.graphics.data.PrimitiveDoubleBuffer' Java class
PrimitiveDoubleBuffer
kcl.waterloo.graphics.data

Class PrimitiveDoubleBuffer



  • public class PrimitiveDoubleBuffer
    extends java.lang.Object
    Wrapper class for a double[]. This class permits double arrays contained as a property in the wrapper to be passed by reference - useful in environments that support that for Java objects but not for primitive data types e.g. MATLAB
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      double[] getData()
      Returns a copy of the wrapped double[] vector
      double[] getDataRef()
      Returns a reference to the wrapped data vector.
      int getDimension()
      Returns the length of the wrapped double[]
      double getEntry(int index)
      Returns the entry at specified index
      void setData(double[] arr)
      Replaces the current wrapped double[] with a copy of the input.
      void setDataRef(double[] arr)
      Replaces the current wrapped double[] with a reference to the input.
      void setEntry(int index, double val)
      Sets the entry at the specified index
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PrimitiveDoubleBuffer

        public PrimitiveDoubleBuffer()
        Constructs a new instance with a zero length vector.
      • PrimitiveDoubleBuffer

        public PrimitiveDoubleBuffer(int sz)
        Constructs a new instance with a vector of length sz.
        Parameters:
        sz -
      • PrimitiveDoubleBuffer

        public PrimitiveDoubleBuffer(double[] arr)
        Constructs a new instance copying the input.
        Parameters:
        arr -
      • PrimitiveDoubleBuffer

        public PrimitiveDoubleBuffer(double[] arr,
                                     boolean copyFlag)
        Constructs a new instance. If copyFlag is true the input is copied, if false is is referenced in the wrapper.
        Parameters:
        arr -
        copyFlag -
    • Method Detail

      • getData

        public double[] getData()
        Returns a copy of the wrapped double[] vector
        Returns:
        the data
      • getDataRef

        public final double[] getDataRef()
        Returns a reference to the wrapped data vector. Note: This exposes a reference to the data vector to external code.
        Returns:
        a reference to the data vector.
      • setData

        public final void setData(double[] arr)
        Replaces the current wrapped double[] with a copy of the input.
        Parameters:
        arr -
      • setDataRef

        public final void setDataRef(double[] arr)
        Replaces the current wrapped double[] with a reference to the input. NOTE: As the reference is external, this exposes data as an external mutable array.
        Parameters:
        arr -
      • getEntry

        public double getEntry(int index)
        Returns the entry at specified index
        Parameters:
        index -
        Returns:
        a double
      • setEntry

        public void setEntry(int index,
                             double val)
        Sets the entry at the specified index
        Parameters:
        index -
        val -
      • getDimension

        public int getDimension()
        Returns the length of the wrapped double[]
        Returns:
        an int

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.