Source Code Cross Referenced for Jumps.java in  » Web-Framework » anvil » anvil » script » statements » 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 » Web Framework » anvil » anvil.script.statements 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * $Id: Jumps.java,v 1.5 2002/09/16 08:05:06 jkl Exp $
003:         *
004:         * Copyright (c) 2002 Njet Communications Ltd. All Rights Reserved.
005:         *
006:         * Use is subject to license terms, as defined in
007:         * Anvil Sofware License, Version 1.1. See LICENSE 
008:         * file, or http://njet.org/license-1.1.txt
009:         */
010:        package anvil.script.statements;
011:
012:        import java.io.PrintStream;
013:
014:        /**
015:         * class Jumps
016:         *
017:         * @author: Jani Lehtimäki
018:         */
019:        public class Jumps {
020:
021:            public static final int BLOCKED = 1;
022:            public static final int EXIT = 2;
023:            public static final int RETURN = 4;
024:            public static final int THROW = 8;
025:
026:            public static final int BREAK = 1;
027:            public static final int CONTINUE = 1;
028:
029:            private byte _flags = 0;
030:            private long _break = 0;
031:            private long _continue = 0;
032:
033:            public Jumps() {
034:            }
035:
036:            public Jumps(Jumps jumps) {
037:                merge(jumps);
038:            }
039:
040:            public boolean isBlocked() {
041:                return (_flags & BLOCKED) != 0;
042:            }
043:
044:            public Jumps setBlocked(boolean blocked) {
045:                if (blocked) {
046:                    _flags |= BLOCKED;
047:                } else {
048:                    _flags &= ~BLOCKED;
049:                }
050:                return this ;
051:            }
052:
053:            public boolean hasExit() {
054:                return (_flags & EXIT) != 0;
055:            }
056:
057:            public Jumps setExit() {
058:                _flags |= EXIT;
059:                return this ;
060:            }
061:
062:            public boolean hasReturn() {
063:                return (_flags & RETURN) != 0;
064:            }
065:
066:            public Jumps setReturn() {
067:                _flags |= RETURN;
068:                return this ;
069:            }
070:
071:            public Jumps setReturn(boolean hasReturn) {
072:                if (hasReturn) {
073:                    _flags |= RETURN;
074:                } else {
075:                    _flags &= ~RETURN;
076:                }
077:                return this ;
078:            }
079:
080:            public boolean hasThrow() {
081:                return (_flags & THROW) != 0;
082:            }
083:
084:            public Jumps setThrow() {
085:                _flags |= THROW;
086:                return this ;
087:            }
088:
089:            public Jumps setThrow(boolean hasThrow) {
090:                if (hasThrow) {
091:                    _flags |= THROW;
092:                } else {
093:                    _flags &= ~THROW;
094:                }
095:                return this ;
096:            }
097:
098:            public boolean hasBreak() {
099:                return (_break & BREAK) != 0;
100:            }
101:
102:            public Jumps setBreak() {
103:                _break |= BREAK;
104:                return this ;
105:            }
106:
107:            public Jumps setBreak(int depth) {
108:                if (depth > 63) {
109:                    throw new RuntimeException(
110:                            "Statement nesting depth overflow");
111:                }
112:                _break |= (BREAK << depth);
113:                return this ;
114:            }
115:
116:            public boolean hasContinue() {
117:                return (_continue & CONTINUE) != 0;
118:            }
119:
120:            public Jumps setContinue() {
121:                _continue |= CONTINUE;
122:                return this ;
123:            }
124:
125:            public Jumps setContinue(int depth) {
126:                if (depth > 63) {
127:                    throw new RuntimeException(
128:                            "Statement nesting depth overflow");
129:                }
130:                _continue |= (CONTINUE << depth);
131:                return this ;
132:            }
133:
134:            public Jumps merge(Jumps jumps) {
135:                _flags |= jumps._flags;
136:                _break |= jumps._break;
137:                _continue |= jumps._continue;
138:                return this ;
139:            }
140:
141:            public Jumps shift() {
142:                _break >>= 1;
143:                _continue >>= 1;
144:                return this ;
145:            }
146:
147:            public void print(String source) {
148:                System.out.print("** " + source + ": ");
149:
150:                long b = _break;
151:                int c = 0;
152:                while (b != 0) {
153:                    if ((b & 1) != 0) {
154:                        System.out.print("b" + c + " ");
155:                    }
156:                    b = b >> 1;
157:                    c++;
158:                }
159:
160:                b = _continue;
161:                c = 0;
162:                while (b != 0) {
163:                    if ((b & 1) != 0) {
164:                        System.out.print("c" + c + " ");
165:                    }
166:                    b = b >> 1;
167:                    c++;
168:                }
169:
170:                if ((_flags & EXIT) != 0) {
171:                    System.out.print("exit ");
172:                }
173:                if ((_flags & RETURN) != 0) {
174:                    System.out.print("return ");
175:                }
176:
177:                if ((_flags & THROW) != 0) {
178:                    System.out.print("throw ");
179:                }
180:
181:                if ((_flags & BLOCKED) != 0) {
182:                    System.out.print("blocked");
183:                }
184:
185:                System.out.println();
186:
187:            }
188:
189:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.