|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jaudiotagger.tag.id3.AbstractTagItem
org.jaudiotagger.tag.id3.AbstractTag
org.jaudiotagger.tag.id3.AbstractID3Tag
org.jaudiotagger.tag.id3.AbstractID3v1Tag
org.jaudiotagger.tag.id3.ID3v1Tag
public class ID3v1Tag
Represents an ID3v1 tag.
Field Summary |
---|
Fields inherited from class org.jaudiotagger.tag.id3.AbstractID3v1Tag |
---|
logger |
Constructor Summary | |
---|---|
ID3v1Tag()
Creates a new ID3v1 datatype. |
|
ID3v1Tag(AbstractTag mp3tag)
|
|
ID3v1Tag(ID3v1Tag copyObject)
|
|
ID3v1Tag(java.io.RandomAccessFile file)
Deprecated. use ID3v1Tag(RandomAccessFile,String) instead |
|
ID3v1Tag(java.io.RandomAccessFile file,
java.lang.String loggingFilename)
Creates a new ID3v1 datatype. |
Method Summary | |
---|---|
void |
add(TagField field)
Adds a tagfield to the structure. |
void |
addAlbum(java.lang.String album)
Add Album |
void |
addArtist(java.lang.String artist)
Add Artist |
void |
addComment(java.lang.String comment)
Add Comment |
void |
addGenre(java.lang.String genre)
Add Genre |
void |
addTitle(java.lang.String title)
Add Title |
void |
addTrack(java.lang.String track)
Adds a track to the tag. |
void |
addYear(java.lang.String year)
Add Year |
void |
createStructure()
Create strcutured representation of this item. |
TagField |
createTagField(TagFieldKey genericKey,
java.lang.String value)
Create Tag Field using generic key |
void |
deleteTagField(TagFieldKey genericKey)
Delete any instance of tag fields with this key |
boolean |
equals(java.lang.Object obj)
Determines whether another datatype is equal to this tag. |
java.util.List |
get(java.lang.String id)
Returns a list of TagField objects whose "id"
is the specified one. |
java.util.List<TagField> |
get(TagFieldKey genericKey)
Returns a list of TagField objects whose "id"
is the specified one. |
java.util.List |
getAlbum()
|
java.util.List |
getArtist()
|
java.util.List |
getComment()
|
java.lang.String |
getEncoding()
|
int |
getFieldCount()
Return the number of fields |
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 genericKey)
Retrieve the first value that exists for this key id |
java.lang.String |
getFirst(TagFieldKey genericKey)
Retrieve the first value that exists for this generic key |
java.lang.String |
getFirstAlbum()
Get Album |
java.lang.String |
getFirstArtist()
Get Artist |
java.lang.String |
getFirstComment()
Get Comment |
TagField |
getFirstField(java.lang.String id)
Retrieve the first tagfield that exists for this key |
java.lang.String |
getFirstGenre()
Get Genre |
java.lang.String |
getFirstTitle()
Get title |
java.lang.String |
getFirstTrack()
|
java.lang.String |
getFirstYear()
Get year |
java.util.List |
getGenre()
Get Genre field |
byte |
getMajorVersion()
Retrieve the Major Version |
byte |
getRelease()
Retrieve the Release |
byte |
getRevision()
Retrieve the Revision |
java.util.List |
getTitle()
Get title field |
java.util.List |
getTrack()
|
java.util.List |
getYear()
Get year field |
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. |
java.util.Iterator |
iterator()
|
void |
read(java.nio.ByteBuffer byteBuffer)
|
boolean |
seek(java.nio.ByteBuffer byteBuffer)
Does a tag of this version exist within the byteBuffer |
void |
set(TagField field)
|
void |
setAlbum(java.lang.String album)
Set Album |
void |
setArtist(java.lang.String artist)
Set Artist |
void |
setComment(java.lang.String comment)
Set Comment |
boolean |
setEncoding(java.lang.String encoding)
|
void |
setGenre(java.lang.String genreVal)
Sets the genreID, |
void |
setTitle(java.lang.String title)
Set Title |
void |
setTrack(java.lang.String track)
|
void |
setYear(java.lang.String year)
Set year |
void |
write(java.io.RandomAccessFile file)
Write this tag to the file, replacing any tag previously existing |
Methods inherited from class org.jaudiotagger.tag.id3.AbstractID3v1Tag |
---|
delete, getSize |
Methods inherited from class org.jaudiotagger.tag.id3.AbstractID3Tag |
---|
getIdentifier, toString |
Methods inherited from class org.jaudiotagger.tag.id3.AbstractTagItem |
---|
isSubsetOf |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.jaudiotagger.tag.Tag |
---|
toString |
Constructor Detail |
---|
public ID3v1Tag()
public ID3v1Tag(ID3v1Tag copyObject)
public ID3v1Tag(AbstractTag mp3tag)
public ID3v1Tag(java.io.RandomAccessFile file, java.lang.String loggingFilename) throws TagNotFoundException, java.io.IOException
file
- loggingFilename
-
TagNotFoundException
java.io.IOException
public ID3v1Tag(java.io.RandomAccessFile file) throws TagNotFoundException, java.io.IOException
ID3v1Tag(RandomAccessFile,String)
instead
file
-
TagNotFoundException
java.io.IOException
Method Detail |
---|
public byte getRelease()
getRelease
in class AbstractID3Tag
public byte getMajorVersion()
getMajorVersion
in class AbstractID3Tag
public byte getRevision()
getRevision
in class AbstractID3Tag
public void add(TagField field)
Tag
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.
public java.util.List get(java.lang.String id)
Tag
TagField
objects whose "id"
is the specified one.
get
in interface Tag
id
- The field id.
TagField
objects with the given "id".public int getFieldCount()
Tag
Fields with the same identifiers are counted seperately i.e two title fields would contribute two to the count
getFieldCount
in interface Tag
public void addAlbum(java.lang.String album)
Only one album can be added so if one already exists it will be replaced.
addAlbum
in interface Tag
album
- public void setAlbum(java.lang.String album)
setAlbum
in interface Tag
album
- public java.lang.String getFirstAlbum()
getFirstAlbum
in interface Tag
public java.util.List getAlbum()
getAlbum
in interface Tag
public void addArtist(java.lang.String artist)
Only one artist can be added so if one already exists it will be replaced.
addArtist
in interface Tag
artist
- public void setArtist(java.lang.String artist)
setArtist
in interface Tag
artist
- public java.lang.String getFirstArtist()
getFirstArtist
in interface Tag
public java.util.List getArtist()
getArtist
in interface Tag
public void addComment(java.lang.String comment)
Only one comment can be added so if one already exists it will be replaced.
addComment
in interface Tag
comment
- public void setComment(java.lang.String comment)
setComment
in interface Tag
comment
- public java.util.List getComment()
getComment
in interface Tag
public java.lang.String getFirstComment()
getFirstComment
in interface Tag
public void addGenre(java.lang.String genre)
Only one Genre can be added so if one already exists it will be replaced.
addGenre
in interface Tag
genre
- public void setGenre(java.lang.String genreVal)
ID3v1 only supports genres defined in a predefined list so if unable to find value in list set 255, which seems to be the value winamp uses for undefined.
setGenre
in interface Tag
genreVal
- public java.lang.String getFirstGenre()
getFirstGenre
in interface Tag
public java.util.List getGenre()
Only a single genre is available in ID3v1
getGenre
in interface Tag
public void addTitle(java.lang.String title)
Only one title can be added so if one already exists it will be replaced.
addTitle
in interface Tag
title
- public void setTitle(java.lang.String title)
setTitle
in interface Tag
title
- public java.lang.String getFirstTitle()
getFirstTitle
in interface Tag
public java.util.List getTitle()
Only a single title is available in ID3v1
getTitle
in interface Tag
public void addYear(java.lang.String year)
Only one year can be added so if one already exists it will be replaced.
addYear
in interface Tag
year
- public void setYear(java.lang.String year)
setYear
in interface Tag
year
- public java.lang.String getFirstYear()
getFirstYear
in interface Tag
public java.util.List getYear()
Only a single year is available in ID3v1
getYear
in interface Tag
public void addTrack(java.lang.String track)
Tag
addTrack
in interface Tag
track
- Trackpublic java.lang.String getFirstTrack()
getFirstTrack
in interface Tag
public void setTrack(java.lang.String track)
setTrack
in interface Tag
public java.util.List getTrack()
getTrack
in interface Tag
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.Iterator getFields()
Tag
getFields
in interface Tag
public boolean hasCommonFields()
Tag
true
, if at least one of the contained
fields is a common field (TagField.isCommon()
).
hasCommonFields
in interface Tag
true
if a common
field is present.public boolean hasField(java.lang.String id)
Tag
hasField
in interface Tag
id
- The field id to look for.
true
if tag contains a TagField
with the
given id.public boolean isEmpty()
Tag
isEmpty
in interface Tag
true
if tag contains no field.public void set(TagField field)
set
in interface Tag
public boolean setEncoding(java.lang.String encoding)
setEncoding
in interface Tag
encoding
-
public TagField createTagField(TagFieldKey genericKey, java.lang.String value)
createTagField
in interface Tag
genericKey
- is the generic keyvalue
- to store
public java.lang.String getEncoding()
public java.util.List<TagField> get(TagFieldKey genericKey)
TagField
objects whose "id"
is the specified one.
get
in interface Tag
genericKey
- The generic field key
TagField
objects with the given "id".public java.lang.String getFirst(java.lang.String genericKey)
getFirst
in interface Tag
genericKey
-
public java.lang.String getFirst(TagFieldKey genericKey)
getFirst
in interface Tag
genericKey
-
public void deleteTagField(TagFieldKey genericKey)
deleteTagField
in interface Tag
genericKey
- public boolean equals(java.lang.Object obj)
AbstractTag
super.equals(obj)
.
equals
in class AbstractTag
obj
-
public java.util.Iterator iterator()
iterator
in class AbstractTag
public void read(java.nio.ByteBuffer byteBuffer) throws TagNotFoundException
read
in class AbstractTagItem
byteBuffer
-
TagNotFoundException
public boolean seek(java.nio.ByteBuffer byteBuffer)
seek
in class AbstractTag
public void write(java.io.RandomAccessFile file) throws java.io.IOException
write
in class AbstractTag
file
-
java.io.IOException
public void createStructure()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |