Mercurial > projects > dwt2
comparison java/src/java/lang/Byte.d @ 0:6dd524f61e62
add dwt win and basic java stuff
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Mon, 02 Mar 2009 14:44:16 +0100 |
parents | |
children | 712ffca654f3 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:6dd524f61e62 |
---|---|
1 module java.lang.Byte; | |
2 | |
3 import java.lang.util; | |
4 | |
5 class Byte : ValueWrapperT!(byte) { | |
6 public static byte parseByte( String s ){ | |
7 try{ | |
8 int res = tango.text.convert.Integer.parse( s ); | |
9 if( res < byte.min || res > byte.max ){ | |
10 throw new NumberFormatException( "out of range" ); | |
11 } | |
12 return res; | |
13 } | |
14 catch( IllegalArgumentException e ){ | |
15 throw new NumberFormatException( e ); | |
16 } | |
17 } | |
18 this( byte value ){ | |
19 super( value ); | |
20 } | |
21 | |
22 public static String toString( byte i ){ | |
23 return tango.text.convert.Integer.toString(i); | |
24 } | |
25 | |
26 } | |
27 alias Byte ValueWrapperByte; | |
28 |