jagafa.object
Class CardList

java.lang.Object
  extended by jagafa.object.CardList
Direct Known Subclasses:
Board, GoneCardHeap, Hand

public class CardList
extends java.lang.Object

Object to store a list of Card Objects Attention: Does not implement java.util.List


Constructor Summary
CardList()
          Constructor: Init the list
 
Method Summary
 void add(Card c)
          Add a card to the CardList
 void addAll(CardList list)
          Adds all Card from the CardList given to the CardList
 void clear()
          Clear the CardList
 boolean contains(Card c)
          Checks wether the CardList contains the Card given
 Card get(int i)
          Get a card out of the CardList at a position specified
 CardList getGoneOfColor(int i)
          Dummy method: Used in GoneCardHeap only
 boolean isEmpty()
          Checks wether the CardList is empty or not
 java.util.Iterator<Card> iterator()
          Converts the CardList to a java.util.iterator object
 java.util.List<Card> list()
          Convert the CardList to a java.util.list object
 void remove(Card c)
          Remove a card from the CardList
 void remove(int i)
          Remove a card from the CardList
 int size()
          Get the number of cards in the CardList
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CardList

public CardList()
Constructor: Init the list

Method Detail

add

public void add(Card c)
Add a card to the CardList

Parameters:
c - The card to add

remove

public void remove(Card c)
Remove a card from the CardList

Parameters:
c - The card to remove

remove

public void remove(int i)
Remove a card from the CardList

Parameters:
i - The cards position

get

public Card get(int i)
Get a card out of the CardList at a position specified

Parameters:
i - The position
Returns:
The card at the ith position in the CardList

iterator

public java.util.Iterator<Card> iterator()
Converts the CardList to a java.util.iterator object

Returns:
An iterator of Card objects

size

public int size()
Get the number of cards in the CardList

Returns:
The number of Cards in the CardList

isEmpty

public boolean isEmpty()
Checks wether the CardList is empty or not

Returns:
True, if there are no Cards in the CardList

contains

public boolean contains(Card c)
Checks wether the CardList contains the Card given

Parameters:
c - The card
Returns:
True, if the list contains the Card given

clear

public void clear()
Clear the CardList


list

public java.util.List<Card> list()
Convert the CardList to a java.util.list object

Returns:
A List (java.util.List) of the Cards in CardList

addAll

public void addAll(CardList list)
Adds all Card from the CardList given to the CardList

Parameters:
list - The CardList to add

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getGoneOfColor

public CardList getGoneOfColor(int i)
Dummy method: Used in GoneCardHeap only



Copyright 2005 MA Software. All Rights Reserved.