Enum Class NonImageFileFormat

Object
Enum<NonImageFileFormat>
NonImageFileFormat
All Implemented Interfaces:
Serializable, Comparable<NonImageFileFormat>, Constable, FileFormat

public enum NonImageFileFormat extends Enum<NonImageFileFormat> implements 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
  • Enum Constant Details

  • Method Details

    • values

      public static NonImageFileFormat[] 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

      public static NonImageFileFormat valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • matches

      public boolean matches(String filePath)
      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 interface FileFormat
      Parameters:
      filePath - the path
      Returns:
      true if the path ends with any of the expected extensions for this format.
    • extensionWithoutPeriod

      public String extensionWithoutPeriod()
      The extension without any leading period.
      Returns:
      the extension (lower-case) without a period.
    • extensionAsArray

      public String[] extensionAsArray()
      The extension (without a period) as an array.
      Returns:
      a newly created array with one element only, the extension (without a period).
    • extensionWithPeriod

      public String extensionWithPeriod()
      The extension with a leading period.
      Returns:
      the extension (lower-case) with a period.
    • descriptiveIdentifier

      public String descriptiveIdentifier()
      Description copied from interface: FileFormat
      An identifier that describes the format, that is meaningful to the end-user.
      Specified by:
      descriptiveIdentifier in interface FileFormat
      Returns:
      a short string that identifies the format (usually the default extension without any leading period).
    • getDefaultExtension

      public String getDefaultExtension()
      Description copied from interface: FileFormat
      The default extension to write associated with a particular format.
      Specified by:
      getDefaultExtension in interface FileFormat
      Returns:
      the extension
    • matchesIdentifier

      public boolean matchesIdentifier(String identifier)
      Description copied from interface: FileFormat
      Does an identifier equal the extension expected by this format?
      Specified by:
      matchesIdentifier in interface FileFormat
      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