Source Code Cross Referenced for SourceCode.java in  » Testing » KeY » de » uka » ilkd » key » casetool » patternimplementor » 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.patternimplementor 
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.patternimplementor;
012:
013:        public class SourceCode extends java.util.Vector {
014:
015:            public String toString() {
016:                String retval = new String();
017:
018:                retval = toText(true);
019:                retval = retval + "-----------------\nNumber of classes : "
020:                        + nofClasses() + "\n";
021:
022:                /*
023:                 * if(nofClasses() > 4) { retval = retval + getClass(0); }
024:                 */
025:                return retval.trim();
026:            }
027:
028:            public String getClassName() {
029:                for (int i = 0; i < size(); i++) {
030:                    if (elementAt(i) instanceof  ClassDelimiter) {
031:                        return ((ClassDelimiter) elementAt(i)).getName();
032:                    }
033:                }
034:                return null;
035:            }
036:
037:            public String toText() {
038:                return toText(false);
039:            }
040:
041:            public String toText(boolean includingClassDelimiter) {
042:                String retval = new String();
043:                for (int i = 0; i < size(); i++) {
044:                    if (includingClassDelimiter) {
045:                        retval = retval + elementAt(i).toString() + "\n";
046:                    } else {
047:                        if (!(elementAt(i) instanceof  ClassDelimiter)) {
048:                            retval = retval + elementAt(i).toString() + "\n";
049:                        }
050:                    }
051:
052:                }
053:                return retval;
054:            }
055:
056:            public void add() {
057:                add("");
058:            }
059:
060:            public boolean add(Object sc) {
061:                if (sc != null) {
062:                    return super .add(sc);
063:                }
064:
065:                return false;
066:            }
067:
068:            public void add(SourceCode sc) {
069:                for (int i = 0; i < sc.size(); i++) {
070:                    add(sc.elementAt(i));
071:                }
072:            }
073:
074:            public void beginClass(String name) {
075:                if (name.indexOf(".java") == -1) {
076:                    add(new ClassDelimiter(name + ".java"));
077:                } else {
078:                    add(new ClassDelimiter(name));
079:                }
080:            }
081:
082:            /*
083:             * class Context { private String context; Context(String context){
084:             * this.context = context; } public String toString() { return "// context :
085:             * "+context; } }
086:             */
087:            public int nofClasses() {
088:                int counter = 0;
089:
090:                //System.out.println(".................................");
091:                for (int i = 0; i < size(); i++) {
092:                    if (elementAt(i) instanceof  ClassDelimiter) {
093:                        counter++;
094:                    }
095:                }
096:
097:                return counter;
098:            }
099:
100:            /**
101:             * 
102:             * @param index -
103:             *            index of the class to be returned
104:             * @return the index:th class. The classes are numbered from 0 to
105:             *         nofClasses-1. If the index given outside the possible range, an
106:             *         empty SourceCode will be returned.
107:             */
108:            public SourceCode getClass(int index) {
109:                int counter = -1;
110:                SourceCode retval = new SourceCode();
111:
112:                //System.out.println(".................................");
113:                for (int i = 0; i < size(); i++) {
114:                    if (elementAt(i) instanceof  ClassDelimiter) {
115:                        counter++;
116:
117:                        if (counter == index) {
118:                            int j = i + 1;
119:                            retval.add(elementAt(i));
120:
121:                            while ((j < size())
122:                                    && !(elementAt(j) instanceof  ClassDelimiter)) {
123:                                retval.add(elementAt(j));
124:                                j++;
125:                            }
126:
127:                            return retval;
128:                        }
129:                    }
130:                }
131:
132:                return retval;
133:            }
134:
135:            /*
136:             * public void setContext(String context) { add(new Context(context)); }
137:             */
138:            class ClassDelimiter {
139:
140:                private String name;
141:
142:                ClassDelimiter(String name) {
143:                    this .name = name;
144:                }
145:
146:                public String toString() {
147:                    return "8<--------- " + name + " -----------";
148:                }
149:
150:                public String getName() {
151:                    return name;
152:                }
153:            }
154:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.