Code improvements.

This commit is contained in:
Ilkka Seppala 2015-05-17 21:46:51 +03:00
parent 8b8b81f26d
commit 8cc843465b
4 changed files with 7 additions and 7 deletions

View File

@ -7,7 +7,7 @@ package com.iluwatar;
*/
public class CoffeeMakingTask extends Task {
private static int TIME_PER_CUP = 300;
private static final int TIME_PER_CUP = 300;
public CoffeeMakingTask(int numCups) {
super(numCups * TIME_PER_CUP);

View File

@ -7,7 +7,7 @@ package com.iluwatar;
*/
public class PotatoPeelingTask extends Task {
private static int TIME_PER_POTATO = 500;
private static final int TIME_PER_POTATO = 500;
public PotatoPeelingTask(int numPotatoes) {
super(numPotatoes * TIME_PER_POTATO);

View File

@ -9,10 +9,10 @@ public abstract class Task {
private static int nextId = 1;
private int id;
private int timeMs;
private final int id;
private final int timeMs;
public Task(int timeMs) {
public Task(final int timeMs) {
this.id = nextId++;
this.timeMs = timeMs;
}

View File

@ -7,9 +7,9 @@ package com.iluwatar;
*/
public class Worker implements Runnable {
private Task task;
private final Task task;
public Worker(Task task) {
public Worker(final Task task) {
this.task = task;
}