diff base/src/java/lang/Byte.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/Byte.d	Tue Apr 14 13:22:56 2009 +0200
+++ b/base/src/java/lang/Byte.d	Sat Apr 18 09:25:29 2009 +0200
@@ -2,12 +2,17 @@
 
 import java.lang.util;
 import java.lang.exceptions;
+import java.lang.Number;
 
 version(Tango){
     static import tango.text.convert.Integer;
 } else { // Phobos
 }
-class Byte : ValueWrapperT!(byte) {
+class Byte : Number {
+    public static const byte MIN_VALUE = byte.min;
+    public static const byte MAX_VALUE = byte.max;
+    private byte value;
+
     public static byte parseByte( String s ){
         version(Tango){
             try{
@@ -26,13 +31,29 @@
         }
     }
     this( byte value ){
-        super( value );
+        super();
+        this.value = value;
     }
 
     public static String toString( byte i ){
         return String_valueOf(i);
     }
 
+    private static TypeInfo TYPE_;
+    public static TypeInfo TYPE(){
+        if( TYPE_ is null ){
+            TYPE_ = typeid(byte);
+        }
+        return TYPE_;
+    }
+
+    byte byteValue(){ return value; }
+    double doubleValue(){ return value; }
+    float floatValue(){ return value; }
+    int intValue(){ return value; }
+    long longValue(){ return value; }
+    short shortValue(){ return value; }
 }
 alias Byte ValueWrapperByte;
 
+