|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.ObjectBag
public class Bag
A simple stack holding all the Tiles
| Field Summary | |
|---|---|
java.util.Stack<Tile> |
Tiles
|
| Constructor Summary | |
|---|---|
Bag()
|
|
Bag(java.util.ArrayList<Tile> tiles)
Initializes the bag from an ArrayList of Tiles |
|
Bag(Tile[] Tiles)
Initializes the bag fom an array of Tiles |
|
| Method Summary | |
|---|---|
void |
addTile(Tile tile)
Adds a tile to the bag |
void |
clear()
Clears all the Tiles from the bag |
static Bag |
createBag()
Creates the scabble set of Tiles. |
boolean |
empty()
Returns true if the bag is empty, otherwise false. |
Tile |
getTile()
gets a random Tile |
java.util.ArrayList<Tile> |
getTiles()
|
void |
initTiles(Tile[] Tiles)
Fills the bag with a new set of Tiles |
void |
setTiles(java.util.ArrayList<Tile> tiles)
|
void |
setTiles(java.util.Stack<Tile> tiles)
|
void |
shake()
Shake the bag! |
Tile |
swapTile(Tile Tile)
Put back a Tile, shake the bag, and get a new Tile |
java.lang.String |
toString()
Prints the contents of the bag |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public java.util.Stack<Tile> Tiles
| Constructor Detail |
|---|
public Bag()
public Bag(Tile[] Tiles)
public Bag(java.util.ArrayList<Tile> tiles)
| Method Detail |
|---|
public void setTiles(java.util.Stack<Tile> tiles)
public void setTiles(java.util.ArrayList<Tile> tiles)
public java.util.ArrayList<Tile> getTiles()
public void shake()
public boolean empty()
public void initTiles(Tile[] Tiles)
Tiles - public void clear()
public Tile getTile()
public void addTile(Tile tile)
public Tile swapTile(Tile Tile)
public static Bag createBag()
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||