diff base/src/java/util/TimerTask.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/util/TimerTask.d@9b96950f2c3c
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/base/src/java/util/TimerTask.d	Sat Mar 21 11:33:57 2009 +0100
@@ -0,0 +1,31 @@
+module java.util.TimerTask;
+
+import java.lang.all;
+import java.util.Timer;
+
+class TimerTask : Runnable {
+
+    package long scheduled;
+    package long lastExecutionTime;
+    package long period;
+    package bool fixed;
+
+    this(){
+        this.scheduled = 0;
+        this.lastExecutionTime = -1;
+    }
+
+    bool cancel(){
+        bool prevented_execution = (this.scheduled >= 0);
+        this.scheduled = -1;
+        return prevented_execution;
+    }
+
+    abstract void run();
+
+    long scheduledExcecutionTime(){
+        return lastExecutionTime;
+    }
+}
+
+