adams.flow.sink
Enum JAIWriter.ImageType

java.lang.Object
  extended by java.lang.Enum<JAIWriter.ImageType>
      extended by adams.flow.sink.JAIWriter.ImageType
All Implemented Interfaces:
EnumWithCustomDisplay<JAIWriter.ImageType>, Serializable, Comparable<JAIWriter.ImageType>
Enclosing class:
JAIWriter

public static enum JAIWriter.ImageType
extends Enum<JAIWriter.ImageType>
implements EnumWithCustomDisplay<JAIWriter.ImageType>

The type of the image to create.

Version:
$Revision: 5867 $
Author:
fracpete (fracpete at waikato dot ac dot nz)

Enum Constant Summary
AUTO
           
BMP
           
JPEG
           
PNG
           
PNM
           
TIFF
           
 
Method Summary
 String getExtension()
          Returns the associated extension.
 String getType()
          Returns the ImageMagick type.
 boolean matches(File file)
          Checks whether the file matches the extension of this item.
 boolean matches(String filename)
          Checks whether the file matches the extension of this item.
 JAIWriter.ImageType parse(String s)
          Parses the given string and returns the associated enum.
 String toDisplay()
          Returns the display string.
 String toRaw()
          Returns the raw enum string.
 String toString()
          Returns the display string.
static String toString(AbstractOption option, Object object)
          Returns the enum as string.
static JAIWriter.ImageType valueOf(AbstractOption option, String str)
          Returns an enum generated from the string.
static JAIWriter.ImageType valueOf(String name)
          Returns the enum constant of this type with the specified name.
static JAIWriter.ImageType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

AUTO

public static final JAIWriter.ImageType AUTO

BMP

public static final JAIWriter.ImageType BMP

JPEG

public static final JAIWriter.ImageType JPEG

PNG

public static final JAIWriter.ImageType PNG

PNM

public static final JAIWriter.ImageType PNM

TIFF

public static final JAIWriter.ImageType TIFF
Method Detail

values

public static JAIWriter.ImageType[] 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 (JAIWriter.ImageType c : JAIWriter.ImageType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static JAIWriter.ImageType 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 name
NullPointerException - if the argument is null

toDisplay

public String toDisplay()
Returns the display string.

Specified by:
toDisplay in interface EnumWithCustomDisplay<JAIWriter.ImageType>
Returns:
the display string

toRaw

public String toRaw()
Returns the raw enum string.

Specified by:
toRaw in interface EnumWithCustomDisplay<JAIWriter.ImageType>
Returns:
the raw enum string

toString

public String toString()
Returns the display string.

Overrides:
toString in class Enum<JAIWriter.ImageType>
Returns:
the display string

getType

public String getType()
Returns the ImageMagick type.

Returns:
the type

getExtension

public String getExtension()
Returns the associated extension.

Returns:
the extension

matches

public boolean matches(File file)
Checks whether the file matches the extension of this item.

Parameters:
file - the file to check
Returns:
true if the extensions match

matches

public boolean matches(String filename)
Checks whether the file matches the extension of this item.

Parameters:
filename - the file to check
Returns:
true if the extensions match

parse

public JAIWriter.ImageType parse(String s)
Parses the given string and returns the associated enum.

Specified by:
parse in interface EnumWithCustomDisplay<JAIWriter.ImageType>
Parameters:
s - the string to parse
Returns:
the enum or null if not found

toString

public static String toString(AbstractOption option,
                              Object object)
Returns the enum as string.

Parameters:
option - the current option
object - the enum object to convert
Returns:
the generated string

valueOf

public static JAIWriter.ImageType valueOf(AbstractOption option,
                                          String str)
Returns an enum generated from the string.

Parameters:
option - the current option
str - the string to convert to an enum
Returns:
the generated enum or null in case of error


Copyright © 2012 University of Waikato, Hamilton, NZ. All Rights Reserved.