-
Notifications
You must be signed in to change notification settings - Fork 0
/
Transaction.java~
45 lines (36 loc) · 899 Bytes
/
Transaction.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
import java.util.HashMap;
import java.util.Map;
public class Transaction {
private String key;
private Map<Integer,TransactionOutput> outputMap;
public Transaction(String key) {
this.key = key;
outputMap = new HashMap<Integer,TransactionOutput>();
}
public String getKey() {
return key;
}
public Map<Integer,TransactionOutput> getOutputMap() {
return outputMap;
}
public void setOutputMap(Map<Integer,TransactionOutput> map) {
outputMap = map;
}
@Override
public boolean equals(Object other) {
if(other == null) return false;
if(other == this) return true;
if(!(other instanceof Transaction)) return false;
Transaction otherTransaction = (Transaction) other;
if(this.getKey() == otherTransaction.getKey()) {
return true;
} else {
return false;
}
}
@Override
public int hashCode() {
Integer b = new Integer(key);
return b.hashCode();
}
}