-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathExchange.java
More file actions
107 lines (92 loc) · 2.76 KB
/
Exchange.java
File metadata and controls
107 lines (92 loc) · 2.76 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
package my.awesome.project.cryptarbitrage30;
import java.util.ArrayList;
/**
* Created by Alexander on 1/9/2018.
*/
public class Exchange {
private String bidQtySymbol;
private String askQtySymbol;
private String findVolumeSymbol;
private ArrayList<Coin> coins;
private ArrayList<Double> asks;
private ArrayList<Double> bids;
private String name;
private int amtCoins;
private String askSymbol;
private String bidSymbol;
private boolean exchangeAPISorted;
private boolean dataIsFinishedRefreshing;
private boolean isUSD;
public Exchange(String name, String askSymbol, String bidSymbol, boolean exchangeAPISorted, boolean dataIsFinishedRefreshing,
boolean isdUSD, String findVolumeSymbol, String bidQtySymbol, String askQtySymbol){
coins = new ArrayList<>();
asks = new ArrayList<>();
bids = new ArrayList<>();
this.name = name;
amtCoins = 0;
this.dataIsFinishedRefreshing = dataIsFinishedRefreshing;
this.askSymbol = askSymbol;
this.bidSymbol = bidSymbol;
this.exchangeAPISorted = exchangeAPISorted;
this.findVolumeSymbol = findVolumeSymbol;
this.isUSD = isdUSD;
this.bidQtySymbol = bidQtySymbol;
this.askQtySymbol = askQtySymbol;
}
public void addCoin(Coin c){
coins.add(c);
amtCoins++;
}
public void removeCoin(Coin c){
if(amtCoins<=0){
return;
}
coins.remove(c);
amtCoins--;
}
public String getFindVolumeSymbol(){
return this.findVolumeSymbol;
}
public boolean getIsUSD(){
return this.isUSD;
}
public String getName(){
return this.name;
}
public ArrayList<Coin> getCoins(){
return this.coins;
}
public void addAsk(Double asks){
this.asks.add(asks);
}
public ArrayList<Double> getAsks(){
return this.asks;
}
public void addBid(Double bids){
this.bids.add(bids);
}
public ArrayList<Double> getBids(){
return this.bids;
}
public String getAskSymbol(){
return this.askSymbol;
}
public String getBidSymbol(){
return this.bidSymbol;
}
public boolean isExchangeAPISorted(){
return this.exchangeAPISorted;
}
public boolean isDataFinishedRefreshing(){
return this.dataIsFinishedRefreshing;
}
public void setDataIsFinishedRefreshing(boolean value){
this.dataIsFinishedRefreshing = value;
}
public String getBidQtySymbol(){
return this.bidQtySymbol;
}
public String getAskQtySymbol(){
return this.askQtySymbol;
}
}