public class PTNode { private String elem; private PTNode [ ] child = new PTNode [26]; //constructor takes a String public PTNode (String w) { elem = w; } //retrieve the String contained within the node public String getElem ( ) { return elem; } //set the String within the node public void setElem (String w) { elem = w; } //get a reference to a specific child of this node public PTNode getChild (char ch) { return child[ch - 'a']; //this uses char arithmetic so the indexing will work correctly } //set a child of this node at the right index, with a String public void setChild (char ch, String w) { child[ch - 'a'] = new PTNode (w); } }