KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > chipchat > RoomInfo


1 /*
2  * Created on 2003. 2. 20.
3  */

4 package chipchat;
5
6 /**
7  * Store Room information temporary.
8  * @author Mr. Lee
9  */

10 public class RoomInfo {
11    /**
12     * Room name.
13     */

14    private final String JavaDoc name;
15    /**
16     * Maxinum number of visitor.
17     */

18    private final int max;
19    /**
20     * The number of presence man in room.
21     */

22    private final int users;
23    /**
24     * Id of room.
25     */

26    private final long roomid;
27    /**
28     * Is have password of room.
29     */

30    private final boolean passwd;
31
32    /**
33     * Constructor.
34     * @param room Room instance.
35     */

36    public RoomInfo(final Room room) {
37       this.name = room.getRoomName();
38       this.max = room.getMaxMan();
39       this.users = room.getUsers().size();
40       this.roomid = room.getRoomid().longValue();
41       String JavaDoc roomPassword = room.getPasswd();
42       this.passwd = (roomPassword != null && (!"".equals(roomPassword)));
43    }
44
45    /**
46     * Getter of max.
47     * @return Maxinum number of visitor.
48     */

49    public final int getMax() {
50       return max;
51    }
52
53    /**
54     * Getter of name
55     * @return Room name.
56     */

57    public final String JavaDoc getName() {
58       return name;
59    }
60
61    /**
62     * Getter of passwd
63     * @return Is have password of room?
64     */

65    public final boolean isPasswd() {
66       return passwd;
67    }
68
69    /**
70     * Getter of roomid
71     * @return Id of room.
72     */

73    public final long getRoomid() {
74       return roomid;
75    }
76
77    /**
78     * Getter of users
79     * @return The number of presence man in room.
80     */

81    public final int getUsers() {
82       return users;
83    }
84 }
85
Popular Tags