Finished Thread Pool example code.

This commit is contained in:
Ilkka Seppala
2015-05-17 18:08:50 +03:00
parent 4c0a300b86
commit 6e76227143
5 changed files with 111 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
package com.iluwatar;
public abstract class Task {
private static int nextId = 1;
private int id;
private int timeMs;
public Task(int timeMs) {
this.id = nextId++;
this.timeMs = timeMs;
}
public int getId() {
return id;
}
public int getTimeMs() {
return timeMs;
}
@Override
public String toString() {
return String.format("id=%d timeMs=%d", id, timeMs);
}
}