bbstopic.java
来自「本人大学时大型作业用JAVA做的一个 BBS系统 模式MVC 非struts版 」· Java 代码 · 共 66 行
JAVA
66 行
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 + =
减小字号Ctrl + -
显示快捷键?