org.vizzini.game.cardgame
Interface ICardCollection

All Superinterfaces:
Cloneable, Collection, ICollection, Iterable, ITokenCollection, Serializable
All Known Implementing Classes:
CardCollection, PokerDeck

public interface ICardCollection
extends ITokenCollection

Defines methods required by a card collection. This collection can be used for a full deck, a discard pile, or an agent's hand.

Since:
v0.1
Version:
v0.3
Author:
Jeffrey M. Thompson

Method Summary
 ICard get(int index)
          Return the card at the given index.
 ICard getFirst()
          Return the first card.
 Collection getKinds(int minimumCount)
          Return a collection of CardCollection s of kinds.
 ICard getLast()
          Return the last card.
 Collection getStraights(int minimumCount)
          Return a collection of CardCollection s of straights.
 ICard removeFirst()
          Remove and return the first card.
 ICard removeLast()
          Remove and return the last card.
 void shuffle()
          Randomly reorder the cards.
 void sort()
          Sort the cards.
 
Methods inherited from interface org.vizzini.game.ITokenCollection
clone, configure, findByName, get, get, iterator
 
Methods inherited from interface org.vizzini.util.ICollection
toString
 
Methods inherited from interface java.util.Collection
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 

Method Detail

get

ICard get(int index)
Return the card at the given index.

Since:
v0.1

getFirst

ICard getFirst()
Return the first card.

Since:
v0.1

getKinds

Collection getKinds(int minimumCount)
Return a collection of CardCollection s of kinds. Each collection will contain at least the given minimum number of cards.

Parameters:
minimumCount - Minimum number of cards required to be considered a kind.
Since:
v0.1

getLast

ICard getLast()
Return the last card.

Since:
v0.1

getStraights

Collection getStraights(int minimumCount)
Return a collection of CardCollection s of straights. Each collection will contain at least the given minimum number of cards.

Parameters:
minimumCount - Minimum number of cards required to be considered a kind.
Since:
v0.1

removeFirst

ICard removeFirst()
Remove and return the first card.

Since:
v0.1

removeLast

ICard removeLast()
Remove and return the last card.

Since:
v0.1

shuffle

void shuffle()
Randomly reorder the cards.

Since:
v0.1

sort

void sort()
Sort the cards.

Since:
v0.1


Copyright 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02