-
Notifications
You must be signed in to change notification settings - Fork 0
/
BaseMiner.java
47 lines (36 loc) · 1020 Bytes
/
BaseMiner.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package edu.nyu.crypto.csci3033.miners;
import java.text.MessageFormat;
public abstract class BaseMiner implements Miner {
private int connectivity;
private int hashRate;
private final String id;
protected BaseMiner(String id, int hashRate, int connectivity) {
this.id = id;
this.hashRate = hashRate;
this.connectivity = connectivity;
}
@Override
public final int getConnectivity() {
return connectivity;
}
@Override
public final void setConnectivity(int connectivity) {
this.connectivity = connectivity;
}
@Override
public final void setHashRate(int hashRate) {
this.hashRate = hashRate;
}
@Override
public final int getHashRate() {
return hashRate;
}
@Override
public String getId() {
return id;
}
@Override
public String toString() {
return MessageFormat.format("Miner[id={0},hashRate={1},connectivity={2}]", id, hashRate, connectivity);
}
}