/* AnimalTreeInfo.java Written by Kim Bruce, 4/13/97 */ /* Class with information on nodes in tree for animals game. */ public class AnimalTreeInfo{ // fields protected boolean isNodeAnimal; // true iff node represents animal protected String contents; // question or answer held in node // constructor /* Create node. If answer then set isAnimal true and QuesAns with the animal name. If question then set isAnimal false and QuesAns has the question. */ public AnimalTreeInfo(boolean isAnimal, String QuesAns) { isNodeAnimal = isAnimal; contents = QuesAns; } // methods /* post: Return true iff node represent animal. */ public boolean isAnimal() { return isNodeAnimal; } /* post: Return contents of node (either question or answer). */ public String getContents() { return contents; } }