|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object entagged.audioformats.asf.data.ContentDescriptor
public final class ContentDescriptor
This class is a wrapper for properties within a
ExtendedContentDescription
.
Field Summary | |
---|---|
static HashSet |
COMMON_FIELD_IDS
This field stores all values of the "ID_"-constants. |
protected byte[] |
content
The binary representation of the value. |
static String |
ID_ALBUM
This constant gives the common id (name) for the "album" field in an asf extended content description. |
static String |
ID_ARTIST
This constant gives the common id (name) for the "artist" field in an asf extended content description. |
static String |
ID_GENRE
This constant gives the common id (name) for the "genre" field in an asf extended content description. |
static String |
ID_GENREID
This constant gives the common id (name) for the "genre Id" field in an asf extended content description. |
static String |
ID_TRACKNUMBER
This constant gives the common id (name) for the "track number" field in an asf extended content description. |
static String |
ID_YEAR
This constant gives the common id (name) for the "year" field in an asf extended content description. |
static int |
TYPE_BINARY
Constant for the content descriptor-type for binary data. |
static int |
TYPE_BOOLEAN
Constant for the content descriptor-type for booleans. |
static int |
TYPE_DWORD
Constant for the content descriptor-type for integers (32-bit). |
static int |
TYPE_QWORD
Constant for the content descriptor-type for integers (64-bit). |
static int |
TYPE_STRING
Constant for the content descriptor-type for Strings. |
static int |
TYPE_WORD
Constant for the content descriptor-type for integers (16-bit). |
Constructor Summary | |
---|---|
ContentDescriptor(String propName,
int propType)
Creates an Instance. |
Method Summary | |
---|---|
Object |
clone()
(overridden) |
int |
compareTo(Object o)
(overridden) |
ContentDescriptor |
createCopy()
This mehtod creates a copy of the current object. |
boolean |
equals(Object obj)
(overridden) |
boolean |
getBoolean()
Returns the value of the ContentDescriptor as a Boolean. |
byte[] |
getBytes()
This method will return a byte array, which can directly be written into an "Extended Content Description"-chunk. |
String |
getName()
This method returns the name of the content descriptor. |
long |
getNumber()
This method returns the value of the content descriptor as an integer. |
byte[] |
getRawData()
This method returns a copy of the content of the descriptor. |
String |
getString()
Returns the value of the ContentDescriptor as a String. |
int |
getType()
Returns the type of the content descriptor. |
boolean |
isCommon()
This method checks whether the name of the current field is one of the commonly specified fields. |
boolean |
isEmpty()
This method checks if the binary data is empty. |
void |
setBinaryValue(byte[] data)
Sets the Value of the current content descriptor. |
void |
setBooleanValue(boolean value)
Sets the Value of the current content descriptor. |
void |
setDWordValue(long value)
Sets the Value of the current content descriptor. |
void |
setQWordValue(long value)
Sets the Value of the current content descriptor. |
void |
setStringValue(String value)
Sets the Value of the current content descriptor. |
void |
setWordValue(int value)
Sets the Value of the current content descriptor. |
String |
toString()
(overridden) |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final HashSet COMMON_FIELD_IDS
public static final String ID_ALBUM
public static final String ID_ARTIST
public static final String ID_GENRE
public static final String ID_GENREID
public static final String ID_TRACKNUMBER
public static final String ID_YEAR
public static final int TYPE_BINARY
public static final int TYPE_BOOLEAN
public static final int TYPE_DWORD
public static final int TYPE_QWORD
public static final int TYPE_STRING
public static final int TYPE_WORD
protected byte[] content
Constructor Detail |
---|
public ContentDescriptor(String propName, int propType)
propName
- Name of the ContentDescriptor.propType
- Type of the content descriptor. See descriptorType
Method Detail |
---|
public Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
Object.clone()
public int compareTo(Object o)
compareTo
in interface Comparable
Comparable.compareTo(java.lang.Object)
public ContentDescriptor createCopy()
public boolean equals(Object obj)
equals
in class Object
Object.equals(java.lang.Object)
public boolean getBoolean()
true
if first byte of content
is not zero.
public byte[] getBytes()
public String getName()
public long getNumber()
content
to a number.
getType()
equals on of the following:
public byte[] getRawData()
public String getString()
public int getType()
descriptorType
TYPE_BINARY
,
TYPE_BOOLEAN
,
TYPE_DWORD
,
TYPE_QWORD
,
TYPE_STRING
,
TYPE_WORD
public boolean isCommon()
true
if a common field.ID_ALBUM
,
ID_GENRE
,
ID_GENREID
,
ID_TRACKNUMBER
,
ID_YEAR
public boolean isEmpty()
true
if no value is set.public void setBinaryValue(byte[] data) throws IllegalArgumentException
descriptorType
to
TYPE_BINARY
.
data
- Value to set.
IllegalArgumentException
- If the byte array is greater that 65535 bytes.public void setBooleanValue(boolean value)
descriptorType
to
TYPE_BOOLEAN
.
value
- Value to set.public void setDWordValue(long value)
descriptorType
to
TYPE_DWORD
.
value
- Value to set.public void setQWordValue(long value)
descriptorType
to
TYPE_QWORD
value
- Value to set.public void setStringValue(String value) throws IllegalArgumentException
descriptorType
to
TYPE_STRING
.
value
- Value to set.
IllegalArgumentException
- If byte representation would take more than 65535 Bytes.public void setWordValue(int value)
descriptorType
to
TYPE_WORD
value
- Value to set.public String toString()
toString
in class Object
Object.toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |