com.threerings.parlor.card.data
Class Hand

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList<E>
              extended by com.threerings.util.StreamableArrayList<Card>
                  extended by com.threerings.parlor.card.data.Hand
All Implemented Interfaces:
Streamable, Serializable, Cloneable, Iterable<Card>, Collection<Card>, List<Card>, RandomAccess

public class Hand
extends StreamableArrayList<Card>

Instances of this class represent hands of cards.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.threerings.io.Streamable
Streamable.Closure
 
Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
Hand()
           
 
Method Summary
 void addAll(Card[] cards)
          Adds all of the specified cards to this hand.
 boolean containsAll(Card[] cards)
          Checks whether this hand contains all of the specified cards.
 Card[] getCards()
          Converts this list of cards into an array.
 int getSuitMemberCount(int suit)
          Counts the members of a particular suit within this hand.
 void removeAll(Card[] cards)
          Removes all of the specified cards from this hand.
 
Methods inherited from class com.threerings.util.StreamableArrayList
newList, readObject, writeObject
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Constructor Detail

Hand

public Hand()
Method Detail

addAll

public void addAll(Card[] cards)
Adds all of the specified cards to this hand.


removeAll

public void removeAll(Card[] cards)
Removes all of the specified cards from this hand.


containsAll

public boolean containsAll(Card[] cards)
Checks whether this hand contains all of the specified cards.


getSuitMemberCount

public int getSuitMemberCount(int suit)
Counts the members of a particular suit within this hand.

Parameters:
suit - the suit of interest
Returns:
the number of cards in the specified suit

getCards

public Card[] getCards()
Converts this list of cards into an array. This only necessary if you need the cards in array form, use ArrayList.get(int) if you simply need to get a card from the hand.