1 package org.hibernate.ejb.test.ops; 3 4 import java.util.HashSet ; 5 import java.util.Set ; 6 7 10 public class Node { 11 private String name; 12 private Node parent; 13 private Set children = new HashSet (); 14 private String description; 15 16 public Node() { 17 } 18 19 public Node(String name) { 20 this.name = name; 21 } 22 23 public Set getChildren() { 24 return children; 25 } 26 27 public void setChildren(Set children) { 28 this.children = children; 29 } 30 31 public String getName() { 32 return name; 33 } 34 35 public void setName(String name) { 36 this.name = name; 37 } 38 39 public Node getParent() { 40 return parent; 41 } 42 43 public void setParent(Node parent) { 44 this.parent = parent; 45 } 46 47 public Node addChild(Node child) { 48 children.add( child ); 49 child.setParent( this ); 50 return this; 51 } 52 53 public String getDescription() { 54 return description; 55 } 56 57 public void setDescription(String description) { 58 this.description = description; 59 } 60 } 61 | Popular Tags |