Mercurial > projects > dwt2
diff base/src/java/lang/Long.d @ 84:fcf926c91ca4
Added base classes
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sat, 18 Apr 2009 09:25:29 +0200 |
parents | 1bf55a6eb092 |
children | 9e0ab372d5d8 |
line wrap: on
line diff
--- a/base/src/java/lang/Long.d Tue Apr 14 13:22:56 2009 +0200 +++ b/base/src/java/lang/Long.d Sat Apr 18 09:25:29 2009 +0200 @@ -1,20 +1,43 @@ module java.lang.Long; import java.lang.util; +import java.lang.Number; -class Long : ValueWrapperT!(long) { +class Long : Number { public static const long MIN_VALUE = long.min; public static const long MAX_VALUE = long.max; + private long value; this( long value ){ - super(value); + super(); + this.value = value; } this( String str ){ implMissing( __FILE__, __LINE__ ); - super(0); + super(); + } + public byte byteValue(){ + return cast(byte)value; } + + public short shortValue(){ + return cast(short)value; + } + + public int intValue(){ + return cast(int)value; + } + public long longValue(){ return value; } + + public float floatValue(){ + return cast(float)value; + } + + public double doubleValue(){ + return cast(double)value; + } public static long parseLong(String s){ implMissing( __FILE__, __LINE__ ); return 0; @@ -23,6 +46,14 @@ implMissing( __FILE__, __LINE__ ); return null; } + private static TypeInfo TYPE_; + public static TypeInfo TYPE(){ + if( TYPE_ is null ){ + TYPE_ = typeid(long); + } + return TYPE_; + } + } alias Long ValueWrapperLong;