Mercurial > projects > dwt2
annotate base/src/java/lang/Integer.d @ 120:536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
===D2===
* added [Try]Immutable/Const/Shared templates to work with differenses in D1/D2 instead of version statements
used these templates to work with strict type storage rules of dmd-2.053
* com.ibm.icu now also compilable with D2, but not tested yet
* small fixes
Snippet288 - shared data is in TLS
===Phobos===
* fixed critical bugs in Phobos implemention
completely incorrect segfault prone fromStringz (Linux's port ruthless killer)
terrible, incorrect StringBuffer realization (StyledText killer)
* fixed small bugs as well
Snippet72 - misprint in the snippet
* implemented missed functionality for Phobos
ByteArrayOutputStream implemented (image loading available)
formatting correctly works for all DWT's cases
As a result, folowing snippets now works with Phobos (Snippet### - what is fixed):
Snippet24, 42, 111, 115, 130, 235, 276 - bad string formatting
Snippet48, 282 - crash on image loading
Snippet163, 189, 211, 213, 217, 218, 222 - crash on copy/cut in StyledText
Snippet244 - hang-up
===Tango===
* few changes for the latest Tango trunc-r5661
* few small performance improvments
===General===
* implMissing-s for only one version changed to implMissingInTango/InPhobos
* incorrect calls to Format in toString-s fixed
* fixed loading \uXXXX characters in ResourceBundle
* added good UTF-8 support for StyledText, TextLayout (Win32) and friends
UTF functions revised and tested. It is now in java.nonstandard.*Utf modules
StyledText and TextLayout (Win32) modules revised for UTF-8 support
* removed small diferences in most identical files in *.swt.* folders
*.swt.internal.image, *.swt.events and *.swt.custom are identical in Win32/Linux32
now 179 of 576 (~31%) files in *.swt.* folders are fully identical
* Win32: snippets now have right subsystem, pretty icons and native system style controls
* small fixes in snippets
Snippet44 - it's not Snippet44
Snippet212 - functions work with different images and offsets arrays
Win32: Snippet282 - crash on close if the button has an image
Snippet293 - setGrayed is commented
and others
Win32: As a result, folowing snippets now works
Snippet68 - color doesn't change
Snippet163, 189, 211, 213, 217, 218, 222 - UTF-8 issues (see above)
Snippet193 - no tabel headers
author | Denis Shelomovskij <verylonglogin.reg@gmail.com> |
---|---|
date | Sat, 09 Jul 2011 15:50:20 +0300 |
parents | 46539f5c5993 |
children |
rev | line source |
---|---|
0
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1 module java.lang.Integer; |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2 |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3 import java.lang.util; |
2
712ffca654f3
Moved java classes to their correct location
Frank Benoit <benoit@tionex.de>
parents:
0
diff
changeset
|
4 import java.lang.exceptions; |
84 | 5 import java.lang.Number; |
88
9e0ab372d5d8
Revert from TypeInfo/ClassInfo to java.lang.Class
Frank Benoit <benoit@tionex.de>
parents:
84
diff
changeset
|
6 import java.lang.Class; |
120
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
114
diff
changeset
|
7 import java.lang.Character; |
112 | 8 import java.lang.String; |
0
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
9 |
21
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
2
diff
changeset
|
10 version(Tango){ |
120
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
114
diff
changeset
|
11 static import tango.text.convert.Integer; |
21
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
2
diff
changeset
|
12 } else { // Phobos |
112 | 13 static import std.conv; |
14 static import std.string; | |
21
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
2
diff
changeset
|
15 } |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
2
diff
changeset
|
16 |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
2
diff
changeset
|
17 |
84 | 18 class Integer : Number { |
0
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
19 |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
20 public static const int MIN_VALUE = 0x80000000; |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
21 public static const int MAX_VALUE = 0x7fffffff; |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
22 public static const int SIZE = 32; |
84 | 23 private int value; |
0
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
24 |
51 | 25 public this ( void* value ){ |
84 | 26 super(); |
27 this.value = cast(int)value; | |
51 | 28 } |
0
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
29 public this ( int value ){ |
84 | 30 super(); |
31 this.value = value; | |
0
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
32 } |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
33 |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
34 public this ( String s ){ |
84 | 35 super(); |
36 this.value = parseInt(s); | |
0
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
37 } |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
38 |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
39 public static String toString( int i, int radix ){ |
120
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
114
diff
changeset
|
40 if(radix < Character.MIN_RADIX || radix > Character.MAX_RADIX) |
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
114
diff
changeset
|
41 radix = 10; |
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
114
diff
changeset
|
42 version(Tango){ |
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
114
diff
changeset
|
43 switch( radix ){ |
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
114
diff
changeset
|
44 case 10: |
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
114
diff
changeset
|
45 return tango.text.convert.Integer.toString(i); |
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
114
diff
changeset
|
46 case 16: |
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
114
diff
changeset
|
47 return tango.text.convert.Integer.toString(i, "x" ); |
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
114
diff
changeset
|
48 case 2: |
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
114
diff
changeset
|
49 return tango.text.convert.Integer.toString(i, "b" ); |
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
114
diff
changeset
|
50 case 8: |
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
114
diff
changeset
|
51 return tango.text.convert.Integer.toString(i, "o" ); |
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
114
diff
changeset
|
52 default: |
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
114
diff
changeset
|
53 implMissingInTango( __FILE__, __LINE__ ); |
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
114
diff
changeset
|
54 return null; |
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
114
diff
changeset
|
55 } |
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
114
diff
changeset
|
56 } else { // Phobos |
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
114
diff
changeset
|
57 return std.conv.to!(String)(i, radix); |
0
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
58 } |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
59 } |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
60 |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
61 public static String toHexString( int i ){ |
120
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
114
diff
changeset
|
62 return toString(i, 16); |
0
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
63 } |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
64 |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
65 public static String toOctalString( int i ){ |
120
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
114
diff
changeset
|
66 return toString(i, 8); |
0
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
67 } |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
68 |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
69 public static String toBinaryString( int i ){ |
120
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
114
diff
changeset
|
70 return toString(i, 2); |
0
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
71 } |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
72 |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
73 public static String toString( int i ){ |
120
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
114
diff
changeset
|
74 return String_valueOf(i); |
0
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
75 } |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
76 |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
77 public static int parseInt( String s, int radix ){ |
120
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
114
diff
changeset
|
78 if(radix < Character.MIN_RADIX || radix > Character.MAX_RADIX) |
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
114
diff
changeset
|
79 throw new NumberFormatException("The radix is out of range"); |
21
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
2
diff
changeset
|
80 version(Tango){ |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
2
diff
changeset
|
81 try{ |
120
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
114
diff
changeset
|
82 return tango.text.convert.Integer.toInt( s, radix ); |
21
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
2
diff
changeset
|
83 } |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
2
diff
changeset
|
84 catch( IllegalArgumentException e ){ |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
2
diff
changeset
|
85 throw new NumberFormatException( e ); |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
2
diff
changeset
|
86 } |
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
2
diff
changeset
|
87 } else { // Phobos |
114 | 88 try{ |
120
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
114
diff
changeset
|
89 immutable res = std.conv.parse!(int)( s, radix ); |
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
114
diff
changeset
|
90 if(s.length) |
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
114
diff
changeset
|
91 throw new NumberFormatException("String has invalid characters: " ~ s); |
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
114
diff
changeset
|
92 return res; |
114 | 93 } |
94 catch( std.conv.ConvException e ){ | |
95 throw new NumberFormatException( e ); | |
96 } | |
0
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
97 } |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
98 } |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
99 |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
100 public static int parseInt( String s ){ |
21
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
2
diff
changeset
|
101 return parseInt( s, 10 ); |
0
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
102 } |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
103 |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
104 public static Integer valueOf( String s, int radix ){ |
21
9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
Frank Benoit <benoit@tionex.de>
parents:
2
diff
changeset
|
105 return new Integer( parseInt( s, radix )); |
0
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
106 } |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
107 |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
108 public static Integer valueOf( String s ){ |
120
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
114
diff
changeset
|
109 return valueOf(parseInt(s)); |
0
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
110 } |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
111 |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
112 public static Integer valueOf( int i ){ |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
113 return new Integer(i); |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
114 } |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
115 |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
116 public byte byteValue(){ |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
117 return cast(byte)value; |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
118 } |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
119 |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
120 public short shortValue(){ |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
121 return cast(short)value; |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
122 } |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
123 |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
124 public int intValue(){ |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
125 return value; |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
126 } |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
127 |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
128 public long longValue(){ |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
129 return cast(long)value; |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
130 } |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
131 |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
132 public float floatValue(){ |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
133 return cast(float)value; |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
134 } |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
135 |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
136 public double doubleValue(){ |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
137 return cast(double)value; |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
138 } |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
139 |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
140 public override hash_t toHash(){ |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
141 return intValue(); |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
142 } |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
143 |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
144 public override String toString(){ |
120
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
114
diff
changeset
|
145 return toString(value); |
0
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
146 } |
84 | 147 |
88
9e0ab372d5d8
Revert from TypeInfo/ClassInfo to java.lang.Class
Frank Benoit <benoit@tionex.de>
parents:
84
diff
changeset
|
148 private static Class TYPE_; |
9e0ab372d5d8
Revert from TypeInfo/ClassInfo to java.lang.Class
Frank Benoit <benoit@tionex.de>
parents:
84
diff
changeset
|
149 public static Class TYPE(){ |
84 | 150 if( TYPE_ is null ){ |
88
9e0ab372d5d8
Revert from TypeInfo/ClassInfo to java.lang.Class
Frank Benoit <benoit@tionex.de>
parents:
84
diff
changeset
|
151 TYPE_ = Class.fromType!(int); |
84 | 152 } |
153 return TYPE_; | |
154 } | |
155 | |
0
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
156 } |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
157 alias Integer ValueWrapperInt; |
6dd524f61e62
add dwt win and basic java stuff
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
158 |