⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 zabstractevent.java

📁 ZDrive Driving Warning System
💻 JAVA
字号:
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package zdrive.protocols;import java.util.ArrayDeque;import java.util.Deque;import zdrive.engines.ZUpdaterThreadsInterface;/** * * @author Mohamed Aly */public abstract class ZAbstractEvent extends Thread implements ZEventInterface{    protected double velocity_kph;    protected double total_distance_m;    protected double remaining_distance_m;    protected int event;    protected String direction;    protected boolean completed;    protected Deque <ZUpdaterThreadsInterface> tobenotified;    public abstract double getVelocity();    public abstract double getRemainingDistance();    public abstract double getTotalDistance();    public abstract int getEvent();    public abstract String getDirection();    public abstract boolean isCompleted();    @Override    public abstract void run();    public void addThreadToBeNotifiedOnCompletion(ZUpdaterThreadsInterface x){        if(tobenotified == null) tobenotified = new ArrayDeque<ZUpdaterThreadsInterface>();        tobenotified.add(x);    }    protected void notifyAllThreads(){        while(tobenotified.size() > 0){            tobenotified.pollFirst().wakeMeUp();        }    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -