KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jresearch > gossip > beans > forum > Message


1 /*
2  * $$Id: Message.java,v 1.4 2005/06/08 08:04:12 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 07.05.2003
27  *
28  */

29 package org.jresearch.gossip.beans.forum;
30
31 import java.io.Serializable JavaDoc;
32 import java.util.ArrayList JavaDoc;
33
34 import org.jresearch.gossip.beans.forum.attachment.FileDataInfo;
35 import org.jresearch.gossip.beans.user.Sender;
36
37 /**
38  * DOCUMENT ME!
39  *
40  * @author Bel
41  */

42 public class Message extends SimpleMessage implements Serializable JavaDoc {
43
44     /**
45      *
46      */

47     private static final long serialVersionUID = 4640143925442759279L;
48
49     private String JavaDoc ip;
50
51     private Sender senderInfo;
52
53     private int threadSort;
54
55     private ArrayList JavaDoc attachments = new ArrayList JavaDoc();
56
57     /**
58      * @param attachments
59      * The attachments to set.
60      */

61     public void setAttachments(ArrayList JavaDoc attachments) {
62         this.attachments = attachments;
63     }
64
65
66     /**
67      * @param fd
68      */

69     public void addFile(FileDataInfo fd) {
70         this.attachments.add(fd);
71     }
72
73     /**
74      * @return
75      */

76     public FileDataInfo[] getAttachments() {
77         int count = this.attachments.size();
78         FileDataInfo[] fdArray = new FileDataInfo[count];
79         for (int i = 0; i < count; i++) {
80             fdArray[i] = (FileDataInfo) this.attachments.get(i);
81         }
82         return fdArray;
83     }
84
85     /**
86      * @return
87      */

88     public boolean isHasAttachment() {
89         return this.attachments.size() > 0;
90     }
91
92     /**
93      * DOCUMENT ME!
94      *
95      * @return
96      */

97     public String JavaDoc getIp() {
98         return ip;
99     }
100
101     /**
102      * DOCUMENT ME!
103      *
104      * @param string
105      */

106     public void setIp(String JavaDoc string) {
107         ip = string;
108     }
109
110     /**
111      * DOCUMENT ME!
112      *
113      * @return
114      */

115     public Sender getSenderInfo() {
116         return senderInfo;
117     }
118
119     /**
120      * DOCUMENT ME!
121      *
122      * @param user
123      */

124     public void setSenderInfo(Sender user) {
125         senderInfo = user;
126     }
127
128     /**
129      * DOCUMENT ME!
130      *
131      * @return
132      */

133     public int getThreadSort() {
134         return threadSort;
135     }
136
137     /**
138      * DOCUMENT ME!
139      *
140      * @param i
141      */

142     public void setThreadSort(int i) {
143         threadSort = i;
144     }
145 }
Popular Tags