KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jfree > base > Library


1 /* ========================================================================
2  * JCommon : a free general purpose class library for the Java(tm) platform
3  * ========================================================================
4  *
5  * (C) Copyright 2000-2005, by Object Refinery Limited and Contributors.
6  *
7  * Project Info: http://www.jfree.org/jcommon/index.html
8  *
9  * This library is free software; you can redistribute it and/or modify it
10  * under the terms of the GNU Lesser General Public License as published by
11  * the Free Software Foundation; either version 2.1 of the License, or
12  * (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful, but
15  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
17  * License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
22  * USA.
23  *
24  * [Java is a trademark or registered trademark of Sun Microsystems, Inc.
25  * in the United States and other countries.]
26  *
27  * ------------
28  * Library.java
29  * ------------
30  * (C) Copyright 2002-2004, by Object Refinery Limited.
31  *
32  * Original Author: David Gilbert (for Object Refinery Limited);
33  * Contributor(s): -;
34  *
35  * $Id: Library.java,v 1.6 2006/03/23 19:47:05 taqua Exp $
36  *
37  * Changes
38  * -------
39  * 21-Feb-2002 : Version 1 (DG);
40  * 25-Mar-2002 : Added a new constructor (DG);
41  * 02-Nov-2005 : Minor API doc updates (DG);
42  *
43  */

44
45 package org.jfree.base;
46
47 import org.jfree.ui.about.AboutFrame;
48
49 /**
50  * A simple class representing a library in a software project. For use in
51  * the {@link AboutFrame} class.
52  *
53  * @author David Gilbert
54  */

55 public class Library {
56
57     /** The name. */
58     private String JavaDoc name;
59
60     /** The version. */
61     private String JavaDoc version;
62
63     /** The licenceName. */
64     private String JavaDoc licenceName;
65
66     /** The version. */
67     private String JavaDoc info;
68
69     /**
70      * Creates a new library reference.
71      *
72      * @param name the name.
73      * @param version the version.
74      * @param licence the licenceName.
75      * @param info the web address or other info.
76      */

77     public Library(final String JavaDoc name, final String JavaDoc version,
78                    final String JavaDoc licence, final String JavaDoc info) {
79
80         this.name = name;
81         this.version = version;
82         this.licenceName = licence;
83         this.info = info;
84     }
85
86     /**
87      * Creates a new library reference.
88      */

89     protected Library() {
90         // nothing required
91
}
92
93     /**
94      * Returns the library name.
95      *
96      * @return the library name.
97      */

98     public String JavaDoc getName() {
99         return this.name;
100     }
101
102     /**
103      * Returns the library version.
104      *
105      * @return the library version.
106      */

107     public String JavaDoc getVersion() {
108         return this.version;
109     }
110
111     /**
112      * Returns the licenceName text.
113      *
114      * @return the licenceName text.
115      */

116     public String JavaDoc getLicenceName() {
117         return this.licenceName;
118     }
119
120     /**
121      * Returns the project info for the library.
122      *
123      * @return the project info.
124      */

125     public String JavaDoc getInfo() {
126         return this.info;
127     }
128
129     /**
130      * Sets the project info.
131      *
132      * @param info the project info.
133      */

134     protected void setInfo(final String JavaDoc info) {
135         this.info = info;
136     }
137
138     /**
139      * Sets the licence name.
140      *
141      * @param licenceName the licence name.
142      */

143     protected void setLicenceName(final String JavaDoc licenceName) {
144         this.licenceName = licenceName;
145     }
146
147     /**
148      * Sets the project name.
149      *
150      * @param name the project name.
151      */

152     protected void setName(final String JavaDoc name) {
153         this.name = name;
154     }
155
156     /**
157      * Sets the version identifier.
158      *
159      * @param version the version identifier.
160      */

161     protected void setVersion(final String JavaDoc version) {
162         this.version = version;
163     }
164
165     public boolean equals(final Object JavaDoc o)
166     {
167       if (this == o)
168       {
169         return true;
170       }
171       if (o == null || getClass() != o.getClass())
172       {
173         return false;
174       }
175
176       final Library library = (Library) o;
177
178       if (name != null ? !name.equals(library.name) : library.name != null)
179       {
180         return false;
181       }
182
183       return true;
184     }
185
186     public int hashCode()
187     {
188       return (name != null ? name.hashCode() : 0);
189     }
190 }
191
Popular Tags