Enum Class ImageFileFormat

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

public enum ImageFileFormat extends Enum<ImageFileFormat> implements FileFormat
A type of image format that are read/written to the filesystem, together with the extensions it may use.

Note this is not a complete list of the types of images that Anchor can read or write, rather just those that are explicitly mentioned in the code-based, for operations relating to their extensions.

Author:
Owen Feehan
  • Enum Constant Details

  • Method Details

    • values

      public static ImageFileFormat[] 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 ImageFileFormat 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
    • allExtensions

      public Stream<String> allExtensions()
      All extensions associated with a file-format.
      Returns:
      a stream of all extensions associated with a particular file format.
    • 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.
    • 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