Package opendap.dap

Class DVector

    • Constructor Detail

      • DVector

        public DVector()
        Constructs a new DVector.
      • DVector

        public DVector​(String n)
        Constructs a new DVector with name n.
        Parameters:
        n - the name of the variable.
    • Method Detail

      • getTypeName

        public String getTypeName()
        Returns the OPeNDAP type name of the class instance as a String.
        Specified by:
        getTypeName in class BaseType
        Returns:
        the OPeNDAP type name of the class instance as a String.
      • getContainerVar

        public BaseType getContainerVar()
      • setContainerVar

        public void setContainerVar​(BaseType var)
      • getLength

        public int getLength()
        Returns the number of elements in the vector.
        Returns:
        the number of elements in the vector.
      • setLength

        public void setLength​(int len)
        Sets the number of elements in the vector. Allocates a new 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.

        Parameters:
        len - the number of elements in the array.
      • addVariable

        public void addVariable​(BaseType v)
        Adds a variable to the container.
        Parameters:
        v - the variable to add.
      • getPrimitiveVector

        public PrimitiveVector getPrimitiveVector()
        Returns the PrimitiveVector for this vector. This can be cast to the appropriate type and used by a OPeNDAP client to read or set individual values in the vector.
        Returns:
        the attached PrimitiveVector.
      • printDecl

        public void printDecl​(PrintWriter os,
                              String space,
                              boolean print_semi,
                              boolean constrained)
        Write the variable's declaration in a C-style syntax. This function is used to create textual representation of the Data Descriptor Structure (DDS). See The OPeNDAP User Manual for information about this structure.
        Overrides:
        printDecl in class BaseType
        Parameters:
        os - The PrintWriter on which to print the declaration.
        space - Each line of the declaration will begin with the characters in this string. Usually used for leading spaces.
        print_semi - a boolean value indicating whether to print a semicolon at the end of the declaration.
        constrained - a boolean value indicating whether to print the declartion dependent on the projection information. This is only used by Server side code.
        See Also:
        BaseType.printDecl(PrintWriter, String, boolean)
      • 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.
        Specified by:
        printVal in class BaseType
        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.
        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
        Parameters:
        sink - a DataOutputStream to write to.
        Throws:
        IOException - thrown on any OutputStream exception.