JavaTron
Class AudioTronSong

java.lang.Object
  |
  +--JavaTron.AudioTronSong

public class AudioTronSong
extends java.lang.Object

Represents all the song information for a song from an the AudioTron.


Field Summary
 java.lang.String album
           
 java.lang.String artist
           
 java.lang.String genre
           
 int index
           
 java.lang.String source
           
 java.lang.String sourceLocation
           
 java.lang.String title
           
 int total
           
 
Constructor Summary
AudioTronSong()
          Default constructor for song -- assigns a negative index
AudioTronSong(int index_)
          Constructor that takes an index
 
Method Summary
 boolean checkMatch(JavaTron.AudioTronSong song)
          Determine if these two songs match.
 boolean shouldUpdate(JavaTron.AudioTronSong s)
          Determine whether this song should be updated by the song that is passed in (whether the passed in song has more info)
 java.lang.String toString()
          Generates a ListBox friendly String
 void update(JavaTron.AudioTronSong song)
          Copy contents of other song to this song
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

title

public java.lang.String title

artist

public java.lang.String artist

album

public java.lang.String album

genre

public java.lang.String genre

source

public java.lang.String source

sourceLocation

public java.lang.String sourceLocation

index

public int index

total

public int total
Constructor Detail

AudioTronSong

public AudioTronSong()
Default constructor for song -- assigns a negative index


AudioTronSong

public AudioTronSong(int index_)
Constructor that takes an index

Parameters:
index_ - the index of the song (in the play queue)
Method Detail

update

public void update(JavaTron.AudioTronSong song)
Copy contents of other song to this song


checkMatch

public boolean checkMatch(JavaTron.AudioTronSong song)
Determine if these two songs match. They match if: 1) This song's title is UNKNOWN 2) The two song titles are the same 3) The two song titles are similar

Returns:
true if they match, false otherwise

shouldUpdate

public boolean shouldUpdate(JavaTron.AudioTronSong s)
Determine whether this song should be updated by the song that is passed in (whether the passed in song has more info)

Parameters:
s - the song to determine if it is newer than this song
Returns:
true if the passed song is newer, false if not

toString

public java.lang.String toString()
Generates a ListBox friendly String

Overrides:
toString in class java.lang.Object