Source Code Cross Referenced for CorrectionChangeGroup.java in  » ERP-CRM-Financial » Kuali-Financial-System » org » kuali » module » gl » bo » 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 » ERP CRM Financial » Kuali Financial System » org.kuali.module.gl.bo 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2006-2007 The Kuali Foundation.
003:         * 
004:         * Licensed under the Educational Community License, Version 1.0 (the "License");
005:         * you may not use this file except in compliance with the License.
006:         * You may obtain a copy of the License at
007:         * 
008:         * http://www.opensource.org/licenses/ecl1.php
009:         * 
010:         * Unless required by applicable law or agreed to in writing, software
011:         * distributed under the License is distributed on an "AS IS" BASIS,
012:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013:         * See the License for the specific language governing permissions and
014:         * limitations under the License.
015:         */
016:
017:        package org.kuali.module.gl.bo;
018:
019:        import java.util.ArrayList;
020:        import java.util.Collections;
021:        import java.util.Iterator;
022:        import java.util.LinkedHashMap;
023:        import java.util.List;
024:
025:        import org.kuali.core.bo.PersistableBusinessObjectBase;
026:        import org.kuali.kfs.KFSPropertyConstants;
027:
028:        /**
029:         * This class represents a GLCP correction change group
030:         */
031:        public class CorrectionChangeGroup extends
032:                PersistableBusinessObjectBase implements  Comparable {
033:            private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger
034:                    .getLogger(CorrectionChangeGroup.class);
035:
036:            private String documentNumber;
037:            private Integer correctionChangeGroupLineNumber;
038:            private Integer correctionCriteriaNextLineNumber;
039:            private Integer correctionChangeNextLineNumber;
040:            private List<CorrectionCriteria> correctionCriteria;
041:            private List<CorrectionChange> correctionChange;
042:
043:            public CorrectionChangeGroup(String documentNumber,
044:                    Integer correctionChangeGroupLineNumber) {
045:                setCorrectionChangeGroupLineNumber(correctionChangeGroupLineNumber);
046:
047:                correctionCriteria = new ArrayList();
048:                correctionChange = new ArrayList();
049:                correctionCriteriaNextLineNumber = new Integer(0);
050:                correctionChangeNextLineNumber = new Integer(0);
051:
052:                setDocumentNumber(documentNumber);
053:            }
054:
055:            public CorrectionChangeGroup() {
056:                super ();
057:                correctionCriteria = new ArrayList();
058:                correctionChange = new ArrayList();
059:                correctionCriteriaNextLineNumber = new Integer(0);
060:                correctionChangeNextLineNumber = new Integer(0);
061:            }
062:
063:            /**
064:             * Add correction change to this correction change group
065:             * 
066:             * @param cc correction change to add
067:             */
068:            public void addCorrectionChange(CorrectionChange cc) {
069:                LOG.debug("addCorrectionChange() started");
070:
071:                cc.setDocumentNumber(documentNumber);
072:                cc
073:                        .setCorrectionChangeGroupLineNumber(correctionChangeGroupLineNumber);
074:                cc
075:                        .setCorrectionChangeLineNumber(correctionChangeNextLineNumber++);
076:                correctionChange.add(cc);
077:            }
078:
079:            /**
080:             * Add correction criteria to this correction change group
081:             * 
082:             * @param cc correction criteria to add to this correction change group
083:             */
084:            public void addCorrectionCriteria(CorrectionCriteria cc) {
085:                cc.setDocumentNumber(documentNumber);
086:                cc
087:                        .setCorrectionChangeGroupLineNumber(correctionChangeGroupLineNumber);
088:                cc
089:                        .setCorrectionCriteriaLineNumber(correctionCriteriaNextLineNumber++);
090:                correctionCriteria.add(cc);
091:            }
092:
093:            /**
094:             * Remove correction change item
095:             * 
096:             * @param changeNumber correction change line number used to determine which correction change item to remove
097:             */
098:            public void removeCorrectionChangeItem(int changeNumber) {
099:                for (Iterator iter = correctionChange.iterator(); iter
100:                        .hasNext();) {
101:                    CorrectionChange element = (CorrectionChange) iter.next();
102:                    if (changeNumber == element.getCorrectionChangeLineNumber()
103:                            .intValue()) {
104:                        iter.remove();
105:                    }
106:                }
107:            }
108:
109:            /**
110:             * Remove correction criteria item 
111:             * 
112:             * @param criteriaNumber correction criteria line number used to determine which correction change to remove
113:             */
114:            public void removeCorrectionCriteriaItem(int criteriaNumber) {
115:                for (Iterator iter = correctionCriteria.iterator(); iter
116:                        .hasNext();) {
117:                    CorrectionCriteria element = (CorrectionCriteria) iter
118:                            .next();
119:                    if (criteriaNumber == element
120:                            .getCorrectionCriteriaLineNumber().intValue()) {
121:                        iter.remove();
122:                    }
123:                }
124:            }
125:
126:            /**
127:             * Get correction change item 
128:             * 
129:             * @param changeNumber correction change line number of object to return
130:             * @return CorrectionChange correction change object with specified line number to return
131:             */
132:            public CorrectionChange getCorrectionChangeItem(int changeNumber) {
133:                for (Iterator iter = correctionChange.iterator(); iter
134:                        .hasNext();) {
135:                    CorrectionChange element = (CorrectionChange) iter.next();
136:                    if (changeNumber == element.getCorrectionChangeLineNumber()
137:                            .intValue()) {
138:                        return element;
139:                    }
140:                }
141:
142:                CorrectionChange cc = new CorrectionChange(getDocumentNumber(),
143:                        correctionChangeGroupLineNumber, changeNumber);
144:                correctionChange.add(cc);
145:
146:                return cc;
147:            }
148:
149:            /**
150:             * Get correction criteria item 
151:             * 
152:             * @param criteriaNumber correction change line number of object to return
153:             * @return CorrectionChange correction change object with specified line number to return
154:             */
155:            public CorrectionCriteria getCorrectionCriteriaItem(
156:                    int criteriaNumber) {
157:                for (Iterator iter = correctionCriteria.iterator(); iter
158:                        .hasNext();) {
159:                    CorrectionCriteria element = (CorrectionCriteria) iter
160:                            .next();
161:                    if (criteriaNumber == element
162:                            .getCorrectionCriteriaLineNumber().intValue()) {
163:                        return element;
164:                    }
165:                }
166:
167:                CorrectionCriteria cc = new CorrectionCriteria(
168:                        getDocumentNumber(), correctionChangeGroupLineNumber,
169:                        criteriaNumber);
170:                correctionCriteria.add(cc);
171:                return cc;
172:            }
173:
174:            public String getDocumentNumber() {
175:                return documentNumber;
176:            }
177:
178:            /**
179:             * Set document number for this correction change group.  This also sets the document number for this correction change group's 
180:             * correction criteria and correction change
181:             * 
182:             * @param documentNumber new document number
183:             */
184:            public void setDocumentNumber(String documentNumber) {
185:                this .documentNumber = documentNumber;
186:
187:                for (Iterator iter = correctionCriteria.iterator(); iter
188:                        .hasNext();) {
189:                    CorrectionCriteria element = (CorrectionCriteria) iter
190:                            .next();
191:                    element.setDocumentNumber(documentNumber);
192:                }
193:                for (Iterator iter = correctionChange.iterator(); iter
194:                        .hasNext();) {
195:                    CorrectionChange element = (CorrectionChange) iter.next();
196:                    element.setDocumentNumber(documentNumber);
197:                }
198:            }
199:
200:            public Integer getCorrectionChangeGroupLineNumber() {
201:                return correctionChangeGroupLineNumber;
202:            }
203:
204:            public void setCorrectionChangeGroupLineNumber(
205:                    Integer correctionChangeGroupLineNumber) {
206:                this .correctionChangeGroupLineNumber = correctionChangeGroupLineNumber;
207:            }
208:
209:            public Integer getCorrectionCriteriaNextLineNumber() {
210:                return correctionCriteriaNextLineNumber;
211:            }
212:
213:            public void setCorrectionCriteriaNextLineNumber(
214:                    Integer correctionCriteriaNextLineNumber) {
215:                this .correctionCriteriaNextLineNumber = correctionCriteriaNextLineNumber;
216:            }
217:
218:            public Integer getCorrectionChangeNextLineNumber() {
219:                return correctionChangeNextLineNumber;
220:            }
221:
222:            public void setCorrectionChangeNextLineNumber(
223:                    Integer correctionChangeNextLineNumber) {
224:                this .correctionChangeNextLineNumber = correctionChangeNextLineNumber;
225:            }
226:
227:            public List<CorrectionCriteria> getCorrectionCriteria() {
228:                Collections.sort(correctionCriteria);
229:                return correctionCriteria;
230:            }
231:
232:            public void setCorrectionCriteria(
233:                    List<CorrectionCriteria> correctionCriteria) {
234:                this .correctionCriteria = correctionCriteria;
235:            }
236:
237:            public List<CorrectionChange> getCorrectionChange() {
238:                Collections.sort(correctionChange);
239:                return correctionChange;
240:            }
241:
242:            public void setCorrectionChange(
243:                    List<CorrectionChange> correctionChange) {
244:                this .correctionChange = correctionChange;
245:            }
246:
247:            /**
248:             * Compares this correction change group to another correction change group object by comparing document number and correction group line number
249:             * 
250:             * @see java.lang.Comparable#compareTo(java.lang.Object)
251:             */
252:            public int compareTo(Object o) {
253:                CorrectionChangeGroup other = (CorrectionChangeGroup) o;
254:
255:                String this FdocNbr = documentNumber == null ? ""
256:                        : documentNumber;
257:                String thatFdocNbr = other.documentNumber == null ? ""
258:                        : other.documentNumber;
259:
260:                int c = this FdocNbr.compareTo(thatFdocNbr);
261:                if (c == 0) {
262:                    Integer this Nbr = correctionChangeGroupLineNumber == null ? 0
263:                            : correctionChangeGroupLineNumber;
264:                    Integer thatNbr = other.correctionChangeGroupLineNumber == null ? 0
265:                            : other.correctionChangeGroupLineNumber;
266:                    return this Nbr.compareTo(thatNbr);
267:                } else {
268:                    return c;
269:                }
270:            }
271:
272:            /**
273:             * @see org.kuali.core.bo.BusinessObjectBase#toStringMapper()
274:             */
275:            protected LinkedHashMap toStringMapper() {
276:                LinkedHashMap m = new LinkedHashMap();
277:                m
278:                        .put(KFSPropertyConstants.DOCUMENT_NUMBER,
279:                                this .documentNumber);
280:                if (this .correctionChangeGroupLineNumber != null) {
281:                    m.put("correctionChangeGroupLineNumber",
282:                            this.correctionChangeGroupLineNumber.toString());
283:                }
284:                return m;
285:            }
286:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.