Source Code Cross Referenced for Byte.java in  » Ajax » GWT » com » google » gwt » emul » java » lang » 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 » Ajax » GWT » com.google.gwt.emul.java.lang 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2007 Google Inc.
003:         * 
004:         * Licensed under the Apache License, Version 2.0 (the "License"); you may not
005:         * use this file except in compliance with the License. You may obtain a copy of
006:         * the License at
007:         * 
008:         * http://www.apache.org/licenses/LICENSE-2.0
009:         * 
010:         * Unless required by applicable law or agreed to in writing, software
011:         * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
012:         * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
013:         * License for the specific language governing permissions and limitations under
014:         * the License.
015:         */
016:        package java.lang;
017:
018:        /**
019:         * Wraps native <code>byte</code> as an object.
020:         */
021:        public final class Byte extends Number implements  Comparable<Byte> {
022:
023:            public static final byte MIN_VALUE = (byte) 0x80;
024:            public static final byte MAX_VALUE = (byte) 0x7F;
025:            public static final int SIZE = 8;
026:
027:            // Box all values according to JLS
028:            private static Byte[] boxedValues = new Byte[256];
029:
030:            public static Byte decode(String s) throws NumberFormatException {
031:                return new Byte((byte) __decodeAndValidateLong(s, MIN_VALUE,
032:                        MAX_VALUE));
033:            }
034:
035:            /**
036:             * @skip
037:             * 
038:             * Here for shared implementation with Arrays.hashCode
039:             */
040:            public static int hashCode(byte b) {
041:                return b;
042:            }
043:
044:            public static byte parseByte(String s) throws NumberFormatException {
045:                final int baseTen = 10;
046:                return parseByte(s, baseTen);
047:            }
048:
049:            public static byte parseByte(String s, int radix)
050:                    throws NumberFormatException {
051:                return (byte) __parseAndValidateLong(s, radix, MIN_VALUE,
052:                        MAX_VALUE);
053:            }
054:
055:            public static String toString(byte b) {
056:                return String.valueOf(b);
057:            }
058:
059:            public static Byte valueOf(byte b) {
060:                int rebase = b + 128;
061:                if (boxedValues[rebase] == null) {
062:                    boxedValues[rebase] = new Byte(b);
063:                }
064:                return boxedValues[rebase];
065:            }
066:
067:            public static Byte valueOf(String s) throws NumberFormatException {
068:                return new Byte(Byte.parseByte(s));
069:            }
070:
071:            public static Byte valueOf(String s, int radix)
072:                    throws NumberFormatException {
073:                return new Byte(Byte.parseByte(s, radix));
074:            }
075:
076:            private final transient byte value;
077:
078:            public Byte(byte value) {
079:                this .value = value;
080:            }
081:
082:            public Byte(String s) {
083:                value = parseByte(s);
084:            }
085:
086:            @Override
087:            public byte byteValue() {
088:                return value;
089:            }
090:
091:            public int compareTo(Byte b) {
092:                if (value < b.value) {
093:                    return -1;
094:                } else if (value > b.value) {
095:                    return 1;
096:                } else {
097:                    return 0;
098:                }
099:            }
100:
101:            @Override
102:            public double doubleValue() {
103:                return value;
104:            }
105:
106:            @Override
107:            public boolean equals(Object o) {
108:                return (o instanceof  Byte) && (((Byte) o).value == value);
109:            }
110:
111:            @Override
112:            public float floatValue() {
113:                return value;
114:            }
115:
116:            @Override
117:            public int hashCode() {
118:                return hashCode(value);
119:            }
120:
121:            @Override
122:            public int intValue() {
123:                return value;
124:            }
125:
126:            @Override
127:            public long longValue() {
128:                return value;
129:            }
130:
131:            @Override
132:            public short shortValue() {
133:                return value;
134:            }
135:
136:            @Override
137:            public String toString() {
138:                return toString(value);
139:            }
140:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.