Files
java-design-patterns/thread-pool/src/main/java/com/iluwatar/threadpool/PotatoPeelingTask.java
T
Jeroen Meulemeester fd8c05846f Added tests for thread-pool pattern
Fixed concurrency problem in id generation of Task
2015-12-30 20:55:22 +01:00

21 lines
413 B
Java

package com.iluwatar.threadpool;
/**
*
* PotatoPeelingTask is a concrete task
*
*/
public class PotatoPeelingTask extends Task {
private static final int TIME_PER_POTATO = 200;
public PotatoPeelingTask(int numPotatoes) {
super(numPotatoes * TIME_PER_POTATO);
}
@Override
public String toString() {
return String.format("%s %s", this.getClass().getSimpleName(), super.toString());
}
}