KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > mvnforum > db > MessageStatisticsBean


1 /*
2  * $Header: /cvsroot/mvnforum/mvnforum/src/com/mvnforum/db/MessageStatisticsBean.java,v 1.5 2006/04/14 17:05:26 minhnn Exp $
3  * $Author: minhnn $
4  * $Revision: 1.5 $
5  * $Date: 2006/04/14 17:05:26 $
6  *
7  * ====================================================================
8  *
9  * Copyright (C) 2002-2006 by MyVietnam.net
10  *
11  * All copyright notices regarding mvnForum MUST remain
12  * intact in the scripts and in the outputted HTML.
13  * The "powered by" text/logo with a link back to
14  * http://www.mvnForum.com and http://www.MyVietnam.net in
15  * the footer of the pages MUST remain visible when the pages
16  * are viewed on the internet or intranet.
17  *
18  * This program is free software; you can redistribute it and/or modify
19  * it under the terms of the GNU General Public License as published by
20  * the Free Software Foundation; either version 2 of the License, or
21  * any later version.
22  *
23  * This program is distributed in the hope that it will be useful,
24  * but WITHOUT ANY WARRANTY; without even the implied warranty of
25  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26  * GNU General Public License for more details.
27  *
28  * You should have received a copy of the GNU General Public License
29  * along with this program; if not, write to the Free Software
30  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
31  *
32  * Support can be obtained from support forums at:
33  * http://www.mvnForum.com/mvnforum/index
34  *
35  * Correspondence and Marketing Questions can be sent to:
36  * info at MyVietnam net
37  *
38  * @author: Minh Nguyen
39  */

40 package com.mvnforum.db;
41
42 import java.sql.Timestamp JavaDoc;
43 import java.util.Collection JavaDoc;
44 import java.util.Iterator JavaDoc;
45
46 /*
47  * Included columns: FromID, ToID, MessageCreationDate, MessageAttachCount, MessageType,
48  * MessageOption, MessageStatus
49  * Excluded columns:
50  */

