view java/src/java/util/TimerTask.d @ 21:9b96950f2c3c

the 'java' tree compiles on both D1-Tango and D2-Phobos
author Frank Benoit <benoit@tionex.de>
date Thu, 19 Mar 2009 20:38:55 +0100
parents bc29606a740c
children
line wrap: on
line source

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;
    }
}