| java.lang.Object model.WordGenerator
WordGenerator | public class WordGenerator implements Serializable(Code) | | The word generator is responsible for reading in a list of words from a data
file and serving them up in a random order. The generator keeps a state
record of which words it has served and randomises them again when the last
word has been served.
author: Chris Turner author: Geert Bevin version: 1.0 |
Constructor Summary | |
public | WordGenerator() Create the word generator, loading the words and preparing them for
serving. | public | WordGenerator(String[] words) Create the word generator using the supplied array of words as the word
source to use. |
Method Summary | |
public Word | next() Returns the next word from the word generator. | public int | size() Get the number of words that were discovered. |
WordGenerator | public WordGenerator()(Code) | | Create the word generator, loading the words and preparing them for
serving.
|
WordGenerator | public WordGenerator(String[] words)(Code) | | Create the word generator using the supplied array of words as the word
source to use.
Parameters: words - The words to use |
next | public Word next()(Code) | | Returns the next word from the word generator.
The next word |
size | public int size()(Code) | | Get the number of words that were discovered.
The number of words |
|
|