Source Code Cross Referenced for MonitorSet.java in  » Code-Analyzer » soot » soot » jimple » toolkits » thread » mhp » 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 » Code Analyzer » soot » soot.jimple.toolkits.thread.mhp 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package soot.jimple.toolkits.thread.mhp;
002:
003:        import java.util.*;
004:        import soot.toolkits.scalar.*;
005:
006:        // *** USE AT YOUR OWN RISK ***
007:        // May Happen in Parallel (MHP) analysis by Lin Li.
008:        // This code should be treated as beta-quality code.
009:        // It was written in 2003, but not incorporated into Soot until 2006.
010:        // As such, it may contain incorrect assumptions about the usage
011:        // of certain Soot classes.
012:        // Some portions of this MHP analysis have been quality-checked, and are
013:        // now used by the Transactions toolkit.
014:        //
015:        // -Richard L. Halpert, 2006-11-30
016:
017:        public class MonitorSet extends ArraySparseSet {
018:
019:            //    int size = 0;
020:
021:            MonitorSet() {
022:                super ();
023:            }
024:
025:            public Object getMonitorDepth(String objName) {
026:                Iterator it = iterator();
027:                while (it.hasNext()) {
028:                    Object obj = it.next();
029:                    if (obj instanceof  MonitorDepth) {
030:                        MonitorDepth md = (MonitorDepth) obj;
031:                        if (md.getObjName().equals(objName))
032:                            return md;
033:                    }
034:                }
035:                return null;
036:            }
037:
038:            public MonitorSet clone() {
039:                MonitorSet newSet = new MonitorSet();
040:                newSet.union(this );
041:                return newSet;
042:            }
043:
044:            /*public void copy(MonitorSet dest){
045:             System.out.println("====begin copy");
046:             dest.clear();
047:             Iterator iterator = iterator();
048:             while (iterator.hasNext()){
049:             Object obj = iterator.next();
050:             if (obj instanceof MonitorDepth) {
051:             System.out.println("obj: "+((MonitorDepth)obj).getObjName());
052:             System.out.println("depth: "+((MonitorDepth)obj).getDepth());	
053:             }
054:             else
055:             System.out.println("obj: "+obj);
056:             if (!dest.contains(obj)) dest.add(obj);
057:             else System.out.println("dest contains "+obj);
058:             }
059:             System.out.println("===finish copy===");
060:             }
061:             */
062:
063:            /**
064:             * Returns the union (join) of this MonitorSet and <code>other</code>, putting
065:             * result into <code>this</code>. */
066:            public void union(MonitorSet other) {
067:
068:            }
069:
070:            /**
071:             * Returns the union (join) of this MonitorSet and <code>other</code>, putting
072:             * result into <code>dest</code>. <code>dest</code>, <code>other</code> and
073:             * <code>this</code> could be the same object.
074:             */
075:            /*ublic void union(MonitorSet other, MonitorSet dest){
076:             other.copy(dest);
077:             Iterator iterator = iterator();
078:             while (iterator.hasNext()){
079:             
080:             MonitorDepth md = (MonitorDepth)iterator.next();
081:             Object obj = dest.getMonitorDepth(md.getObjName());
082:             if ( obj == null){
083:             dest.add(md);
084:             }
085:             else{
086:             if (obj instanceof MonitorDepth){
087:             if (md.getDepth() != ((MonitorDepth)obj).getDepth())
088:             throw new RuntimeException("Find different monitor depth at merge point!");
089:             
090:             }
091:             else
092:             throw new RuntimeException("MonitorSet contains non MonitorDepth element!");
093:             }
094:             
095:             }
096:             
097:             }
098:             */
099:            public void intersection(MonitorSet other, MonitorSet dest) {
100:                /*
101:                 System.out.println("this:");
102:                 this.test();
103:                 System.out.println("other:");
104:                 other.test();
105:                 */
106:                if (other.contains("&")) {
107:
108:                    this .copy(dest);
109:                    //System.out.println("copy this to dest: ");
110:                    //dest.test();
111:                } else if (this .contains("&")) {
112:                    other.copy(dest);
113:                    //System.out.println("copy other to dest: ");
114:                    //dest.test();
115:                } else {
116:                    Iterator it = iterator();
117:                    while (it.hasNext()) {
118:                        Object o = it.next();
119:                        if (o instanceof  MonitorDepth) {
120:                            MonitorDepth md = (MonitorDepth) o;
121:                            Object obj = dest.getMonitorDepth(md.getObjName());
122:                            if (obj != null)
123:
124:                                if (md.getDepth() != ((MonitorDepth) obj)
125:                                        .getDepth()) {
126:                                    throw new RuntimeException(
127:                                            "stmt inside different monitor depth !");
128:                                } else
129:                                    dest.add(obj);
130:                        }
131:                    }
132:
133:                }
134:
135:            }
136:
137:            public void test() {
138:                System.out.println("====MonitorSet===");
139:                Iterator it = iterator();
140:                while (it.hasNext()) {
141:                    Object obj = it.next();
142:                    if (obj instanceof  MonitorDepth) {
143:                        MonitorDepth md = (MonitorDepth) obj;
144:                        ;
145:                        System.out.println("obj: " + md.getObjName());
146:                        System.out.println("depth: " + md.getDepth());
147:                    } else
148:                        System.out.println(obj);
149:                }
150:                System.out.println("====MonitorSet end====");
151:            }
152:
153:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.