com.tffenterprises.music.tag
Interface ID3Tag

All Known Implementing Classes:
ID3v1, ID3v2, SmartID3v1

public interface ID3Tag

Tag is an abstract superclass for implementations of ID3 tags and similar types of tags for music files. Tag defines the basic interface for such implementations, providing facilities to obtain and set the title, artist, album, track number and genre information as well as a comment for a given Tag. Subclasses must also provide a way to output themselves as a string and as a byte array suitable for inclusion as the tag portion of a mpeg-audio file. Writing the tag into a file at its proper location is not the responsibility of an Tag subclass; it is the responsibility of its user. The class com.tffenterprises.music.io.TaggedFile is a compliant user for ID3v1 and ID3v2, implementors of the Tag interface. Those two classes define static utilities to help in retrieving tags from instances of RandomAccessFile.

Version:
1.0d1 $Date: 2002/10/11 00:57:29 $
Author:
Guillaume Lessard

Method Summary
 java.lang.String getAlbum()
          Return the name of the album or set on which thes track can be found
 java.lang.String getArtist()
          Return the name of the artist or performer featured on the track represented by this tag
 byte[] getBytes()
          Get a byte array equivalent to the tag's representation in a file.
 java.lang.String getComment()
          Return a comment attached to the track.
 byte getGenre()
          Return a byte representing the genre of the track.
 java.lang.String getTitle()
          Return the title of the crack represented by this tag.
 byte getTrackNumber()
          Return the track's position out of its set, as an integer.
 short getYear()
          Return the year during which the track was recorded or released.
 boolean isChanged()
          Returns whether or not the tag has been changed.
 void setAlbum(java.lang.String album)
          Set the title of the album or set of which the track is extracted.
 void setArtist(java.lang.String artist)
          Set the name of the artist or performer featured on the track
 void setChanged(boolean changed)
          Sets or clears the "changed" bit.
 void setComment(java.lang.String comment)
          Attach a comment relevant to the track.
 void setGenre(byte genre)
          Set the byte representing the genre of the track.
 void setTitle(java.lang.String title)
          Set the title of the track represented by this tag.
 void setTrackNumber(byte track)
          Set the position of the track within its set.
 void setYear(short year)
          Set the year during which the track was recorded or released.
 java.lang.String toString()
          Get a String representation of the tag.
 

Method Detail

getTitle

java.lang.String getTitle()
Return the title of the crack represented by this tag.

Returns:
the title of the track represented by this tag.

getArtist

java.lang.String getArtist()
Return the name of the artist or performer featured on the track represented by this tag

Returns:
the name of the artist or performer featured on the track represented by this tag

getAlbum

java.lang.String getAlbum()
Return the name of the album or set on which thes track can be found

Returns:
the name of the album or set on which thes track can be found

getComment

java.lang.String getComment()
Return a comment attached to the track.

Returns:
a comment attached to the track.

getTrackNumber

byte getTrackNumber()
Return the track's position out of its set, as an integer. If there is no such information, return -1.

Returns:
the track's position out of its set, as an integer. If there is no such information, return -1.

getGenre

byte getGenre()
Return a byte representing the genre of the track. If there is no such information, return -1.

Returns:
a byte representing the genre of the track. If there is no such information, return -1.

getYear

short getYear()
Return the year during which the track was recorded or released. If there is no such information, return -1.

Returns:
the year during which the track was recorded or released. If there is no such information, return -1.

setTitle

void setTitle(java.lang.String title)
Set the title of the track represented by this tag.

Parameters:
title - the title of the track represented by this tag.

setArtist

void setArtist(java.lang.String artist)
Set the name of the artist or performer featured on the track

Parameters:
artist - the name of the artist or performer featured on the track.

setAlbum

void setAlbum(java.lang.String album)
Set the title of the album or set of which the track is extracted.

Parameters:
album - the title of the album or set of which the track is extracted.

setComment

void setComment(java.lang.String comment)
Attach a comment relevant to the track.

Parameters:
comment - a comment relevant to the track.

setTrackNumber

void setTrackNumber(byte track)
Set the position of the track within its set.

Parameters:
track - the position of the track within its set.

setGenre

void setGenre(byte genre)
Set the byte representing the genre of the track.

Parameters:
genre - the byte representing the genre of the track.

setYear

void setYear(short year)
Set the year during which the track was recorded or released.

Parameters:
year - during which the track was recorded or released.

isChanged

boolean isChanged()
Returns whether or not the tag has been changed.

Returns:
whether or not the tag has been changed.

setChanged

void setChanged(boolean changed)
Sets or clears the "changed" bit.

Parameters:
changed - true to set the changed bit, false to unset it.

toString

java.lang.String toString()
Get a String representation of the tag.

Overrides:
toString in class java.lang.Object
Returns:
a String representation of the tag.

getBytes

byte[] getBytes()
Get a byte array equivalent to the tag's representation in a file.

Returns:
a byte array equivalent to the tag's representation in a file.