2-APL UPC project.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at main 49 lines 710 B view raw
1package cardtable; 2 3import java.util.*; 4 5 6public class Hand { 7 8 private java.util.List hand = new ArrayList(); 9 10 public void addCard( Card card ) { 11 hand.add( card ); 12 } 13 14 public Card getCard( int index ) { 15 return (Card) hand.get( index ); 16 } 17 18 19 public Card removeCard( int index ) { 20 return (Card) hand.remove( index ); 21 } 22 23 24 public void sort() { 25 Collections.sort( hand ); 26 } 27 28 29 public boolean isEmpty() { 30 return hand.isEmpty(); 31 } 32 33 34 public boolean containsCard( Card card ) { 35 return false; 36 } 37 38 39 public int findCard( Card card ) { 40 return hand.indexOf( card ); 41 } 42 43 44 45 public String toString() { 46 return hand.toString(); 47 } 48 49}