KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mmbase > applications > packaging > sharehandlers > ShareGroup


1 /*
2  * This software is OSI Certified Open Source Software.
3  * OSI Certified is a certification mark of the Open Source Initiative.
4  * The license (Mozilla version 1.0) can be read at the MMBase site.
5  * See http://www.MMBase.org/license
6  */

7 package org.mmbase.applications.packaging.sharehandlers;
8
9 import java.util.HashMap JavaDoc;
10 import java.util.Iterator JavaDoc;
11
12 import org.mmbase.applications.packaging.ShareManager;
13
14 /**
15  * @author Daniel Ockeloen
16  */

17 public class ShareGroup {
18
19     private String JavaDoc name;
20
21     private HashMap JavaDoc members = new HashMap JavaDoc();
22
23
24     /**
25      *Constructor for the ShareGroup object
26      *
27      * @param name Description of the Parameter
28      */

29     public ShareGroup(String JavaDoc name) {
30         this.name = name;
31     }
32
33
34     /**
35      * Sets the name attribute of the ShareGroup object
36      *
37      * @param name The new name value
38      */

39     public void setName(String JavaDoc name) {
40         this.name = name;
41     }
42
43
44     /**
45      * Gets the name attribute of the ShareGroup object
46      *
47      * @return The name value
48      */

49     public String JavaDoc getName() {
50         return name;
51     }
52
53
54     /**
55      * Adds a feature to the Member attribute of the ShareGroup object
56      *
57      * @param name The feature to be added to the Member attribute
58      * @return Description of the Return Value
59      */

60     public boolean addMember(String JavaDoc name) {
61         ShareUser su = ShareManager.getShareUser(name);
62         if (su != null) {
63             members.put(name, su);
64         }
65         return false;
66     }
67
68
69     /**
70      * Description of the Method
71      *
72      * @param name Description of the Parameter
73      * @return Description of the Return Value
74      */

75     public boolean removeMember(String JavaDoc name) {
76         members.remove(name);
77         return false;
78     }
79
80
81     /**
82      * Gets the members attribute of the ShareGroup object
83      *
84      * @return The members value
85      */

86     public Iterator JavaDoc getMembers() {
87         return members.values().iterator();
88     }
89 }
90
91
Popular Tags