Package ucar.nc2.write
Enum NetcdfFileFormat
- java.lang.Object
-
- java.lang.Enum<NetcdfFileFormat>
-
- ucar.nc2.write.NetcdfFileFormat
-
- All Implemented Interfaces:
Serializable
,Comparable<NetcdfFileFormat>
public enum NetcdfFileFormat extends Enum<NetcdfFileFormat>
Enumeration of the kinds of NetCDF file formats. NETCDF3_64BIT_DATA is not currently supported.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description INVALID
NCSTREAM
NETCDF3
NETCDF3_64BIT_DATA
NETCDF3_64BIT_OFFSET
NETCDF4
NETCDF4_CLASSIC
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static NetcdfFileFormat
findNetcdfFormatType(RandomAccessFile raf)
Figure out what kind of netcdf-related file we have.String
formatName()
boolean
isExtendedModel()
boolean
isNetcdf3Format()
boolean
isNetcdf4Format()
boolean
isNetdf3format()
Deprecated.boolean
isNetdf4format()
Deprecated.static boolean
isValidNetcdfObjectName(String name)
Determine if the given name can be used for a NetCDF object, i.e.static String
makeValidNetcdfObjectName(String name)
Convert a name to a legal netcdf-3 name.static boolean
memequal(byte[] b1, byte[] b2, int len)
static NetcdfFileFormat
valueOf(String name)
Returns the enum constant of this type with the specified name.static NetcdfFileFormat[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.int
version()
-
-
-
Enum Constant Detail
-
INVALID
public static final NetcdfFileFormat INVALID
-
NETCDF3
public static final NetcdfFileFormat NETCDF3
-
NETCDF3_64BIT_OFFSET
public static final NetcdfFileFormat NETCDF3_64BIT_OFFSET
-
NETCDF4
public static final NetcdfFileFormat NETCDF4
-
NETCDF4_CLASSIC
public static final NetcdfFileFormat NETCDF4_CLASSIC
-
NETCDF3_64BIT_DATA
public static final NetcdfFileFormat NETCDF3_64BIT_DATA
-
NCSTREAM
public static final NetcdfFileFormat NCSTREAM
-
-
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 nameNullPointerException
- 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)
-
-