KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > ejb > test > ops > Node


1 //$Id: Node.java,v 1.2 2005/07/09 20:04:44 epbernard Exp $
2
package org.hibernate.ejb.test.ops;
3
4 import java.util.HashSet JavaDoc;
5 import java.util.Set JavaDoc;
6
7 /**
8  * @author Gavin King
9  */

10 public class Node {
11     private String JavaDoc name;
12     private Node parent;
13     private Set JavaDoc children = new HashSet JavaDoc();
14     private String JavaDoc description;
15
16     public Node() {
17     }
18
19     public Node(String JavaDoc name) {
20         this.name = name;
21     }
22
23     public Set JavaDoc getChildren() {
24         return children;
25     }
26
27     public void setChildren(Set JavaDoc children) {
28         this.children = children;
29     }
30
31     public String JavaDoc getName() {
32         return name;
33     }
34
35     public void setName(String JavaDoc 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 JavaDoc getDescription() {
54         return description;
55     }
56
57     public void setDescription(String JavaDoc description) {
58         this.description = description;
59     }
60 }
61
Popular Tags