title: Collections.sort, Enum, Comparable Interface problems
body: <p>I have got a class Card from which other cards(Card Game) inherit from. The Cards suits and number are stored in enums like this</p>
  
  <pre><code>public static enum Suit {
      CLUBS, DIAMONDS, HEARTS, SPADES
  };
  
  public static enum Rank {
      DEUCE, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, TEN, JACK, QUEEN, KING, ACE
  };
  </code></pre>
  
  <p>My first problem is how to change the order of the cards ranks. In each separate class(Card Game) that inherits from class Card as different card games place different levels of importance on different cards. </p>
  
  <p>My second problem is using the Comparable Interface. </p>
  
  <p>So I have a class card like this: </p>
  
  <pre><code>public  class Card implements Comparable&lt;Card&gt; {
  
  public Suit suit;
  public Rank rank;
  
  
  public Card(Rank ranker, Suit suiter) {
  
      rank = ranker;
      suit = suiter;
  }
  
  
  //Other Methods for rank and suit here. 
  
  
  @Override
  public int compareTo(Card o) {
  
      int rankCom = rank.compareTo(o.rank);
      return rankCom != 0 ? rankCom : suit.compareTo(o.suit);
  }
  </code></pre>
  
  <p>}</p>
  
  <p>I have just been recently introduced to the comparable interface and I am not entirely sure my implementation is right. The problem arises when I want to sort out my cards using collections.sort(cards_saver). cards_saver is where I store my cards. All of that works fine. collections.shuffle(cards_saver) also works fine. The problem I get when I do collections.sort is this: </p>
  
  <pre><code>Bound mismatch: The generic method sort(List&lt;T&gt;) of type Collections is not applicable for the arguments (List&lt;Card&gt;). The inferred type Card is not a valid substitute for the bounded parameter &lt;T extends Comparable&lt;? super T&gt;&gt;
  </code></pre>
  
  <p>I would have put up all the extra code I have...Only this is getting way too long. If I didn't explain the problems well enough, please comment-I will try to explain.</p>
  
  <p>Thanks in Advance </p>