|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jaudiotagger.tag.datatype.AbstractDataType
public abstract class AbstractDataType
Represents a field/data type that can be held within a frames body, these map loosely onto Section 4. ID3v2 frame overview at http://www.id3.org/id3v2.4.0-structure.txt
Field Summary | |
---|---|
protected AbstractTagFrameBody |
frameBody
Holds the calling body, allows an datatype to query other objects in the body such as the Text Encoding of the frame |
protected java.lang.String |
identifier
Holds the key such as "Text" or "PictureType", the naming of keys are fairly arbitary but are intended to make it easier to for the developer, the keys themseleves are not written to the tag. |
static java.util.logging.Logger |
logger
|
protected int |
size
Holds the size of the data in file when read/written |
protected static java.lang.String |
TYPE_ELEMENT
|
protected java.lang.Object |
value
Holds the data |
Constructor Summary | |
---|---|
|
AbstractDataType(AbstractDataType copyObject)
This is used by subclasses, to clone the data within the copyObject TODO:It seems to be missing some of the more complex value types. |
protected |
AbstractDataType(java.lang.String identifier,
AbstractTagFrameBody frameBody)
Construct an abstract datatype identified by identifier and linked to a framebody without setting an initial value. |
protected |
AbstractDataType(java.lang.String identifier,
AbstractTagFrameBody frameBody,
java.lang.Object value)
Construct an abstract datatype identified by identifier and linked to a framebody initilised with a value |
Method Summary | |
---|---|
void |
createStructure()
Return String Representation of Datatype * |
boolean |
equals(java.lang.Object obj)
|
AbstractTagFrameBody |
getBody()
Get the framebody associated with this datatype |
java.lang.String |
getIdentifier()
Return the key as declared by the frame bodies datatype list |
abstract int |
getSize()
This defines the size in bytes of the datatype being held when read/written to file. |
java.lang.Object |
getValue()
Get value held by this Object |
void |
readByteArray(byte[] arr)
Simplified wrapper for reading bytes from file into Object. |
abstract void |
readByteArray(byte[] arr,
int offset)
This is the starting point for reading bytes from the file into the ID3 datatype starting at offset. |
void |
setBody(AbstractTagFrameBody frameBody)
Set the framebody that this datatype is associated with |
void |
setValue(java.lang.Object value)
Set the value held by this datatype, this is used typically used when the user wants to modify the value in an existing frame. |
abstract byte[] |
writeByteArray()
Starting point write ID3 Datatype back to array of bytes. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final java.lang.String TYPE_ELEMENT
public static java.util.logging.Logger logger
protected java.lang.Object value
protected java.lang.String identifier
protected AbstractTagFrameBody frameBody
protected int size
Constructor Detail |
---|
protected AbstractDataType(java.lang.String identifier, AbstractTagFrameBody frameBody)
identifier
- to allow retrieval of this datatype by name from framebodyframeBody
- that the dataype is associated withprotected AbstractDataType(java.lang.String identifier, AbstractTagFrameBody frameBody, java.lang.Object value)
identifier
- to allow retrieval of this datatype by name from framebodyframeBody
- that the dataype is associated withvalue
- of this DataTypepublic AbstractDataType(AbstractDataType copyObject)
copyObject
- Method Detail |
---|
public void setBody(AbstractTagFrameBody frameBody)
frameBody
- public AbstractTagFrameBody getBody()
public java.lang.String getIdentifier()
public void setValue(java.lang.Object value)
value
- public java.lang.Object getValue()
public final void readByteArray(byte[] arr) throws InvalidDataTypeException
arr
-
InvalidDataTypeException
public abstract int getSize()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
-
public abstract void readByteArray(byte[] arr, int offset) throws InvalidDataTypeException
arr
- offset
-
InvalidDataTypeException
public abstract byte[] writeByteArray()
public void createStructure()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |