Source Code Cross Referenced for SourceData.java in  » Testing » KeY » de » uka » ilkd » key » java » 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.java 
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:        package de.uka.ilkd.key.java;
009:
010:        /**
011:         * This class keeps track of the next element to match, which is provided by  
012:         * calling method {@link #getSource()}. The rough idea is to store the parent ast 
013:         * node and the index of the child which has to be matched (for convenience reasons 
014:         * <tt>-1</tt> encodes that the parent node itself has to be matched).
015:         * 
016:         * This kind of wrapping is useful when matching list schemavariables.
017:         */
018:        public class SourceData {
019:
020:            /**
021:             * the program element being either the parent of the program element to be matched or 
022:             * the element itself depending on the value of childPos
023:             */
024:            private ProgramElement element;
025:
026:            /** the position of the children of element which has to be matched
027:             * against the pattern. If <tt>childPos</tt> is <tt>-1</tt> then <tt>element</tt> has to be matched.
028:             */
029:            private int childPos;
030:
031:            /** the services */
032:            private final Services services;
033:
034:            /**
035:             * creates a new source data object with parent node <tt>element</tt> whose 
036:             * <tt>childPos</tt>-th child has to be matched (-1 denotes <tt>element</tt> itself 
037:             * has to be matched 
038:             * @param element the ProgramElement 
039:             * @param childPos the int giving the index of the child of <tt>element</tt> to be matched
040:             * @param services the Services 
041:             */
042:            public SourceData(ProgramElement element, int childPos,
043:                    Services services) {
044:                this .services = services;
045:                this .element = element;
046:                this .childPos = childPos;
047:            }
048:
049:            /**
050:             * returns index of the child to be matched
051:             * @return an int which is <tt>-1</tt> if @link #getElement() 
052:             * has to be matched itself otherwise it refers to the index of the child 
053:             * of <tt>element</tt> to be matched
054:             */
055:            public int getChildPos() {
056:                return childPos;
057:            }
058:
059:            /**
060:             * sets the index of the child to be matched
061:             * @param childPos the int with the new index
062:             */
063:            public void setChildPos(int childPos) {
064:                this .childPos = childPos;
065:            }
066:
067:            /**
068:             * returns always the parent node
069:             * @return the parent node
070:             */
071:            public ProgramElement getElement() {
072:                return element;
073:            }
074:
075:            /**
076:             * sets the parent node
077:             * @param element the ProgramElement used as new parent node
078:             */
079:            public void setElement(ProgramElement element) {
080:                this .element = element;
081:            }
082:
083:            /**
084:             * returns the element to be matched, i.e. if @link #getChildPos() is <tt>-1</tt> 
085:             * it returns @link #getElement()
086:             * otherwise it returns the getChildPos()-th child or <tt>null</tt> if the returned
087:             * child position is out of bound.  
088:             * @return the ProgramElement to be matched next or <tt>null</tt> if there is no such 
089:             * element
090:             */
091:            public ProgramElement getSource() {
092:                if (childPos == -1)
093:                    return element;
094:
095:                final NonTerminalProgramElement ntpe = (NonTerminalProgramElement) element;
096:
097:                if (childPos < ntpe.getChildCount()) {
098:                    return ntpe.getChildAt(childPos);
099:                } else {
100:                    return null;
101:                }
102:            }
103:
104:            /**
105:             * increments the child position by one, this means moving on to the next sibling 
106:             * (or the first child if childPos has been <tt>-1</tt> before     
107:             */
108:            public void next() {
109:                childPos++;
110:            }
111:
112:            /**
113:             * returns the services object 
114:             * @return the services object 
115:             */
116:            public Services getServices() {
117:                return services;
118:            }
119:
120:            /**
121:             * toString
122:             */
123:            public String toString() {
124:                return "Source:" + element + " child: " + childPos;
125:            }
126:
127:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.