aboutsummaryrefslogtreecommitdiffstats
path: root/src/ru/olamedia/tasks/Task.java
blob: 1886265091da37e1d3edd4d65bae00ef26725ef0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package ru.olamedia.tasks;

public abstract class Task implements Runnable {

	public Task(){
		TaskManager.add(this);
	}
	
	protected volatile boolean stopped = false;

	public void setStopped(boolean s){
		this.stopped = s;
	}
	
	public void stop() {
		this.stopped = true;
	}

	protected boolean shouldStop() {
		return this.stopped;
	}

	public abstract void run();
}