KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > lucane > common > concepts > GroupConcept


1 /*
2  * Lucane - a collaborative platform
3  * Copyright (C) 2003 Vincent Fiack <vfiack@mail15.com>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  */

19  
20 package org.lucane.common.concepts;
21
22 import java.util.*;
23
24 public class GroupConcept extends Concept
25 {
26     //links
27
private ArrayList parents;
28     private ArrayList services;
29     private ArrayList plugins;
30     private ArrayList users;
31     
32     public GroupConcept(String JavaDoc 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     //-- parents
43

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     //-- services
66

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     //-- plugins
88

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     //-- users
110

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     //--
137

138     public boolean equals(Object JavaDoc o)
139     {
140         if(o instanceof GroupConcept)
141             return this.name.equals(((GroupConcept)o).name);
142
143         return false;
144     }
145 }
Popular Tags