public enum NonImageFileFormat extends Enum<NonImageFileFormat> implements FileFormat
See instead ImageFileFormat
for an image file format.
Enum Constant and Description |
---|
CSV
CSV (Comma Separated Value) files.
|
HDF5
HDF5
|
PROPERTIES_XML
XML for storing properties (key/value pairs).
|
SERIALIZED_BINARY
Binary serialization format from Java native serialization.
|
SERIALIZED_XML
XML for storing serialized XML (via XStream).
|
TEXT
Text files.
|
XML
XML
|
Modifier and Type | Method and Description |
---|---|
String |
descriptiveIdentifier()
An identifier that describes the format, that is meaningful to the end-user.
|
String[] |
extensionAsArray()
The extension (without a period) as an array.
|
String |
extensionWithoutPeriod()
The extension without any leading period.
|
String |
extensionWithPeriod()
The extension with a leading period.
|
String |
getDefaultExtension()
The default extension to write associated with a particular format.
|
boolean |
matches(String filePath)
Does a file-path (or file-name) end with an extension expected by this format?
|
boolean |
matchesIdentifier(String identifier)
Does an identifier equal the extension expected by this format?
|
static NonImageFileFormat |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static NonImageFileFormat[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final NonImageFileFormat CSV
public static final NonImageFileFormat HDF5
public static final NonImageFileFormat XML
public static final NonImageFileFormat TEXT
public static final NonImageFileFormat PROPERTIES_XML
public static final NonImageFileFormat SERIALIZED_XML
public static final NonImageFileFormat SERIALIZED_BINARY
public static NonImageFileFormat[] values()
for (NonImageFileFormat c : NonImageFileFormat.values()) System.out.println(c);
public static NonImageFileFormat valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic boolean matches(String filePath)
FileFormat
The case of the extension is irrelevant i.e. a case insensitive match occurs.
A leading period is also expected before the extension.
matches
in interface FileFormat
filePath
- the pathpublic String extensionWithoutPeriod()
public String[] extensionAsArray()
public String extensionWithPeriod()
public String descriptiveIdentifier()
FileFormat
descriptiveIdentifier
in interface FileFormat
public String getDefaultExtension()
FileFormat
getDefaultExtension
in interface FileFormat
public boolean matchesIdentifier(String identifier)
FileFormat
matchesIdentifier
in interface FileFormat
identifier
- an identifier that should be equal (ignoring case, and with or without a
leading period) to any extension associated with the formatidentifier
is equal to an extension associated with this formatCopyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.