org.ninm.games.cardgames.common
Class CardUtils

java.lang.Object
  |
  +--org.ninm.games.cardgames.common.CardUtils

public final class CardUtils
extends java.lang.Object

General purpose card utilities

Version:
1.0
Author:
Nikolay

Constructor Summary
private CardUtils()
          CardUtils should not be instantiated.
 
Method Summary
static boolean contains(Face face, java.util.Set cards)
          returns true if the set of cards contains the given face
static java.util.Set getCardsFrom(Face face, java.util.Set cards)
          finds all the cards from the given face
static java.util.Set getCardsFrom(Suit suit, java.util.Set cards)
          returns all the cards of the given suit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CardUtils

private CardUtils()
CardUtils should not be instantiated.

Method Detail

getCardsFrom

public static final java.util.Set getCardsFrom(Suit suit,
                                               java.util.Set cards)
returns all the cards of the given suit

Parameters:
suit - the suit to search for
cards - the set of cards to search through
Returns:
Set a set of cards found

getCardsFrom

public static final java.util.Set getCardsFrom(Face face,
                                               java.util.Set cards)
finds all the cards from the given face

Parameters:
face - the face to search for
cards - the cards to search in
Returns:
Set all the cards from the given face

contains

public static boolean contains(Face face,
                               java.util.Set cards)
returns true if the set of cards contains the given face

Parameters:
face - the face to search for
cards - the cards to search in
Returns:
boolean true if the set contains the given face, false otherwise

SourceForge.net Logo