dbrown
Class PhraseList
java.lang.Object
dbrown.PhraseList
public class PhraseList
- extends java.lang.Object
Phrases are stored in a text file and processed by this class. Phrases may be
repeated within a game as they are randomly selected from the list.
- Version:
- 2011-11-11
- Author:
- David Brown (from Byron Weber Becker)
Field Summary |
private java.util.ArrayList<java.lang.String> |
phrases
Contains the list of phrases for the user to guess. |
private java.util.Random |
rand
A random number generator object. |
Constructor Summary |
PhraseList(java.lang.String filename)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
phrases
private final java.util.ArrayList<java.lang.String> phrases
- Contains the list of phrases for the user to guess.
rand
private final java.util.Random rand
- A random number generator object.
PhraseList
public PhraseList(java.lang.String filename)
throws java.io.FileNotFoundException
- Parameters:
filename
- - the name of the text file containing the list of phrases to
process
- Throws:
java.io.FileNotFoundException
randomPhrase
public java.lang.String randomPhrase()
- Returns:
- a random phrase from the list of phrases