1 //==============================================================================
2 // file : NewsClass.java
3 // project: East Networks News System
4 //
5 // last change: date: $Date: 2003/09/10 09:28:36 $
6 // by: $Author: bitiboy $
7 // revision: $Revision: 1.1 $
8 //------------------------------------------------------------------------------
9 // copyright: GNU GPL Software License (see class documentation)
10 //==============================================================================
11 package net.eastol.news.jdo.bean;
12
13
14 /*
15 * $Id: NewsClass.java,v 1.1 2003/09/10 09:28:36 bitiboy Exp $
16 *
17 * Copyright 2003 Acai Software All Rights Reserved.
18 *
19 * This file NewsClass.java is part of the East Networks News System.
20
21 * The East Networks News System is free software; you can redistribute it and/or modify
22 * it under the terms of the GNU General Public License as published by
23 * the Free Software Foundation; either version 2 of the License, or
24 * (at your option) any later version.
25
26 * East Networks News System is distributed in the hope that it will be useful,
27 * but WITHOUT ANY WARRANTY; without even the implied warranty of
28 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 * GNU General Public License for more details.
30
31 * You should have received a copy of the GNU General Public License
32 * along with the East Networks News System; if not, write to the Free Software
33 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
34
35 * http://www.justhis.com http://ejb.cn
36 * CONTACT: email = webmaster@justhis.com superaxis@sohu.com
37 */
38 import com.justhis.util.Base64Utils;
39 import com.justhis.util.exception.UtilException;
40
41 import java.util.ArrayList;
42 import java.util.Date;
43
44 import javax.jdo.JDOHelper;
45
46
47 /***
48 * TODO DOCUMENT ME!
49 *
50 * @author <a href="http://blog.ejb.cn">acai</a>
51 * @version $Revision $
52 */
53 public class NewsClass implements CommonClass, JDOConst {
54 //~ Instance fields --------------------------------------------------------
55
56 /*** TODO */
57 public ArrayList childList;
58
59 /*** TODO */
60 public ArrayList newsList;
61
62 /*** TODO */
63 public Date lastUpdate;
64
65 /*** TODO */
66 public String className;
67
68 /*** TODO */
69 public String headAd;
70
71 /*** TODO */
72 public String logo;
73
74 /*** TODO */
75 public String newsAd;
76
77 /*** TODO */
78 public int articleNum;
79
80 /*** TODO */
81 public int imgNewsNum;
82
83 /*** TODO */
84 public int listStyle;
85
86 /*** TODO */
87 public int orderId;
88
89 /*** TODO */
90 public int styleId;
91
92 /*** TODO */
93 public int topicNum;
94
95 /*** TODO */
96 public long newsClassId;
97
98 //~ Constructors -----------------------------------------------------------
99
100 /***
101 * Creates a new NewsClass object.
102 */
103 public NewsClass() {
104 childList = new ArrayList();
105 }
106
107 //~ Methods ----------------------------------------------------------------
108
109 /***
110 * @param i
111 */
112 public void setArticleNum(int i) {
113 articleNum = i;
114 }
115
116 /***
117 * @return TODO
118 */
119 public int getArticleNum() {
120 return articleNum;
121 }
122
123 /***
124 * @return TODO
125 */
126 public ArrayList getChildList() {
127 return this.childList;
128 }
129
130 /***
131 * @param string
132 */
133 public void setClassName(String string) {
134 className = string;
135 }
136
137 /***
138 * @return TODO
139 */
140 public String getClassName() {
141 return className;
142 }
143
144 /***
145 * @param string
146 */
147 public void setHeadAd(String string) {
148 headAd = string;
149 }
150
151 /***
152 * @return TODO
153 */
154 public String getHeadAd() {
155 return headAd;
156 }
157
158 /***
159 * @param i
160 */
161 public void setImgNewsNum(int i) {
162 imgNewsNum = i;
163 }
164
165 /***
166 * @return TODO
167 */
168 public int getImgNewsNum() {
169 return imgNewsNum;
170 }
171
172 /***
173 * @param date
174 */
175 public void setLastUpdate(Date date) {
176 lastUpdate = date;
177 }
178
179 /***
180 * @return TODO
181 */
182 public Date getLastUpdate() {
183 return lastUpdate;
184 }
185
186 /***
187 * @param i
188 */
189 public void setListStyle(int i) {
190 listStyle = i;
191 }
192
193 /***
194 * @return TODO
195 */
196 public int getListStyle() {
197 return listStyle;
198 }
199
200 /***
201 * @param string
202 */
203 public void setLogo(String string) {
204 logo = string;
205 }
206
207 /***
208 * @return TODO
209 */
210 public String getLogo() {
211 return logo;
212 }
213
214 /***
215 * @param string
216 */
217 public void setNewsAd(String string) {
218 newsAd = string;
219 }
220
221 /***
222 * @return TODO
223 */
224 public String getNewsAd() {
225 return newsAd;
226 }
227
228 /***
229 * @param i
230 */
231 public void setNewsClassId(long i) {
232 newsClassId = i;
233 }
234
235 /***
236 * @return TODO
237 */
238 public long getNewsClassId() {
239 return newsClassId;
240 }
241
242 /***
243 * @return TODO
244 */
245 public ArrayList getNewsList() {
246 return newsList;
247 }
248
249 /***
250 * TODO
251 *
252 * @param objectId TODO
253 */
254 public void setObjectId(String objectId) {
255 }
256
257 /***
258 * @see net.eastol.news.jdo.bean.JDOConst#getObjectId()
259 */
260 public String getObjectId() throws UtilException {
261 Object oid = JDOHelper.getObjectId(this);
262 char[] m = null;
263
264 m = Base64Utils.encode(oid);
265
266 String oidStr = new String(m);
267
268 return oidStr;
269 }
270
271 /***
272 * @param i
273 */
274 public void setOrderId(int i) {
275 orderId = i;
276 }
277
278 /***
279 * @return TODO
280 */
281 public int getOrderId() {
282 return orderId;
283 }
284
285 /***
286 * @param i
287 */
288 public void setStyleId(int i) {
289 styleId = i;
290 }
291
292 /***
293 * @return TODO
294 */
295 public int getStyleId() {
296 return styleId;
297 }
298
299 /***
300 * @param i
301 */
302 public void setTopicNum(int i) {
303 topicNum = i;
304 }
305
306 /***
307 * @return TODO
308 */
309 public int getTopicNum() {
310 return topicNum;
311 }
312
313 /***
314 * TODO
315 *
316 * @param nc TODO
317 */
318 public void addChild(NewsClass nc) {
319 if (childList == null) {
320 childList = new ArrayList();
321 }
322
323 childList.add(nc);
324 }
325
326 /***
327 * TODO
328 *
329 * @param nb TODO
330 */
331 public void addNews(NewsBean nb) {
332 newsList.add(nb);
333 }
334
335 /***
336 * @see net.eastol.news.jdo.bean.JDOConst#delete()
337 */
338 public void delete() {
339 JDOHelper.getPersistenceManager(this).deletePersistent(this);
340 }
341
342 /***
343 * TODO
344 *
345 * @param nc TODO
346 *
347 * @throws UtilException TODO
348 */
349 public void removeChild(NewsClass nc) throws UtilException {
350 for (int i = 0; i < childList.size(); i++) {
351 NewsClass temp = (NewsClass) childList.get(i);
352
353 if (nc.getObjectId().equals(temp.getObjectId())) {
354 childList.remove(i);
355 }
356 }
357 }
358 }
359
360
361 /*
362 * $Log: NewsClass.java,v $
363 * Revision 1.1 2003/09/10 09:28:36 bitiboy
364 * *** empty log message ***
365 *
366 *
367 */
This page was automatically generated by Maven