Mercurial > projects > dwt2
comparison base/src/java/lang/Byte.d @ 27:1bf55a6eb092
Renamed java tree to base
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sat, 21 Mar 2009 11:33:57 +0100 |
parents | java/src/java/lang/Byte.d@9b96950f2c3c |
children | fcf926c91ca4 |
comparison
equal
deleted
inserted
replaced
26:f589fc20a5f9 | 27:1bf55a6eb092 |
---|---|
1 module java.lang.Byte; | |
2 | |
3 import java.lang.util; | |
4 import java.lang.exceptions; | |
5 | |
6 version(Tango){ | |
7 static import tango.text.convert.Integer; | |
8 } else { // Phobos | |
9 } | |
10 class Byte : ValueWrapperT!(byte) { | |
11 public static byte parseByte( String s ){ | |
12 version(Tango){ | |
13 try{ | |
14 int res = tango.text.convert.Integer.parse( s ); | |
15 if( res < byte.min || res > byte.max ){ | |
16 throw new NumberFormatException( "out of range" ); | |
17 } | |
18 return res; | |
19 } | |
20 catch( IllegalArgumentException e ){ | |
21 throw new NumberFormatException( e ); | |
22 } | |
23 } else { // Phobos | |
24 implMissing( __FILE__, __LINE__); | |
25 return 0; | |
26 } | |
27 } | |
28 this( byte value ){ | |
29 super( value ); | |
30 } | |
31 | |
32 public static String toString( byte i ){ | |
33 return String_valueOf(i); | |
34 } | |
35 | |
36 } | |
37 alias Byte ValueWrapperByte; | |
38 |