1 19 20 package org.lucane.common.concepts; 21 22 import java.util.*; 23 24 public class GroupConcept extends Concept 25 { 26 private ArrayList parents; 28 private ArrayList services; 29 private ArrayList plugins; 30 private ArrayList users; 31 32 public GroupConcept(String name) 33 { 34 super(name, ""); 35 this.parents = new ArrayList(); 36 this.services = new ArrayList(); 37 this.plugins = new ArrayList(); 38 this.users = new ArrayList(); 39 } 40 41 42 44 public void setParents(ArrayList parents) 45 { 46 this.parents = parents; 47 } 48 49 public void addParent(GroupConcept group) 50 { 51 this.parents.add(group); 52 } 53 54 public Iterator getParents() 55 { 56 return this.parents.iterator(); 57 } 58 59 public boolean hasParent(GroupConcept group) 60 { 61 return this.parents.contains(group); 62 } 63 64 65 67 public void setServices(ArrayList services) 68 { 69 this.services = services; 70 } 71 72 public void addService(ServiceConcept service) 73 { 74 this.services.add(service); 75 } 76 77 public Iterator getServices() 78 { 79 return this.services.iterator(); 80 } 81 82 public boolean hasService(ServiceConcept service) 83 { 84 return this.services.contains(service); 85 } 86 87 89 public void setPlugins(ArrayList plugins) 90 { 91 this.plugins = plugins; 92 } 93 94 public void addPlugin(PluginConcept plugin) 95 { 96 this.plugins.add(plugin); 97 } 98 99 public Iterator getPlugins() 100 { 101 return this.plugins.iterator(); 102 } 103 104 public boolean hasPlugin(PluginConcept plugin) 105 { 106 return this.plugins.contains(plugin); 107 } 108 109 111 public void setUsers(ArrayList users) 112 { 113 this.users = users; 114 } 115 116 public void addUser(UserConcept user) 117 { 118 this.users.add(user); 119 } 120 121 public Iterator getUsers() 122 { 123 return this.users.iterator(); 124 } 125 126 public void removeUser(UserConcept user) 127 { 128 this.users.remove(user); 129 } 130 131 public boolean hasUser(UserConcept user) 132 { 133 return this.users.contains(user); 134 } 135 136 138 public boolean equals(Object o) 139 { 140 if(o instanceof GroupConcept) 141 return this.name.equals(((GroupConcept)o).name); 142 143 return false; 144 } 145 } | Popular Tags |