|
||||||||||
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.
Some audio file tagging systems allow to specify multiple values for one type
of information. The artist for example. Some songs may be a cooperation of
two or more artists. Sometimes a tagging user wants to specify them in the
tag without making one long text string.
For that kind of fields, the commonly used fields have adequate
methods for adding values. But it is possible the underlying implementation
does not support that kind of storing multiple values.
Code Examples:
AudioFile file = AudioFileIO.read(new File("C:\\test.mp3"));
Tag tag = file.getTag();
Field Summary | |
---|---|
static String[] |
DEFAULT_GENRES
This final field contains all the tags that id3v1 supports. |
Method Summary | |
---|---|
void |
add(TagField field)
Adds a tagfield to the structure. It is not recommended to use this method for normal use of the audiolibrary. |
void |
addAlbum(String album)
Adds an album to the tag. |
void |
addArtist(String artist)
Adds an artist to the tag. |
void |
addComment(String comment)
Adds a comment to the tag. |
void |
addGenre(String genre)
Adds a genre to the tag. |
void |
addTitle(String title)
Adds a title to the tag. |
void |
addTrack(String track)
Adds a track to the tag. |
void |
addYear(String year)
Adds a year to the Tag. |
List |
get(String id)
Returns a list of TagField objects whose "id"
is the specified one. |
List |
getAlbum()
|
List |
getArtist()
|
List |
getComment()
|
Iterator |
getFields()
|
String |
getFirstAlbum()
|
String |
getFirstArtist()
|
String |
getFirstComment()
|
String |
getFirstGenre()
|
String |
getFirstTitle()
|
String |
getFirstTrack()
|
String |
getFirstYear()
|
List |
getGenre()
|
List |
getTitle()
|
List |
getTrack()
|
List |
getYear()
|
boolean |
hasCommonFields()
Returns true , if at least one of the contained
fields is a common field (TagField.isCommon() ). |
boolean |
hasField(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. |
void |
merge(Tag tag)
|
void |
set(TagField field)
|
void |
setAlbum(String s)
|
void |
setArtist(String s)
|
void |
setComment(String s)
|
boolean |
setEncoding(String enc)
|
void |
setGenre(String s)
|
void |
setTitle(String s)
|
void |
setTrack(String s)
|
void |
setYear(String s)
|
String |
toString()
|
Field Detail |
---|
static final String[] DEFAULT_GENRES
Method Detail |
---|
void add(TagField field)
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.
field
- The field to add.void addAlbum(String album)
album
- Album descriptionvoid addArtist(String artist)
artist
- Artist's namevoid addComment(String comment)
comment
- Comment.void addGenre(String genre)
genre
- Genrevoid addTitle(String title)
title
- Titlevoid addTrack(String track)
track
- Trackvoid addYear(String year)
year
- YearList get(String id)
TagField
objects whose "id"
is the specified one.
id
- The field id.
TagField
objects with the given "id".List getAlbum()
List getArtist()
List getComment()
Iterator getFields()
String getFirstAlbum()
String getFirstArtist()
String getFirstComment()
String getFirstGenre()
String getFirstTitle()
String getFirstTrack()
String getFirstYear()
List getGenre()
List getTitle()
List getTrack()
List getYear()
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(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.void merge(Tag tag)
void set(TagField field)
void setAlbum(String s)
void setArtist(String s)
void setComment(String s)
boolean setEncoding(String enc)
void setGenre(String s)
void setTitle(String s)
void setTrack(String s)
void setYear(String s)
String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |