|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectAnimalGuess
public class AnimalGuess
The AnimalGuess Java application illustrates the use of
the binary tree node class is a small animal-guessing game.
| Constructor Summary | |
|---|---|
AnimalGuess()
|
|
| Method Summary | |
|---|---|
static BTNode<java.lang.String> |
beginningTree()
Construct a small taxonomy tree with four animals. |
static void |
instruct()
Print instructions for the animal-guessing game. |
static void |
learn(BTNode<java.lang.String> current)
Elicits information from the user to improve a binary taxonomy tree. |
static void |
main(java.lang.String[] args)
The main method prints instructions and repeatedly plays the animal-guessing game. |
static void |
play(BTNode<java.lang.String> current)
Play one round of the animal guessing game. |
static boolean |
query(java.lang.String prompt)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AnimalGuess()
| Method Detail |
|---|
public static void main(java.lang.String[] args)
String argument
(args) is not used in this implementation.
public static void instruct()
public static void play(BTNode<java.lang.String> current)
current - a reference to the root node of a binary taxonomy tree that will be
used to play the game.
java.lang.OutOfMemoryError - Indicates that there is insufficient memory to add new
information to the tree.public static BTNode<java.lang.String> beginningTree()
- - none
java.lang.OutOfMemoryError - Indicates that there is insufficient memory to create the tree.public static void learn(BTNode<java.lang.String> current)
current - a reference to a leaf node of a binary taxonomy tree
current is a reference to a leaf in a binary
taxonomy tree
java.lang.OutOfMemoryError - Indicates that there is insufficient memory to add new
information to the tree.public static boolean query(java.lang.String prompt)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||