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: package org.nemesis.forum.util.tree;
26:
27: import java.io.Serializable;
28: import java.util.Vector;
29:
30: public class Tree implements TreeInterface, Serializable {
31:
32: private Vector children;
33: private int selected;
34: private String name;
35:
36: public static int NODE = 0;
37: public static int LEAF = 1;
38:
39: public Tree() {
40: children = new Vector();
41: }
42:
43: public Tree(String name) {
44: this .name = name;
45: children = new Vector();
46: }
47:
48: public String getName() {
49: return this .name;
50: }
51:
52: public void setName(String name) {
53: this .name = name;
54: }
55:
56: public int getSelected() {
57: return this .selected;
58: }
59:
60: public void setSelected(int selected) {
61: this .selected = selected;
62: }
63:
64: public void addChild(TreeObject child) {
65: children.addElement(child);
66: }
67:
68: public TreeObject getChild(int index) {
69: return (TreeObject) children.elementAt(index);
70: }
71:
72: public int size() {
73: return children.size();
74: }
75: }
|