KickJava   Java API By Example, From Geeks To Geeks.

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


1 //$Id: Node.java,v 1.4 2005/06/20 03:19:34 oneovthafew Exp $
2
package org.hibernate.test.ops;
3
4 import java.util.Date JavaDoc;
5 import java.util.HashSet JavaDoc;
6 import java.util.Set JavaDoc;
7
8 /**
9  * @author Gavin King
10  */

11 public class Node {
12     
13     private String JavaDoc name;
14     private Node parent;
15     private Set JavaDoc children = new HashSet JavaDoc();
16     private String JavaDoc description;
17     private Date JavaDoc created;
18     
19     public Node() {}
20     
21     public Node(String JavaDoc name) {
22         this.name = name;
23         created = new Date JavaDoc();
24     }
25     
26     public Set JavaDoc getChildren() {
27         return children;
28     }
29     public void setChildren(Set JavaDoc children) {
30         this.children = children;
31     }
32     public String JavaDoc getName() {
33         return name;
34     }
35     public void setName(String JavaDoc name) {
36         this.name = name;
37     }
38     public Node getParent() {
39         return parent;
40     }
41     public void setParent(Node parent) {
42         this.parent = parent;
43     }
44     
45     public Node addChild(Node child) {
46         children.add(child);
47         child.setParent(this);
48         return this;
49     }
50     public String JavaDoc getDescription() {
51         return description;
52     }
53     public void setDescription(String JavaDoc description) {
54         this.description = description;
55     }
56
57     public Date JavaDoc getCreated() {
58         return created;
59     }
60
61     public void setCreated(Date JavaDoc created) {
62         this.created = created;
63     }
64 }
65
Popular Tags