|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.Observable
jskat.share.CardVector
public class CardVector
| Constructor Summary | |
|---|---|
CardVector()
Creates a new instance of CardVector |
|
CardVector(java.util.HashSet<Card> cardSet)
Creates a new instance of CardVector from a HashSet of Cards |
|
| Method Summary | |
|---|---|
void |
add(Card card)
Adds a Card to the CardVector |
void |
addNew(Card card)
Adds a Card to the CardVector by creating a new Card object instead of using the reference |
void |
clear()
Clears the CardVector |
boolean |
contains(Card card)
Searches in the Vector for the given card |
boolean |
contains(int suit,
int value)
Searches in the Vector for the given card |
Card |
getCard(int index)
Returns a reference to a Card in the CardVector without removing it |
int |
getFirstIndexOfSuit(int suit)
Gets the index of a card in the Vector |
int |
getFirstIndexOfSuit(int gameType,
int suit)
Gets the index of a card in the Vector |
int |
getIndexOf(Card c)
Gets the index of a card in the Vector |
int |
getIndexOf(int suit,
int value)
Gets the index of a card in the Vector |
int |
getLastIndexOfSuit(int suit)
Gets the index of a card in the Vector |
int |
getLastIndexOfSuit(int gameType,
int suit)
Gets the index of a card in the Vector |
int |
getMostFrequentSuitColor()
|
int |
getSuitColorCount(int suit)
Deprecated. |
int |
getSuitColorCount(int gameType,
int suit)
Returns the numer of cards with a given suit dependent on a game type |
boolean |
hasSuit(int suit)
Deprecated. |
boolean |
hasSuit(int gameType,
int suit)
Tests whether a card with a suit is in the CardVector or not |
boolean |
hasTrump(int trump)
Deprecated. |
boolean |
hasTrump(int gameType,
int trump)
Tests whether a trump card is in the CardVector or not |
java.util.Iterator |
iterator()
|
Card |
remove(Card card)
Returns a reference to a Card in the CardVector and removes this card from the CardVector |
Card |
remove(int index)
Returns a reference to a Card in the CardVector and removes this card from the CardVector |
Card |
remove(int suit,
int value)
Returns a reference to a Card in the CardVector and removes this card from the CardVector |
int |
size()
Returns the size of the CardVector |
void |
sort(int sortType)
|
void |
sort(int gameType,
int trump)
Sorts the cards in the Vector according the sort type SkatConstants |
java.lang.String |
toString()
Generates a String of all cards in the CardVector |
| Methods inherited from class java.util.Observable |
|---|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public CardVector()
public CardVector(java.util.HashSet<Card> cardSet)
SkatGameData.getDealtCards()| Method Detail |
|---|
public void addNew(Card card)
card - The Card to be addedpublic void add(Card card)
card - The Card to be addedpublic Card getCard(int index)
index - The Index of the Card to be returnedpublic Card remove(int index)
index - The index of the Card to remove
public Card remove(Card card)
card - The Card to remove
public Card remove(int suit,
int value)
suit - The suit of the card to removevalue - The value of the card to remove
public boolean contains(int suit,
int value)
suit - The suit of the cardvalue - The value of the card
public boolean contains(Card card)
card - The Card
public boolean hasSuit(int suit)
suit - Suit to be tested
public boolean hasSuit(int gameType,
int suit)
gameType - Game type of the game playedsuit - Suit color
public boolean hasTrump(int trump)
trump - Current trump color
public boolean hasTrump(int gameType,
int trump)
gameType - Game type of the game playedtrump - Trump color
public int getIndexOf(Card c)
public int getIndexOf(int suit,
int value)
public int getFirstIndexOfSuit(int suit)
public int getFirstIndexOfSuit(int gameType,
int suit)
public int getLastIndexOfSuit(int suit)
public int getLastIndexOfSuit(int gameType,
int suit)
public int getMostFrequentSuitColor()
public int getSuitColorCount(int suit)
suit - The suit to search for
public int getSuitColorCount(int gameType,
int suit)
gameType - The game typesuit - The suit to search for
public void sort(int sortType)
public void sort(int gameType,
int trump)
public int size()
public java.lang.String toString()
toString in class java.lang.Objectpublic java.util.Iterator iterator()
public void clear()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||