1 package org.ozoneDB.adminGui.feature.account; 8 9 import java.util.Vector ; 10 11 12 21 23 public class AccountItem { 24 25 26 private String name = null; 27 28 private int id = 0; 29 30 private boolean admin = false; 31 32 private Vector children = new Vector (); 33 34 35 41 public AccountItem(String name, int id) { 42 this.name = name; 44 this.id = id; 45 } 46 47 52 public String toString() { 53 return this.name; 54 } 55 56 61 public int getId() { 62 return this.id; 63 } 64 65 71 public boolean isAdmin() { 72 return this.admin; 73 } 74 75 81 public int getIndexOfChild(AccountItem item) { 82 if (this.children != null) 84 return this.children.indexOf(item); 85 86 else 88 return -1; 89 } 90 91 97 public AccountItem getChildAt(int i) { 98 if (this.children != null) 100 return (AccountItem) this.children.elementAt(i); 101 102 else 104 return null; 105 } 106 107 112 public int getChildCount() { 113 if (this.children != null) 115 return this.children.size(); 116 117 else 119 return 0; 120 } 121 122 127 public void setChildren(Vector children) { 128 this.children = children; 129 130 if (this.children == null) 131 this.children = new Vector (); 132 } 133 134 139 public Vector getChildren() { 140 return this.children; 141 } 142 143 148 public void addChild(AccountItem item) { 149 this.children.add(item); 150 } 151 152 157 public void removeChild(AccountItem item) { 158 this.children.remove(item); 159 } 160 161 } 163 | Popular Tags |