|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jaudiotagger.audio.generic.AbstractTag
public abstract class AbstractTag
This class is the default implementation for
Tag and introduces some more useful
functionality to be implemented.
| Constructor Summary | |
|---|---|
AbstractTag()
|
|
| Method Summary | |
|---|---|
void |
add(TagField field)
Add field |
void |
addAlbum(java.lang.String s)
Add (another) album |
void |
addArtist(java.lang.String s)
Add (another) artist |
void |
addComment(java.lang.String s)
Add (another) comment |
void |
addGenre(java.lang.String s)
Add (another) genre |
void |
addTitle(java.lang.String s)
Add (another) title |
void |
addTrack(java.lang.String s)
Add (another) track |
void |
addYear(java.lang.String s)
(Add (another) year |
abstract TagField |
createAlbumField(java.lang.String content)
Creates a field which represents the "album". The field will already contain the given content. |
void |
createAndSetArtworkField(Artwork artwork)
Create field and then set within tag itself |
abstract TagField |
createArtistField(java.lang.String content)
Creates a field which represents the "artist". The field will already contain the given content. |
abstract TagField |
createCommentField(java.lang.String content)
Creates a field which represents the "comment". The field will already contain the given content. |
abstract TagField |
createGenreField(java.lang.String content)
Creates a field which represents the "genre". The field will already contain the given content. |
abstract TagField |
createTagField(TagFieldKey genericKey,
java.lang.String value)
Create a new TagField based on generic key |
abstract TagField |
createTitleField(java.lang.String content)
Creates a field which represents the "title". The field will already contain the given content. |
abstract TagField |
createTrackField(java.lang.String content)
Creates a field which represents the "track". The field will already contain the given content. |
abstract TagField |
createYearField(java.lang.String content)
Creates a field which represents the "year". The field will already contain the given content. |
abstract void |
deleteTagField(TagFieldKey tagFieldKey)
Delete any instance of tag fields with this key |
java.util.List<TagField> |
get(java.lang.String id)
Get list of fields within this tag with the specified id |
java.util.List<TagField> |
get(TagFieldKey id)
Returns a list of TagField objects whose "id"
is the specified one. |
java.util.List<TagField> |
getAlbum()
(overridden) |
java.util.List<TagField> |
getArtist()
Get Artist |
java.util.List<TagField> |
getComment()
Get Comment |
int |
getFieldCount()
Return field count TODO:There must be a more efficient way to do this. |
java.util.Iterator<TagField> |
getFields()
Iterator over all the fields within the tag, handle multiple fields with the same id |
java.lang.String |
getFirst(java.lang.String id)
Retrieve the first value that exists for this key |
abstract java.lang.String |
getFirst(TagFieldKey genericKey)
Retrieve String value of first tagfield that exists for this key |
java.lang.String |
getFirstAlbum()
Get the first album or empty string if doesnt exist |
java.lang.String |
getFirstArtist()
Get the first artist or empty string if doesnt exist |
Artwork |
getFirstArtwork()
|
java.lang.String |
getFirstComment()
Get the first comment or empty string if doesnt exist |
TagField |
getFirstField(java.lang.String id)
Retrieve the first tagfield that exists for this key |
abstract TagField |
getFirstField(TagFieldKey genericKey)
|
java.lang.String |
getFirstGenre()
Get the first genre or empty string if doesnt exist |
java.lang.String |
getFirstTitle()
Get the first title or empty string if doesnt exist |
java.lang.String |
getFirstTrack()
Get the first track or empty string if doesnt exist |
java.lang.String |
getFirstYear()
Get the first year or empty string if doesnt exist |
java.util.List<TagField> |
getGenre()
Get the genres or empty list if none exist |
java.util.List<TagField> |
getTitle()
Get the titles or empty list if none exist |
java.util.List<TagField> |
getTrack()
Get the tracks or empty list if none exist |
java.util.List<TagField> |
getYear()
Get the years or empty list if none exist |
boolean |
hasCommonFields()
Does this tag contain any comon fields |
boolean |
hasField(java.lang.String id)
Does this tag contain a field with the specified id |
boolean |
isEmpty()
Is this tag empty |
void |
set(TagField field)
Set field Changed:Just because field is empty it doesnt mean it should be deleted. |
void |
setAlbum(java.lang.String s)
Set or add album |
void |
setArtist(java.lang.String s)
Set or add artist |
void |
setComment(java.lang.String s)
Set or add comment |
boolean |
setEncoding(java.lang.String enc)
Set or add encoding |
void |
setGenre(java.lang.String s)
Set or add genre |
void |
setTitle(java.lang.String s)
Set or add title |
void |
setTrack(java.lang.String s)
Set or add track |
void |
setYear(java.lang.String s)
Set or add year |
java.lang.String |
toString()
(overridden) |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.jaudiotagger.tag.Tag |
|---|
createArtworkField, getArtworkList |
| Constructor Detail |
|---|
public AbstractTag()
| Method Detail |
|---|
public void add(TagField field)
add in interface Tagfield - The field to add.
Changed so add empty fieldspublic void addAlbum(java.lang.String s)
addAlbum in interface Tags - Album descriptionTag.addAlbum(java.lang.String)public void addArtist(java.lang.String s)
addArtist in interface Tags - Artist's nameTag.addArtist(java.lang.String)public void addComment(java.lang.String s)
addComment in interface Tags - Comment.Tag.addComment(java.lang.String)public void addGenre(java.lang.String s)
addGenre in interface Tags - GenreTag.addGenre(java.lang.String)public void addTitle(java.lang.String s)
addTitle in interface Tags - TitleTag.addTitle(java.lang.String)
public void addTrack(java.lang.String s)
throws FieldDataInvalidException
addTrack in interface Tags - Track
FieldDataInvalidExceptionTag.addTrack(java.lang.String)public void addYear(java.lang.String s)
addYear in interface Tags - YearTag.addYear(java.lang.String)public java.util.List<TagField> get(java.lang.String id)
get in interface Tagid - The field id.
TagField objects with the given "id".Tag.get(java.lang.String)
public java.util.List<TagField> get(TagFieldKey id)
throws KeyNotFoundException
TagTagField objects whose "id"
is the specified one.
get in interface Tagid -
KeyNotFoundExceptionpublic java.lang.String getFirst(java.lang.String id)
Tag
getFirst in interface Tagid -
public TagField getFirstField(java.lang.String id)
TagCan be used to retrieve fields with any identifier, useful if the identifier is not within the jaudiotagger enum
getFirstField in interface Tagid - audio specific key
public java.util.List<TagField> getAlbum()
getAlbum in interface TagTag.getAlbum()public java.util.List<TagField> getArtist()
getArtist in interface TagTag.getArtist()public java.util.List<TagField> getComment()
getComment in interface TagTag.getComment()public java.util.Iterator<TagField> getFields()
Tag
getFields in interface TagTag.getFields()public int getFieldCount()
getFieldCount in interface Tagpublic java.lang.String getFirstAlbum()
getFirstAlbum in interface TagTag.getFirstAlbum()public java.lang.String getFirstArtist()
getFirstArtist in interface TagTag.getFirstArtist()public java.lang.String getFirstComment()
getFirstComment in interface TagTag.getFirstComment()public java.lang.String getFirstGenre()
getFirstGenre in interface TagTag.getFirstGenre()public java.lang.String getFirstTitle()
getFirstTitle in interface TagTag.getFirstTitle()public java.lang.String getFirstTrack()
getFirstTrack in interface TagTag.getFirstTrack()public java.lang.String getFirstYear()
getFirstYear in interface TagTag.getFirstYear()public java.util.List<TagField> getGenre()
getGenre in interface TagTag.getGenre()public java.util.List<TagField> getTitle()
getTitle in interface TagTag.getTitle()public java.util.List<TagField> getTrack()
getTrack in interface TagTag.getTrack()public java.util.List<TagField> getYear()
getYear in interface TagTag.getYear()public boolean hasCommonFields()
hasCommonFields in interface Tagtrue if a common
field is present.Tag.hasCommonFields()public boolean hasField(java.lang.String id)
hasField in interface Tagid - The field id to look for.
true if tag contains a TagField with the
given id.Tag.hasField(java.lang.String)public boolean isEmpty()
isEmpty in interface Tagtrue if tag contains no field.Tag.isEmpty()public void set(TagField field)
set in interface TagTag.set(org.jaudiotagger.tag.TagField)public void setAlbum(java.lang.String s)
setAlbum in interface TagTag.setAlbum(java.lang.String)public void setArtist(java.lang.String s)
setArtist in interface TagTag.setArtist(java.lang.String)public void setComment(java.lang.String s)
setComment in interface TagTag.setComment(java.lang.String)public boolean setEncoding(java.lang.String enc)
setEncoding in interface TagTag.setEncoding(java.lang.String)public void setGenre(java.lang.String s)
setGenre in interface TagTag.setGenre(java.lang.String)public void setTitle(java.lang.String s)
setTitle in interface TagTag.setTitle(java.lang.String)
public void setTrack(java.lang.String s)
throws FieldDataInvalidException
setTrack in interface TagFieldDataInvalidExceptionTag.setTrack(java.lang.String)public void setYear(java.lang.String s)
setYear in interface TagTag.setYear(java.lang.String)public java.lang.String toString()
toString in interface TagtoString in class java.lang.ObjectObject.toString()
public abstract TagField createTagField(TagFieldKey genericKey,
java.lang.String value)
throws KeyNotFoundException,
FieldDataInvalidException
TagOnly textual data supported at the moment. The genericKey will be mapped to the correct implementation key and return a TagField.
createTagField in interface TaggenericKey - value -
KeyNotFoundException
FieldDataInvalidException
public abstract java.lang.String getFirst(TagFieldKey genericKey)
throws KeyNotFoundException
Tag
getFirst in interface TaggenericKey -
KeyNotFoundException
public abstract TagField getFirstField(TagFieldKey genericKey)
throws KeyNotFoundException
getFirstField in interface TaggenericKey -
KeyNotFoundException
public abstract void deleteTagField(TagFieldKey tagFieldKey)
throws KeyNotFoundException
Tag
deleteTagField in interface TagtagFieldKey -
KeyNotFoundExceptionpublic abstract TagField createAlbumField(java.lang.String content)
content - The content of the created field.
public abstract TagField createArtistField(java.lang.String content)
content - The content of the created field.
public abstract TagField createCommentField(java.lang.String content)
content - The content of the created field.
public abstract TagField createGenreField(java.lang.String content)
content - The content of the created field.
public abstract TagField createTitleField(java.lang.String content)
content - The content of the created field.
public abstract TagField createTrackField(java.lang.String content)
throws FieldDataInvalidException
content - The content of the created field.
FieldDataInvalidExceptionpublic abstract TagField createYearField(java.lang.String content)
content - The content of the created field.
public Artwork getFirstArtwork()
getFirstArtwork in interface Tag
public void createAndSetArtworkField(Artwork artwork)
throws FieldDataInvalidException
createAndSetArtworkField in interface Tagartwork -
FieldDataInvalidException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||