Class SolitairePlayStack

  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.Vector
              extended by
                  extended by
All Implemented Interfaces:
Serializable, Cloneable, Iterable, Collection, List, RandomAccess

public class SolitairePlayStack
extends CardStack

A CardStack that is used as an intermediate location for cards while trying to get them to the goal location in Solitaire.

$Revision: 1.1 $
See Also:
Serialized Form

Field Summary
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
Fields inherited from class java.util.AbstractList
Constructor Summary
SolitairePlayStack(Collection list)
Method Summary
 boolean canPickUp(int i)
          Determine if we are allowed to call CardStack.pickUp(int) without getting a null back.
 boolean canStack(Card card)
          Override for stacks with rules.
Methods inherited from class
add, bottomCard, canStack, getReverse, pickUp, topCard
Methods inherited from class java.util.Vector
add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.List
iterator, listIterator, listIterator

Constructor Detail


public SolitairePlayStack()


public SolitairePlayStack(Collection list)
Method Detail


public boolean canStack(Card card)
Description copied from class: CardStack
Override for stacks with rules.

canStack in class CardStack
card - the card that wants to be stacked on top of this instance.
true if the stack is empty and the card is a King, or the card's suit color is opposite of this stack's top card and the card's value is one less than the top card.


public boolean canPickUp(int i)
Description copied from class: CardStack
Determine if we are allowed to call CardStack.pickUp(int) without getting a null back.

canPickUp in class CardStack
true if the identified card exists and is face up.