Source Code Cross Referenced for TypeBoundTranslation.java in  » Testing » KeY » de » uka » ilkd » key » proof » decproc » 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.proof.decproc 
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:        //This file is part of KeY - Integrated Deductive Software Design
009:        //Copyright (C) 2001-2005 Universitaet Karlsruhe, Germany
010:        //                      Universitaet Koblenz-Landau, Germany
011:        //                      Chalmers University of Technology, Sweden
012:        //
013:        //The KeY system is protected by the GNU General Public License. 
014:        //See LICENSE.TXT for details.
015:        //
016:        //
017:
018:        package de.uka.ilkd.key.proof.decproc;
019:
020:        /** This class is responsible for the translation of type boundary <tt>String</tt>s into their 
021:         * actual values.
022:         *  
023:         * @author akuwertz
024:         * @version 1.0,  03/31/2006 
025:         */
026:
027:        public class TypeBoundTranslation {
028:
029:            /** The array of <tt>String</tt> representations of the type boundary values */
030:            private static final String[][] typeBounds = new String[][] {
031:            // Int bounds
032:                    { "-2147483648", //MIN
033:                            "2147483647", //MAX
034:                            "2147483648", //HALFRANGE
035:                            "4294967296" //RANGE 
036:                    },
037:
038:                    // Char bounds
039:                    { "0", //MIN  
040:                            "65535", //MAX
041:                            null, // NullPointerException for char_HALFRANGE
042:                            "65535" //RANGE
043:                    },
044:
045:                    // Long bounds
046:                    { "-9223372036854775808", //MIN
047:                            "9223372036854775807", //MAX
048:                            "9223372036854775808", //HALFRANGE
049:                            "18446744073709551616" //RANGE
050:                    },
051:
052:                    // Byte bounds
053:                    { "-128", //MIN
054:                            "127", //MAX
055:                            "128", //HALFRANGE
056:                            "256" //RANGE
057:                    },
058:
059:                    // Short bounds
060:                    { "-32768", //MIN
061:                            "32767", //MAX
062:                            "32768", //HALFRANGE
063:                            "65536" //RANGE
064:                    } };
065:
066:            /** String constants for wrong boundary specifiers */
067:            private static final String noTypeBoundString = "The given string constant does not represent a valid type boudary!";
068:
069:            /** Make the constructor private */
070:            private TypeBoundTranslation() {
071:                super ();
072:            }
073:
074:            /* Public method implementation */
075:
076:            /** Returns a <tt>String</tt> representation of the value of a type boundary specified by 
077:             * the argument <tt>String</tt> <tt>typeBound</tt>
078:             * 
079:             * @param typeBound the type boundary to be translated into a value
080:             * @throws IllegalArgumentException if <tt>typeBound</tt> represent no valid type boundary
081:             */
082:            public static String getTypeBoundValue(String typeBound) {
083:
084:                int indexOne, indexTwo;
085:
086:                // Parse type constraint
087:                String[] parts = typeBound.split("_");
088:                String partOne = parts[0];
089:                String partTwo = parts[1];
090:
091:                // Compare data type
092:                if (partOne.equals("int"))
093:                    indexOne = 0;
094:                else if (partOne.equals("char"))
095:                    indexOne = 1;
096:                else if (partOne.equals("long"))
097:                    indexOne = 2;
098:                else if (partOne.equals("byte"))
099:                    indexOne = 3;
100:                else if (partOne.equals("short"))
101:                    indexOne = 4;
102:                else
103:                    throw new IllegalArgumentException(noTypeBoundString);
104:
105:                // compare constraint
106:                if (partTwo.equals("MIN"))
107:                    indexTwo = 0;
108:                else if (partTwo.equals("MAX"))
109:                    indexTwo = 1;
110:                else if (partTwo.equals("HALFRANGE"))
111:                    indexTwo = 2;
112:                else if (partTwo.equals("RANGE"))
113:                    indexTwo = 3;
114:                else
115:                    throw new IllegalArgumentException(noTypeBoundString);
116:
117:                return typeBounds[indexOne][indexTwo];
118:            }
119:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.