Source Code Cross Referenced for GlobusVersion.java in  » Workflow-Engines » pegasus-2.1.0 » org » griphyn » cPlanner » classes » 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 » Workflow Engines » pegasus 2.1.0 » org.griphyn.cPlanner.classes 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * This file or a portion of this file is licensed under the terms of
003:         * the Globus Toolkit Public License, found at $PEGASUS_HOME/GTPL or
004:         * http://www.globus.org/toolkit/download/license.html.
005:         * This notice must appear in redistributions of this file
006:         * with or without modification.
007:         *
008:         * Redistributions of this Software, with or without modification, must reproduce
009:         * the GTPL in:
010:         * (1) the Software, or
011:         * (2) the Documentation or
012:         * some other similar material which is provided with the Software (if any).
013:         *
014:         * Copyright 1999-2004
015:         * University of Chicago and The University of Southern California.
016:         * All rights reserved.
017:         */package org.griphyn.cPlanner.classes;
018:
019:        import java.util.StringTokenizer;
020:
021:        /**
022:         * This is a data class that stores the globus version installed and to be used
023:         * on a particular pool for the gridftp server or the jobmanagers.
024:         *
025:         * @author Gaurang Mehta gmehta@isi.edu
026:         * @author Karan Vahi vahi@isi.edu
027:         *
028:         * @version $Revision: 50 $
029:         */
030:        public class GlobusVersion {
031:
032:            /**
033:             * The constant for the major version type.
034:             */
035:            public static final String MAJOR = "major";
036:
037:            /**
038:             * The constant for the minor version type.
039:             */
040:            public static final String MINOR = "minor";
041:
042:            /**
043:             * The constant for patche version type.
044:             */
045:            public static final String PATCH = "patch";
046:
047:            /**
048:             * This variable defines the major version number.
049:             */
050:            private int mMajorVersion;
051:
052:            /**
053:             * This variable defines the minor version number.
054:             */
055:            private int mMinorVersion;
056:
057:            /**
058:             * This variable defines the patch version number.
059:             */
060:            private int mPatchVersion;
061:
062:            /**
063:             * The default constructor.
064:             */
065:            public GlobusVersion() {
066:                mMajorVersion = 0;
067:                mMinorVersion = 0;
068:                mPatchVersion = 0;
069:            }
070:
071:            /**
072:             * Overloaded constructor for the class;
073:             *
074:             * @param version  a . separated String denoting the version . e.g. 2.2.4
075:             */
076:            public GlobusVersion(String version) {
077:
078:                StringTokenizer st = new StringTokenizer(version, ".");
079:                int count = st.countTokens();
080:
081:                mMajorVersion = (count > 0) ? new Integer(st.nextToken())
082:                        .intValue() : 0;
083:                mMinorVersion = (count > 1) ? new Integer(st.nextToken())
084:                        .intValue() : 0;
085:                mPatchVersion = (count > 2) ? new Integer(st.nextToken())
086:                        .intValue() : 0;
087:
088:            }
089:
090:            /**
091:             * Constructor to set the version information
092:             *
093:             * @param major Specifies the Major version number.
094:             * @param minor Specifies the minor version number.
095:             * @param patch Specifies the patch version number.
096:             */
097:            public GlobusVersion(int major, int minor, int patch) {
098:                mMajorVersion = major;
099:                mMinorVersion = minor;
100:                mPatchVersion = patch;
101:            }
102:
103:            /**
104:             * Returns the version corresponding to a particular version type.
105:             * If an invalid version type is specified then 0 is returned.
106:             *
107:             * @param version the <code>String</code> type corresponding to the version that
108:             *             you want.
109:             *
110:             * @return int value corresponding to the version,
111:             *         0 in case of incorrect version type.
112:             *
113:             * @see #MAJOR
114:             * @see #MINOR
115:             * @see #PATCH
116:             */
117:            public int getGlobusVersion(String version) {
118:                int value = 0;
119:                if (version.equalsIgnoreCase(MAJOR)) {
120:                    value = mMajorVersion;
121:                } else if (version.equalsIgnoreCase(MINOR)) {
122:                    value = mMinorVersion;
123:                } else if (version.equalsIgnoreCase(PATCH)) {
124:                    value = mPatchVersion;
125:                }
126:                return value;
127:            }
128:
129:            /**
130:             * Returns the Globus version as a dot separated String.
131:             * It is of type major.minor.patch where major, minor and patch are the
132:             * various version numbers stored in the class.
133:             *
134:             * @return the version a dot separated String.
135:             */
136:            public String getGlobusVersion() {
137:                StringBuffer version = new StringBuffer(5);
138:                version.append(mMajorVersion).append(".").append(mMinorVersion)
139:                        .append(".").append(mPatchVersion);
140:
141:                return version.toString();
142:            }
143:
144:            /**
145:             * Returns the textual description of the  contents of <code>GlobusVersion</code>
146:             * object in the multiline format.
147:             *
148:             * @return the textual description in multiline format.
149:             */
150:            public String toMultiLine() {
151:                return getGlobusVersion();
152:            }
153:
154:            /**
155:             * Returns the textual description of the  contents of <code>GlobusVersion
156:             * </code> object.
157:             *
158:             * @return the textual description.
159:             */
160:            public String toString() {
161:                return getGlobusVersion();
162:            }
163:
164:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.