package yoonforh.bbs;

/**
 * BBSData.java
 * Copyright (c) 1997-1998 Yoon Kyung Koo. All rights reserved.
 *
 * contact via yoonforh@moon.daewoo.co.kr
 *
 * first release date 1997/10/07
 * @version 1.02 1998/03/15
 * 		this version supports article threads
 * @author Yoon Kyung Koo
 */

import java.net.URL;
import java.util.Date;
import java.util.Vector;

/**
 * BBSData class
 * This class defines each article data
 */
class BBSData implements java.io.Serializable {
	int articleNo=-1;
	int prevNo=-1;
	Vector nextNumbers=null;
	String name=null;
	URL webAddress=null;
	URL emailAddress=null;
	Date logDate=null;
	String passwd=null;
	String title=null;
	String data=null;
	int	visitCount=0;

	BBSData() 
	{
		articleNo=-1;
		prevNo=-1;
		nextNumbers=new Vector();
		name=null;
		webAddress=null;
		emailAddress=null;
		logDate=null;
		passwd=null;
		title=null;
		data=null;
		visitCount=0;
	}

	BBSData(int articleNo, String name, 
		URL webAddress, URL emailAddress, 
		Date logDate, String passwd, 
		String title, String data) 
	{
		this.articleNo=articleNo;
		prevNo=-1;
		nextNumbers=new Vector();
		this.name=name;
		this.webAddress=webAddress;
		this.emailAddress=emailAddress;
		this.logDate=logDate;
		this.passwd=passwd;
		this.title=title;
		this.data=data;
	}

	BBSData(int articleNo, int prevNo,
		String name, 
		URL webAddress, URL emailAddress, 
		Date logDate, String passwd, 
		String title, String data) 
	{
		this.articleNo=articleNo;
		this.prevNo=prevNo;
		this.name=name;
		this.webAddress=webAddress;
		this.emailAddress=emailAddress;
		this.logDate=logDate;
		this.passwd=passwd;
		this.title=title;
		this.data=data;
	}

	public String toString() 
	{
		return ("\tarticle number="+articleNo
			+"\n\tprev. article="+prevNo
			+"\n\tNAME="+name+"\n\tWEB="+webAddress.toString()
			+"\n\tEMail="+emailAddress.toString()
			+"\n\tDATE="+logDate.toString()
			+"\n\tPASS="+passwd
			+"\n\tTITLE="+title
			+"\n\tCOMMENT="+data);
	}
}
