01: /**
02: * Copyright (C) 2006 NetMind Consulting Bt.
03: *
04: * This library is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License as published by the Free Software Foundation; either
07: * version 3 of the License, or (at your option) any later version.
08: *
09: * This library is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12: * Lesser General Public License for more details.
13: *
14: * You should have received a copy of the GNU Lesser General Public
15: * License along with this library; if not, write to the Free Software
16: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17: */package hu.netmind.persistence;
18:
19: /**
20: * This is an article, a form of writing.
21: * @author Brautigam Robert
22: * @version Revision: $Revision$
23: */
24: public class Article extends Writing {
25: private String magazine;
26:
27: public Article() {
28: super ();
29: }
30:
31: public Article(String title, String magazine) {
32: super (title);
33: setMagazine(magazine);
34: }
35:
36: public String getMagazine() {
37: return magazine;
38: }
39:
40: public void setMagazine(String magazine) {
41: this .magazine = magazine;
42: }
43:
44: public int hashCode() {
45: return (magazine == null ? 0 : magazine.hashCode())
46: ^ super .hashCode();
47: }
48:
49: public boolean equals(Object rhs) {
50: if ((rhs == null) || (!(rhs instanceof Article)))
51: return false;
52: return ((magazine == null) && ((Article) rhs).magazine == null)
53: || ((magazine != null) && (magazine
54: .equals(((Article) rhs).magazine) && super
55: .equals(rhs)));
56: }
57:
58: public String toString() {
59: return "[Article: '" + getTitle() + ",' magazine: '" + magazine
60: + "']";
61: }
62:
63: }
|