Source Code Cross Referenced for JobSpace.java in  » Workflow-Engines » pegasus-2.1.0 » org » griphyn » cPlanner » visualize » spaceusage » 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.visualize.spaceusage 
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 in file GTPL, or at
004:         * http://www.globus.org/toolkit/download/license.html. This notice must
005:         * appear in redistributions of this file, with or without modification.
006:         *
007:         * Redistributions of this Software, with or without modification, must
008:         * reproduce the GTPL in: (1) the Software, or (2) the Documentation or
009:         * some other similar material which is provided with the Software (if
010:         * any).
011:         *
012:         * Copyright 1999-2004 University of Chicago and The University of
013:         * Southern California. All rights reserved.
014:         */
015:
016:        package org.griphyn.cPlanner.visualize.spaceusage;
017:
018:        import java.util.List;
019:        import java.util.Iterator;
020:        import java.util.ArrayList;
021:
022:        /**
023:         * A data class that associates at most three space reading with the job
024:         * corresponding to the GRIDSTART_PREJOB, GRIDSTART_MAINJOB and GRIDSTART_POSTJOB.
025:         *
026:         * @author Karan Vahi vahi@isi.edu
027:         * @version $Revision: 50 $
028:         */
029:
030:        public class JobSpace {
031:
032:            /**
033:             * The PREJOB data index.
034:             */
035:            public static final int GRIDSTART_PREJOB_EVENT_TYPE = 0;
036:
037:            /**
038:             * The MAINJOB data index.
039:             */
040:            public static final int GRIDSTART_MAINJOB_EVENT_TYPE = 1;
041:
042:            /**
043:             * The POSTJOB data index.
044:             */
045:            public static final int GRIDSTART_POSTJOB_EVENT_TYPE = 2;
046:
047:            /**
048:             * The name of the job.
049:             */
050:            private String mName;
051:
052:            /**
053:             * The list of Space reading objects.
054:             */
055:            private List mSpaceList;
056:
057:            /**
058:             * The default constructor.
059:             */
060:            public JobSpace() {
061:                mSpaceList = new ArrayList(3);
062:                for (int i = 0; i < 3; i++) {
063:                    mSpaceList.add(null);
064:                }
065:            }
066:
067:            /**
068:             * The overloaded constructor.
069:             *
070:             * @param name  the name of the job
071:             */
072:            public JobSpace(String name) {
073:                this ();
074:                mName = name;
075:            }
076:
077:            /**
078:             * Adds a space record for a particular event type.
079:             *
080:             * @param space  the space record.
081:             * @param type   the type of job
082:             */
083:            public void addSpaceReading(Space space, int type) {
084:                if (!typeInRange(type)) {
085:                    throw new NumberFormatException(
086:                            "Event type specified is not in range " + type);
087:                }
088:
089:                mSpaceList.set(type, space);
090:            }
091:
092:            /**
093:             * Returns the space reading for a particular type of job of event.
094:             *
095:             * @param type event type.
096:             *
097:             * @return <code>Space</code> object if data exists else null
098:             */
099:            public Space getSpaceReading(int type) {
100:                if (!typeInRange(type)) {
101:                    throw new NumberFormatException(
102:                            "Event type specified is not in range " + type);
103:                }
104:                Object obj = mSpaceList.get(type);
105:                return (obj == null) ? null : (Space) obj;
106:
107:            }
108:
109:            /**
110:             * Returns the readings iterator. Values can be null.
111:             *
112:             * @return iterator to space readings.
113:             */
114:            public Iterator spaceReadingsIterator() {
115:                return mSpaceList.iterator();
116:            }
117:
118:            /**
119:             * Returns a boolean indicating whether the event type is in range of not.
120:             *
121:             * @param type the type value
122:             */
123:            public boolean typeInRange(int type) {
124:                return (type >= GRIDSTART_PREJOB_EVENT_TYPE && type <= GRIDSTART_POSTJOB_EVENT_TYPE);
125:            }
126:
127:            /**
128:             * Returns a textual description of the object.
129:             *
130:             * @return description
131:             */
132:            public String toString() {
133:                StringBuffer sb = new StringBuffer();
134:                sb.append(mName).append(" ").append(mSpaceList);
135:                return sb.toString();
136:            }
137:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.