1 package ch.hslu.exercises.sw05.input.ex2;
2
3
4 public final class AccountTask implements Runnable {
5 private final BankAccount source;
6 private final BankAccount target;
7 private final int amount;
8
9
10
11
12
13
14
15
16 public AccountTask(final BankAccount source, final BankAccount target, final int amount) {
17 this.source = source;
18 this.target = target;
19 this.amount = amount;
20 }
21
22 @Override
23 public void run() {
24 for (int n = 0; n < amount; n++) {
25 source.transfer(target, 1);
26 }
27 }
28 }