|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--agentland.device.intelliCD.Song
Class for holding Songs. Contains information on the song itself, and also holds information on an enclosing SongContainer.
Serializable,
SongContainerElement, Serialized Form| Field Summary | |
protected String |
author
The author of the song. |
protected int |
duration
The duration of the song, in seconds. |
protected long |
id
The song identifier. |
protected SongContainer |
parent
The containing structure that has information about this song. |
protected Player |
player
|
protected String |
title
The title of the song |
| Constructor Summary | |
Song()
Creates a new, empty Song. |
|
Song(long id)
Creates a song placeholder. |
|
Song(long id,
String title,
String author,
int duration)
Creates a new song and populates the fields. |
|
| Method Summary | |
SongContainerElement |
copyParentTree()
|
SongContainerElement |
copySubtree()
|
boolean |
equals(long id)
|
boolean |
equals(Object o)
|
boolean |
equals(Song s)
|
String |
getAuthor()
Returns the author of the song. |
int |
getDuration()
Returns the duration of the song. |
long |
getID()
Get the identifier code for the song. |
String |
getName()
|
String |
getNiceDuration()
Gets a string with a nicely formatted duration. |
SongContainer |
getParent()
Gets the song's containing class. |
Player |
getPlayer()
|
String |
getTitle()
Return the title of the song. |
int |
hashCode()
|
String |
iconName()
|
SongContainerElement |
lightweightCopy()
|
static String |
niceDuration(long t)
Creates a nicely formatted duration string for the given duration. |
void |
pause()
|
void |
play()
|
void |
resume()
|
void |
setAuthor(String a)
|
void |
setDuration(int d)
|
protected void |
setID(long l)
|
void |
setParent(SongContainer d)
|
void |
setPlayer(Player agent)
|
void |
setTitle(String t)
|
void |
stop()
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected long id
protected String title
protected String author
protected SongContainer parent
protected int duration
protected transient Player player
| Constructor Detail |
public Song()
public Song(long id,
String title,
String author,
int duration)
id - the song ID.title - the title.author - the author.duration - the song duration, in seconds.idpublic Song(long id)
id - the identifier.| Method Detail |
public String getTitle()
public String getAuthor()
public long getID()
getID in interface SongContainerElementpublic int hashCode()
hashCode in class Objectpublic SongContainer getParent()
getParent in interface SongContainerElementpublic int getDuration()
public String getNiceDuration()
niceDuration(long)public static String niceDuration(long t)
t - the duration to format, in millisecondspublic void setTitle(String t)
public void setAuthor(String a)
protected void setID(long l)
public void setParent(SongContainer d)
setParent in interface SongContainerElementpublic void setDuration(int d)
public void setPlayer(Player agent)
public Player getPlayer()
public String toString()
toString in class Objectpublic String getName()
getName in interface SongContainerElementpublic boolean equals(Object o)
equals in class Objectpublic boolean equals(long id)
public boolean equals(Song s)
public void play()
public void pause()
public void resume()
public void stop()
public SongContainerElement lightweightCopy()
lightweightCopy in interface SongContainerElementpublic SongContainerElement copyParentTree()
copyParentTree in interface SongContainerElementpublic SongContainerElement copySubtree()
copySubtree in interface SongContainerElementpublic String iconName()
iconName in interface SongContainerElement
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||