com.tffenterprises.music.tag.id3v2.frame
Class FrameHeader_2_0

java.lang.Object
  extended by com.tffenterprises.music.tag.id3v2.frame.FrameHeader
      extended by com.tffenterprises.music.tag.id3v2.frame.FrameHeader_2_0
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class FrameHeader_2_0
extends FrameHeader
implements java.io.Serializable, java.lang.Cloneable

FrameHeader_2_0 is a class that provides ID3v2 with an interpretation of the frame header structure, as defined in the older ID3v2.2 specification.

Version:
1.0d1 $Date: 2003/03/19 22:48:21 $
Author:
Guillaume Lessard
See Also:
Serialized Form

Field Summary
private  java.lang.String oldID
          The 2.0 frame ID string
private static java.util.ResourceBundle TYPE_MAPPING_INFO
          A bundle that maps 3-letter frame types to their 4-letter equivalents.
 
Fields inherited from class com.tffenterprises.music.tag.id3v2.frame.FrameHeader
NULL_ID
 
Constructor Summary
FrameHeader_2_0()
          Default Constructor.
FrameHeader_2_0(java.io.InputStream in)
          Constructs a FrameHeader_2_0 from an InputStream.
 
Method Summary
 java.lang.Object clone()
          Returns a clone of this Flags object.
 boolean equals(java.lang.Object other)
          Compares this FrameHeader object with another one.
static java.lang.String GetEquivalenceForID(java.lang.String id)
          Obtain an equivalent ID under more modern rules, i.e.
static boolean isValidFrameID(java.lang.String id)
          Is the given ID valid under ID3v2.2 ?
 void setFrameID(java.lang.String newID)
          Set the current FrameHeader's frame ID.
 java.lang.String toString()
          returns a String representation of this ID3v2 Flags object.
 void updateChecksum(DataOutputChecksum checksum)
          Updates a Checksum with all of this object's data.
 void writeTo(java.io.OutputStream os)
          Writes this FrameHeader to an OutputStream.
 
Methods inherited from class com.tffenterprises.music.tag.id3v2.frame.FrameHeader
checkFormatMask, checkStatusMask, getChecksum, getDataLength, getFormatFlags, getFrameBytesFromStream, getFrameID, getFrameLength, getNewInstance, getNewInstance, getNewInstance, getNewInstance, getStatusFlags, hashCode, isChanged, processInput, processOutput, setChanged, setDataLength, setFormatFlags, setFormatMask, setFrameLength, setStatusFlags, setStatusMask, unsetFormatMask, unsetStatusMask, usesCompression, usesDataLengthIndicator, usesEncryption, usesGroupID, usesUnsynchronization
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

oldID

private java.lang.String oldID
The 2.0 frame ID string


TYPE_MAPPING_INFO

private static java.util.ResourceBundle TYPE_MAPPING_INFO
A bundle that maps 3-letter frame types to their 4-letter equivalents.

Constructor Detail

FrameHeader_2_0

public FrameHeader_2_0()
Default Constructor. This should not be called by normal users of FrameHeader objects. Use the factory class method getNewInstance(short version) instead.


FrameHeader_2_0

public FrameHeader_2_0(java.io.InputStream in)
                throws PaddingException,
                       java.io.IOException,
                       TagDataFormatException
Constructs a FrameHeader_2_0 from an InputStream. This should not be called by normal users of FrameHeader objects. Use the factory class method getNewInstance(short version, InputStream in) instead.

Parameters:
in - An InputStream from which to read the FrameHeader information.
Throws:
PaddingException - if all the read bytes are nulls
java.io.IOException - if the InputStream throws one
TagDataFormatException
Method Detail

GetEquivalenceForID

public static java.lang.String GetEquivalenceForID(java.lang.String id)
Obtain an equivalent ID under more modern rules, i.e. ID3v2.3 and up.

Parameters:
id - the ID for which we want to find an equivalent.
Returns:
an equivalent ID under ID3v2.3

isValidFrameID

public static boolean isValidFrameID(java.lang.String id)
Is the given ID valid under ID3v2.2 ?

Parameters:
id - the ID to verify
Returns:
whether the ID passed a test of validity.

updateChecksum

public void updateChecksum(DataOutputChecksum checksum)
Updates a Checksum with all of this object's data. This is used by the hashCode() and getChecksum() methods of Flags.

Overrides:
updateChecksum in class FrameHeader
Parameters:
checksum - the Checksum to be updated.

clone

public java.lang.Object clone()
Returns a clone of this Flags object. The object returned by this implementation already has the proper type. In order for this method to work, subclasses of BaseFrame must have a default constructor accessible to this class.

Overrides:
clone in class FrameHeader
Returns:
a clone of this Flags object.

equals

public boolean equals(java.lang.Object other)
Compares this FrameHeader object with another one.

Overrides:
equals in class FrameHeader
Parameters:
other - The other object.
Returns:
true if the two objects are equivalent, false otherwise.

toString

public java.lang.String toString()
returns a String representation of this ID3v2 Flags object.

Overrides:
toString in class FrameHeader
Returns:
a String representation of this ID3v2 Flags object.

setFrameID

public void setFrameID(java.lang.String newID)
Set the current FrameHeader's frame ID.

Overrides:
setFrameID in class FrameHeader
Parameters:
newID - The new frame ID for this FrameHeader.

writeTo

public void writeTo(java.io.OutputStream os)
             throws java.io.IOException
Writes this FrameHeader to an OutputStream. This method is used by Frame subclasses during the execution of their writeTo(OutputStream) and getBytes() methods.

The state of the object should be assumed to have preliminarily been updated with data and values obtained from the writeTo in class FrameHeader

Parameters:
os - the OutputStream to which this object will be written.
Throws:
java.io.IOException - if an I/O error occurs