mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-15 04:59:24 +00:00
21 lines
405 B
Java
21 lines
405 B
Java
package com.iluwatar.threadpool;
|
|
|
|
/**
|
|
*
|
|
* PotatoPeelingTask is a concrete task
|
|
*
|
|
*/
|
|
public class PotatoPeelingTask extends Task {
|
|
|
|
private static final int TIME_PER_POTATO = 500;
|
|
|
|
public PotatoPeelingTask(int numPotatoes) {
|
|
super(numPotatoes * TIME_PER_POTATO);
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return String.format("%s %s", this.getClass().getSimpleName(), super.toString());
|
|
}
|
|
}
|