Source Code Cross Referenced for S.java in  » Scripting » Nice » mlsub » typing » lowlevel » 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 » Scripting » Nice » mlsub.typing.lowlevel 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package mlsub.typing.lowlevel;
002:
003:        import java.util.Properties;
004:        import java.io.*;
005:
006:        /**
007:         * Repository of useful global variables and methods
008:         *
009:         * @version $Revision: 1.4 $, $Date: 2002/08/22 16:58:17 $
010:         * @author Alexandre Frey
011:         **/
012:        public class S {
013:            private S() {
014:            }
015:
016:            final static boolean ALLOW_RC = false;
017:
018:            final public static Properties props = new Properties();
019:            static {
020:                try {
021:                    FileInputStream in = new FileInputStream(new File(System
022:                            .getProperty("user.home"), ".jazzrc"));
023:                    props.load(new BufferedInputStream(in));
024:                    in.close();
025:                } catch (Exception e) {
026:                }
027:            }
028:
029:            public static boolean getBoolean(boolean defaultValue, String name) {
030:                if (ALLOW_RC) {
031:                    String value = props.getProperty(name);
032:                    if (value == null) {
033:                        return defaultValue;
034:                    } else {
035:                        return value.equals("true");
036:                    }
037:                } else {
038:                    return defaultValue;
039:                }
040:            }
041:
042:            final public static boolean debug = getBoolean(false, "debug");
043:
044:            final public static boolean debugK0 = getBoolean(false, "debug.K0");
045:
046:            final public static boolean debugBlock = getBoolean(false,
047:                    "debug.block");
048:            final public static boolean contextSimpl = getBoolean(true,
049:                    "context.simplify");
050:
051:            final public static boolean debugSimpl = getBoolean(false,
052:                    "debug.simplify");
053:            final public static boolean trace = getBoolean(false, "trace");
054:            final public static boolean trace2 = getBoolean(false, "trace2");
055:            final public static boolean debugScope = getBoolean(false,
056:                    "debug.scope");
057:            final public static boolean debugDepend = getBoolean(false,
058:                    "debug.depend");
059:
060:            final public static boolean simplifyBlock = getBoolean(true,
061:                    "simplify.block");
062:            final public static boolean prettyPrint = getBoolean(false,
063:                    "pretty.print");
064:            final public static boolean debugPrint = getBoolean(false,
065:                    "debug.print");
066:            final public static boolean debugType = getBoolean(false,
067:                    "debug.type");
068:            final public static boolean debugPoly = getBoolean(false,
069:                    "debug.poly");
070:
071:            final public static boolean traceDispatch = getBoolean(false,
072:                    "trace.dispatch");
073:            final public static boolean traceDepth = getBoolean(false,
074:                    "trace.depth");
075:            final public static boolean debugMeth = getBoolean(false,
076:                    "debug.meth");
077:            final public static boolean debug1 = getBoolean(false, "debug.1");
078:            final public static boolean debug3 = getBoolean(false, "debug.3");
079:            final public static boolean debug2 = getBoolean(false, "debug.2");
080:            final public static boolean debugInterf = getBoolean(false,
081:                    "debug.interf");
082:            final public static boolean allowOverloading = getBoolean(false,
083:                    "allow.overloading");
084:            final public static boolean debugNative = getBoolean(false,
085:                    "debug.native");
086:            final public static boolean debugBinders = getBoolean(false,
087:                    "debug.binders");
088:            final public static boolean debugNullTypeArgs = getBoolean(false,
089:                    "debug.nullTypeArgs");
090:            final public static boolean debugModule = getBoolean(false,
091:                    "debug.module");
092:
093:            final public static PrintWriter dbg = new PrintWriter(System.err,
094:                    true);
095:
096:            public static Error panic() {
097:                return panic("");
098:            }
099:
100:            public static Error panic(String msg) {
101:                bossa.util.Internal.error("panic: " + msg);
102:                return null;
103:
104:            }
105:
106:            public static void printStack() {
107:                try {
108:                    throw new Throwable();
109:                } catch (Throwable e) {
110:                    e.printStackTrace(S.dbg);
111:                }
112:            }
113:
114:            public static String address(Object x) {
115:                //    return (x == null ? "null" : Integer.toHexString(x.hashCode()));
116:                return (x == null ? "null" : Integer
117:                        .toString(x.hashCode() % 10000));
118:            }
119:
120:            public static void assume(boolean cond) {
121:                assume(cond, "");
122:            }
123:
124:            public static void assume(boolean cond, Object message) {
125:                if (allowAssert && !cond) {
126:                    S.panic("assertion failed: " + message);
127:                }
128:            }
129:
130:            final private static boolean allowAssert = true;
131:            final public static boolean a = allowAssert;
132:
133:            public final static int VERBOSE_MUTE = 0;
134:            public final static int VERBOSE_DEFAULT = 1;
135:            public final static int VERBOSE_DEVEL = 2;
136:
137:            /**
138:             * verbose = 0: mute
139:             * verbose = 1: reasonable
140:             * verbose = 2: developer
141:             **/
142:            private static int verboseLevel = 1;
143:
144:            static void setVerboseLevel(int verboseLevel) {
145:                S.verboseLevel = verboseLevel;
146:            }
147:
148:            public static void verbosePrintln(int level, String msg) {
149:                if (level <= verboseLevel) {
150:                    S.dbg.println(msg);
151:                }
152:            }
153:
154:            public static void verbosePrint(int level, String msg) {
155:                if (level <= verboseLevel) {
156:                    S.dbg.print(msg);
157:                    S.dbg.flush();
158:                }
159:            }
160:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.