Class Card

java.lang.Object
  extended byCard
All Implemented Interfaces:
java.lang.Comparable
Direct Known Subclasses:
ZetCard

public class Card
extends java.lang.Object
implements java.lang.Comparable

Represents a generic Card with a given int ID.


Constructor Summary
Card(int id)
          Construcs a card with a given id.
 
Method Summary
 int compareTo(Card other)
          Compares this card with the specified object for order.
 boolean equals(java.lang.Object other)
          Indicates whether some other object is "equal to" this one.
 int getId()
          Returns this card's id.
 java.lang.String toString()
          Returns a String representation of this card.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Card

public Card(int id)
Construcs a card with a given id.

Parameters:
id - this card's id.
Method Detail

getId

public int getId()
Returns this card's id.

Returns:
this card's id.

equals

public boolean equals(java.lang.Object other)
Indicates whether some other object is "equal to" this one.

Parameters:
other - the reference object with which to compare.
Returns:
true if this object is the same as other; false otherwise.

compareTo

public int compareTo(Card other)
Compares this card with the specified object for order.

Specified by:
compareTo in interface Comparable<String>
Parameters:
other - the card to be compared.
Returns:
a negative integer, zero, or a positive integer as this card is less than, equal to, or greater than other.

toString

public java.lang.String toString()
Returns a String representation of this card.

Returns:
a String representation of this card.