KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > geinuke > vo > TopicVO


1
2
3  /*
4  -- GeiNuke --
5 Copyright (c) 2005 by Roberto Sidoti [geinuke@users.sourceforge.net]
6  http://www.hostingjava.it/-geinuke/
7
8 This file is part of GeiNuke.
9
10     GeiNuke is free software; you can redistribute it and/or modify
11     it under the terms of the GNU General Public License as published by
12     the Free Software Foundation; either version 2 of the License, or
13     (at your option) any later version.
14
15     GeiNuke is distributed in the hope that it will be useful,
16     but WITHOUT ANY WARRANTY; without even the implied warranty of
17     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18     GNU General Public License for more details.
19
20     You should have received a copy of the GNU General Public License
21     along with GeiNuke; if not, write to the Free Software
22     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 */

24 package com.geinuke.vo;
25
26 import java.io.Serializable JavaDoc;
27 import java.util.ArrayList JavaDoc;
28 import java.util.Date JavaDoc;
29 import java.util.GregorianCalendar JavaDoc;
30
31 public class TopicVO implements Serializable JavaDoc{
32     public final static String JavaDoc TOPIC_NEWS="NEWS";
33     public final static String JavaDoc TOPIC_DOWNLOADS="DOWNLOADS";
34     public final static String JavaDoc TOPIC_FORUMS="FORUMS";
35     protected int tId=-1;
36     protected int eLink=-1;//link to forum id
37
protected String JavaDoc topicType=null;
38     protected ArrayList JavaDoc comments=null;
39     protected String JavaDoc name=null;
40     protected String JavaDoc image=null;
41     protected String JavaDoc text=null;
42     protected int counter=0;
43     protected long lastModTime=0;
44     protected long creationTime=0;
45     protected UserVO author=null;
46     protected long lastVisit=0;
47     
48     /**
49      * @return Returns the counter.
50      */

51     public int getCounter() {
52         return counter;
53     }
54     
55     /**
56      * @return Returns the counter.
57      */

58     public boolean hasNewContent() {
59         return this.lastModTime>this.lastVisit;
60     }
61     /**
62      * @param counter The counter to set.
63      */

64     public void setCounter(int counter) {
65         this.counter = counter;
66     }
67     /**
68      * @return Returns the image.
69      */

70     public String JavaDoc getImage() {
71         return image;
72     }
73     /**
74      * @param image The image to set.
75      */

76     public void setImage(String JavaDoc image) {
77         this.image = image;
78     }
79     /**
80      * @return Returns the name.
81      */

82     public String JavaDoc getName() {
83         return name;
84     }
85     /**
86      * @param name The name to set.
87      */

88     public void setName(String JavaDoc name) {
89         this.name = name;
90     }
91     /**
92      * @return Returns the text.
93      */

94     public String JavaDoc getText() {
95         return text;
96     }
97     /**
98      * @param text The text to set.
99      */

100     public void setText(String JavaDoc text) {
101         this.text = text;
102     }
103     /**
104      * @return Returns the tId.
105      */

106     public int getTId() {
107         return tId;
108     }
109     /**
110      * @param id The tId to set.
111      */

112     public void setTId(int id) {
113         tId = id;
114     }
115     public int getELink() {
116         return eLink;
117     }
118     public void setELink(int link) {
119         eLink = link;
120     }
121     /**
122      * @return Returns the comments.
123      */

124     public ArrayList JavaDoc getComments() {
125         return comments;
126     }
127     /**
128      * @param comments The comments to set.
129      */

130     public void setComments(ArrayList JavaDoc comments) {
131         this.comments = comments;
132     }
133     /**
134      * @return Returns the topicType.
135      */

136     public String JavaDoc getTopicType() {
137         return topicType;
138     }
139     /**
140      * @param topicType The topicType to set.
141      */

142     public void setTopicType(String JavaDoc topicType) {
143         this.topicType = topicType;
144     }
145     /**
146      * @return Returns the creationTime.
147      */

148     public long getCreationTime() {
149         return creationTime;
150     }
151     /**
152      * @param creationTime The creationTime to set.
153      */

154     public void setCreationTime(long creationTime) {
155         this.creationTime = creationTime;
156     }
157     /**
158      * @return Returns the lastModTime.
159      */

160     public long getLastModTime() {
161         return lastModTime;
162     }
163     
164     public GregorianCalendar JavaDoc getLastDateTime() {
165         GregorianCalendar JavaDoc gc=null;
166         Date JavaDoc d=new Date JavaDoc(this.lastModTime);
167         gc=new GregorianCalendar JavaDoc();
168         gc.setTime(d);
169         return gc;
170     }
171     
172     public GregorianCalendar JavaDoc getCreationDateTime() {
173         GregorianCalendar JavaDoc gc=null;
174         Date JavaDoc d=new Date JavaDoc(this.creationTime);
175         gc=new GregorianCalendar JavaDoc();
176         gc.setTime(d);
177         return gc;
178     }
179     
180     
181     /**
182      * @param lastModTime The lastModTime to set.
183      */

184     public void setLastModTime(long lastModTime) {
185         this.lastModTime = lastModTime;
186     }
187     public UserVO getAuthor() {
188         return author;
189     }
190     public void setAuthor(UserVO author) {
191         this.author = author;
192     }
193     public long getLastVisit() {
194         return lastVisit;
195     }
196     public void setLastVisit(long lastVisit) {
197         this.lastVisit = lastVisit;
198     }
199 }
200
Popular Tags