⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bbstopic.java

📁 本人大学时大型作业用JAVA做的一个 BBS系统 模式MVC 非struts版 开发工具JCreator Pro 数据库SQL2
💻 JAVA
字号:
package domain;
import java.util.*;
public class BBSTopic extends Posting implements java.io.Serializable
{	
	private int sortId;
	private String title;
	private HashMap responses=new HashMap();
	public BBSTopic()
	{
	}
	public BBSTopic(int id,int sortId,String title,String content,String author, Date time)
	{
		super(id,content,author,time);
		this.title=title;
		this.sortId=sortId;
	}
	public void setTitle(String title)
	{
		this.title=title;
	}
	public void setSortId(int sortId) 
	{
		this.sortId = sortId;
	}
	public String getTitle()
	{
		return (this.title);
	}
	public int getSortId()	
	{
		return (this.sortId); 
	}
	public void add(BBSResponse response)
	{
		responses.put(response.getId(),response);
		response.setId(responses.size()-1);
		response.setBBSTopic(this);
	}
	public void remove(BBSResponse response)
	{
		response.setDeleted(true);
	}	
	public BBSResponse getResponse(int id)
	{
		return (BBSResponse)responses.get(id);
	}
	public Collection getResponses()
	{
		return responses.values();
	}
	public int getResponseCount()
	{
		int count = 0;
		BBSResponse response;		
		Iterator it = responses.values().iterator();
		while (it.hasNext())
		{
			response = (BBSResponse)it.next();
			if (!response.isDeleted())
			{
				count++;
			}
		}
		return count;
	}	
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -