|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectglassfrog.handevaluator.EvaluateHand
public class EvaluateHand
Stores a Hand of Cards (up to a maximum of 7)
| Field Summary | |
|---|---|
private int[] |
cards
|
static int |
MAX_CARDS
|
| Constructor Summary | |
|---|---|
EvaluateHand()
|
|
EvaluateHand(EvaluateHand h)
Duplicate an existing hand. |
|
EvaluateHand(java.lang.String cs)
|
|
| Method Summary | |
|---|---|
boolean |
addCard(EvaluateCard c)
Add a card to the hand. |
boolean |
addCard(int i)
Add a card to the hand. |
EvaluateCard |
getCard(int pos)
Get the a specified card in the hand |
int[] |
getCardArray()
Obtain the array of card indexes for this hand. |
int |
getCardIndex(int pos)
Get the specified card id |
void |
makeEmpty()
Remove the all cards from the hand. |
void |
removeCard()
Remove the last card in the hand. |
void |
setCard(int pos,
EvaluateCard c)
Add a card to the hand. |
int |
size()
Get the size of the hand. |
void |
sort()
Bubble Sort the hand to have cards in descending order, but card index. |
java.lang.String |
toString()
Get a string representation of this Hand. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int MAX_CARDS
private int[] cards
| Constructor Detail |
|---|
public EvaluateHand()
public EvaluateHand(java.lang.String cs)
cs - A string representing a Hand of cardspublic EvaluateHand(EvaluateHand h)
h - the hand to clone.| Method Detail |
|---|
public int size()
public void removeCard()
public void makeEmpty()
public boolean addCard(EvaluateCard c)
c - the card to add
public boolean addCard(int i)
i - the index value of the card to add
public EvaluateCard getCard(int pos)
pos - the position (1..n) of the card in the hand
public void setCard(int pos,
EvaluateCard c)
c - the card to addpublic int[] getCardArray()
public void sort()
public java.lang.String toString()
toString in class java.lang.Objectpublic int getCardIndex(int pos)
pos - the position (1..n) of the card in the hand
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||