magoffin.matt.ma2
Enum MediaQuality

java.lang.Object
  extended by java.lang.Enum<MediaQuality>
      extended by magoffin.matt.ma2.MediaQuality
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<MediaQuality>

public enum MediaQuality
extends java.lang.Enum<MediaQuality>

Quality constants for media items.

This enumeration defines a finite set of quality values that media items can be requested as. This is to limit the number of different quality values the application needs to generate, and possibly cache, for each media item it processes. Each enumeration defines a default quality value as a float, with 0 being the lowest quality and 100 being the highest quality. These defauls can be overridden by the application, however, and quality values will have different meanings to different types of media types. For many media types the quality value corresponds to the amount of lossy compression applied to them, e.g. the higher the quality the lower the amount of compression.

Version:
$Revision: 43 $ $Date: 2007-10-21 11:10:01 +1300 (Sun, 21 Oct 2007) $
Author:
matt.magoffin

Enum Constant Summary
AVERAGE
          Average quality.
GOOD
          Good quality.
HIGH
          Very high quality.
HIGHEST
          The highest quality possible.
LOW
          Low quality.
 
Method Summary
 float getQualityValue()
          Get the default quality value.
static MediaQuality valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static MediaQuality[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

HIGHEST

public static final MediaQuality HIGHEST
The highest quality possible.


HIGH

public static final MediaQuality HIGH
Very high quality.


GOOD

public static final MediaQuality GOOD
Good quality.


AVERAGE

public static final MediaQuality AVERAGE
Average quality.


LOW

public static final MediaQuality LOW
Low quality.

Method Detail

values

public static final MediaQuality[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(MediaQuality c : MediaQuality.values())
        System.out.println(c);

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

valueOf

public static MediaQuality valueOf(java.lang.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:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name

getQualityValue

public float getQualityValue()
Get the default quality value.

Returns:
quality value