com.antelmann.game.card
Class Card
java.lang.Object
com.antelmann.game.card.Card
- All Implemented Interfaces:
- Serializable
public class Card
- extends Object
- implements Serializable
a representation of a game card
- Author:
- Holger Antelmann
- See Also:
- Serialized Form
|
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 |
BIG_DECK
public static final boolean BIG_DECK
- See Also:
- Constant Field Values
SMALL_DECK
public static final boolean SMALL_DECK
- See Also:
- Constant Field Values
CLUBS
public static final byte CLUBS
- See Also:
- Constant Field Values
SPADES
public static final byte SPADES
- See Also:
- Constant Field Values
HEARTS
public static final byte HEARTS
- See Also:
- Constant Field Values
DIAMONDS
public static final byte DIAMONDS
- See Also:
- Constant Field Values
ACE
public static final int ACE
- See Also:
- Constant Field Values
KING
public static final int KING
- See Also:
- Constant Field Values
QUEEN
public static final int QUEEN
- See Also:
- Constant Field Values
JACK
public static final int JACK
- See Also:
- Constant Field Values
TEN
public static final int TEN
- See Also:
- Constant Field Values
NINE
public static final int NINE
- See Also:
- Constant Field Values
EIGHT
public static final int EIGHT
- See Also:
- Constant Field Values
SEVEN
public static final int SEVEN
- See Also:
- Constant Field Values
SIX
public static final int SIX
- See Also:
- Constant Field Values
FIVE
public static final int FIVE
- See Also:
- Constant Field Values
FOUR
public static final int FOUR
- See Also:
- Constant Field Values
THREE
public static final int THREE
- See Also:
- Constant Field Values
TWO
public static final int TWO
- See Also:
- Constant Field Values
JOKER
public static final int JOKER
- See Also:
- Constant Field Values
Card
public Card(int type)
throws IllegalArgumentException
- to instanciate a Joker only; accepts only JOKER as type
- Throws:
IllegalArgumentException
Card
public Card(int rank,
byte suit)
throws IllegalArgumentException
- use static members of this class for parameters
- Throws:
IllegalArgumentException
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)
getSuit
public byte getSuit()
equals
public boolean equals(Object obj)
- Overrides:
equals in class Object
sameRank
public boolean sameRank(Card c)
sameSuit
public boolean sameSuit(Card c)
getRank
public int getRank()
toString
public String toString()
- Overrides:
toString in class Object
(c) 2001-2006 Holger Antelmann - all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads