|
||||||||
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.AbstractSequentialList<E>
java.util.LinkedList<Card>
CardPile
public class CardPile
This class stores a collection of playing cards in a linked list format.
Field Summary |
---|
Fields inherited from class java.util.AbstractList |
---|
modCount |
Constructor Summary | |
---|---|
CardPile(Card[] cards,
int x,
int y)
Constructor puts array of cards into pile |
|
CardPile(CardPile pile)
Copy constructor |
|
CardPile(int x,
int y)
Constructor initializes location of empty pile |
Method Summary | |
---|---|
void |
append(CardPile suffix)
Appends the provided suffix onto this list. |
void |
draw(java.awt.Graphics g)
Draws the pile at its location on the table. |
int |
getX()
Accessor for x coordinate of pile |
int |
getY()
Accessor for y coordinate of pile |
void |
insertAfter(Card card,
Card mark)
Insert a card node after the specified marker |
void |
insertAfter(CardPile insert,
Card mark)
Inserts a one pile into another, leaving the inserted pile empty |
void |
insertBefore(Card card,
Card mark)
Insert a card node before the specified marker |
void |
insertBefore(CardPile insert,
Card mark)
Inserts a one pile into another, leaving the inserted pile empty |
java.util.ListIterator<Card> |
iteratorAfter(Card mark)
Find an iterator just after the mark |
java.util.ListIterator<Card> |
iteratorBefore(Card mark)
Find an iterator just before the mark |
Card |
locateCard(int x,
int y)
Determine if the specified click falls upon a card in this pile. |
void |
print()
Prints a representation of a CardPile |
void |
setX(int x)
Manipulator for x coordinate of pile |
void |
setY(int y)
Manipulator for y coordinate of pile |
CardPile |
split(Card mark)
Moves every element after the mark into a new pile. |
Methods inherited from class java.util.LinkedList |
---|
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, descendingIterator, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, set, size, toArray, toArray |
Methods inherited from class java.util.AbstractSequentialList |
---|
iterator |
Methods inherited from class java.util.AbstractList |
---|
equals, hashCode, listIterator, removeRange, subList |
Methods inherited from class java.util.AbstractCollection |
---|
containsAll, isEmpty, 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, isEmpty, iterator, listIterator, removeAll, retainAll, subList |
Methods inherited from interface java.util.Deque |
---|
iterator |
Constructor Detail |
---|
public CardPile(int x, int y)
public CardPile(CardPile pile)
public CardPile(Card[] cards, int x, int y)
Method Detail |
---|
public int getX()
public int getY()
public void setX(int x)
public void setY(int y)
public java.util.ListIterator<Card> iteratorBefore(Card mark)
mark
- New card goes before this onepublic java.util.ListIterator<Card> iteratorAfter(Card mark)
mark
- New card goes before this onepublic void insertBefore(Card card, Card mark)
node
- The card to insertmark
- New card goes before this onepublic void insertAfter(Card card, Card mark)
card
- The card to insertmark
- New card goes after this onepublic void insertBefore(CardPile insert, Card mark)
insert
- list to insertmark
- insert before this cardpublic void insertAfter(CardPile insert, Card mark)
insert
- list to insertmark
- insert after this pointpublic CardPile split(Card mark)
mark
- elements including and after this are moved
public void append(CardPile suffix)
suffix
- list to append and emptypublic void draw(java.awt.Graphics g)
g
- Graphics object to draw intopublic Card locateCard(int x, int y)
x
- Coordinate of mouse clicky
- Coordinate of mouse click
public void print()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |