Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class BTNode implements Position{
- String word;
- int wordCounter=0;
- BTNode left, right, parent;
- public BTNode(String s, BTNode u, BTNode v, BTNode w){
- word = s; // ?setElement(word);
- left = u; //???setLeft(left);
- right = v; //???setRight(right);
- parent = w; //????setParent(parent);
- }
- public String getElement() { //I think same as getElement()
- return word;
- }
- public int getWordCounter() { ///that's it ? or more?
- return wordCounter;
- }
- public void increaseWordCounter() { ///not sure if we have to do more here
- wordCounter++;
- }
- //-----------------------------------
- public BTNode getLeft() {
- return left;
- }
- public void setLeft(BTNode v) {
- left = v;
- }
- public BTNode getRight() {
- return right;
- }
- public void setRight(BTNode v) {
- right = v;
- }
- public BTNode getParent() {
- return parent;
- }
- public void setParent(BTNode v) {
- parent = v;
- }
- /*
- public String getElement(){ //not sure with the given just element() method
- return word; //return the word at a specific position using interface Position;
- }
- */
- public void setElement(String e){
- word = e;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement