entagged.audioformats.mp3.util.id3frames
Class TextId3Frame

java.lang.Object
  extended by entagged.audioformats.mp3.util.id3frames.Id3Frame
      extended by entagged.audioformats.mp3.util.id3frames.TextId3Frame
All Implemented Interfaces:
TagField, TagTextField
Direct Known Subclasses:
ApicId3Frame, CommId3Frame, TimeId3Frame

public class TextId3Frame
extends Id3Frame
implements TagTextField


Field Summary
protected  boolean common
           
protected  String content
           
protected  byte encoding
           
protected  String id
           
 
Fields inherited from class entagged.audioformats.mp3.util.id3frames.Id3Frame
flags, version
 
Constructor Summary
TextId3Frame(String id, byte[] rawContent, byte version)
           
TextId3Frame(String id, String content)
           
 
Method Summary
protected  byte[] build()
          This method creates a binary representation of the current Id3Frame data.
This data can directly be written to a file or stream.
s
 void copyContent(TagField field)
          This method copies the data of the given filed to the current data.
 String getContent()
          Returns the content of the field.
 String getEncoding()
          Returns the current used charset encoding.
 String getId()
          (overridden)
For Id3-Frames its something like "TCOM","TENC","TALB" and so on.
 boolean isBinary()
          (overridden)
 boolean isCommon()
          (overridden)
 boolean isEmpty()
          Determines whether the content of the field is empty.
protected  void populate(byte[] raw)
          This method reads the given data of an ID3-Frame and interprets it implementation specific.
The values of the Id3Frame instance are adjusted.
 void setContent(String s)
          Sets the content of the field.
 void setEncoding(String enc)
          Sets the charset encoding used by the field.
 String toString()
          This method returns a human readable description of the fields contents.
For text fields it should be the text itself.
 
Methods inherited from class entagged.audioformats.mp3.util.id3frames.Id3Frame
clone, copy, equals, getBytes, getFlags, getIdBytes, getRawContent, getSize, getString, indexOfFirstNull, isBinary
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface entagged.audioformats.generic.TagField
getRawContent, isBinary
 

Field Detail

content

protected String content

encoding

protected byte encoding

id

protected String id

common

protected boolean common
Constructor Detail

TextId3Frame

public TextId3Frame(String id,
                    String content)

TextId3Frame

public TextId3Frame(String id,
                    byte[] rawContent,
                    byte version)
             throws UnsupportedEncodingException
Throws:
UnsupportedEncodingException
Method Detail

getEncoding

public String getEncoding()
Description copied from interface: TagTextField
Returns the current used charset encoding.

Specified by:
getEncoding in interface TagTextField
Returns:
Charset encoding.

setEncoding

public void setEncoding(String enc)
Description copied from interface: TagTextField
Sets the charset encoding used by the field.

Specified by:
setEncoding in interface TagTextField
Parameters:
enc - charset.

getContent

public String getContent()
Description copied from interface: TagTextField
Returns the content of the field.

Specified by:
getContent in interface TagTextField
Returns:
Content

isBinary

public boolean isBinary()
Description copied from class: Id3Frame
(overridden)

Specified by:
isBinary in interface TagField
Specified by:
isBinary in class Id3Frame
Returns:
true if field represents binary data (not human readable).
See Also:
TagField.isBinary()

getId

public String getId()
Description copied from class: Id3Frame
(overridden)
For Id3-Frames its something like "TCOM","TENC","TALB" and so on.

Specified by:
getId in interface TagField
Specified by:
getId in class Id3Frame
Returns:
Unique identifier for the fields type. (title, artist...)
See Also:
TagField.getId()

isCommon

public boolean isCommon()
Description copied from class: Id3Frame
(overridden)

Specified by:
isCommon in interface TagField
Specified by:
isCommon in class Id3Frame
Returns:
true if the field is of common use.
See Also:
TagField.isCommon()

setContent

public void setContent(String s)
Description copied from interface: TagTextField
Sets the content of the field.

Specified by:
setContent in interface TagTextField
Parameters:
s - fields content.

isEmpty

public boolean isEmpty()
Description copied from interface: TagField
Determines whether the content of the field is empty.

Specified by:
isEmpty in interface TagField
Returns:
true if no data is stored (or empty String).

copyContent

public void copyContent(TagField field)
Description copied from interface: TagField
This method copies the data of the given filed to the current data.

Specified by:
copyContent in interface TagField
Parameters:
field - The field containing the data to be taken.

populate

protected void populate(byte[] raw)
                 throws UnsupportedEncodingException
Description copied from class: Id3Frame
This method reads the given data of an ID3-Frame and interprets it implementation specific.
The values of the Id3Frame instance are adjusted.

Specified by:
populate in class Id3Frame
Parameters:
raw - The frame data.
Throws:
UnsupportedEncodingException - On text frames there can be such errors.

build

protected byte[] build()
                throws UnsupportedEncodingException
Description copied from class: Id3Frame
This method creates a binary representation of the current Id3Frame data.
This data can directly be written to a file or stream.
s

Specified by:
build in class Id3Frame
Returns:
Binary representation of current frame based on the implementation (what does it stand for) and data (its contents).
Throws:
UnsupportedEncodingException - If a text-Frame is constructed there can occur an error during text conversions.

toString

public String toString()
Description copied from interface: TagField
This method returns a human readable description of the fields contents.
For text fields it should be the text itself. Other fields containing images may return a formatted string with image properties like width, height and so on.

Specified by:
toString in interface TagField
Overrides:
toString in class Object
Returns:
Description of the fields content.


Copyright © 2007-2008. All Rights Reserved.