51 public class MessageStatisticsBean {
52     private int fromID;
53     private int toID;
54     private Timestamp JavaDoc messageCreationDate;
55     private int messageAttachCount;
56     private int messageType;
57     private int messageOption;
58     private int messageStatus;
59
60     public int getFromID() {
61         return fromID;
62     }
63     public void setFromID(int fromID) {
64         this.fromID = fromID;
65     }
66
67     public int getToID() {
68         return toID;
69     }
70     public void setToID(int toID) {
71         this.toID = toID;
72     }
73
74     public Timestamp JavaDoc getMessageCreationDate() {
75         return messageCreationDate;
76     }
77     public void setMessageCreationDate(Timestamp JavaDoc messageCreationDate) {
78         this.messageCreationDate = messageCreationDate;
79     }
80
81     public int getMessageAttachCount() {
82         return messageAttachCount;
83     }
84     public void setMessageAttachCount(int messageAttachCount) {
85         this.messageAttachCount = messageAttachCount;
86     }
87
88     public int getMessageType() {
89         return messageType;
90     }
91     public void setMessageType(int messageType) {
92         this.messageType = messageType;
93     }
94
95     public int getMessageOption() {
96         return messageOption;
97     }
98     public void setMessageOption(int messageOption) {
99         this.messageOption = messageOption;
100     }
101
102     public int getMessageStatus() {
103         return messageStatus;
104     }
105     public void setMessageStatus(int messageStatus) {
106         this.messageStatus = messageStatus;
107     }
108
109     public String JavaDoc getXML() {
110         StringBuffer JavaDoc xml = new StringBuffer JavaDoc(1024);
111         xml.append("<MessageStatisticsSection>\n");
112         xml.append(" <Rows>\n");
113         xml.append(" <Row>\n");
114         xml.append(" <Column>\n");
115         xml.append(" <Name>FromID</Name>\n");
116         xml.append(" <Value>").append(String.valueOf(fromID)).append("</Value>\n");
117         xml.append(" </Column>\n");
118         xml.append(" <Column>\n");
119         xml.append(" <Name>ToID</Name>\n");
120         xml.append(" <Value>").append(String.valueOf(toID)).append("</Value>\n");
121         xml.append(" </Column>\n");
122         xml.append(" <Column>\n");
123         xml.append(" <Name>MessageCreationDate</Name>\n");
124         xml.append(" <Value>").append(String.valueOf(messageCreationDate)).append("</Value>\n");
125         xml.append(" </Column>\n");
126         xml.append(" <Column>\n");
127         xml.append(" <Name>MessageAttachCount</Name>\n");
128         xml.append(" <Value>").append(String.valueOf(messageAttachCount)).append("</Value>\n");
129         xml.append(" </Column>\n");
130         xml.append(" <Column>\n");
131         xml.append(" <Name>MessageType</Name>\n");
132         xml.append(" <Value>").append(String.valueOf(messageType)).append("</Value>\n");
133         xml.append(" </Column>\n");
134         xml.append(" <Column>\n");
135         xml.append(" <Name>MessageOption</Name>\n");
136         xml.append(" <Value>").append(String.valueOf(messageOption)).append("</Value>\n");
137         xml.append(" </Column>\n");
138         xml.append(" <Column>\n");
139         xml.append(" <Name>MessageStatus</Name>\n");
140         xml.append(" <Value>").append(String.valueOf(messageStatus)).append("</Value>\n");
141         xml.append(" </Column>\n");
142         xml.append(" </Row>\n");
143         xml.append(" </Rows>\n");
144         xml.append("</MessageStatisticsSection>\n");
145         return xml.toString();
146     }
147
148     public static String JavaDoc getXML(Collection JavaDoc objMessageStatisticsBeans) {
149         StringBuffer JavaDoc xml = new StringBuffer JavaDoc(1024);
150         Iterator JavaDoc iterator = objMessageStatisticsBeans.iterator();
151         xml.append("<MessageStatisticsSection>\n");
152         xml.append(" <Rows>\n");
153         while (iterator.hasNext()) {
154             MessageStatisticsBean objMessageStatisticsBean = (MessageStatisticsBean)iterator.next();
155             xml.append(" <Row>\n");
156             xml.append(" <Column>\n");
157             xml.append(" <Name>FromID</Name>\n");
158             xml.append(" <Value>").append(String.valueOf(objMessageStatisticsBean.fromID)).append("</Value>\n");
159             xml.append(" </Column>\n");
160             xml.append(" <Column>\n");
161             xml.append(" <Name>ToID</Name>\n");
162             xml.append(" <Value>").append(String.valueOf(objMessageStatisticsBean.toID)).append("</Value>\n");
163             xml.append(" </Column>\n");
164             xml.append(" <Column>\n");
165             xml.append(" <Name>MessageCreationDate</Name>\n");
166             xml.append(" <Value>").append(String.valueOf(objMessageStatisticsBean.messageCreationDate)).append("</Value>\n");
167             xml.append(" </Column>\n");
168             xml.append(" <Column>\n");
169             xml.append(" <Name>MessageAttachCount</Name>\n");
170             xml.append(" <Value>").append(String.valueOf(objMessageStatisticsBean.messageAttachCount)).append("</Value>\n");
171             xml.append(" </Column>\n");
172             xml.append(" <Column>\n");
173             xml.append(" <Name>MessageType</Name>\n");
174             xml.append(" <Value>").append(String.valueOf(objMessageStatisticsBean.messageType)).append("</Value>\n");
175             xml.append(" </Column>\n");
176             xml.append(" <Column>\n");
177             xml.append(" <Name>MessageOption</Name>\n");
178             xml.append(" <Value>").append(String.valueOf(objMessageStatisticsBean.messageOption)).append("</Value>\n");
179             xml.append(" </Column>\n");
180             xml.append(" <Column>\n");
181             xml.append(" <Name>MessageStatus</Name>\n");
182             xml.append(" <Value>").append(String.valueOf(objMessageStatisticsBean.messageStatus)).append("</Value>\n");
183             xml.append(" </Column>\n");
184             xml.append(" </Row>\n");
185         }//while
186
xml.append(" </Rows>\n");
187         xml.append("</MessageStatisticsSection>\n");
188         return xml.toString();
189     }
190 } //end of class MessageStatisticsBean
191
Popular Tags