Source Code Cross Referenced for DefaultModuleInfo.java in  » Graphic-Library » jcommon-components » org » jfree » base » modules » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Graphic Library » jcommon components » org.jfree.base.modules 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* ========================================================================
002:         * JCommon : a free general purpose class library for the Java(tm) platform
003:         * ========================================================================
004:         *
005:         * (C) Copyright 2000-2005, by Object Refinery Limited and Contributors.
006:         * 
007:         * Project Info:  http://www.jfree.org/jcommon/index.html
008:         *
009:         * This library is free software; you can redistribute it and/or modify it 
010:         * under the terms of the GNU Lesser General Public License as published by 
011:         * the Free Software Foundation; either version 2.1 of the License, or 
012:         * (at your option) any later version.
013:         *
014:         * This library is distributed in the hope that it will be useful, but 
015:         * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
016:         * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 
017:         * License for more details.
018:         *
019:         * You should have received a copy of the GNU Lesser General Public
020:         * License along with this library; if not, write to the Free Software
021:         * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, 
022:         * USA.  
023:         *
024:         * [Java is a trademark or registered trademark of Sun Microsystems, Inc. 
025:         * in the United States and other countries.]
026:         * 
027:         * ----------------------
028:         * DefaultModuleInfo.java
029:         * ----------------------
030:         * (C)opyright 2003, 2004, by Thomas Morgner and Contributors.
031:         *
032:         * Original Author:  Thomas Morgner;
033:         * Contributor(s):   David Gilbert (for Object Refinery Limited);
034:         *
035:         * $Id: DefaultModuleInfo.java,v 1.2 2005/10/18 13:14:50 mungady Exp $
036:         *
037:         * Changes
038:         * -------
039:         * 05-Jul-2003 : Initial version
040:         * 07-Jun-2004 : Added JCommon header (DG);
041:         *
042:         */
043:
044:        package org.jfree.base.modules;
045:
046:        /**
047:         * Provides a default implementation of the module info interface.
048:         *
049:         * @author Thomas Morgner
050:         */
051:        public class DefaultModuleInfo implements  ModuleInfo {
052:            /** The name of the module class. */
053:            private String moduleClass;
054:            /** The major version of the described module. */
055:            private String majorVersion;
056:            /** The minor version of the described module. */
057:            private String minorVersion;
058:            /** The patchlevel version of the described module. */
059:            private String patchLevel;
060:
061:            /**
062:             * DefaultConstructor.
063:             */
064:            public DefaultModuleInfo() {
065:                // nothing required
066:            }
067:
068:            /**
069:             * Creates a new module info an initalizes it with the given values.
070:             *
071:             * @param moduleClass the class name of the module implementation holding the module
072:             * description.
073:             * @param majorVersion the modules major version.
074:             * @param minorVersion the modules minor version.
075:             * @param patchLevel the modules patchlevel.
076:             * @throws NullPointerException if the moduleClass is null.
077:             */
078:            public DefaultModuleInfo(final String moduleClass,
079:                    final String majorVersion, final String minorVersion,
080:                    final String patchLevel) {
081:                if (moduleClass == null) {
082:                    throw new NullPointerException(
083:                            "Module class must not be null.");
084:                }
085:                this .moduleClass = moduleClass;
086:                this .majorVersion = majorVersion;
087:                this .minorVersion = minorVersion;
088:                this .patchLevel = patchLevel;
089:            }
090:
091:            /**
092:             * Returns the class name of the module described implementation.
093:             *
094:             * @see ModuleInfo#getModuleClass()
095:             *
096:             * @return the module class name.
097:             */
098:            public String getModuleClass() {
099:                return this .moduleClass;
100:            }
101:
102:            /**
103:             * Defines the module class name.
104:             *
105:             * @param moduleClass the class name of the module implementation.
106:             */
107:            public void setModuleClass(final String moduleClass) {
108:                if (moduleClass == null) {
109:                    throw new NullPointerException();
110:                }
111:                this .moduleClass = moduleClass;
112:            }
113:
114:            /**
115:             * Returns the major version of the module. This property may be
116:             * null to indicate that the module version is not specified.
117:             * @see ModuleInfo#getMajorVersion()
118:             *
119:             * @return the major version.
120:             */
121:            public String getMajorVersion() {
122:                return this .majorVersion;
123:            }
124:
125:            /**
126:             * Defines the major version of the module. This property may be
127:             * null to indicate that the module version is not specified.
128:             * @see ModuleInfo#getMajorVersion()
129:             *
130:             * @param majorVersion the major version.
131:             */
132:            public void setMajorVersion(final String majorVersion) {
133:                this .majorVersion = majorVersion;
134:            }
135:
136:            /**
137:             * Returns the minor version of the module. This property may be
138:             * null to indicate that the module version is not specified.
139:             * @see ModuleInfo#getMajorVersion()
140:             *
141:             * @return the minor version.
142:             */
143:            public String getMinorVersion() {
144:                return this .minorVersion;
145:            }
146:
147:            /**
148:             * Defines the minor version of the module. This property may be
149:             * null to indicate that the module version is not specified.
150:             * @see ModuleInfo#getMajorVersion()
151:             *
152:             * @param minorVersion the minor version.
153:             */
154:            public void setMinorVersion(final String minorVersion) {
155:                this .minorVersion = minorVersion;
156:            }
157:
158:            /**
159:             * Returns the patch level version of the module. This property may be
160:             * null to indicate that the module version is not specified.
161:             * @see ModuleInfo#getMajorVersion()
162:             *
163:             * @return the patch level version.
164:             */
165:            public String getPatchLevel() {
166:                return this .patchLevel;
167:            }
168:
169:            /**
170:             * Defines the patch level version of the module. This property may be
171:             * null to indicate that the module version is not specified.
172:             * @see ModuleInfo#getMajorVersion()
173:             *
174:             * @param patchLevel the patch level version.
175:             */
176:            public void setPatchLevel(final String patchLevel) {
177:                this .patchLevel = patchLevel;
178:            }
179:
180:            /**
181:             * Two moduleinfos are equal,if they have the same module class.
182:             *
183:             * @param o the other object to compare.
184:             * @return true, if the module points to the same module, false otherwise.
185:             */
186:            public boolean equals(final Object o) {
187:                if (this  == o) {
188:                    return true;
189:                }
190:                if (!(o instanceof  DefaultModuleInfo)) {
191:                    return false;
192:                }
193:
194:                final ModuleInfo defaultModuleInfo = (ModuleInfo) o;
195:
196:                if (!this .moduleClass
197:                        .equals(defaultModuleInfo.getModuleClass())) {
198:                    return false;
199:                }
200:                return true;
201:            }
202:
203:            /**
204:             * Computes an hashcode for this module information.
205:             * @see java.lang.Object#hashCode()
206:             *
207:             * @return the hashcode.
208:             */
209:            public int hashCode() {
210:                final int result;
211:                result = this .moduleClass.hashCode();
212:                return result;
213:            }
214:
215:            /**
216:             * Returns a string representation of this module information.
217:             *
218:             * @see java.lang.Object#toString()
219:             *
220:             * @return a string describing this class.
221:             */
222:            public String toString() {
223:                final StringBuffer buffer = new StringBuffer();
224:                buffer.append(getClass().getName());
225:                buffer.append("={ModuleClass=");
226:                buffer.append(getModuleClass());
227:                if (getMajorVersion() != null) {
228:                    buffer.append("; Version=");
229:                    buffer.append(getMajorVersion());
230:                    if (getMinorVersion() != null) {
231:                        buffer.append("-");
232:                        buffer.append(getMinorVersion());
233:                        if (getPatchLevel() != null) {
234:                            buffer.append("_");
235:                            buffer.append(getPatchLevel());
236:                        }
237:                    }
238:                }
239:                buffer.append("}");
240:                return buffer.toString();
241:            }
242:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.