# Hand (vilya 1.3 API)
Date: 2011-04-06

## com.threerings.parlor.card.data
Class Hand

    java.lang.Object
      java.util.AbstractCollection<E>
          java.util.AbstractList<E>
              java.util.ArrayList<E>
                  com.threerings.util.StreamableArrayList<Card>
                      com.threerings.parlor.card.data.Hand

All Implemented Interfaces:
  com.threerings.io.Streamable, Serializable, Cloneable, Iterable<Card>, Collection<Card>, List<Card>, RandomAccess

    public class Hand

extends com.threerings.util.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
`com.threerings.io.Streamable.Closure`

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, 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
`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.

Copyright © 2011. All Rights Reserved.