|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.ObjectRack
This class defines a Rack - a list of Letters. Each Player has a Rack. The methods defined in the class operate on Racks, so that a Letter can be extracted from an index, an index from a Letter, and so forth.
Game,
Player| Constructor Summary | |
Rack()
|
|
| Method Summary | |
void |
addLetters(java.util.List l)
Adds letters to the Rack. |
int |
getIndexOfLetter(Letter lett)
Gets an index from a Letter. |
Letter |
getLetter(int i)
Gets a Letter from the Rack at i. |
int |
getRackSize()
Returns the size of the Rack. |
int |
getRackValue()
Returns the value of the Rack as an int. |
int |
getReverseIndexOfLetter(Letter lett)
Similar to getIndexOfLetter, but only from the back of the rack. |
boolean |
isEmpty()
Return whether a Rack is empty or not. |
void |
removeLetters(java.util.List l)
Removes letters from the Rack. |
void |
setLetter(int i,
Letter lett)
Sets the Letter at i on the Rack. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public Rack()
| Method Detail |
public void addLetters(java.util.List l)
l - List containing the letters to be added.public void removeLetters(java.util.List l)
l - The List of Letters to be removed from the Rack.public Letter getLetter(int i)
i - The index of the letter we require.
public int getIndexOfLetter(Letter lett)
lett - The Letter we require an index for.
public int getReverseIndexOfLetter(Letter lett)
lett - The Letter we require an index for.
public int getRackSize()
public int getRackValue()
public boolean isEmpty()
public void setLetter(int i,
Letter lett)
i - The index of the Rack we'd like to set.lett - The letter we'd like to set on the Rack.public java.lang.String toString()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||