|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectcardDeck.CardPile
public class CardPile
A pile of cards which can be used for a discard pile, hand, deck, etc.
| Constructor Summary | |
|---|---|
CardPile()
|
|
| Method Summary | |
|---|---|
void |
clear()
Empty the pile of cards |
boolean |
isRemovable()
Checks if a card is removable from this pile. |
java.util.Iterator<Card> |
iterator()
Returns iterator of all the cards in the pile. |
Card |
peekTop()
Allows you to see what card is at the top, without removing it from the pile |
Card |
pop()
Removes the top card of the pile for use if cards can be removed from this pile. |
Card |
popIgnoreRules()
Removes card from the top of this pile without adhering to any rules. |
boolean |
push(Card newCard)
Adds card to this pile, adhering to any rules. |
void |
pushIgnoreRules(Card newCard)
Adds card to this pile without adhering to any rules. |
java.util.ListIterator<Card> |
reverseIterator()
Returns a list iterator of the elements in this list (in proper sequence), |
boolean |
rulesAllowAddingThisCard(Card card)
Subclasses may override this to enforce their rules for adding cards to the pile. |
void |
shuffle()
Shuffles the deck |
int |
size()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CardPile()
| Method Detail |
|---|
public void pushIgnoreRules(Card newCard)
newCard - Card to be added to the pilepublic Card popIgnoreRules()
public boolean push(Card newCard)
newCard - Card to be added to the pilepublic boolean rulesAllowAddingThisCard(Card card)
card - Card to be added.
public int size()
public Card pop()
public void shuffle()
public Card peekTop()
public java.util.Iterator<Card> iterator()
iterator in interface java.lang.Iterable<Card>public java.util.ListIterator<Card> reverseIterator()
public void clear()
public boolean isRemovable()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||