|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--de.kosi.gui.model.CCard
The client-side representation of a card.
Very similar to de.kosi.model.game.Card
.
Field Summary | |
protected static CCard[] |
CARD
All cards in an array. |
protected int |
index
The index of this card. |
Constructor Summary | |
protected |
CCard(int index)
Creates a card with the given index. |
Method Summary | |
static CCard |
getBack()
Gets a card that shows a back side. |
static CCard |
getCard(Card gameCard)
Gets the card corresponding to the de.kosi.model.game.Card card. |
static CCard |
getCard(int index)
Gets the card with the given index. |
static CCard |
getCard(int suit,
int value)
Gets the card with the specified suit and value. |
static java.util.Vector |
getCards(java.util.Collection gameCards)
Gets a Collection of CCard objects corresponding to the de.kosi.model.game.Card Collection. |
int |
getIndex()
Gets the index of this card. |
protected static int |
getIndex(Card gameCard)
Gets the index of the given card. |
protected static int |
getIndex(int suit,
int value)
Gets the index of a card with the given suit and value. |
int |
getSuit()
Gets the suit of this card. |
int |
getValue()
Gets the value of this card. |
int |
hashCode()
A hash code for using this card as an hash key. |
boolean |
isBack()
Tells if this card is a card back or not. |
Card |
toGameCard()
Gets the de.kosi.model.game.Card instance corresponding to this card. |
java.lang.String |
toString()
A string representation of this card. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
protected int index
protected static CCard[] CARD
Constructor Detail |
protected CCard(int index)
index
- the index of the new card.Method Detail |
public static CCard getCard(int index)
index
- the index of the card.public static CCard getCard(Card gameCard)
de.kosi.model.game.Card
card.gameCard
- the other card.public static CCard getCard(int suit, int value)
suit
- the suit of the card.value
- the value of the card.public static CCard getBack()
protected static int getIndex(Card gameCard)
gameCard
- the cardprotected static int getIndex(int suit, int value)
suit
- the suit of the cardvalue
- the value of the cardpublic int getSuit()
public int getValue()
public int getIndex()
public boolean isBack()
true
if this is a card back.public Card toGameCard()
de.kosi.model.game.Card
instance corresponding to this card.de.kosi.model.game.Card
instance corresponding to this card.public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public static java.util.Vector getCards(java.util.Collection gameCards)
CCard
objects corresponding to the de.kosi.model.game.Card
Collection.gameCards
- a collection of Card
objects.CCard
objects.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |