|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.farng.mp3.AbstractMP3FileItem org.farng.mp3.AbstractMP3FragmentBody
This class is contained in the AbstractMP3Fragment
and represents the actual data of tags. It contains
default get/set methods for all data objects. The data is represented as an ArrayList of MP3Object
.
ID3v2 tags have frames. Lyrics3 tags have fields. ID3v1 tags do not have fragments.
Constructor Summary | |
protected |
AbstractMP3FragmentBody()
Creates a new MP3FragmentBody object. |
protected |
AbstractMP3FragmentBody(AbstractMP3FragmentBody copyObject)
Creates a new AbstractMP3FragmentBody object. |
Method Summary | |
protected void |
appendToObjectList(AbstractMP3Object object)
|
boolean |
equals(java.lang.Object obj)
Returns true if this object and its entire MP3Object 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. |
java.lang.String |
getDescription()
This method calls toString for all it's objects and appends them. |
java.lang.Object |
getObject(java.lang.String identifier)
Returns the object of the MP3Object with the specified identifier |
java.util.Iterator |
getObjectListIterator()
|
int |
getSize()
Returns the estimated size in bytes of this object if it was to be written to file. |
protected static boolean |
has6ByteHeader()
|
boolean |
isSubsetOf(java.lang.Object object)
Returns true if this instance and its entire MP3Object array list is a subset of the argument. |
java.util.Iterator |
iterator()
Returns an iterator of the MP3Object object list. |
void |
read(java.io.RandomAccessFile file)
Read the data from the given file into this object. |
protected abstract int |
readHeader(java.io.RandomAccessFile file)
Reads the header for the fragment body. |
void |
setObject(java.lang.String identifier,
java.lang.Object object)
Sets the all objects of identifier type to object argument. |
protected abstract void |
setupObjectList()
Create the order of MP3Object objects that this body expects. |
java.lang.String |
toString()
Calls toString for all MP3Object objects and creates a string with a new line
character. |
void |
write(java.io.RandomAccessFile file)
Write the contents of this object to the file at the position it is currently at. |
protected abstract void |
writeHeader(java.io.RandomAccessFile file,
int size)
Write the body header to the file at the current file position. |
Methods inherited from class org.farng.mp3.AbstractMP3FileItem |
getIdentifier |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
protected AbstractMP3FragmentBody()
protected AbstractMP3FragmentBody(AbstractMP3FragmentBody copyObject)
Method Detail |
public java.lang.String getBriefDescription()
toString
for all it's objects and appends them without any newline characters.
public java.lang.String getDescription()
toString
for all it's objects and appends them. It contains new line characters
and is more suited for display purposes
public java.util.Iterator getObjectListIterator()
public void setObject(java.lang.String identifier, java.lang.Object object)
object
argument.
identifier
- MP3Object
identifierobject
- new object valuepublic java.lang.Object getObject(java.lang.String identifier)
MP3Object
with the specified identifier
identifier
- MP3Object
identifier
MP3Object
with the specified identifier
public int getSize()
getSize
in class AbstractMP3FileItem
public boolean isSubsetOf(java.lang.Object object)
MP3Object
array list is a subset of the argument. This
class is a subset if it is the same class as the argument.
isSubsetOf
in class AbstractMP3FileItem
object
- object to determine subset of
public boolean equals(java.lang.Object obj)
MP3Object
array list equals the argument. This object is
equal to the argument only if they are the same class.
equals
in class AbstractMP3FileItem
obj
- object to determine equality of
MP3Object
array list equals the argument.public java.util.Iterator iterator()
MP3Object
object list.
MP3Object
object list.protected void appendToObjectList(AbstractMP3Object object)
public void read(java.io.RandomAccessFile file) throws java.io.IOException, InvalidTagException
read
in class AbstractMP3FileItem
file
- file to read from
java.io.IOException
- on any I/O error
InvalidTagException
- if there is any error in the data format.public java.lang.String toString()
toString
for all MP3Object
objects and creates a string with a new line
character.
public void write(java.io.RandomAccessFile file) throws java.io.IOException
write
in class AbstractMP3FileItem
file
- destination file
java.io.IOException
- on any I/O errorprotected abstract int readHeader(java.io.RandomAccessFile file) throws java.io.IOException, InvalidTagException
file
- file to read the header from.
java.io.IOException
- on any I/O error
InvalidTagException
- if there is any error in the data format.protected abstract void setupObjectList()
MP3Object
objects that this body expects. This method needs to be overwritten.
protected abstract void writeHeader(java.io.RandomAccessFile file, int size) throws java.io.IOException
file
- file to write tosize
- number of bytes the body contains.
java.io.IOException
- on any I/O errorprotected static boolean has6ByteHeader()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |