Source Code Cross Referenced for ConcreteActivity.java in  » Workflow-Engines » wilos » wilos » model » misc » concreteactivity » 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 » wilos » wilos.model.misc.concreteactivity 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * 
003:         * Wilos Is a cLever process Orchestration Software - http://www.wilos-project.org
004:         * Copyright (C) 2006-2007 Paul Sabatier University, IUP ISI (Toulouse, France) <massie@irit.fr>
005:         * Copyright (C) 2007 Mathieu BENOIT <mathieu-benoit@hotmail.fr>
006:         * Copyright (C) 2007-2008 Paul Sabatier University, IUP ISI (Toulouse, France) <massie@irit.fr>
007:         *
008:         * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
009:         * General Public License as published by the Free Software Foundation; either version 2 of the License,
010:         * or (at your option) any later version.
011:         *
012:         * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
013:         * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
014:         * GNU General Public License for more details.
015:         *
016:         * You should have received a copy of the GNU General Public License along with this program; if not,
017:         * write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 
018:         */
019:
020:        package wilos.model.misc.concreteactivity;
021:
022:        import java.util.Set;
023:        import java.util.SortedSet;
024:        import java.util.TreeSet;
025:
026:        import org.apache.commons.lang.builder.EqualsBuilder;
027:        import org.apache.commons.lang.builder.HashCodeBuilder;
028:
029:        import wilos.model.misc.concretebreakdownelement.ConcreteBreakdownElement;
030:        import wilos.model.misc.concreteworkbreakdownelement.ConcreteWorkBreakdownElement;
031:        import wilos.model.misc.project.Project;
032:        import wilos.model.spem2.activity.Activity;
033:
034:        /**
035:         * 
036:         * A ConcreteActivity is a specific {@link Activity} for a {@link Project}.
037:         * 
038:         */
039:        public class ConcreteActivity extends ConcreteWorkBreakdownElement
040:                implements  Cloneable {
041:
042:            private SortedSet<ConcreteBreakdownElement> concreteBreakdownElements;
043:
044:            private Activity activity;
045:
046:            /**
047:             * Class constructor.
048:             * 
049:             */
050:            public ConcreteActivity() {
051:                super ();
052:                this .concreteBreakdownElements = new TreeSet<ConcreteBreakdownElement>();
053:            }
054:
055:            /**
056:             * Compares an object in parameter with the current instance of the class
057:             * and returns true if both those objects are equals.
058:             * 
059:             * @param obj
060:             *            the object to be compare with the current instance of
061:             *            ConcreteActivity
062:             * @return true if the object is the same or has the same values as the
063:             *         current instance of ConcreteActivity, false otherwise
064:             */
065:            public boolean equals(Object obj) {
066:                if (obj instanceof  ConcreteActivity == false) {
067:                    return false;
068:                }
069:                if (this  == obj) {
070:                    return true;
071:                }
072:                ConcreteActivity concreteActivity = (ConcreteActivity) obj;
073:                return new EqualsBuilder().appendSuper(
074:                        super .equals(concreteActivity)).append(this .activity,
075:                        concreteActivity.activity).append(
076:                        this .concreteBreakdownElements,
077:                        concreteActivity.concreteBreakdownElements).isEquals();
078:            }
079:
080:            /**
081:             * Returns a hash code value for the object. This method is supported for
082:             * the benefit of hash tables.
083:             * 
084:             * @return the hash code of the current instance of ConcreteActivity
085:             */
086:            public int hashCode() {
087:                return new HashCodeBuilder(17, 37)
088:                        .appendSuper(super .hashCode()).append(this .activity)
089:                        .toHashCode();
090:            }
091:
092:            /**
093:             * Returns a copy of the current instance of ConcreteActivity.
094:             * 
095:             * @return a copy of the ConcreteActivity
096:             * @throws CloneNotSupportedException
097:             */
098:            public ConcreteActivity clone() throws CloneNotSupportedException {
099:                ConcreteActivity concreteActivity = new ConcreteActivity();
100:                concreteActivity.copy(this );
101:                return concreteActivity;
102:            }
103:
104:            /**
105:             * Copy the values of the specified ConcreteActivity into the current
106:             * instance of the class.
107:             * 
108:             * @param _concreteActivity
109:             *            the concreteActivity to copy.
110:             */
111:            protected void copy(final ConcreteActivity _concreteActivity) {
112:                super .copy(_concreteActivity);
113:                this .activity = _concreteActivity.getActivity();
114:                this .concreteBreakdownElements.addAll(_concreteActivity
115:                        .getConcreteBreakdownElements());
116:            }
117:
118:            /*
119:             * Relation between ConcreteActivity and ConcreteBreakdownElement
120:             */
121:
122:            /**
123:             * Adds a ConcreteBreakdownElement to the Collection of the current
124:             * instance. Defines the relation between ConcreteActivity and
125:             * ConcreteBreakdownElement.
126:             * 
127:             * @param _concreteBeakdownElement
128:             *            the concreteBreakdownElement to be add
129:             */
130:
131:            public void addConcreteBreakdownElement(
132:                    ConcreteBreakdownElement _concreteBeakdownElement) {
133:                this .getConcreteBreakdownElements().add(
134:                        _concreteBeakdownElement);
135:                _concreteBeakdownElement.getSuperConcreteActivities().add(this );
136:            }
137:
138:            /**
139:             * Adds a Set of ConcreteBreakdownElement to the current instance. Defines
140:             * for them all the relation between ConcreteActivity and
141:             * ConcreteBreakdownElement.
142:             * 
143:             * @param _concreteBreakdownElements
144:             *            the Set of ConcreteBreakdownElement to add
145:             */
146:            public void addAllConcreteBreakdownElements(
147:                    Set<ConcreteBreakdownElement> _concreteBreakdownElements) {
148:                for (ConcreteBreakdownElement cbde : _concreteBreakdownElements) {
149:                    cbde.addSuperConcreteActivity(this );
150:                }
151:            }
152:
153:            /**
154:             * Removes from the instance Collection a specified
155:             * ConcreteBreakdownElement. Deletes the link between the ConcreteActivity
156:             * and the ConcreteBreakdownElement.
157:             * 
158:             * @param _concreteBreakdownElement
159:             *            the ConcreteBreakdownElement to be remove
160:             */
161:            public void removeConcreteBreakdownElement(
162:                    ConcreteBreakdownElement _concreteBreakdownElement) {
163:                _concreteBreakdownElement.getSuperConcreteActivities().remove(
164:                        this );
165:                this .getConcreteBreakdownElements().remove(
166:                        _concreteBreakdownElement);
167:            }
168:
169:            /**
170:             * Removes all the ConcreteBreakdownElement from the Collection of the
171:             * current instance.
172:             */
173:            public void removeAllConcreteBreakdownElements() {
174:                for (ConcreteBreakdownElement bde : this 
175:                        .getConcreteBreakdownElements())
176:                    bde.getSuperConcreteActivities().remove(this );
177:                this .getConcreteBreakdownElements().clear();
178:            }
179:
180:            /*
181:             * Relation between ConcreteActivity and Activity
182:             * 
183:             */
184:
185:            /**
186:             * Specifies the Activity related to the current ConcreteActivity. Adds that
187:             * ConcreteActivity to the Activity's Collection.
188:             * 
189:             * @param _activity
190:             *            the Activity related to the current ConcreteActivity
191:             */
192:            public void addActivity(Activity _activity) {
193:                this .activity = _activity;
194:                _activity.addConcreteActivity(this );
195:            }
196:
197:            /**
198:             * Remove the relation between the specified Activity and the
199:             * ConcreteActivity.
200:             * 
201:             * @param _activity
202:             *            the activity to be unlinked with the ConcreteActivity
203:             */
204:            public void removeActivity(Activity _activity) {
205:                this .activity = null;
206:                _activity.removeConcreteActivity(this );
207:            }
208:
209:            /*
210:             * Getter & Setter.
211:             * 
212:             */
213:
214:            /**
215:             * Returns a SortedSet of ConcreteBreakdownElement related to the
216:             * ConcreteActivity.
217:             * 
218:             * @return the SortedSet of ConcreteBreakdownElement
219:             */
220:            public SortedSet<ConcreteBreakdownElement> getConcreteBreakdownElements() {
221:                return concreteBreakdownElements;
222:            }
223:
224:            /**
225:             * Initialize the ConcreteActivity's Collection of ConcreteBreakdownElement
226:             * with the specified SortedSet.
227:             * 
228:             * @param concreteBreakdownElements
229:             *            the SortedSet to be assigned to the ConcreteActivity
230:             */
231:            public void setConcreteBreakdownElements(
232:                    SortedSet<ConcreteBreakdownElement> concreteBreakdownElements) {
233:                this .concreteBreakdownElements = concreteBreakdownElements;
234:            }
235:
236:            /**
237:             * Returns the Activity that is in relation with the ConcreteActivity.
238:             * 
239:             * @return the Activity related to the ConcreteActivity
240:             */
241:            public Activity getActivity() {
242:                return activity;
243:            }
244:
245:            /**
246:             * Initialize the ConcreteActivity's Activity with the specified one.
247:             * 
248:             * @param activity
249:             *            the Activity to be assigned to the ConcreteActivity
250:             */
251:            public void setActivity(Activity activity) {
252:                this.activity = activity;
253:            }
254:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.