Package org.anchoranalysis.core.format
Enum Class NonImageFileFormat
- All Implemented Interfaces:
Serializable
,Comparable<NonImageFileFormat>
,Constable
,FileFormat
Non image file-formats that are read or writeten to the filesystem, each with an associated
extension.
See instead ImageFileFormat
for an image file format.
- Author:
- Owen Feehan
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionCSV (Comma Separated Value) files.HDF5XML for storing properties (key/value pairs).Binary serialization format from Java native serialization.XML for storing serialized XML (via XStream).Text files.XML -
Method Summary
Modifier and TypeMethodDescriptionAn identifier that describes the format, that is meaningful to the end-user.String[]
The extension (without a period) as an array.The extension without any leading period.The extension with a leading period.The default extension to write associated with a particular format.boolean
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
Returns the enum constant of this class with the specified name.static NonImageFileFormat[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
CSV
CSV (Comma Separated Value) files. -
HDF5
HDF5 -
XML
XML -
TEXT
Text files. -
PROPERTIES_XML
XML for storing properties (key/value pairs). -
SERIALIZED_XML
XML for storing serialized XML (via XStream). -
SERIALIZED_BINARY
Binary serialization format from Java native serialization.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException
- if the argument is null
-
matches
Description copied from interface:FileFormat
Does a file-path (or file-name) end with an extension expected by this format?The case of the extension is irrelevant i.e. a case insensitive match occurs.
A leading period is also expected before the extension.
- Specified by:
matches
in interfaceFileFormat
- Parameters:
filePath
- the path- Returns:
- true if the path ends with any of the expected extensions for this format.
-
extensionWithoutPeriod
The extension without any leading period.- Returns:
- the extension (lower-case) without a period.
-
extensionAsArray
The extension (without a period) as an array.- Returns:
- a newly created array with one element only, the extension (without a period).
-
extensionWithPeriod
The extension with a leading period.- Returns:
- the extension (lower-case) with a period.
-
descriptiveIdentifier
Description copied from interface:FileFormat
An identifier that describes the format, that is meaningful to the end-user.- Specified by:
descriptiveIdentifier
in interfaceFileFormat
- Returns:
- a short string that identifies the format (usually the default extension without any leading period).
-
getDefaultExtension
Description copied from interface:FileFormat
The default extension to write associated with a particular format.- Specified by:
getDefaultExtension
in interfaceFileFormat
- Returns:
- the extension
-
matchesIdentifier
Description copied from interface:FileFormat
Does an identifier equal the extension expected by this format?- Specified by:
matchesIdentifier
in interfaceFileFormat
- Parameters:
identifier
- an identifier that should be equal (ignoring case, and with or without a leading period) to any extension associated with the format- Returns:
- true if
identifier
is equal to an extension associated with this format
-