Package opendap.dap

Class Float64PrimitiveVector

    • Constructor Detail

      • Float64PrimitiveVector

        public Float64PrimitiveVector​(BaseType var)
        Constructs a new Float64PrimitiveVector.
        Parameters:
        var - the template BaseType to use.
    • Method Detail

      • getLength

        public int getLength()
        Returns the number of elements in the array.
        Specified by:
        getLength in class PrimitiveVector
        Returns:
        the number of elements in the array.
      • setLength

        public void setLength​(int len)
        Sets the number of elements in the array. Allocates a new primitive array of the desired size. Note that if this is called multiple times, the old array and its contents will be lost.

        Only called inside of deserialize method or in derived classes on server.

        Specified by:
        setLength in class PrimitiveVector
        Parameters:
        len - the number of elements in the array.
      • getValue

        public final double getValue​(int i)
        Return the i'th value as a double.
        Parameters:
        i - the index of the value to return.
        Returns:
        the i'th value.
      • setValue

        public final void setValue​(int i,
                                   double newVal)
        Set the i'th value of the array.
        Parameters:
        i - the index of the value to set.
        newVal - the new value.
      • printVal

        public void printVal​(PrintWriter os,
                             String space)
        Prints the value of all variables in this vector. This method is primarily intended for debugging OPeNDAP applications and text-based clients such as geturl.
        Specified by:
        printVal in class PrimitiveVector
        Parameters:
        os - the PrintWriter on which to print the value.
        space - this value is passed to the printDecl method, and controls the leading spaces of the output.
        See Also:
        BaseType.printVal(PrintWriter, String, boolean)
      • externalize

        public void externalize​(DataOutputStream sink)
                         throws IOException
        Writes data to a DataOutputStream. This method is used primarily by GUI clients which need to download OPeNDAP data, manipulate it, and then re-save it as a binary file.
        Specified by:
        externalize in interface ClientIO
        Specified by:
        externalize in class PrimitiveVector
        Parameters:
        sink - a DataOutputStream to write to.
        Throws:
        IOException - thrown on any OutputStream exception.
      • externalize

        public void externalize​(DataOutputStream sink,
                                int start,
                                int stop,
                                int stride)
                         throws IOException
        Write a subset of the data to a DataOutputStream.
        Parameters:
        sink - a DataOutputStream to write to.
        start - starting index (i=start)
        stop - ending index (i<=stop)
        stride - index stride (i+=stride)
        Throws:
        IOException - thrown on any OutputStream exception.
      • getInternalStorage

        public Object getInternalStorage()
        Returns (a reference to) the internal storage for this PrimitiveVector object.

        WARNING:

        Because this method breaks encapsulation rules the user must beware! If we (the OPeNDAP prgramming team) choose to change the internal representation(s) of these types your code will probably break.

        This method is provided as an optimization to eliminate massive copying of data.

        Specified by:
        getInternalStorage in class PrimitiveVector
        Returns:
        The internal array of doubles.
      • setInternalStorage

        public void setInternalStorage​(Object o)
        Set the internal storage for PrimitiveVector.

        WARNING:

        Because this method breaks encapsulation rules the user must beware! If we (the OPeNDAP prgramming team) choose to change the internal representation(s) of these types your code will probably break.

        This method is provided as an optimization to eliminate massive copying of data.

        Specified by:
        setInternalStorage in class PrimitiveVector
      • subset

        public PrimitiveVector subset​(int start,
                                      int stop,
                                      int stride)
        Create a new primitive vector using a subset of the data.
        Specified by:
        subset in class PrimitiveVector
        Parameters:
        start - starting index (i=start)
        stop - ending index (i<=stop)
        stride - index stride (i+=stride)
        Returns:
        new primitive vector, of type Float64PrimitiveVector.
      • printVal

        public void printVal​(PrintWriter os,
                             String space,
                             boolean print_decl_p)
        Prints the value of the variable, with its declaration. This function is primarily intended for debugging OPeNDAP applications and text-based clients such as geturl.
        Parameters:
        os - the PrintWriter on which to print the value.
        space - this value is passed to the printDecl method, and controls the leading spaces of the output.
        print_decl_p - a boolean value controlling whether the variable declaration is printed as well as the value.