|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.musicontroller.songselection.RandomCandidateSelector
public class RandomCandidateSelector
Randomly selects a preset number of songs from the song collection.
| Constructor Summary | |
|---|---|
RandomCandidateSelector()
Default constructor sets the playRequestInOrder property to false. |
|
| Method Summary | |
|---|---|
void |
addToCandidates(Song song)
Adds a Song to the pool. |
int |
getCandidateCount()
Getter for the number of candidates that will be returned in a list of candidate Songs. |
Dao |
getDao()
|
void |
playRequestsAtRandom()
Instructs the selector to play the requested songs in random order. |
void |
playRequestsInOrder()
Instructs the selector to select requested songs in the order of entry. |
void |
removeFromCandidates(Song song)
Removes a Song from the pool. |
boolean |
requestsPlayedAtRandom()
Returns true if the requests will be played at random or false otherwise. |
boolean |
requestsPlayedInOrder()
Returns true if the requests will be played in order of entry or false otherwise. |
java.util.List<Song> |
selectCandidates(int count)
Selects a selection of candidate-Songs from the pool. |
java.util.List<Song> |
selectCandidates(java.util.List<java.lang.Long> requests)
Selects candidate-Songs from the pool. |
void |
setCandidateCount(int candidatecount)
Setter for the number of candidates in the candidate set. |
void |
setDao(Dao dao)
Sets the Dao and initializes the internal set of songIDs. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RandomCandidateSelector()
| Method Detail |
|---|
public void setDao(Dao dao)
dao - The Dao.public Dao getDao()
public void playRequestsInOrder()
CandidateSelector
playRequestsInOrder in interface CandidateSelectorpublic void playRequestsAtRandom()
CandidateSelector
playRequestsAtRandom in interface CandidateSelectorpublic java.util.List<Song> selectCandidates(java.util.List<java.lang.Long> requests)
CandidateSelector
selectCandidates in interface CandidateSelectorrequests - An optional list of requested songs.
public java.util.List<Song> selectCandidates(int count)
CandidateSelector
selectCandidates in interface CandidateSelectorcount - The amount of candidates to select. When this value is
bigger than the amount of songs available in the pool, a
as much Songs as possible are returned.
public void removeFromCandidates(Song song)
CandidateSelector
removeFromCandidates in interface CandidateSelectorsong - The Song to remove.public boolean requestsPlayedAtRandom()
CandidateSelector
requestsPlayedAtRandom in interface CandidateSelectorpublic boolean requestsPlayedInOrder()
CandidateSelector
requestsPlayedInOrder in interface CandidateSelectorpublic int getCandidateCount()
CandidateSelector
getCandidateCount in interface CandidateSelectorpublic void setCandidateCount(int candidatecount)
candidatecount - The size of the candidate set.public void addToCandidates(Song song)
CandidateSelector
addToCandidates in interface CandidateSelectorsong - The Song to add.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||