org.blinkenlights.jid3.v1
Class ID3V1Tag

java.lang.Object
  extended byorg.blinkenlights.jid3.ID3Tag
      extended byorg.blinkenlights.jid3.v1.ID3V1Tag
All Implemented Interfaces:
ID3Visitable
Direct Known Subclasses:
ID3V1_0Tag, ID3V1_1Tag

public abstract class ID3V1Tag
extends ID3Tag


Nested Class Summary
static class ID3V1Tag.Genre
          A class representing the predefined genres.
 
Field Summary
protected  ID3V1Tag.Genre m_oGenre
           
protected  java.lang.String m_sAlbum
           
protected  java.lang.String m_sArtist
           
protected  java.lang.String m_sComment
           
protected  java.lang.String m_sTitle
           
protected  java.lang.String m_sYear
           
 
Constructor Summary
ID3V1Tag()
          Constructor.
 
Method Summary
 java.lang.String getAlbum()
          Get the name of the album from which the recording comes.
 java.lang.String getArtist()
          Get the artist of the recording.
 java.lang.String getComment()
          Get the comment.
 ID3V1Tag.Genre getGenre()
          Get the genre of the recording.
 java.lang.String getTitle()
          Get the title of the recording.
 java.lang.String getYear()
          Get the year in which the recording was made.
static ID3V1Tag read(java.io.InputStream oIS)
          Read an ID3 V1 tag from an input stream.
 void setAlbum(java.lang.String sAlbum)
          Set the name of the album from which the recording comes.
 void setArtist(java.lang.String sArtist)
          Set the artist for the recording.
abstract  void setComment(java.lang.String sComment)
          Set the comment field.
 void setGenre(ID3V1Tag.Genre oGenre)
          Set the genre of the recording, using one of the predefined genre values.
 void setTitle(java.lang.String sTitle)
          Set the title of the recording.
 void setYear(java.lang.String sYear)
          Set the year in which the recording was made.
 java.lang.String toString()
          Represent a tag as string for debugging purposes.
abstract  void write(java.io.OutputStream oOS)
          Write tag to output stream.
 
Methods inherited from class org.blinkenlights.jid3.ID3Tag
useStrict, usingStrict
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.blinkenlights.jid3.util.ID3Visitable
accept
 

Field Detail

m_sTitle

protected java.lang.String m_sTitle

m_sArtist

protected java.lang.String m_sArtist

m_sAlbum

protected java.lang.String m_sAlbum

m_sYear

protected java.lang.String m_sYear

m_sComment

protected java.lang.String m_sComment

m_oGenre

protected ID3V1Tag.Genre m_oGenre
Constructor Detail

ID3V1Tag

public ID3V1Tag()
Constructor.

Method Detail

setTitle

public void setTitle(java.lang.String sTitle)
Set the title of the recording.

Parameters:
sTitle - the title of the recording (truncated to 30 characters, if longer)

getTitle

public java.lang.String getTitle()
Get the title of the recording.

Returns:
the set title for the recording

setArtist

public void setArtist(java.lang.String sArtist)
Set the artist for the recording.

Parameters:
sArtist - the artist of the recording (truncated to 30 characters, if longer)

getArtist

public java.lang.String getArtist()
Get the artist of the recording.

Returns:
the set artist for the recording

setAlbum

public void setAlbum(java.lang.String sAlbum)
Set the name of the album from which the recording comes.

Parameters:
sAlbum - the name of the album (truncated to 30 characters, if longer)

getAlbum

public java.lang.String getAlbum()
Get the name of the album from which the recording comes.

Returns:
the set name of the album

setYear

public void setYear(java.lang.String sYear)
Set the year in which the recording was made.

Parameters:
sYear - the year of the recording (up to 4 characters, should be numeric)

getYear

public java.lang.String getYear()
Get the year in which the recording was made.

Returns:
the set year of the recording

setComment

public abstract void setComment(java.lang.String sComment)
Set the comment field.

Parameters:
sComment - a comment field (truncated to 30 characters, if longer, or 28 characters in a v1.1 tag)

getComment

public java.lang.String getComment()
Get the comment.

Returns:
the set comment

setGenre

public void setGenre(ID3V1Tag.Genre oGenre)
Set the genre of the recording, using one of the predefined genre values.

Parameters:
oGenre - the genre of the recording

getGenre

public ID3V1Tag.Genre getGenre()
Get the genre of the recording.

Returns:
the predefined genre of the recording

read

public static ID3V1Tag read(java.io.InputStream oIS)
                     throws ID3Exception
Read an ID3 V1 tag from an input stream.

Parameters:
oIS - the input stream from which to read a V1 tag
Returns:
an object representing the tag just read
Throws:
ID3Exception - if an error occurs while reading the tag

write

public abstract void write(java.io.OutputStream oOS)
                    throws ID3Exception
Write tag to output stream.

Parameters:
oOS - output stream to which tag is to be written
Throws:
ID3Exception - if an error occurs while writing the tag

toString

public java.lang.String toString()
Description copied from class: ID3Tag
Represent a tag as string for debugging purposes.

Specified by:
toString in class ID3Tag
Returns:
a string representation of the contents of the tag