fi.helsinki.cs.ohtu.mpeg2.audio.mpa
Enum MP123Header.Layer

java.lang.Object
  extended by java.lang.Enum<MP123Header.Layer>
      extended by fi.helsinki.cs.ohtu.mpeg2.audio.mpa.MP123Header.Layer
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<MP123Header.Layer>
Enclosing class:
MP123Header

public static enum MP123Header.Layer
extends java.lang.Enum<MP123Header.Layer>

Represents the MPEG-1 audio layer.


Enum Constant Summary
LAYER_1
          MPEG-1 Layer I
LAYER_2
          MPEG-1 Layer II
LAYER_3
          MPEG-1 Layer III
 
Field Summary
private  int layer
          The MPEG-1 audio layer.
 
Method Summary
static MP123Header.Layer valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static MP123Header.Layer[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 void writeTo(BitOutputStream stream)
          Encodes this Layer to the given bit stream.
 
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

LAYER_1

public static final MP123Header.Layer LAYER_1
MPEG-1 Layer I


LAYER_2

public static final MP123Header.Layer LAYER_2
MPEG-1 Layer II


LAYER_3

public static final MP123Header.Layer LAYER_3
MPEG-1 Layer III

Field Detail

layer

private final int layer
The MPEG-1 audio layer.

Method Detail

values

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

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

valueOf

public static MP123Header.Layer 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

writeTo

public void writeTo(BitOutputStream stream)
             throws java.io.IOException
Encodes this Layer to the given bit stream.

Parameters:
stream - the stream to encode this Layer to
Throws:
java.io.IOException