Reformat rest of the design patterns - Issue #224

This commit is contained in:
Ankur Kaushal
2015-11-01 21:29:13 -05:00
parent 449340bd2b
commit 306b1f3d31
337 changed files with 6744 additions and 6851 deletions

View File

@@ -6,20 +6,21 @@ package com.iluwatar.threadpool;
*
*/
public class Worker implements Runnable {
private final Task task;
public Worker(final Task task) {
this.task = task;
}
@Override
public void run() {
System.out.println(String.format("%s processing %s", Thread.currentThread().getName(), task.toString()));
try {
Thread.sleep(task.getTimeMs());
} catch (InterruptedException e) {
e.printStackTrace();
}
}
private final Task task;
public Worker(final Task task) {
this.task = task;
}
@Override
public void run() {
System.out.println(String.format("%s processing %s", Thread.currentThread().getName(),
task.toString()));
try {
Thread.sleep(task.getTimeMs());
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}