|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.ObjectBag
This class contains the bag of letters for a current ScrabbleBuilder. Class also provides methods for operating on the bag of letters.
Game,
Letter| Constructor Summary | |
Bag(ScrabbleBuilder builder)
Constructs a new bag for a given Scrabblebuilder |
|
| Method Summary | |
int |
getBagValue()
Returns an int containing the current score sum of the bag. |
Letter |
getLetter(int i)
Returns a Letter at a specific i in the bag. |
java.util.List |
getLetters()
Returns a List, the bag. |
int |
getSize()
Returns an int containing the current size of the bag. |
java.util.List |
giveLetters(int giving)
Allocates a random selection of new letters to a list, the size of the required number of letters. |
java.util.List |
giveLetters(int giving,
boolean remote)
Overloaded method of giveLetters. |
boolean |
isEmpty()
Tests to see whether the bag of letters is empty. |
void |
replaceLetters(java.util.List list)
Method takes a list of letters and replaces (into the bag) all letters from the list |
void |
setLetters(java.util.List letters)
Sets the current bag to be the input List letters. |
java.lang.String |
toString()
Returns a String representation of the bag. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public Bag(ScrabbleBuilder builder)
builder - The ScrabbleBuilder of the game you'd like to create a bag for.| Method Detail |
public Letter getLetter(int i)
i - The specific location in the bag of the letter to return.
public int getBagValue()
public int getSize()
public java.util.List getLetters()
public boolean isEmpty()
public void setLetters(java.util.List letters)
letters - A List containing the letters the bag should be set to.public java.lang.String toString()
public java.util.List giveLetters(int giving)
giving - The number of letters needed to be returned to the rack.
public java.util.List giveLetters(int giving,
boolean remote)
giving - The number of letters needing to be replaced in the rack.remote - A field used to denote a call to this overloaded method.
public void replaceLetters(java.util.List list)
list - The list of letters to replace into the bag.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||