Mercurial > projects > dwt2
view base/src/java/lang/Byte.d @ 77:af948d4bbf8c
Impls for core.jobs
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Mon, 13 Apr 2009 13:58:00 +0200 |
parents | 1bf55a6eb092 |
children | fcf926c91ca4 |
line wrap: on
line source
module java.lang.Byte; import java.lang.util; import java.lang.exceptions; version(Tango){ static import tango.text.convert.Integer; } else { // Phobos } class Byte : ValueWrapperT!(byte) { public static byte parseByte( String s ){ version(Tango){ try{ int res = tango.text.convert.Integer.parse( s ); if( res < byte.min || res > byte.max ){ throw new NumberFormatException( "out of range" ); } return res; } catch( IllegalArgumentException e ){ throw new NumberFormatException( e ); } } else { // Phobos implMissing( __FILE__, __LINE__); return 0; } } this( byte value ){ super( value ); } public static String toString( byte i ){ return String_valueOf(i); } } alias Byte ValueWrapperByte;