Source Code Cross Referenced for Os.java in  » Workflow-Engines » pegasus-2.1.0 » org » griphyn » common » 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.common.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.common.classes;
018:
019:        /**
020:         * This is an enumerated data class for the different types of operating systems.
021:         *
022:         * @author Gaurang Mehta gmehta@isi.edu
023:         * @version $Revision: 426 $
024:         */
025:
026:        import java.io.Serializable;
027:        import java.util.HashMap;
028:
029:        public class Os implements  Serializable {
030:            private String _value_;
031:            private static HashMap _table_ = new HashMap(5);
032:
033:            protected Os(String value) {
034:                _value_ = value;
035:                _table_.put(_value_, this );
036:            }
037:
038:            private static final String _LINUX = "LINUX";
039:            private static final String _SUNOS = "SUNOS";
040:            private static final String _AIX = "AIX";
041:            private static final String _WINDOWS = "WINDOWS";
042:
043:            public static final Os LINUX = new Os(_LINUX);
044:            public static final Os SUNOS = new Os(_SUNOS);
045:            public static final Os AIX = new Os(_AIX);
046:            public static final Os WINDOWS = new Os(_WINDOWS);
047:
048:            public static final String err = "Error: Illegal Operating System defined. Please specify one of the predefined types \n [LINUX, SUNOS, AIX, WINDOWS]";
049:
050:            /**
051:             * Returns the value of the operating system as string.
052:             * @return String
053:             */
054:            public String getValue() {
055:                return _value_;
056:            }
057:
058:            /**
059:             * Creates a new Os object given an os string.
060:             * @param value String
061:             * @throws IllegalStateException Throws Exception if the operating system is not defined in this class.
062:             * @return Os
063:             */
064:            public static Os fromValue(String value)
065:                    throws IllegalStateException {
066:                Os m_enum = (Os) _table_.get(value.toUpperCase());
067:                if (m_enum == null) {
068:                    throw new IllegalStateException(err);
069:                }
070:                return m_enum;
071:            }
072:
073:            /**
074:             * Creates a new Os object given an os string.
075:             * @param value String
076:             * @throws IllegalStateException Throws Exception if the operating system is not defined in this class.
077:             * @return Os
078:             */
079:            public static Os fromString(String value)
080:                    throws IllegalStateException {
081:                return fromValue(value);
082:            }
083:
084:            /**
085:             * Compares if a given Os object is equal to this.
086:             * @param obj Object
087:             * @return boolean
088:             */
089:            public boolean equals(Object obj) {
090:                return (obj == this );
091:            }
092:
093:            public int hashCode() {
094:                return toString().hashCode();
095:            }
096:
097:            /**
098:             * Returns the string value of the operating system.
099:             * @return String
100:             */
101:            public String toString() {
102:                return _value_;
103:            }
104:
105:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.