Mercurial > projects > dwt2
diff base/src/java/lang/Integer.d @ 84:fcf926c91ca4
Added base classes
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sat, 18 Apr 2009 09:25:29 +0200 |
parents | c01d033c633a |
children | 9e0ab372d5d8 |
line wrap: on
line diff
--- a/base/src/java/lang/Integer.d Tue Apr 14 13:22:56 2009 +0200 +++ b/base/src/java/lang/Integer.d Sat Apr 18 09:25:29 2009 +0200 @@ -2,6 +2,7 @@ import java.lang.util; import java.lang.exceptions; +import java.lang.Number; version(Tango){ } else { // Phobos @@ -12,21 +13,25 @@ } -class Integer : ValueWrapperT!(int) { +class Integer : Number { public static const int MIN_VALUE = 0x80000000; public static const int MAX_VALUE = 0x7fffffff; public static const int SIZE = 32; + private int value; public this ( void* value ){ - super( cast(int)value ); + super(); + this.value = cast(int)value; } public this ( int value ){ - super( value ); + super(); + this.value = value; } public this ( String s ){ - super(parseInt(s)); + super(); + this.value = parseInt(s); } public static String toString( int i, int radix ){ @@ -142,6 +147,15 @@ return std.string.toString(value); } } + + private static TypeInfo TYPE_; + public static TypeInfo TYPE(){ + if( TYPE_ is null ){ + TYPE_ = typeid(int); + } + return TYPE_; + } + } alias Integer ValueWrapperInt;