Package jadex.bdi.examples.blackjack
Class Card
- java.lang.Object
-
- jadex.bdi.examples.blackjack.Card
-
public class Card extends java.lang.Object
Card information.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
clone()
Get a clone of thisCard
.boolean
equals(java.lang.Object obj)
Test the equality of thisCard
and an objectobj
.java.lang.String
getColor()
Get the col of this Card.java.lang.String
getType()
Get the type of this Card.int
getValue()
Get the val of this Card.int
hashCode()
void
setColor(java.lang.String col)
Set the col of this Card.void
setType(java.lang.String type)
Set the type of this Card.void
setValue(int val)
Set the val of this Card.java.lang.String
toString()
Get a string representation of thisCard
.
-
-
-
Constructor Detail
-
Card
public Card()
Default Constructor.
Card.
-
Card
public Card(java.lang.String type, java.lang.String color, int value)
Default Constructor.
Card.
-
Card
public Card(Card proto)
Clone Constructor.
Card.
proto to this instance.- Parameters:
proto
- The prototype instance.
-
-
Method Detail
-
getColor
public java.lang.String getColor()
Get the col of this Card.- Returns:
- col
-
setColor
public void setColor(java.lang.String col)
Set the col of this Card.- Parameters:
col
- the value to be set
-
getType
public java.lang.String getType()
Get the type of this Card.- Returns:
- type
-
setType
public void setType(java.lang.String type)
Set the type of this Card.- Parameters:
type
- the value to be set
-
getValue
public int getValue()
Get the val of this Card.- Returns:
- val
-
setValue
public void setValue(int val)
Set the val of this Card.- Parameters:
val
- the value to be set
-
toString
public java.lang.String toString()
Get a string representation of thisCard
.- Overrides:
toString
in classjava.lang.Object
- Returns:
- The string representation.
-
clone
public java.lang.Object clone()
Get a clone of thisCard
.- Overrides:
clone
in classjava.lang.Object
- Returns:
- a shalow copy of this instance.
-
equals
public boolean equals(java.lang.Object obj)
Test the equality of thisCard
and an objectobj
.- Overrides:
equals
in classjava.lang.Object
- Parameters:
obj
- the object this test will be performed with- Returns:
- false if
obj
is not ofCard
class, true if all attributes are equal.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-