Enum NetcdfFileFormat

    • Method Detail

      • values

        public static NetcdfFileFormat[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (NetcdfFileFormat c : NetcdfFileFormat.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static NetcdfFileFormat valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • version

        public int version()
      • formatName

        public String formatName()
      • isNetcdf3Format

        public boolean isNetcdf3Format()
      • isNetdf3format

        public boolean isNetdf3format()
        Deprecated.
        Returns:
      • isNetcdf4Format

        public boolean isNetcdf4Format()
      • isNetdf4format

        public boolean isNetdf4format()
        Deprecated.
        Returns:
      • isExtendedModel

        public boolean isExtendedModel()
      • findNetcdfFormatType

        public static NetcdfFileFormat findNetcdfFormatType​(RandomAccessFile raf)
                                                     throws IOException
        Figure out what kind of netcdf-related file we have. Constraint: leave raf read pointer to point just after the magic number.
        Parameters:
        raf - to test type
        Returns:
        NetcdfFileFormat that matches constants in netcdf-c/include/netcdf.h, or INVALID if not a netcdf file.
        Throws:
        IOException
      • memequal

        public static boolean memequal​(byte[] b1,
                                       byte[] b2,
                                       int len)
      • isValidNetcdfObjectName

        public static boolean isValidNetcdfObjectName​(String name)
        Determine if the given name can be used for a NetCDF object, i.e. a Dimension, Attribute, or Variable. The allowed name syntax (in RE form) is:
         ([a-zA-Z0-9_]|{UTF8})([^\x00-\x1F\x7F/]|{UTF8})*
         
        where UTF8 represents a multi-byte UTF-8 encoding. Also, no trailing spaces are permitted in names. We do not allow '/' because HDF5 does not permit slashes in names as slash is used as a group separator. If UTF-8 is supported, then a multi-byte UTF-8 character can occur anywhere within an identifier.
        Parameters:
        name - the name to validate.
        Returns:
        true if the name is valid.
      • makeValidNetcdfObjectName

        public static String makeValidNetcdfObjectName​(String name)
        Convert a name to a legal netcdf-3 name.
        Parameters:
        name - the name to convert.
        Returns:
        the converted name.
        See Also:
        isValidNetcdfObjectName(String)