|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Tag
This interface represents the basic data structure for the default
audiolibrary functionality.
AudioFile file = AudioFileIO.read(new File("C:\\test.mp3"));
Tag tag = file.getTag();
Method Summary | |
---|---|
void |
addField(Artwork artwork)
Create artwork field based on the data in artwork and then add it to the tag itself |
void |
addField(FieldKey genericKey,
java.lang.String value)
Create the field based on the generic key and add it to the tag |
void |
addField(TagField field)
Adds a field to the structure, used internally by the library |
TagField |
createField(Artwork artwork)
Create artwork field based on the data in artwork |
TagField |
createField(FieldKey genericKey,
java.lang.String value)
Create a new field based on generic key, used internally by the library |
void |
deleteArtworkField()
Delete any instance of tag fields used to store artwork |
void |
deleteField(FieldKey fieldKey)
Delete any fields with this key |
java.util.List<TagField> |
get(java.lang.String id)
Returns a list of TagField objects whose "id"
is the specified one. |
java.util.List<Artwork> |
getArtworkList()
|
int |
getFieldCount()
Return the number of fields |
java.util.Iterator<TagField> |
getFields()
Iterator over all the fields within the tag, handle multiple fields with the same id |
java.util.List<TagField> |
getFields(FieldKey id)
Returns a list of TagField objects whose "id"
is the specified one. |
java.lang.String |
getFirst(FieldKey id)
Retrieve String value of the first tagfield that exists for this generic key |
java.lang.String |
getFirst(java.lang.String id)
Retrieve String value of the first value that exists for this format specific key |
Artwork |
getFirstArtwork()
|
TagField |
getFirstField(FieldKey id)
|
TagField |
getFirstField(java.lang.String id)
Retrieve the first field that exists for this format specific key |
boolean |
hasCommonFields()
Returns true , if at least one of the contained
fields is a common field (TagField.isCommon() ). |
boolean |
hasField(java.lang.String id)
Determines whether the tag has at least one field with the specified "id". |
boolean |
isEmpty()
Determines whether the tag has no fields specified. |
boolean |
setEncoding(java.lang.String enc)
|
void |
setField(Artwork artwork)
Create artwork field based on the data in artwork and then set it in the tag itself |
void |
setField(FieldKey genericKey,
java.lang.String value)
Create the field based on the generic key and set it in the tag |
void |
setField(TagField field)
Sets a field in the structure, used internally by the library |
java.lang.String |
toString()
|
Method Detail |
---|
void setField(FieldKey genericKey, java.lang.String value) throws KeyNotFoundException, FieldDataInvalidException
genericKey
- value
-
KeyNotFoundException
FieldDataInvalidException
void addField(FieldKey genericKey, java.lang.String value) throws KeyNotFoundException, FieldDataInvalidException
genericKey
- value
-
KeyNotFoundException
FieldDataInvalidException
void deleteField(FieldKey fieldKey) throws KeyNotFoundException
fieldKey
-
KeyNotFoundException
java.util.List<TagField> get(java.lang.String id)
TagField
objects whose "id"
is the specified one.
id
- The field id.
TagField
objects with the given "id".java.lang.String getFirst(java.lang.String id)
Can be used to retrieve fields with any identifier, useful if the identifier is not within FieldKey
id
-
java.lang.String getFirst(FieldKey id) throws KeyNotFoundException
id
-
KeyNotFoundException
TagField getFirstField(java.lang.String id)
Can be used to retrieve fields with any identifier, useful if the identifier is not within FieldKey
id
- audio specific key
TagField getFirstField(FieldKey id)
id
-
boolean hasCommonFields()
true
, if at least one of the contained
fields is a common field (TagField.isCommon()
).
true
if a common
field is present.boolean hasField(java.lang.String id)
id
- The field id to look for.
true
if tag contains a TagField
with the
given id.boolean isEmpty()
true
if tag contains no field.java.lang.String toString()
toString
in class java.lang.Object
java.util.List<TagField> getFields(FieldKey id) throws KeyNotFoundException
TagField
objects whose "id"
is the specified one.
id
- The field id.
TagField
objects with the given "id".
KeyNotFoundException
java.util.Iterator<TagField> getFields()
int getFieldCount()
Fields with the same identifiers are counted seperately i.e two title fields would contribute two to the count
boolean setEncoding(java.lang.String enc) throws FieldDataInvalidException
FieldDataInvalidException
java.util.List<Artwork> getArtworkList()
Artwork getFirstArtwork()
void deleteArtworkField() throws KeyNotFoundException
We need this additional deleteField method because in some formats artwork can be stored in multiple fields
KeyNotFoundException
TagField createField(Artwork artwork) throws FieldDataInvalidException
artwork
-
FieldDataInvalidException
void setField(Artwork artwork) throws FieldDataInvalidException
artwork
-
FieldDataInvalidException
void addField(Artwork artwork) throws FieldDataInvalidException
artwork
-
FieldDataInvalidException
void setField(TagField field) throws FieldDataInvalidException
It is not recommended to use this method for normal use of the
audiolibrary. The developer will circumvent the underlying
implementation. For example, if one adds a field with the field id
"TALB" for an mp3 file, and the given
TagField
implementation does not return a text field compliant data with
TagField.getRawContent()
other software and the audio library
won't read the file correctly, if they do read it at all.
So for short:
field
- The field to add.
FieldDataInvalidException
void addField(TagField field) throws FieldDataInvalidException
It is not recommended to use this method for normal use of the
audiolibrary. The developer will circumvent the underlying
implementation. For example, if one adds a field with the field id
"TALB" for an mp3 file, and the given
TagField
implementation does not return a text field compliant data with
TagField.getRawContent()
other software and the audio library
won't read the file correctly, if they do read it at all.
So for short:
field
- The field to add.
FieldDataInvalidException
TagField createField(FieldKey genericKey, java.lang.String value) throws KeyNotFoundException, FieldDataInvalidException
Only textual data supported at the moment. The genericKey will be mapped to the correct implementation key and return a TagField.
It is not recommended to use this method for normal use of the audiolibrary, this is snot added to the structure
genericKey
- is the generic keyvalue
- to store
KeyNotFoundException
FieldDataInvalidException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |