01: /*
02: * NEMESIS-FORUM.
03: * Copyright (C) 2002 David Laurent(lithium2@free.fr). All rights reserved.
04: *
05: * Copyright (c) 2000 The Apache Software Foundation. All rights reserved.
06: *
07: * Copyright (C) 2001 Yasna.com. All rights reserved.
08: *
09: * Copyright (C) 2000 CoolServlets.com. All rights reserved.
10: *
11: * NEMESIS-FORUM. is free software; you can redistribute it and/or
12: * modify it under the terms of the Apache Software License, Version 1.1,
13: * or (at your option) any later version.
14: *
15: * NEMESIS-FORUM core framework, NEMESIS-FORUM backoffice, NEMESIS-FORUM frontoffice
16: * application are parts of NEMESIS-FORUM and are distributed under
17: * same terms of licence.
18: *
19: *
20: * NEMESIS-FORUM includes software developed by the Apache Software Foundation (http://www.apache.org/)
21: * and software developed by CoolServlets.com (http://www.coolservlets.com).
22: * and software developed by Yasna.com (http://www.yasna.com).
23: *
24: */
25:
26: package org.nemesis.forum.util.tree;
27:
28: import java.io.Serializable;
29:
30: public class TreeNode extends TreeObject implements TreeInterface,
31: Serializable {
32:
33: private String name;
34: private String link;
35: private boolean visible;
36: private Tree children;
37: private int id;
38:
39: public TreeNode(int id, String name) {
40: super (0);
41: this .id = id;
42: this .name = name;
43: visible = true;
44: children = new Tree();
45: }
46:
47: public TreeNode(int id, String name, String link) {
48: super (0);
49: this .id = id;
50: this .name = name;
51: this .link = link;
52: visible = true;
53: children = new Tree();
54: }
55:
56: public void addChild(TreeObject child) {
57: children.addChild(child);
58: }
59:
60: public int getId() {
61: return id;
62: }
63:
64: public String getName() {
65: return name;
66: }
67:
68: public String getLink() {
69: return link;
70: }
71:
72: public Tree getChildren() {
73: return children;
74: }
75:
76: public boolean isVisible() {
77: return visible;
78: }
79:
80: public void setId(int id) {
81: this .id = id;
82: }
83:
84: public void setName(String name) {
85: this .name = name;
86: }
87:
88: public void setLink(String link) {
89: this .link = link;
90: }
91:
92: public void setVisible(boolean value) {
93: visible = value;
94: }
95:
96: public void toggleVisible() {
97: visible = !visible;
98: }
99: }
|