1 53 54 106 107 110 111 package com.Yasna.forum.util.tree; 112 113 import java.io.*; 114 import java.util.Vector ; 115 116 public class Tree implements TreeInterface, Serializable { 117 118 private Vector children; 119 private int selected; 120 private String name; 121 122 public static int NODE = 0; 123 public static int LEAF = 1; 124 125 public Tree() { 126 children = new Vector (); 127 } 128 129 public Tree( String name ) { 130 this.name = name; 131 children = new Vector (); 132 } 133 134 public String getName() { 135 return this.name; 136 } 137 public void setName( String name ) { 138 this.name = name; 139 } 140 141 public int getSelected() { 142 return this.selected; 143 } 144 145 public void setSelected( int selected ) { 146 this.selected = selected; 147 } 148 149 public void addChild (TreeObject child) { 150 children.addElement(child); 151 } 152 153 public TreeObject getChild(int index) { 154 return (TreeObject)children.elementAt(index); 155 } 156 157 public int size() { 158 return children.size(); 159 } 160 } 161 | Popular Tags |