org.metasyntactic.id3.v2.frame
Class TextInformationFrame

java.lang.Object
  |
  +--org.metasyntactic.id3.v2.frame.Frame
        |
        +--org.metasyntactic.id3.v2.frame.TextInformationFrame
All Implemented Interfaces:
Id3v2Constants
Direct Known Subclasses:
NumericStringFrame, TALB, TCOM, TCON, TCOP, TENC, TEXT, TimestampFrame, TIPL, TIT1, TIT2, TIT3, TKEY, TMCL, TOAL, TOLY, TOPE, TPE1, TPE2, TPE3, TPE4, TPOS, TPRO, TRCK, TSRC, TSST

public abstract class TextInformationFrame
extends Frame
implements Id3v2Constants

The text information frames are often the most important frames, containing information like artist, album and more. There may only be one text information frame of its kind in an tag. All text information frames supports multiple strings, stored as a null separated list, where null is reperesented by the termination code for the charater encoding. All text frame identifiers begin with "T". Only text frame identifiers begin with "T", with the exception of the "TXXX" frame. All the text information frames have the following format:

Text encoding $xx Information


Field Summary
protected  byte encoding
           
protected  java.lang.String information
           
 
Fields inherited from class org.metasyntactic.id3.v2.frame.Frame
compressed, dataLengthIndicator, discardOnFileAlteration, discardOnTagAlteration, encrypted, frameID, groupInformation, readOnly, unsynchronised
 
Fields inherited from interface org.metasyntactic.id3.v2.Id3v2Constants
ISO_8859_1, JAVA_ISO_8859_1, JAVA_US_ASCII, JAVA_UTF_16, JAVA_UTF_16_BIG_ENDIAN, JAVA_UTF_8, MAJOR_VERSION, MAX_ENCODING, MIN_ENCODING, REVISION_NUMBER, UTF_16, UTF_16_BIG_ENDIAN, UTF_8
 
Constructor Summary
protected TextInformationFrame()
           
protected TextInformationFrame(byte encoding, java.lang.String information)
           
protected TextInformationFrame(java.lang.String information)
           
 
Method Summary
 boolean equals(java.lang.Object o)
           
 boolean equals(TextInformationFrame t)
           
 int getSize()
          The size of a TextInformationFrame is the length of the information, plus the one byte for the encoding type information.
 int hashCode()
           
 void readContent(java.io.PushbackInputStream in, int length)
          Creates new TextInformationFrame
 void setInformation(java.lang.String information)
           
 java.lang.String toString()
           
protected  void validate()
          Intended for subclasses to use to validate the information read in by readContent.
 void writeContent(java.io.OutputStream out)
          This is called as the last step of write(OutputStream).
 
Methods inherited from class org.metasyntactic.id3.v2.frame.Frame
getTotalSize, hasDataLengthIndicator, isCompressed, isDiscardedOnFileAlteration, isDiscardedOnTagAlteration, isEncrypted, isPartOfGroup, isReadOnly, isUnsynchronized, read, write
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

encoding

protected byte encoding

information

protected java.lang.String information
Constructor Detail

TextInformationFrame

protected TextInformationFrame()

TextInformationFrame

protected TextInformationFrame(byte encoding,
                               java.lang.String information)

TextInformationFrame

protected TextInformationFrame(java.lang.String information)
Method Detail

getSize

public int getSize()
The size of a TextInformationFrame is the length of the information, plus the one byte for the encoding type information.

Overrides:
getSize in class Frame

setInformation

public void setInformation(java.lang.String information)

writeContent

public void writeContent(java.io.OutputStream out)
                  throws java.io.IOException
Description copied from class: Frame
This is called as the last step of write(OutputStream). Subclasses must implement in order to properly write out their data to the stream

Specified by:
writeContent in class Frame
java.io.IOException

readContent

public void readContent(java.io.PushbackInputStream in,
                        int length)
                 throws java.io.IOException,
                        Id3v2Exception
Creates new TextInformationFrame

Specified by:
readContent in class Frame
java.io.IOException
Id3v2Exception

validate

protected void validate()
                 throws Id3v2Exception
Intended for subclasses to use to validate the information read in by readContent. The default implementation is to do nothing

Id3v2Exception

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

equals

public boolean equals(TextInformationFrame t)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class Frame