|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsolitaire.examples.Deck370
public class Deck370
A Deck provides access to cards one-at-a-time using the Iterator interface from java.util. Objects returned from the iterator implement the IGuiCard interface. The Deck uses the simple GuiCard class from the freecell package. This class is for demo purposes in showing the GuiDemo, not as an example of how to design a deck class.
Field Summary | |
---|---|
protected java.util.ArrayList<GuiCard> |
myCardList
|
protected int |
myIndex
|
Constructor Summary | |
---|---|
Deck370()
Construct a full deck in which the cards are shuffled. |
Method Summary | |
---|---|
boolean |
hasNext()
Returns true if this deck can deal more cards, false otherwise. |
GuiCard |
next()
Return the next card in the deck (will throw an exception if there are no more cards). |
void |
remove()
Required for the Iterator interface, not implemented. |
protected void |
shuffle()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.ArrayList<GuiCard> myCardList
protected int myIndex
Constructor Detail |
---|
public Deck370()
Method Detail |
---|
protected void shuffle()
public boolean hasNext()
hasNext
in interface java.util.Iterator<IGuiCard>
public GuiCard next()
next
in interface java.util.Iterator<IGuiCard>
public void remove()
remove
in interface java.util.Iterator<IGuiCard>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |