|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.tffenterprises.music.tag.id3v2.Frame
com.tffenterprises.music.tag.id3v2.frame.BaseFrame
com.tffenterprises.music.tag.id3v2.frame.TextBasedFrame
com.tffenterprises.music.tag.id3v2.frame.TXXXFrame
com.tffenterprises.music.tag.id3v2.frame.CommentFrame
public class CommentFrame
This class is the ID3v2 Comment frame (and non-synchronized lyrics) type. It has a structure similar to TXXX, which contains two strings (the "Description" and the "Value"), but the first string is preceded by a three-byte language identifier.
Field Summary | |
---|---|
private java.lang.String |
frameLanguage
A language identifier for the text in this frame. |
private static java.lang.String |
MY_ID
The frame ID of 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 | |
---|---|
CommentFrame()
Constructs a new CommentFrame with no description or value. |
|
CommentFrame(FrameHeader header)
Constructs a CommentFrame using the given header. |
|
CommentFrame(FrameHeader header,
java.lang.String languageID,
java.lang.String frameDescription,
java.lang.String frameValue)
Constructs a new CommentFrame with the specified header, language 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 |
getTextEncoding(ByteArrayInputStream in)
Returns a string representing the text encoding used by this frame. |
byte[] |
getTextEncoding(java.lang.String s)
Returns a byte array representing the text encoding used by this frame. |
java.lang.String |
toString()
Returns a String representation of this frame. |
Methods inherited from class com.tffenterprises.music.tag.id3v2.frame.TXXXFrame |
---|
getDescription, getRawData, getValue, isOfRepeatableType, setDescription, setRawData, setValue |
Methods inherited from class com.tffenterprises.music.tag.id3v2.frame.TextBasedFrame |
---|
getNullBytes, 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 |
Methods inherited from interface com.tffenterprises.music.tag.id3v2.frame.KeyedFrame |
---|
getDescription, isOfRepeatableType |
Field Detail |
---|
private static final java.lang.String MY_ID
private java.lang.String frameLanguage
Constructor Detail |
---|
public CommentFrame()
public CommentFrame(FrameHeader header) throws java.lang.IllegalArgumentException
header
- The FrameHeader to be used for this Frame instance.
See FrameHeader
for details.
java.lang.IllegalArgumentException
- This is exception is thrown when
the parameter is unacceptable for
use with an object of this
Frame class/subclass.public CommentFrame(FrameHeader header, java.lang.String languageID, java.lang.String frameDescription, java.lang.String frameValue) throws java.lang.IllegalArgumentException
header
- The FrameHeader to be used for this frame.languageID
- The language in which this comment is written.frameDescription
- The frame description.frameValue
- The frame value.
java.lang.IllegalArgumentException
- if the specified frame type,
the specified frame description,
or the specified frame value is null.Method Detail |
---|
public java.lang.Object clone()
clone
in class TXXXFrame
public boolean equals(java.lang.Object other)
equals
in class TXXXFrame
other
- The other object.
public java.lang.String toString()
toString
in class TXXXFrame
public java.lang.String getTextEncoding(ByteArrayInputStream in) throws FrameDataFormatException
For the moment, this method returns either "ISO8859_1" or "Unicode". Note that in the case of Unicode, further probing may be necessary in order to determine the byte ordering. The readUnicodeString() method does such additional probing.
getTextEncoding
in class TextBasedFrame
in
- the input stream from which the information will be read.
FrameDataFormatException
- if the text encoding is unknown.public byte[] getTextEncoding(java.lang.String s) throws FrameDataFormatException
This method will concatenate the language code bytes to the encoding byte.
getTextEncoding
in class TextBasedFrame
s
- the encoding used, as a string.
FrameDataFormatException
- if somehow the passed string
represents an unknown encoding.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |