-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathBar.java
72 lines (53 loc) · 1.37 KB
/
Bar.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
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
package com.g4.fauxexchange.model;
import java.util.LinkedList;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
public class Bar {
private final long time;
private final double open;
private double high, low, close;
private Bar(long time, double open, double high,double low, double close) {
this.time = time;
this.open = open;
this.high = high;
this.low = low;
this.close = close;
}
public Bar(long time, final double value) {
this(time, value, value, value, value);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(" time: ").append(time);
sb.append(" open: ").append(open);
sb.append(" high: ").append(high);
sb.append(" low: ").append(low);
sb.append(" close: ").append(close);
return sb.toString();
}
public double getOpen() {
return open;
}
public double getHigh() {
return high;
}
public double getLow() {
return low;
}
public double getClose() {
return close;
}
public void setHigh(double high) {
this.high = high;
}
public void setLow(double low) {
this.low = low;
}
public void setClose(double close) {
this.close = close;
}
public long getTime() {
return time;
}
}