org.stanwood.media.info
Enum AspectRatio

java.lang.Object
  extended by java.lang.Enum<AspectRatio>
      extended by org.stanwood.media.info.AspectRatio
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<AspectRatio>

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

Used to enumerate known display aspect ratios


Enum Constant Summary
Ratio_1_1
          The aspect ratio 1:1
Ratio_14_9
          The aspect ratio 14:9
Ratio_16_10
          The aspect ratio 16:10
Ratio_16_9
          The aspect ratio 16:9
Ratio_2_35_1
          The aspect ratio 2.35:1
Ratio_4_3
          The aspect ratio 4:3
Unknown
          This means the ratio is not known
 
Method Summary
static AspectRatio fromRatio(double ratio)
          Used to find the ratio from it's decimal value
static AspectRatio fromString(java.lang.String ratio)
          Used to find the ratio from it's string description value
 java.lang.String getDescription()
          Used to get the ratio as a string
 double getValue()
          Used to get the ratio as a decimal value
 boolean isWideScreen()
          Returns true if the aspect ratio is wide screen
static AspectRatio valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static AspectRatio[] 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, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

Ratio_1_1

public static final AspectRatio Ratio_1_1
The aspect ratio 1:1


Ratio_16_9

public static final AspectRatio Ratio_16_9
The aspect ratio 16:9


Ratio_16_10

public static final AspectRatio Ratio_16_10
The aspect ratio 16:10


Ratio_14_9

public static final AspectRatio Ratio_14_9
The aspect ratio 14:9


Ratio_2_35_1

public static final AspectRatio Ratio_2_35_1
The aspect ratio 2.35:1


Ratio_4_3

public static final AspectRatio Ratio_4_3
The aspect ratio 4:3


Unknown

public static final AspectRatio Unknown
This means the ratio is not known

Method Detail

values

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

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

valueOf

public static AspectRatio 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
java.lang.NullPointerException - if the argument is null

isWideScreen

public boolean isWideScreen()
Returns true if the aspect ratio is wide screen

Returns:
true if the aspect ratio is wide screen

getDescription

public java.lang.String getDescription()
Used to get the ratio as a string

Returns:
the ratio as a string

getValue

public double getValue()
Used to get the ratio as a decimal value

Returns:
the ratio as a decimal value

fromRatio

public static AspectRatio fromRatio(double ratio)
Used to find the ratio from it's decimal value

Parameters:
ratio - The decimal value of the ratio
Returns:
The ratio

fromString

public static AspectRatio fromString(java.lang.String ratio)
Used to find the ratio from it's string description value

Parameters:
ratio - The string description value of the ratio
Returns:
The ratio