org.jscience.computing.game.cards
Class Card

java.lang.Object
  extended by org.jscience.computing.game.cards.Card
All Implemented Interfaces:
java.io.Serializable

public class Card
extends java.lang.Object
implements java.io.Serializable

a representation of a game card

See Also:
Serialized Form

Field Summary
static int ACE
          DOCUMENT ME!
static boolean BIG_DECK
          DOCUMENT ME!
static byte CLUBS
          DOCUMENT ME!
static byte DIAMONDS
          DOCUMENT ME!
static int EIGHT
          DOCUMENT ME!
static int FIVE
          DOCUMENT ME!
static int FOUR
          DOCUMENT ME!
static byte HEARTS
          DOCUMENT ME!
static int JACK
          DOCUMENT ME!
static int JOKER
          DOCUMENT ME!
static int KING
          DOCUMENT ME!
static int NINE
          DOCUMENT ME!
static int QUEEN
          DOCUMENT ME!
static int SEVEN
          DOCUMENT ME!
static int SIX
          DOCUMENT ME!
static boolean SMALL_DECK
          DOCUMENT ME!
static byte SPADES
          DOCUMENT ME!
static int TEN
          DOCUMENT ME!
static int THREE
          DOCUMENT ME!
static int TWO
          DOCUMENT ME!
 
Constructor Summary
Card(int type)
          to instanciate a Joker only; accepts only JOKER as type
Card(int rank, byte suit)
          use static members of this class for parameters
 
Method Summary
 boolean equals(java.lang.Object obj)
          DOCUMENT ME!
 int getRank()
          DOCUMENT ME!
 byte getSuit()
          DOCUMENT ME!
 boolean isInSmallDeck()
          returns true only if the Card is one that belongs in a small deck (Ace, King, Queen, Jack, Ten, Nine, Eight, Seven)
 boolean sameRank(Card c)
          DOCUMENT ME!
 boolean sameSuit(Card c)
          DOCUMENT ME!
 java.lang.String toString()
          DOCUMENT ME!
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BIG_DECK

public static final boolean BIG_DECK
DOCUMENT ME!

See Also:
Constant Field Values

SMALL_DECK

public static final boolean SMALL_DECK
DOCUMENT ME!

See Also:
Constant Field Values

CLUBS

public static final byte CLUBS
DOCUMENT ME!

See Also:
Constant Field Values

SPADES

public static final byte SPADES
DOCUMENT ME!

See Also:
Constant Field Values

HEARTS

public static final byte HEARTS
DOCUMENT ME!

See Also:
Constant Field Values

DIAMONDS

public static final byte DIAMONDS
DOCUMENT ME!

See Also:
Constant Field Values

ACE

public static final int ACE
DOCUMENT ME!

See Also:
Constant Field Values

KING

public static final int KING
DOCUMENT ME!

See Also:
Constant Field Values

QUEEN

public static final int QUEEN
DOCUMENT ME!

See Also:
Constant Field Values

JACK

public static final int JACK
DOCUMENT ME!

See Also:
Constant Field Values

TEN

public static final int TEN
DOCUMENT ME!

See Also:
Constant Field Values

NINE

public static final int NINE
DOCUMENT ME!

See Also:
Constant Field Values

EIGHT

public static final int EIGHT
DOCUMENT ME!

See Also:
Constant Field Values

SEVEN

public static final int SEVEN
DOCUMENT ME!

See Also:
Constant Field Values

SIX

public static final int SIX
DOCUMENT ME!

See Also:
Constant Field Values

FIVE

public static final int FIVE
DOCUMENT ME!

See Also:
Constant Field Values

FOUR

public static final int FOUR
DOCUMENT ME!

See Also:
Constant Field Values

THREE

public static final int THREE
DOCUMENT ME!

See Also:
Constant Field Values

TWO

public static final int TWO
DOCUMENT ME!

See Also:
Constant Field Values

JOKER

public static final int JOKER
DOCUMENT ME!

See Also:
Constant Field Values
Constructor Detail

Card

public Card(int type)
     throws java.lang.IllegalArgumentException
to instanciate a Joker only; accepts only JOKER as type

Parameters:
type - DOCUMENT ME!
Throws:
java.lang.IllegalArgumentException - DOCUMENT ME!

Card

public Card(int rank,
            byte suit)
     throws java.lang.IllegalArgumentException
use static members of this class for parameters

Parameters:
rank - DOCUMENT ME!
suit - DOCUMENT ME!
Throws:
java.lang.IllegalArgumentException - DOCUMENT ME!
Method Detail

isInSmallDeck

public boolean isInSmallDeck()
returns true only if the Card is one that belongs in a small deck (Ace, King, Queen, Jack, Ten, Nine, Eight, Seven)

Returns:
DOCUMENT ME!

getSuit

public byte getSuit()
DOCUMENT ME!

Returns:
DOCUMENT ME!

equals

public boolean equals(java.lang.Object obj)
DOCUMENT ME!

Overrides:
equals in class java.lang.Object
Parameters:
obj - DOCUMENT ME!
Returns:
DOCUMENT ME!

sameRank

public boolean sameRank(Card c)
DOCUMENT ME!

Parameters:
c - DOCUMENT ME!
Returns:
DOCUMENT ME!

sameSuit

public boolean sameSuit(Card c)
DOCUMENT ME!

Parameters:
c - DOCUMENT ME!
Returns:
DOCUMENT ME!

getRank

public int getRank()
DOCUMENT ME!

Returns:
DOCUMENT ME!

toString

public java.lang.String toString()
DOCUMENT ME!

Overrides:
toString in class java.lang.Object
Returns:
DOCUMENT ME!