Mercurial > projects > dwt2
view 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 |
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;