| 1 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 public void setName(String name) { 52 this.name = name; 53 } 54 55 public int getSelected() { 56 return this.selected; 57 } 58 59 public void setSelected(int selected) { 60 this.selected = selected; 61 } 62 63 public void addChild(TreeObject child) { 64 children.addElement(child); 65 } 66 67 public TreeObject getChild(int index) { 68 return (TreeObject) children.elementAt(index); 69 } 70 71 public int size() { 72 return children.size(); 73 } 74 } 75 | Popular Tags |