Mercurial > projects > dwt2
diff base/src/java/lang/Double.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/Double.d Tue Apr 14 13:22:56 2009 +0200 +++ b/base/src/java/lang/Double.d Sat Apr 18 09:25:29 2009 +0200 @@ -1,19 +1,21 @@ module java.lang.Double; import java.lang.util; +import java.lang.Number; -class Double : ValueWrapperT!(double) { +class Double : Number { + public static double POSITIVE_INFINITY = double.infinity; + public static double NEGATIVE_INFINITY = -double.infinity; public static double MAX_VALUE = double.max; public static double MIN_VALUE = double.min; + private double value; this( double value ){ - super(value); + super(); + this.value = value; } this( String str ){ implMissing( __FILE__, __LINE__ ); - super(0.0); - } - public double doubleValue(){ - return value; + super(); } public static String toString( double value ){ implMissing( __FILE__, __LINE__ ); @@ -23,4 +25,38 @@ implMissing( __FILE__, __LINE__ ); return 0.0; } + + private static TypeInfo TYPE_; + public static TypeInfo TYPE(){ + if( TYPE_ is null ){ + TYPE_ = typeid(double); + } + return TYPE_; + } + + 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 cast(long)value; + } + + public float floatValue(){ + return cast(float)value; + } + + public double doubleValue(){ + return cast(double)value; + } } + +