Priority Sorting with Comparator or Multiple Comparators?

So I have a large LinkedList of FlashCards, 1000 cards, for a flashcard app.
Some have never been seen before, others have been seen and either guessed correctly or incorrectly a number of times.

With so many Cards I want the ones that I have never laid eyes on to be first in the List, followed by the ones that have been missed more than they have been nailed.

Ideally this would be GENERAL rule and not always true; there would still be an occasional Card that I had seen before but the majority of them are unseen.

Also right now I am using Collections.shuffle(), Within the above criteria I still want the Cards to come out somewhat randomly.

I just cooked up this Comparator:

public class TimesSeenComparator implements Comparator<Card> {
    public int compare(Card one, Card two){
        boolean oneNeverSeen = false;
        boolean twoNeverSeen = false;
        if(one.getMissed() + one.getMade() == 0){ oneNeverSeen = true; }
        if(two.getMissed() + two.getMade() == 0){ twoNeverSeen = true; }
        if(oneNeverSeen && twoNeverSeen){ return 0; }

        if(one.getMissed() > two.getMissed()){
            return 1;
        } else if(one.getMissed() == two.getMissed()){
            return 0;
        } else{
            return -1;
        }
    }

}

Its pretty tough I know! Any help is appreciated.

EDIT:
The last comparator viloated its contract, I was obviously trying to do too much in one Comparator. How does it work if you have a few Comparators and then do Collections.sort(x,comp1); Collections.sort(x,comp2); Collections.sort(x,comp3); ?

public class TimesSeenComparator implements Comparator<Card> {
    public int compare(Card one, Card two){
        boolean oneNeverSeen = false;
        boolean twoNeverSeen = false;
        if(one.getMissed() + one.getMade() == 0){ oneNeverSeen = true; }
        if(two.getMissed() + two.getMade() == 0){ twoNeverSeen = true; }

        if(oneNeverSeen && !twoNeverSeen){
            return 1;
        } else if(oneNeverSeen && twoNeverSeen){
            return 0;
        } else {
            return -1;
        }
    }

}

I don’t know what you cooked a Comparator for so I’m going to answer this:

With so many Cards I want the ones that I have never laid eyes on to be first in the List, followed by the ones that have been missed more than they have been nailed.

Ideally this would be GENERAL rule and not always true; there would still be an occasional Card that I had seen before but the majority of them are unseen.

The following code will do what you want:

List<Card> cards;

List<Card> neverSeen = new ArrayList<>();
List<Card> missedMore = new ArrayList<>();
List<Card> other = new ArrayList<>();

for (Card card : cards) {
    if (card.getMade() == 0 && card.getMissed() == 0) {
        neverSeen.add(card);
    } else if (card.getMissed() > card.getMade()) {
        // Add about 1 in 10 to the beginning
        if (Math.random() < 0.1) {
            neverSeen.add(card);
        } else {
            missedMore.add(card);
        }
    } else {
        // Add about 1 in 20 to the beginning
        if (Math.random() < 0.05) {
            neverSeen.add(card);
        } else {
            other.add(card);
        }
    }
}

Collections.shuffle(neverSeen);
Collections.shuffle(missedMore);
Collections.shuffle(other);

neverSeen.addAll(missedMore);
neverSeen.addAll(other);

cards = neverSeen;

Notes:

  • Collections.sort(x,comp1); Collections.sort(x,comp2); Collections.sort(x,comp3);
    is the same as Collections.sort(x,comp3);
    if you want to use multiple Comparators you can use ComparatorChain
    or java 8 Comparator.comparing.thenComparing
  • It’s almost always better(faster) to use ArrayList than LinkedList

Consider the basic example of Comparators with Collections:

// Create and initialize linked list
        LinkedList ll = new LinkedList();
        ll.add(new Integer(-8));
        ll.add(new Integer(20));
        ll.add(new Integer(-20));
        ll.add(new Integer(8));
// Create a reverse order comparator
        Comparator r = Collections.reverseOrder();
// Sort list by using the comparator
        Collections.sort(ll, r);
        // Get iterator
        Iterator  li = ll.iterator();
System.out.print("List sorted in reverse: ");
while(li.hasNext())
    System.out.print(li.next() + " ");
System.out.println();
Collections.shuffle(ll);
// display randomized list
li = ll.iterator();
System.out.print("List shuffled: ");
while(li.hasNext())
    System.out.print(li.next() + " ");
System.out.println();
System.out.println("Minimum: " + Collections.min(ll));
System.out.println("Maximum: " + Collections.max(ll));

The output would be:

Similarly you can use multiple Collections by initializing like this:

// Create a reverse order comparator
        Comparator r1 = Collections.reverseOrder();
        Collections.sort(ll, r1);

        Comparator r2 = Collections.reverseOrder();
        Collections.sort(ll, r2);

        Comparator r3 = Collections.reverseOrder();
        Collections.sort(ll, r3);

and access it through Iterators. Its upto you what methods you wanna use. I used here reverseOrder() but you can use according to your logic. I hope this would help you.
Thanks!