public abstract class AbstractDataType extends Object
Modifier and Type | Field and Description |
---|---|
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 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 Logger |
logger |
protected int |
size
Holds the size of the data in file when read/written
|
protected static String |
TYPE_ELEMENT |
protected Object |
value
Holds the data
|
Modifier | Constructor and Description |
---|---|
|
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(String identifier,
AbstractTagFrameBody frameBody)
Construct an abstract datatype identified by identifier and linked to a framebody without setting
an initial value.
|
protected |
AbstractDataType(String identifier,
AbstractTagFrameBody frameBody,
Object value)
Construct an abstract datatype identified by identifier and linked to a framebody initilised with a value
|
Modifier and Type | Method and Description |
---|---|
void |
createStructure()
Return String Representation of Datatype *
|
boolean |
equals(Object obj) |
AbstractTagFrameBody |
getBody()
Get the framebody associated with this datatype
|
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.
|
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(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.
|
protected static final String TYPE_ELEMENT
public static Logger logger
protected Object value
protected String identifier
protected AbstractTagFrameBody frameBody
protected int size
protected AbstractDataType(String identifier, AbstractTagFrameBody frameBody)
identifier
- to allow retrieval of this datatype by name from framebodyframeBody
- that the dataype is associated withprotected AbstractDataType(String identifier, AbstractTagFrameBody frameBody, 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
- public void setBody(AbstractTagFrameBody frameBody)
frameBody
- public AbstractTagFrameBody getBody()
public String getIdentifier()
public void setValue(Object value)
value
- public Object getValue()
public final void readByteArray(byte[] arr) throws InvalidDataTypeException
arr
- InvalidDataTypeException
public abstract int getSize()
public boolean equals(Object obj)
public abstract void readByteArray(byte[] arr, int offset) throws InvalidDataTypeException
arr
- offset
- InvalidDataTypeException
public abstract byte[] writeByteArray()
public void createStructure()
Copyright © 2005–2020 jthink.net. All rights reserved.