Let's assume that I have a list of Word
objects. Each Word
has the following structure preliminary:
class Word {
String text;
double rank;
}
How can I implement the solution to show the user random word from list by relevancy? User, for example, can adjust rank
field to force the word appear more frequently or set the rank to 0 in order to make it not showable at all.
Thank you!
UPD Will PriorityQueue
be ok for that?