|
||||||||||
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. |
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. |
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. |
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 |
getAlbum()
(overridden) |
java.util.List |
getArtist()
Get Artist |
java.util.List |
getComment()
Get Comment |
int |
getFieldCount()
Return field count TODO:There must be a more efficient way to do this. |
java.util.Iterator |
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 |
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 |
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 |
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 |
getGenre()
Get the genres or empty list if none exist |
java.util.List |
getTitle()
Get the titles or empty list if none exist |
java.util.List |
getTrack()
Get the tracks or empty list if none exist |
java.util.List |
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 |
Constructor Detail |
---|
public AbstractTag()
Method Detail |
---|
public void add(TagField field)
add
in interface Tag
field
- The field to add.
Changed so add empty fields
public void addAlbum(java.lang.String s)
addAlbum
in interface Tag
s
- Album descriptionTag.addAlbum(java.lang.String)
public void addArtist(java.lang.String s)
addArtist
in interface Tag
s
- Artist's nameTag.addArtist(java.lang.String)
public void addComment(java.lang.String s)
addComment
in interface Tag
s
- Comment.Tag.addComment(java.lang.String)
public void addGenre(java.lang.String s)
addGenre
in interface Tag
s
- GenreTag.addGenre(java.lang.String)
public void addTitle(java.lang.String s)
addTitle
in interface Tag
s
- TitleTag.addTitle(java.lang.String)
public void addTrack(java.lang.String s) throws FieldDataInvalidException
addTrack
in interface Tag
s
- Track
FieldDataInvalidException
Tag.addTrack(java.lang.String)
public void addYear(java.lang.String s)
addYear
in interface Tag
s
- YearTag.addYear(java.lang.String)
public java.util.List<TagField> get(java.lang.String id)
get
in interface Tag
id
- The field id.
TagField
objects with the given "id".Tag.get(java.lang.String)
public java.util.List<TagField> get(TagFieldKey id) throws KeyNotFoundException
Tag
TagField
objects whose "id"
is the specified one.
get
in interface Tag
id
-
KeyNotFoundException
public java.lang.String getFirst(java.lang.String id)
Tag
getFirst
in interface Tag
id
-
public TagField getFirstField(java.lang.String id)
Tag
Can be used to retrieve fields with any identifier, useful if the identifier is not within the jaudiotagger enum
getFirstField
in interface Tag
id
- audio specific key
public java.util.List getAlbum()
getAlbum
in interface Tag
Tag.getAlbum()
public java.util.List getArtist()
getArtist
in interface Tag
Tag.getArtist()
public java.util.List getComment()
getComment
in interface Tag
Tag.getComment()
public java.util.Iterator getFields()
Tag
getFields
in interface Tag
Tag.getFields()
public int getFieldCount()
getFieldCount
in interface Tag
public java.lang.String getFirstAlbum()
getFirstAlbum
in interface Tag
Tag.getFirstAlbum()
public java.lang.String getFirstArtist()
getFirstArtist
in interface Tag
Tag.getFirstArtist()
public java.lang.String getFirstComment()
getFirstComment
in interface Tag
Tag.getFirstComment()
public java.lang.String getFirstGenre()
getFirstGenre
in interface Tag
Tag.getFirstGenre()
public java.lang.String getFirstTitle()
getFirstTitle
in interface Tag
Tag.getFirstTitle()
public java.lang.String getFirstTrack()
getFirstTrack
in interface Tag
Tag.getFirstTrack()
public java.lang.String getFirstYear()
getFirstYear
in interface Tag
Tag.getFirstYear()
public java.util.List getGenre()
getGenre
in interface Tag
Tag.getGenre()
public java.util.List getTitle()
getTitle
in interface Tag
Tag.getTitle()
public java.util.List getTrack()
getTrack
in interface Tag
Tag.getTrack()
public java.util.List getYear()
getYear
in interface Tag
Tag.getYear()
public boolean hasCommonFields()
hasCommonFields
in interface Tag
true
if a common
field is present.Tag.hasCommonFields()
public boolean hasField(java.lang.String id)
hasField
in interface Tag
id
- 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 Tag
true
if tag contains no field.Tag.isEmpty()
public void set(TagField field)
set
in interface Tag
Tag.set(org.jaudiotagger.tag.TagField)
public void setAlbum(java.lang.String s)
setAlbum
in interface Tag
Tag.setAlbum(java.lang.String)
public void setArtist(java.lang.String s)
setArtist
in interface Tag
Tag.setArtist(java.lang.String)
public void setComment(java.lang.String s)
setComment
in interface Tag
Tag.setComment(java.lang.String)
public boolean setEncoding(java.lang.String enc)
setEncoding
in interface Tag
Tag.setEncoding(java.lang.String)
public void setGenre(java.lang.String s)
setGenre
in interface Tag
Tag.setGenre(java.lang.String)
public void setTitle(java.lang.String s)
setTitle
in interface Tag
Tag.setTitle(java.lang.String)
public void setTrack(java.lang.String s) throws FieldDataInvalidException
setTrack
in interface Tag
FieldDataInvalidException
Tag.setTrack(java.lang.String)
public void setYear(java.lang.String s)
setYear
in interface Tag
Tag.setYear(java.lang.String)
public java.lang.String toString()
toString
in interface Tag
toString
in class java.lang.Object
Object.toString()
public TagField createTagField(TagFieldKey genericKey, java.lang.String value) throws KeyNotFoundException, FieldDataInvalidException
Tag
Only textual data supported at the moment. The genericKey will be mapped to the correct implementation key and return a TagField.
createTagField
in interface Tag
genericKey
- is the generic keyvalue
- to store
KeyNotFoundException
FieldDataInvalidException
public java.lang.String getFirst(TagFieldKey genericKey) throws KeyNotFoundException
Tag
getFirst
in interface Tag
KeyNotFoundException
public void deleteTagField(TagFieldKey tagFieldKey) throws KeyNotFoundException
Tag
deleteTagField
in interface Tag
KeyNotFoundException
public 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.
FieldDataInvalidException
public abstract TagField createYearField(java.lang.String content)
content
- The content of the created field.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |