org.jaudiotagger.tag.id3
Class AbstractTagFrameBody

java.lang.Object
  extended by org.jaudiotagger.tag.id3.AbstractTagItem
      extended by org.jaudiotagger.tag.id3.AbstractTagFrameBody
Direct Known Subclasses:
AbstractID3v2FrameBody, AbstractLyrics3v2FieldFrameBody

public abstract class AbstractTagFrameBody
extends AbstractTagItem

A frame body contains the data content for a frame


Field Summary
private  AbstractTagFrame header
          Reference to the header associated with this frame body, a framebody can be created without a header but one it is associated with a header this should be set.
protected  java.util.ArrayList<AbstractDataType> objectList
          List of data types that make up this particular frame body.
 
Fields inherited from class org.jaudiotagger.tag.id3.AbstractTagItem
logger
 
Constructor Summary
protected AbstractTagFrameBody()
          Creates a new framebody, at this point the bodys ObjectList is setup which defines what datatypes are expected in body
protected AbstractTagFrameBody(AbstractTagFrameBody copyObject)
          Copy Constructor for fragment body.
 
Method Summary
 void createStructure()
           
 boolean equals(java.lang.Object obj)
          Returns true if this datatype and its entire DataType array list equals the argument.
 java.lang.String getBriefDescription()
          This method calls toString for all it's objects and appends them without any newline characters.
 AbstractTagFrame getHeader()
          Get Reference to header
 java.lang.String getLongDescription()
          This method calls toString for all it's objects and appends them.
 AbstractDataType getObject(java.lang.String identifier)
          Returns the datatype with the specified identifier
 java.lang.Object getObjectValue(java.lang.String identifier)
          Returns the value of the datatype with the specified identifier
 int getSize()
          Returns the size in bytes of this fragmentbody
 byte getTextEncoding()
          Return the Text Encoding
 boolean isSubsetOf(java.lang.Object obj)
          Returns true if this instance and its entire DataType array list is a subset of the argument.
 java.util.Iterator iterator()
          Returns an iterator of the DataType list.
 void setHeader(AbstractTagFrame header)
          Set header
 void setObjectValue(java.lang.String identifier, java.lang.Object value)
          Sets all objects of identifier type to value defined by obj argument.
 void setTextEncoding(byte textEncoding)
          Set the Text Encoding to use for this frame body
protected abstract  void setupObjectList()
          Create the list of Datatypes that this body expects in the correct order This method needs to be implemented by concrete subclasses
 java.lang.String toString()
          Return brief description of FrameBody
 
Methods inherited from class org.jaudiotagger.tag.id3.AbstractTagItem
getIdentifier, read
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

header

private AbstractTagFrame header
Reference to the header associated with this frame body, a framebody can be created without a header but one it is associated with a header this should be set. It is principally useful for the framebody to know its header, because this will specify its tag version and some framebodies behave slighly different between tag versions.


objectList

protected java.util.ArrayList<AbstractDataType> objectList
List of data types that make up this particular frame body.

Constructor Detail

AbstractTagFrameBody

protected AbstractTagFrameBody()
Creates a new framebody, at this point the bodys ObjectList is setup which defines what datatypes are expected in body


AbstractTagFrameBody

protected AbstractTagFrameBody(AbstractTagFrameBody copyObject)
Copy Constructor for fragment body. Copies all objects in the Object Iterator with data.

Parameters:
copyObject -
Method Detail

createStructure

public void createStructure()

getTextEncoding

public final byte getTextEncoding()
Return the Text Encoding

Returns:
the text encoding used by this framebody

setTextEncoding

public final void setTextEncoding(byte textEncoding)
Set the Text Encoding to use for this frame body

Parameters:
textEncoding - to use for this frame body

getBriefDescription

public java.lang.String getBriefDescription()
This method calls toString for all it's objects and appends them without any newline characters.

Returns:
brief description string

getLongDescription

public final java.lang.String getLongDescription()
This method calls toString for all it's objects and appends them. It contains new line characters and is more suited for display purposes

Returns:
formatted description string

setObjectValue

public final void setObjectValue(java.lang.String identifier,
                                 java.lang.Object value)
Sets all objects of identifier type to value defined by obj argument.

Parameters:
identifier - MP3Object identifier
value - new datatype value

getObjectValue

public final java.lang.Object getObjectValue(java.lang.String identifier)
Returns the value of the datatype with the specified identifier

Parameters:
identifier -
Returns:
the value of the dattype with the specified identifier

getObject

public final AbstractDataType getObject(java.lang.String identifier)
Returns the datatype with the specified identifier

Parameters:
identifier -
Returns:
the datatype with the specified identifier

getSize

public int getSize()
Returns the size in bytes of this fragmentbody

Specified by:
getSize in class AbstractTagItem
Returns:
estimated size in bytes of this datatype

isSubsetOf

public boolean isSubsetOf(java.lang.Object obj)
Returns true if this instance and its entire DataType array list is a subset of the argument. This class is a subset if it is the same class as the argument.

Overrides:
isSubsetOf in class AbstractTagItem
Parameters:
obj - datatype to determine subset of
Returns:
true if this instance and its entire datatype array list is a subset of the argument.

equals

public boolean equals(java.lang.Object obj)
Returns true if this datatype and its entire DataType array list equals the argument. This datatype is equal to the argument if they are the same class.

Overrides:
equals in class AbstractTagItem
Parameters:
obj - datatype to determine equality of
Returns:
true if this datatype and its entire MP3Object array list equals the argument.

iterator

public java.util.Iterator iterator()
Returns an iterator of the DataType list.

Returns:
iterator of the DataType list.

toString

public java.lang.String toString()
Return brief description of FrameBody

Overrides:
toString in class java.lang.Object
Returns:
brief description of FrameBody

setupObjectList

protected abstract void setupObjectList()
Create the list of Datatypes that this body expects in the correct order This method needs to be implemented by concrete subclasses


getHeader

public AbstractTagFrame getHeader()
Get Reference to header

Returns:

setHeader

public void setHeader(AbstractTagFrame header)
Set header

Parameters:
header -