|
What this is
Other links
The source code/* * $Header: /cvsroot/mvnforum/mvnforum/src/com/mvnforum/db/MessageStatisticsBean.java,v 1.3 2005/01/18 11:52:18 minhnn Exp $ * $Author: minhnn $ * $Revision: 1.3 $ * $Date: 2005/01/18 11:52:18 $ * * ==================================================================== * * Copyright (C) 2002-2005 by MyVietnam.net * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or any later version. * * All copyright notices regarding mvnForum MUST remain intact * in the scripts and in the outputted HTML. * The "powered by" text/logo with a link back to * http://www.mvnForum.com and http://www.MyVietnam.net in the * footer of the pages MUST remain visible when the pages * are viewed on the internet or intranet. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * Support can be obtained from support forums at: * http://www.mvnForum.com/mvnforum/index * * Correspondence and Marketing Questions can be sent to: * info@MyVietnam.net * * @author: Minh Nguyen minhnn@MyVietnam.net */ package com.mvnforum.db; import java.sql.Timestamp; import java.util.Collection; import java.util.Iterator; /* * Included columns: FromID, ToID, MessageCreationDate, MessageAttachCount, MessageType, * MessageOption, MessageStatus * Excluded columns: */ public class MessageStatisticsBean { private int fromID; private int toID; private Timestamp messageCreationDate; private int messageAttachCount; private int messageType; private int messageOption; private int messageStatus; public int getFromID() { return fromID; } public void setFromID(int fromID) { this.fromID = fromID; } public int getToID() { return toID; } public void setToID(int toID) { this.toID = toID; } public Timestamp getMessageCreationDate() { return messageCreationDate; } public void setMessageCreationDate(Timestamp messageCreationDate) { this.messageCreationDate = messageCreationDate; } public int getMessageAttachCount() { return messageAttachCount; } public void setMessageAttachCount(int messageAttachCount) { this.messageAttachCount = messageAttachCount; } public int getMessageType() { return messageType; } public void setMessageType(int messageType) { this.messageType = messageType; } public int getMessageOption() { return messageOption; } public void setMessageOption(int messageOption) { this.messageOption = messageOption; } public int getMessageStatus() { return messageStatus; } public void setMessageStatus(int messageStatus) { this.messageStatus = messageStatus; } public String getXML() { StringBuffer xml = new StringBuffer(1024); xml.append("<MessageStatisticsSection>\n"); xml.append(" <Rows>\n"); xml.append(" <Row>\n"); xml.append(" <Column>\n"); xml.append(" <Name>FromID\n"); xml.append(" <Value>").append(String.valueOf(fromID)).append("\n"); xml.append(" </Column>\n"); xml.append(" <Column>\n"); xml.append(" <Name>ToID\n"); xml.append(" <Value>").append(String.valueOf(toID)).append("\n"); xml.append(" </Column>\n"); xml.append(" <Column>\n"); xml.append(" <Name>MessageCreationDate\n"); xml.append(" <Value>").append(String.valueOf(messageCreationDate)).append("\n"); xml.append(" </Column>\n"); xml.append(" <Column>\n"); xml.append(" <Name>MessageAttachCount\n"); xml.append(" <Value>").append(String.valueOf(messageAttachCount)).append("\n"); xml.append(" </Column>\n"); xml.append(" <Column>\n"); xml.append(" <Name>MessageType\n"); xml.append(" <Value>").append(String.valueOf(messageType)).append("\n"); xml.append(" </Column>\n"); xml.append(" <Column>\n"); xml.append(" <Name>MessageOption\n"); xml.append(" <Value>").append(String.valueOf(messageOption)).append("\n"); xml.append(" </Column>\n"); xml.append(" <Column>\n"); xml.append(" <Name>MessageStatus\n"); xml.append(" <Value>").append(String.valueOf(messageStatus)).append("\n"); xml.append(" </Column>\n"); xml.append(" </Row>\n"); xml.append(" </Rows>\n"); xml.append("</MessageStatisticsSection>\n"); return xml.toString(); } public static String getXML(Collection objMessageStatisticsBeans) { StringBuffer xml = new StringBuffer(1024); Iterator iterator = objMessageStatisticsBeans.iterator(); xml.append("<MessageStatisticsSection>\n"); xml.append(" <Rows>\n"); while (iterator.hasNext()) { MessageStatisticsBean objMessageStatisticsBean = (MessageStatisticsBean)iterator.next(); xml.append(" <Row>\n"); xml.append(" <Column>\n"); xml.append(" <Name>FromID\n"); xml.append(" <Value>").append(String.valueOf(objMessageStatisticsBean.fromID)).append("\n"); xml.append(" </Column>\n"); xml.append(" <Column>\n"); xml.append(" <Name>ToID\n"); xml.append(" <Value>").append(String.valueOf(objMessageStatisticsBean.toID)).append("\n"); xml.append(" </Column>\n"); xml.append(" <Column>\n"); xml.append(" <Name>MessageCreationDate\n"); xml.append(" <Value>").append(String.valueOf(objMessageStatisticsBean.messageCreationDate)).append("\n"); xml.append(" </Column>\n"); xml.append(" <Column>\n"); xml.append(" <Name>MessageAttachCount\n"); xml.append(" <Value>").append(String.valueOf(objMessageStatisticsBean.messageAttachCount)).append("\n"); xml.append(" </Column>\n"); xml.append(" <Column>\n"); xml.append(" <Name>MessageType\n"); xml.append(" <Value>").append(String.valueOf(objMessageStatisticsBean.messageType)).append("\n"); xml.append(" </Column>\n"); xml.append(" <Column>\n"); xml.append(" <Name>MessageOption\n"); xml.append(" <Value>").append(String.valueOf(objMessageStatisticsBean.messageOption)).append("\n"); xml.append(" </Column>\n"); xml.append(" <Column>\n"); xml.append(" <Name>MessageStatus\n"); xml.append(" <Value>").append(String.valueOf(objMessageStatisticsBean.messageStatus)).append("\n"); xml.append(" </Column>\n"); xml.append(" </Row>\n"); }//while xml.append(" </Rows>\n"); xml.append("</MessageStatisticsSection>\n"); return xml.toString(); } } //end of class MessageStatisticsBean |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.