KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > jforum > entities > Banner


1 /*
2  * Copyright (c) 2003, Rafael Steil
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms,
6  * with or without modification, are permitted provided
7  * that the following conditions are met:
8  *
9  * 1) Redistributions of source code must retain the above
10  * copyright notice, this list of conditions and the
11  * following disclaimer.
12  * 2) Redistributions in binary form must reproduce the
13  * above copyright notice, this list of conditions and
14  * the following disclaimer in the documentation and/or
15  * other materials provided with the distribution.
16  * 3) Neither the name of "Rafael Steil" nor
17  * the names of its contributors may be used to endorse
18  * or promote products derived from this software without
19  * specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
22  * HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
23  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
24  * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
25  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR
26  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
27  * THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
28  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
29  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES
30  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
32  * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
33  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
34  * IN CONTRACT, STRICT LIABILITY, OR TORT
35  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
36  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
37  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
38  *
39  * This file creating date: Feb 17, 2003 / 10:47:29 PM
40  * The JForum Project
41  * http://www.jforum.net
42  */

43 package net.jforum.entities;
44
45 import java.io.Serializable JavaDoc;
46
47 /**
48  * Represents a banner in the System.
49  *
50  * @author Samuel Yung
51  * @version $Id: Banner.java,v 1.3 2005/07/26 03:04:52 rafaelsteil Exp $
52  */

53 public class Banner implements Serializable JavaDoc
54 {
55     private int id;
56     private String JavaDoc comment;
57     private boolean active;
58     private int type;
59     private String JavaDoc name;
60     private String JavaDoc description;
61     private int width;
62     private int height;
63     private int views;
64     private int clicks;
65     private String JavaDoc url;
66     private int placement;
67     private int weight;
68
69     public Banner()
70     {}
71
72     public Banner(int id)
73     {
74         this.id = id;
75     }
76
77     public Banner(Banner c)
78     {
79         this.id = c.getId();
80         this.comment = c.getComment();
81         this.active = c.isActive();
82         this.type = c.getType();
83         this.name = c.getName();
84         this.description = c.getDescription();
85         this.width = c.getWeight();
86         this.height = c.getHeight();
87         this.views = c.getViews();
88         this.clicks = c.getClicks();
89         this.url = c.getUrl();
90         this.placement = c.getPlacement();
91         this.weight = c.getWeight();
92     }
93
94     /**
95      * @return int
96      */

97     public int getId()
98     {
99         return this.id;
100     }
101
102     public String JavaDoc getComment()
103     {
104         return comment;
105     }
106
107     public boolean isActive()
108     {
109         return active;
110     }
111
112     public int getType()
113     {
114         return type;
115     }
116
117     public String JavaDoc getName()
118     {
119         return name;
120     }
121
122     public String JavaDoc getDescription()
123     {
124         return description;
125     }
126
127     public int getWidth()
128     {
129         return width;
130     }
131
132     public int getHeight()
133     {
134         return height;
135     }
136
137     public int getViews()
138     {
139         return views;
140     }
141
142     public int getClicks()
143     {
144         return clicks;
145     }
146
147     public String JavaDoc getUrl()
148     {
149         return url;
150     }
151
152     public int getPlacement()
153     {
154         return placement;
155     }
156
157     public int getWeight()
158     {
159         return weight;
160     }
161
162     /**
163      * Sets the id.
164      * @param id The id to set
165      */

166     public void setId(int id)
167     {
168         this.id = id;
169     }
170
171     public void setComment(String JavaDoc comment)
172     {
173         this.comment = comment;
174     }
175
176     public void setActive(boolean active)
177     {
178         this.active = active;
179     }
180
181     public void setType(int type)
182     {
183         this.type = type;
184     }
185
186     public void setName(String JavaDoc name)
187     {
188         this.name = name;
189     }
190
191     public void setDescription(String JavaDoc description)
192     {
193         this.description = description;
194     }
195
196     public void setWidth(int width)
197     {
198         this.width = width;
199     }
200
201     public void setHeight(int height)
202     {
203         this.height = height;
204     }
205
206     public void setViews(int views)
207     {
208         this.views = views;
209     }
210
211     public void setClicks(int clicks)
212     {
213         this.clicks = clicks;
214     }
215
216     public void setUrl(String JavaDoc url)
217     {
218         this.url = url;
219     }
220
221     public void setPlacement(int placement)
222     {
223         this.placement = placement;
224     }
225
226     public void setWeight(int weight)
227     {
228         this.weight = weight;
229     }
230
231     /**
232      * @see java.lang.Object#hashCode()
233      */

234     public int hashCode()
235     {
236         return this.id;
237     }
238
239     /**
240      * @see java.lang.Object#equals(java.lang.Object)
241      */

242     public boolean equals(Object JavaDoc o)
243     {
244         return((o instanceof Banner) && (((Banner)o).getId() == this.id));
245     }
246
247     /**
248      * @see java.lang.Object#toString()
249      */

250     public String JavaDoc toString()
251     {
252         return "[comment=" + this.comment + ", id=" + this.id +
253             ", type=" + this.type + ", name=" + this.name +
254             ", description=" + this.description + ", active=" +
255             this.active + "]";
256     }
257
258 }
259
Popular Tags