|
|||||||||
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 FormField 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.id
public Song(long id)
id
- the identifier.Method Detail |
public String getTitle()
public String getAuthor()
public long getID()
getID
in interface SongContainerElement
public int hashCode()
hashCode
in class Object
public SongContainer getParent()
getParent
in interface SongContainerElement
public 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 SongContainerElement
public void setDuration(int d)
public void setPlayer(Player agent)
public Player getPlayer()
public String toString()
toString
in class Object
public String getName()
getName
in interface SongContainerElement
public boolean equals(Object o)
equals
in class Object
public 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 SongContainerElement
public SongContainerElement copyParentTree()
copyParentTree
in interface SongContainerElement
public SongContainerElement copySubtree()
copySubtree
in interface SongContainerElement
public String iconName()
iconName
in interface SongContainerElement
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |