|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An aspect of the Model. This inferface provides the methods neccessary to
manipulate the dictionary data and word history data. The interface could
be implemented by the same concrete class that implements IBoggleModel,
or it could be a separate class. For use with the 143 Mix Matcher, a separate class
would have to be inside the same compilation unit, i.e., .java file, as
the main Model class.
Method Summary | |
void |
addToDictionary(String[] words)
Add new words to dictionary, without changing what was already there. |
void |
addToHistory(String acceptedProposal)
Add the accepted proposal to the history. |
void |
emptyHistory()
Clear the history list. |
List |
getHistory()
get a history (list) of all accepted words in the current game. |
boolean |
isValidPosition(int row,
int col)
Determine if the selected square of the board is a legal position for the next letter of the word being developed. |
int |
isValidWord(String proposal)
Determine if the word proposed is valid or not. |
boolean |
loadDictionary(String fileID)
Load a dictionary from a resource (file). |
void |
setDictionary(Collection dict)
set the dictionary to be a given one. |
Method Detail |
public boolean loadDictionary(String fileID)
fileID
- a String which specifies the place to load the resource from.
public void setDictionary(Collection dict)
dict
- a non-null collection used to set the dictionary
to an external source.public void addToDictionary(String[] words)
words
- an array of strings to store in dictionary; each string
should be non-null and non-empty.public boolean isValidPosition(int row, int col)
row
- specify the row of the letter selected.col
- specify the column of the letter selected.
public int isValidWord(String proposal)
proposal
- a String contains the word being proposed.
public List getHistory()
public void emptyHistory()
public void addToHistory(String acceptedProposal)
acceptedProposal
- a string that to be added to the history
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |