au.edu.mq.itec802.cardGame
Class Card

java.lang.Object
  extended by au.edu.mq.itec802.cardGame.Card

public class Card
extends java.lang.Object

The Class Card. TODO: Aces could be modelled as a subclass of Card redefining appropriate methods and properties (more logical, I guess) :-)

Version:
$Id: Card.java 19/03/2011 jumbo$
Author:
Tomas Krajca

Constructor Summary
Card(int value, java.lang.String name, boolean isAce)
          Instantiates a new card.
 
Method Summary
 java.lang.String getName()
          Gets the name.
 int getValue()
          Gets the value.
 boolean isAce()
          Checks if is ace.
 void setAce(boolean isAce)
          Sets the ace.
 void setName(java.lang.String name)
          Sets the name.
 void setValue(int value)
          Sets the value.
 java.lang.String toString()
          Serializes the card into String
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Card

public Card(int value,
            java.lang.String name,
            boolean isAce)
Instantiates a new card.

Parameters:
value - the value of the card
name - the name of the card
isAce - determines whether it should be treated as an Ace
Method Detail

setName

public void setName(java.lang.String name)
Sets the name.

Parameters:
name - the name to set

setAce

public void setAce(boolean isAce)
Sets the ace.

Parameters:
isAce - the isAce to set

getValue

public int getValue()
Gets the value.

Returns:
the value

setValue

public void setValue(int value)
Sets the value.

Parameters:
value - the value to set

getName

public java.lang.String getName()
Gets the name.

Returns:
the name

isAce

public boolean isAce()
Checks if is ace.

Returns:
the isAce

toString

public java.lang.String toString()
Serializes the card into String

Overrides:
toString in class java.lang.Object
Returns:
card as String