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

java.lang.Object
  extended by com.tffenterprises.music.tag.id3v2.Frame
      extended by com.tffenterprises.music.tag.id3v2.frame.BaseFrame
          extended by com.tffenterprises.music.tag.id3v2.frame.TextBasedFrame
              extended by com.tffenterprises.music.tag.id3v2.frame.TXXXFrame
All Implemented Interfaces:
KeyedFrame, java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
CommentFrame

public class TXXXFrame
extends TextBasedFrame
implements KeyedFrame, java.io.Serializable, java.lang.Cloneable

This class is the ID3v2 TXXX frame type; it handles "user-defined text" frames, which contain two strings (the "Description" and the "Value").

Version:
1.0d1 $Date: 2003/07/04 09:08:36 $
Author:
Guillaume Lessard, Daniel M. Zimmerman
See Also:
Serialized Form

Field Summary
private static java.lang.String FRAME_ID
          The frame ID of this frame.
private  java.lang.String frameDescription
          The description text for this frame.
private  java.lang.String frameValue
          The value text for this frame.
 
Fields inherited from class com.tffenterprises.music.tag.id3v2.frame.TextBasedFrame
BOM_CHAR, BOM_CHAR_STRING, ENCODING_STRINGS, ISO_8859_1, NULL_BOM_STRING, NULL_CHAR, NULL_CHAR_STRING, UNICODE, UNICODE_BIG, UNICODE_LITTLE, UTF8
 
Constructor Summary
TXXXFrame()
          Constructs a new TXXXFrame with no description or value.
TXXXFrame(FrameHeader header)
          Constructs a TXXXFrame using the given header.
TXXXFrame(FrameHeader header, java.lang.String frameDescription, java.lang.String frameValue)
          Constructs a new TXXXFrame with the specified header, description and value.
 
Method Summary
 java.lang.Object clone()
          Returns a clone of this ID3v2 frame.
 boolean equals(java.lang.Object other)
          Compares this ID3v2 frame with another object.
 java.lang.String getDescription()
          Returns the description field of this frame.
 byte[] getRawData()
          Returns the raw data corresponding to this frame.
 java.lang.String getValue()
          Returns the value field of this frame.
 boolean isOfRepeatableType()
          Reveals whether it is legal for multiple frames of this type to exist in the same ID3v2 tag.
 void setDescription(java.lang.String frameDescription)
          Sets the description field of this frame.
 void setRawData(byte[] rawData)
          Sets the raw data corresponding to this frame.
 void setValue(java.lang.String frameValue)
          Sets the value field of this frame.
 java.lang.String toString()
          Returns a String representation of this frame.
 
Methods inherited from class com.tffenterprises.music.tag.id3v2.frame.TextBasedFrame
getNullBytes, getTextEncoding, getTextEncoding, getTextEncoding, is8859String, read8859Characters, read8859String, readCharacters, readString, readUnicodeCharacters, readUnicodeString
 
Methods inherited from class com.tffenterprises.music.tag.id3v2.frame.BaseFrame
getBytes, getChecksum, getFormatFlags, getFrameID, getHeader, getStatusFlags, hashCode, isChanged, setChanged, setFormatFlags, setStatusFlags, toByteArray, updateChecksum, writeTo
 
Methods inherited from class com.tffenterprises.music.tag.id3v2.Frame
FromByteArray, FromByteArray, FromInputStream, GetFrameClassForID, getNewInstance, getNewInstance, getNewInstance, MinimumLength, RegisterFrameClass, UnregisterFrameClass
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

FRAME_ID

private static final java.lang.String FRAME_ID
The frame ID of this frame.

See Also:
Constant Field Values

frameDescription

private java.lang.String frameDescription
The description text for this frame.


frameValue

private java.lang.String frameValue
The value text for this frame.

Constructor Detail

TXXXFrame

public TXXXFrame()
Constructs a new TXXXFrame with no description or value.


TXXXFrame

public TXXXFrame(FrameHeader header)
          throws java.lang.IllegalArgumentException
Constructs a TXXXFrame using the given header. The frame ID contained in the header will be redefined to "TXXX", given that it is the only frame type handled by this class. The frame flags defined in the FrameHeader instance will be honored, however.

Parameters:
header - The FrameHeader to be used for this Frame instance. See FrameHeader for details.
Throws:
java.lang.IllegalArgumentException - This is exception is thrown when the parameter is unacceptable for use with an object of this Frame class/subclass.

TXXXFrame

public TXXXFrame(FrameHeader header,
                 java.lang.String frameDescription,
                 java.lang.String frameValue)
          throws java.lang.IllegalArgumentException
Constructs a new TXXXFrame with the specified header, description and value.

Parameters:
header - The FrameHeader to be used for this Frame instance
frameDescription - The frame description
frameValue - The frame value
Throws:
java.lang.IllegalArgumentException - if the specified frame type, the specified frame description, or the specified frame value is null.
Method Detail

clone

public java.lang.Object clone()
Returns a clone of this ID3v2 frame.

Overrides:
clone in class BaseFrame
Returns:
a clone of this ID3v2 frame.

equals

public boolean equals(java.lang.Object other)
Compares this ID3v2 frame with another object.

Overrides:
equals in class BaseFrame
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 frame.

Overrides:
toString in class BaseFrame
Returns:
a String representation of this frame.

getRawData

public byte[] getRawData()
Returns the raw data corresponding to this frame. This does not include the frame header.

Specified by:
getRawData in class BaseFrame
Returns:
the raw data corresponding to this frame.

setRawData

public void setRawData(byte[] rawData)
                throws FrameDataFormatException,
                       java.lang.IllegalArgumentException
Sets the raw data corresponding to this frame.

Specified by:
setRawData in class BaseFrame
Parameters:
rawData - The raw data.
Throws:
FrameDataFormatException - if the raw data is not in an appropriate format for this frame's type.
java.lang.IllegalArgumentException - if the specified raw data is null.

isOfRepeatableType

public boolean isOfRepeatableType()
Reveals whether it is legal for multiple frames of this type to exist in the same ID3v2 tag. "TXXX" frames are keyed, so this will return true.

Specified by:
isOfRepeatableType in interface KeyedFrame
Overrides:
isOfRepeatableType in class BaseFrame
Returns:
true

getDescription

public java.lang.String getDescription()
Returns the description field of this frame.

Specified by:
getDescription in interface KeyedFrame
Returns:
the description field of this frame.

setDescription

public void setDescription(java.lang.String frameDescription)
Sets the description field of this frame.

Parameters:
frameDescription - The description text.
Throws:
java.lang.IllegalArgumentException - if the description text is null.

getValue

public java.lang.String getValue()
Returns the value field of this frame.

Returns:
the value field of this frame.

setValue

public void setValue(java.lang.String frameValue)
Sets the value field of this frame.

Parameters:
frameValue - The value text.
Throws:
java.lang.IllegalArgumentException - if the value text is null.