|
|||||||||
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
audio library 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 This is handled differently by different formats |
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 |
void |
deleteField(java.lang.String key)
Delete any fields with this Flac (Vorbis Comment) id |
java.util.List<Artwork> |
getArtworkList()
|
int |
getFieldCount()
Return the number of fields |
int |
getFieldCountIncludingSubValues()
Return the number of fields taking multiple value fields into consideration Fields that actually contain multiple values are counted seperately i.e. |
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.util.List<TagField> |
getFields(java.lang.String 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 tag field 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 |
java.lang.String |
getSubValue(FieldKey id,
int n,
int m)
Retrieve String value of the mth field within the nth tag field that exists for this id |
java.lang.String |
getValue(FieldKey id,
int n)
Retrieve String value of the nth tag field that exists for this generic 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
void deleteField(java.lang.String key) throws KeyNotFoundException
key
-
KeyNotFoundException
java.util.List<TagField> getFields(java.lang.String id)
TagField
objects whose "id"
is the specified one.Can be used to retrieve fields with any identifier, useful if the identifier is not within FieldKey
id
- The field id.
TagField
objects with the given "id".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()
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
java.lang.String getValue(FieldKey id, int n)
id
- n
-
java.lang.String getSubValue(FieldKey id, int n, int m)
This method id useful for formats that hold multiple values within one field, namely ID3v2 can hold multiple values within one Text Frame. the #getValue() method will return all values within the frame but this method lets you retrieve just the individual values.
id
- n
-
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
int getFieldCount()
Fields with the same identifiers are counted separately i.e two TITLE fields in a Vorbis Comment file would count as two
int getFieldCountIncludingSubValues()
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
field
- The field to add.
FieldDataInvalidException
void addField(TagField field) throws FieldDataInvalidException
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.
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 |