|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Objectcomp202.fall2007.a5.util.Song
public class Song
A Song
object records the attributes of a digital audio track.
These attributes includes the title of the audio track, the artist who
produced it, the album on which it appears, the disc number, the track
number, the playing length of the the track, and the path of the file
on disk which contains this track.
Song
objects are immutable; that is, the value of
their attributes cannot be changed after they have been created.
Field Summary | |
---|---|
static int |
EMPTY_TRACK
Constant indicating that the track attribute is undefined. |
Constructor Summary | |
---|---|
Song(java.io.File filePath,
String artist,
String album,
String title,
int trackNumber,
int length)
Creates a new Song object with the specified attributes,
and a disc number attribute equal to 1 . |
|
Song(java.io.File filePath,
String artist,
String album,
String title,
int discNumber,
int trackNumber,
int length)
Creates a new Song object with the specified attributes. |
Method Summary | |
---|---|
String |
getAlbum()
Returns the title of the album on which this Song appears. |
String |
getArtist()
Returns the name of the artist who produced this Song . |
int |
getDiscNumber()
Returns the disc number of this Song . |
java.io.File |
getFilePath()
Returns the path of the file on disk containing the audio track represented by this Song object. |
int |
getLength()
Returns the length of this Song in seconds. |
String |
getTitle()
Returns the title of this Song . |
int |
getTrackNumber()
Returns the track number of this Song . |
String |
toString()
Returns a String representation of this Song . |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int EMPTY_TRACK
Constructor Detail |
---|
public Song(java.io.File filePath, String artist, String album, String title, int discNumber, int trackNumber, int length)
Song
object with the specified attributes.
filePath
- The path of the file on disk containing the audio track
represented by the newly-created Song
object.artist
- The artist who produced the newly-created Song
.album
- The album on which the newly-created Song
appears.title
- The title of the newly-created Song
.discNumber
- The disc number of the newly-created Song
.trackNumber
- The track number of the newly-created Song
.length
- The length in seconds of the audio track represented by the
newly-created Song
.public Song(java.io.File filePath, String artist, String album, String title, int trackNumber, int length)
Song
object with the specified attributes,
and a disc number attribute equal to 1
.
filePath
- The path of the file on disk containing the audio track
represented by the newly-created Song
object.artist
- The name of the artist who produced the newly-created
Song
.album
- The title of the album on which the newly-created
Song
appears.title
- The title of the newly-created Song
.trackNumber
- The track number of the newly-created Song
.length
- The length in seconds of the audio track represented by the
newly-created Song
.Method Detail |
---|
public java.io.File getFilePath()
Song
object.
Song
object.public String getArtist()
Song
.
Song
.public String getAlbum()
Song
appears.
Song
appears.public String getTitle()
Song
.
Song
.public int getTrackNumber()
Song
.
Song
.public int getDiscNumber()
Song
.
Song
.public int getLength()
Song
in seconds.
Song
in seconds.public String toString()
String
representation of this Song
.
toString
in class Object
String
representation of this Song
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |