Class Song

java.lang.Object
  extended bySong

public class Song
extends java.lang.Object

CS3134 HW#1 MP3 Song class. Designed to contain information for exactly one song. Complete with built-in routines to automatically read the MP3 header for bitrate and ID3 tags for other info. YOU SHOULD NOT HAVE TO TOUCH THIS CLASS AT ALL.

Version:
1.0
Author:
Janak J Parekh (janak at cs dot columbia dot edu)

Constructor Summary
Song(java.lang.String filename)
          Create a Song instance from a file.
 
Method Summary
 java.lang.String getAlbumTitle()
          Get the album title.
 java.lang.String getArtist()
          Get the artist.
 int getBitrate()
          Get the song's bitrate.
 java.lang.String getSongTitle()
          Get the song title.
 int getYear()
          Get the song year.
 int length()
          Get the song's length (in seconds).
 java.lang.String toString()
          Return a String representation of this Song.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Song

public Song(java.lang.String filename)
     throws java.io.IOException
Create a Song instance from a file. YOU DO NOT NEED TO KNOW HOW THIS METHOD WORKS, although you may find it interesting.

Parameters:
filename - The name of the file
Throws:
java.io.IOException - if it has trouble opening the file OR trouble with the file format. Yes, I know, it's pretty picky right now.
Method Detail

getArtist

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


getAlbumTitle

public java.lang.String getAlbumTitle()
Get the album title.


getSongTitle

public java.lang.String getSongTitle()
Get the song title.


getYear

public int getYear()
Get the song year.


getBitrate

public int getBitrate()
Get the song's bitrate.


length

public int length()
Get the song's length (in seconds).


toString

public java.lang.String toString()
Return a String representation of this Song.

Returns:
A multi-line description of this Song object.