Source Code Cross Referenced for UMLInfo.java in  » Testing » KeY » de » uka » ilkd » key » casetool » 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 » Testing » KeY » de.uka.ilkd.key.casetool 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        // This file is part of KeY - Integrated Deductive Software Design
002:        // Copyright (C) 2001-2007 Universitaet Karlsruhe, Germany
003:        //                         Universitaet Koblenz-Landau, Germany
004:        //                         Chalmers University of Technology, Sweden
005:        //
006:        // The KeY system is protected by the GNU General Public License. 
007:        // See LICENSE.TXT for details.
008:        //
009:        //
010:
011:        package de.uka.ilkd.key.casetool;
012:
013:        import de.uka.ilkd.key.java.JavaInfo;
014:        import de.uka.ilkd.key.java.Services;
015:        import de.uka.ilkd.key.java.abstraction.KeYJavaType;
016:
017:        public class UMLInfo {
018:            private final Services services;
019:            private final ListOfAssociation allAssociations;
020:
021:            public UMLInfo(Services services, ListOfAssociation allAssociations) {
022:                this .services = services;
023:                this .allAssociations = allAssociations;
024:            }
025:
026:            /**
027:             * Returns all associations with at least one end in the passed type 
028:             * or one of its supertypes.
029:             */
030:            public ListOfAssociation getAssociations(KeYJavaType kjt) {
031:                assert kjt != null;
032:                ListOfAssociation result = SLListOfAssociation.EMPTY_LIST;
033:
034:                IteratorOfAssociation it = allAssociations.iterator();
035:                while (it.hasNext()) {
036:                    Association assoc = it.next();
037:
038:                    IteratorOfAssociationEnd it2 = assoc.getEnds().iterator();
039:                    while (it2.hasNext()) {
040:                        AssociationEnd end = it2.next();
041:                        String endClassName = end.getModelClass()
042:                                .getFullClassName();
043:                        KeYJavaType endKjt = services.getJavaInfo()
044:                                .getKeYJavaTypeByClassName(endClassName);
045:
046:                        if (services.getJavaInfo().isSubtype(kjt, endKjt)) {
047:                            result = result.prepend(assoc);
048:                            break;
049:                        }
050:                    }
051:                }
052:
053:                return result;
054:            }
055:
056:            /**
057:             * Returns all binary associations with at least one end in the passed type,
058:             * and whose role name on the other side is the passed string.
059:             */
060:            public ListOfAssociation getAssociations(KeYJavaType kjt,
061:                    String qualifier) {
062:                ListOfAssociation result = SLListOfAssociation.EMPTY_LIST;
063:
064:                //iterate over all associations for the desired class
065:                ListOfAssociation classAssocs = getAssociations(kjt);
066:                IteratorOfAssociation it = classAssocs.iterator();
067:                while (it.hasNext()) {
068:                    Association assoc = it.next();
069:
070:                    ListOfAssociationEnd ends = assoc.getEnds();
071:                    if (ends.size() != 2) {
072:                        continue;
073:                    }
074:
075:                    //identify possible "other side" ends
076:                    JavaInfo javaInfo = services.getJavaInfo();
077:                    String end1ClassName = ends.head().getModelClass()
078:                            .getFullClassName();
079:                    String end2ClassName = ends.tail().head().getModelClass()
080:                            .getFullClassName();
081:                    KeYJavaType end1Kjt = javaInfo
082:                            .getTypeByClassName(end1ClassName);
083:                    KeYJavaType end2Kjt = javaInfo
084:                            .getTypeByClassName(end2ClassName);
085:                    ListOfAssociationEnd targetEnds = SLListOfAssociationEnd.EMPTY_LIST;
086:                    if (javaInfo.isSubtype(kjt, end1Kjt)) {
087:                        targetEnds = targetEnds.prepend(ends.tail().head());
088:                    }
089:                    if (javaInfo.isSubtype(kjt, end2Kjt)) {
090:                        targetEnds = targetEnds.prepend(ends.head());
091:                    }
092:                    assert !targetEnds.isEmpty();
093:
094:                    //check if one of those ends has the desired role name
095:                    IteratorOfAssociationEnd it2 = targetEnds.iterator();
096:                    while (it2.hasNext()) {
097:                        AssociationEnd end = it2.next();
098:                        if (end.getRoleName().toString().equals(qualifier)) {
099:                            result = result.prepend(assoc);
100:                            break;
101:                        }
102:                    }
103:                }
104:
105:                return result;
106:            }
107:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.