1 15 package org.apache.tapestry.workbench.tree.examples; 16 17 import org.apache.tapestry.contrib.tree.model.IMutableTreeNode; 18 import org.apache.tapestry.contrib.tree.simple.TreeNode; 19 20 23 public class TestTreeNode extends TreeNode { 24 25 private String m_strValue; 26 27 30 public TestTreeNode(String strValue) { 31 this(null, strValue); 32 } 33 34 38 public TestTreeNode(IMutableTreeNode parentNode, String strValue) { 39 super(parentNode); 40 m_strValue = strValue; 41 } 42 43 public String toString(){ 44 return m_strValue; 45 } 46 47 public int hashCode(){ 48 return m_strValue.hashCode(); 49 } 50 51 public boolean equals(Object objTarget){ 52 if(objTarget == this) 53 return true; 54 if(! (objTarget instanceof TestTreeNode)) 55 return false; 56 57 TestTreeNode objTargetNode = (TestTreeNode)objTarget; 58 return this.getValue().equals(objTargetNode.getValue()); 59 } 60 61 65 public String getValue() { 66 return m_strValue; 67 } 68 69 } 70 | Popular Tags |