KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jresearch > gossip > beans > user > EntryList


1 /*
2  * $$Id: EntryList.java,v 1.3 2005/06/07 12:32:15 bel70 Exp $$
3  *
4  * ***** BEGIN LICENSE BLOCK *****
5  * The contents of this file are subject to the Mozilla Public License
6  * Version 1.1 (the "License"); you may not use this file except in
7  * compliance with the License. You may obtain a copy of the License
8  * at http://www.mozilla.org/MPL/
9  *
10  * Software distributed under the License is distributed on an "AS IS"
11  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
12  * the License for the specific language governing rights and
13  * limitations under the License.
14  *
15  * The Original Code is JGossip forum code.
16  *
17  * The Initial Developer of the Original Code is the JResearch, Org.
18  * Portions created by the Initial Developer are Copyright (C) 2004
19  * the Initial Developer. All Rights Reserved.
20  *
21  * Contributor(s):
22  * Dmitry Belov <bel@jresearch.org>
23  *
24  * ***** END LICENSE BLOCK ***** */

25 /*
26  * Created on Oct 16, 2003
27  *
28  */

29 package org.jresearch.gossip.beans.user;
30
31 import java.util.HashMap JavaDoc;
32 import java.util.Set JavaDoc;
33
34 /**
35  * DOCUMENT ME!
36  *
37  * @author dbelov
38  */

39 public class EntryList {
40     private int total;
41
42     private HashMap JavaDoc logged = new HashMap JavaDoc();
43
44     /**
45      * DOCUMENT ME!
46      *
47      * @return
48      */

49     public int getTotal() {
50         return total;
51     }
52
53     /**
54      * DOCUMENT ME!
55      *
56      * @param i
57      */

58     public void setTotal(int i) {
59         total = i;
60     }
61
62     /**
63      * DOCUMENT ME!
64      *
65      * @param entry
66      * DOCUMENT ME!
67      */

68     public void put(Entry entry) {
69         logged.put(entry.getLogin(), entry);
70     }
71
72     /**
73      * DOCUMENT ME!
74      *
75      * @param login
76      * DOCUMENT ME!
77      *
78      * @return DOCUMENT ME!
79      */

80     public Entry get(String JavaDoc login) {
81         return (Entry) logged.get(login);
82     }
83
84     /**
85      * DOCUMENT ME!
86      *
87      * @return DOCUMENT ME!
88      */

89     public int getLoggedCount() {
90         return logged.size();
91     }
92
93     /**
94      * DOCUMENT ME!
95      *
96      * @param login
97      * DOCUMENT ME!
98      */

99     public void remove(String JavaDoc login) {
100         logged.remove(login);
101     }
102
103     /**
104      * DOCUMENT ME!
105      *
106      * @return DOCUMENT ME!
107      */

108     public Set JavaDoc getLoggedUsers() {
109         return logged.keySet();
110     }
111
112     /**
113      * DOCUMENT ME!
114      *
115      * @return DOCUMENT ME!
116      */

117     public int getGuestsCount() {
118         return this.total - logged.size();
119     }
120
121 }
122
Popular Tags