Source Code Cross Referenced for ShadowAttributeOp.java in  » Testing » KeY » de » uka » ilkd » key » logic » op » 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.logic.op 
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:        package de.uka.ilkd.key.logic.op;
011:
012:        import java.lang.ref.WeakReference;
013:        import java.util.WeakHashMap;
014:
015:        import de.uka.ilkd.key.logic.Term;
016:
017:        /** 
018:         * this class is used to represent the reference operator '.' 
019:         * in the shadow form (for transactions)
020:         */
021:        public class ShadowAttributeOp extends AttributeOp implements 
022:                ShadowedOperator {
023:
024:            /** 
025:             * The pool of already created attribute operators. Ensures
026:             * 'singleton' property of attribute operators.
027:             */
028:            private static final WeakHashMap operatorPool = new WeakHashMap(50);
029:
030:            /** 
031:             * returns and if neccessary creates the access operator of the
032:             * given attribute 
033:             * @return the attribute operator for the given attribute
034:             */
035:            public static ShadowAttributeOp getShadowAttributeOp(
036:                    IProgramVariable attribute) {
037:                WeakReference attributeOpReference = (WeakReference) operatorPool
038:                        .get(attribute);
039:                if (attributeOpReference == null
040:                        || attributeOpReference.get() == null) {
041:                    // wrapping attributeOp in a weak reference is necessary as
042:                    // it contains a strong reference to its key
043:                    attributeOpReference = new WeakReference(
044:                            new ShadowAttributeOp(attribute));
045:                    operatorPool.put(attribute, attributeOpReference);
046:                }
047:                return (ShadowAttributeOp) attributeOpReference.get();
048:            }
049:
050:            /** 
051:             * creates a new shadow attribute operator.
052:             */
053:            private ShadowAttributeOp(IProgramVariable attribute) {
054:                super (attribute);
055:            }
056:
057:            /**
058:             * In contrast to the standard attribute access operator the arity
059:             * of a shadowed attribute is two. The first term denotes the object
060:             * whose field is accessed and second one stores a shadow marker.
061:             * @return arity of the Operator as int 
062:             */
063:            public int arity() {
064:                return 2;
065:            }
066:
067:            /**
068:             * @return true if the operator is a shadowed 
069:             */
070:            public boolean isShadowed() {
071:                return true;
072:            }
073:
074:            /**
075:             * returns the transaction number (shadow marker) of the given term
076:             * it assumes that the term's top operator is a ShadowedAttributeOp
077:             */
078:            public Term getTransactionNumber(Term t) {
079:                return t.sub(1);
080:            }
081:
082:            /**
083:             * returns true if the given loc may be aliased by the current location 
084:             */
085:            public boolean mayBeAliasedBy(Location loc) {
086:                if (loc == this ) {
087:                    return true;
088:                }
089:
090:                if (loc instanceof  AttributeOp) {
091:                    return attributesAliased(((AttributeOp) loc).attribute());
092:                }
093:
094:                return false;
095:            }
096:
097:            /**
098:             * @param variable
099:             * @return
100:             */
101:            private boolean attributesAliased(IProgramVariable variable) {
102:                boolean attributesAliased = (variable instanceof  SortedSchemaVariable || attribute() instanceof  SortedSchemaVariable);
103:
104:                attributesAliased = attributesAliased
105:                        || variable == attribute();
106:
107:                return attributesAliased;
108:            }
109:
110:            public String toString() {
111:                return ".(shadowed)" + attribute();
112:            }
113:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.