|
-footer | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList
garrettsmith.playingcards.CardList
public final class CardList
Provides a List with some protection to ensure only Card objects are
put into the list.
| Field Summary |
|---|
| Fields inherited from class java.util.AbstractList |
|---|
modCount |
| Constructor Summary | |
|---|---|
CardList()
Creates an empty card list with an initial capaciy of 10. |
|
CardList(CardList cards)
Creates a card list which contains the contents of cards. |
|
CardList(int capacity)
Creates an empty card list with an initial capaciy of capacity. |
|
| Method Summary | |
|---|---|
boolean |
add(java.lang.Object o)
Adds a card to the list. |
Card |
getCard(int index)
Returns a Card from the specified index. |
Card |
removeCard(int i)
Removes a Card at the specified index. |
| Methods inherited from class java.util.ArrayList |
|---|
add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize |
| Methods inherited from class java.util.AbstractList |
|---|
equals, hashCode, iterator, listIterator, listIterator, subList |
| Methods inherited from class java.util.AbstractCollection |
|---|
containsAll, removeAll, retainAll, toString |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.List |
|---|
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList |
| Constructor Detail |
|---|
public CardList()
public CardList(int capacity)
capacity.
public CardList(CardList cards)
cards.
| Method Detail |
|---|
public boolean add(java.lang.Object o)
add in interface java.util.Collectionadd in interface java.util.Listadd in class java.util.ArrayListjava.lang.IllegalArgumentException - if o isn't a Card.public Card getCard(int index)
Card from the specified index.
public Card removeCard(int i)
Card at the specified index.
|
-footer | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||