mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-15 04:59:24 +00:00
Changed package naming across all examples.
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
package com.iluwatar.threadpool;
|
||||
|
||||
/**
|
||||
*
|
||||
* Abstract base class for tasks
|
||||
*
|
||||
*/
|
||||
public abstract class Task {
|
||||
|
||||
private static int nextId = 1;
|
||||
|
||||
private final int id;
|
||||
private final int timeMs;
|
||||
|
||||
public Task(final 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user