package s2jsp.lg.entity;
//主题类 继承帖子类
public class Topic extends Tip{
private int topicId=1; //主题id
private int boardId=1; //引用板块id,用来表示该帖子是哪个板块的
// private String tTitle="s2学习"; //主题标题
// private String tContent="加油"; //主题内容
// private String tPublishTime="2008-11-12 22:27:40"; //发表时间
private int uid; //引用用户的id,用来表示该帖子是哪个用户发表的
public Topic()
{
super();
System.out.println("主题类的无参构造方法");
}
public Topic(String pTitle,String pContent,String pTime)
{
super(pTitle,pContent,pTime);
System.out.println("主题类的有参构造方法");
}
public Topic(int topicId,int boardId,String tTitle,String tContent,String tPublishTime)
{
super(tTitle,tContent,tPublishTime);
this.topicId=topicId;
this.boardId=boardId;
// this.tTitle=tTitle;
// this.tContent=tContent;
// this.tPublishTime=tPublishTime;
}
/*
** 输出主题信息
*/
public void getInfo()
{
System.out.println("===主题信息===");
System.out.println("主题标题:"+this.getTitle());
System.out.println("主题内容:"+this.getContent());
System.out.println("主题时间:"+this.getPublishTime()+"\n");
}
public void getTopicInfo()
{
System.out.println("===主题信息===");
System.out.println("主题标题:"+this.getTitle());
System.out.println("主题内容:"+this.getContent());
System.out.println("主题时间:"+this.getPublishTime());
// System.out.println("主题标题:"+tTitle);
// System.out.println("主题内容:"+tContent);
// System.out.println("主题时间:"+tPublishTime);
}
public void getTopicInfo(Topic topic)
{
System.out.println("===主题信息===");
System.out.println("主题标题:"+topic.getTitle());
System.out.println("主题内容:"+topic.getContent());
System.out.println("主题时间:"+topic.getPublishTime());
// System.out.println("主题标题:"+topic.tTitle);
// System.out.println("主题内容:"+topic.tContent);
// System.out.println("主题时间:"+topic.tPublishTime);
}
public int getBoardId() {
return boardId;
}
public void setBoardId(int id) {
boardId = id;
}
// public String getTContent() {
// return tContent;
// }
// public void setTContent(String content) {
// tContent = content;
// }
public int getTopicId() {
return topicId;
}
public void setTopicId(int id) {
topicId = id;
}
// public String getTPublishTime() {
// return tPublishTime;
// }
// public void setTPublishTime(String publishTime) {
// tPublishTime = publishTime;
// }
//
// public String getTTitle() {
// return tTitle;
// }
//
// public void setTTitle(String title) {
// tTitle = title;
// }
public int getUid() {
return uid;
}
public void setUid(int uid) {
this.uid = uid;
}
}
评论0
最新资源