org.musicontroller.songselection
Interface CandidateSelector

All Known Implementing Classes:
RandomCandidateSelector

public interface CandidateSelector

Randomly selects a preset number of songs from the song pool. The Candidate selector does not know the user for which the candidates are selected.


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.
 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.
 

Method Detail

selectCandidates

java.util.List<Song> selectCandidates(java.util.List<java.lang.Long> requests)
Selects candidate-Songs from the pool. If requests were made, all those requests are returned, even if there are more than candidatecount of them.

Parameters:
requests - An optional list of requested songs.
Returns:
A list of candidate Songs

selectCandidates

java.util.List<Song> selectCandidates(int count)
Selects a selection of candidate-Songs from the pool.

Parameters:
count - 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.
Returns:
A list of candidate Songs, in which no Song appears more than once.

addToCandidates

void addToCandidates(Song song)
Adds a Song to the pool.

Parameters:
song - The Song to add.

removeFromCandidates

void removeFromCandidates(Song song)
Removes a Song from the pool.

Parameters:
song - The Song to remove.

requestsPlayedAtRandom

boolean requestsPlayedAtRandom()
Returns true if the requests will be played at random or false otherwise.

Returns:
True if the requests will be played at random.

requestsPlayedInOrder

boolean requestsPlayedInOrder()
Returns true if the requests will be played in order of entry or false otherwise.

Returns:
True if the requests will be played in the order of entry.

playRequestsInOrder

void playRequestsInOrder()
Instructs the selector to select requested songs in the order of entry. TODO if this setting changes, the DJ must revise its predictions


playRequestsAtRandom

void playRequestsAtRandom()
Instructs the selector to play the requested songs in random order. TODO if this setting changes, the DJ must revise its predictions


getCandidateCount

int getCandidateCount()
Getter for the number of candidates that will be returned in a list of candidate Songs.

Returns:
The size of the candidate list.


Copyright © 2010 A.J.V.. All Rights Reserved.