|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jaudiotagger.tag.id3.ID3v1TagField
public class ID3v1TagField
This class encapsulates the name and content of a tag entry in id3 fields
| Field Summary | |
|---|---|
private boolean |
common
If true, the id of the current encapsulated tag field is
specified as a common field. |
private java.lang.String |
content
Stores the content of the tag field. |
private java.lang.String |
id
Stores the id (name) of the tag field. |
| Constructor Summary | |
|---|---|
ID3v1TagField(byte[] raw)
Creates an instance. |
|
ID3v1TagField(java.lang.String fieldId,
java.lang.String fieldContent)
Creates an instance. |
|
| Method Summary | |
|---|---|
private void |
checkCommon()
This method examines the ID of the current field and modifies commonin order to reflect if the tag id is a commonly used one. |
protected void |
copy(byte[] src,
byte[] dst,
int dstOffset)
This method will copy all bytes of src to dst
at the specified location. |
void |
copyContent(TagField field)
This method copies the data of the given field to the current data. |
java.lang.String |
getContent()
Returns the content of the field. |
java.lang.String |
getEncoding()
Returns the current used charset encoding. |
java.lang.String |
getId()
Returns the Id of the represented tag field. This value should uniquely identify a kind of tag data, like title. |
byte[] |
getRawContent()
This method delivers the binary representation of the fields data in order to be directly written to the file. |
boolean |
isBinary()
Determines whether the represented field contains (is made up of) binary data, instead of text data. Software can identify fields to be displayed because they are human readable if this method returns false. |
void |
isBinary(boolean b)
This method will set the field to represent binary data. Some implementations may support conversions. As of now (Octobre 2005) there is no implementation really using this method to perform useful operations. |
boolean |
isCommon()
Identifies a field to be of common use. Some software may differ between common and not common fields. |
boolean |
isEmpty()
Determines whether the content of the field is empty. |
void |
setContent(java.lang.String s)
Sets the content of the field. |
void |
setEncoding(java.lang.String s)
Sets the charset encoding used by the field. |
java.lang.String |
toString()
This method returns a human readable description of the fields contents. For text fields it should be the text itself. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private boolean common
true, the id of the current encapsulated tag field is
specified as a common field. checkCommon().
private java.lang.String content
private java.lang.String id
| Constructor Detail |
|---|
public ID3v1TagField(byte[] raw)
throws java.io.UnsupportedEncodingException
raw - Raw byte data of the tagfield.
java.io.UnsupportedEncodingException - If the data doesn't conform "UTF-8" specification.
public ID3v1TagField(java.lang.String fieldId,
java.lang.String fieldContent)
fieldId - ID (name) of the field.fieldContent - Content of the field.| Method Detail |
|---|
private void checkCommon()
commonin order to reflect if the tag id is a commonly used one.
protected void copy(byte[] src,
byte[] dst,
int dstOffset)
src to dst
at the specified location.
src - bytes to copy.dst - where to copy to.dstOffset - at which position of dst the data should be
copied.public void copyContent(TagField field)
TagField
copyContent in interface TagFieldfield - The field containing the data to be taken.TagField.copyContent(TagField)public java.lang.String getContent()
TagTextField
getContent in interface TagTextFieldTagTextField.getContent()public java.lang.String getEncoding()
TagTextField
getEncoding in interface TagTextFieldTagTextField.getEncoding()public java.lang.String getId()
TagFieldAbstractTag will use the "id" to summarize multiple
fields.
getId in interface TagFieldTagField.getId()
public byte[] getRawContent()
throws java.io.UnsupportedEncodingException
TagField
getRawContent in interface TagFieldjava.io.UnsupportedEncodingException - Most tag data represents text. In some cases the underlying
implementation will need to convert the text data in java to
a specific charset encoding. In these cases an
UnsupportedEncodingException may occur.TagField.getRawContent()public boolean isBinary()
TagFieldfalse.
isBinary in interface TagFieldtrue if field represents binary data (not human
readable).TagField.isBinary()public void isBinary(boolean b)
TagField
isBinary in interface TagFieldb - true, if the field contains binary data.
//@deprecated As for now is of no use. Implementations should use another
// way of setting this property.TagField.isBinary(boolean)public boolean isCommon()
TagField
isCommon in interface TagFieldtrue if the field is of common use.TagField.isCommon()public boolean isEmpty()
TagField
isEmpty in interface TagFieldtrue if no data is stored (or empty String).TagField.isEmpty()public void setContent(java.lang.String s)
TagTextField
setContent in interface TagTextFields - fields content.TagTextField.setContent(String)public void setEncoding(java.lang.String s)
TagTextField
setEncoding in interface TagTextFields - charset.TagTextField.setEncoding(String)public java.lang.String toString()
TagField
toString in interface TagFieldtoString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||