-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRide.java
More file actions
76 lines (60 loc) · 1.3 KB
/
Ride.java
File metadata and controls
76 lines (60 loc) · 1.3 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
public class Ride implements Comparable<Ride>{
int id, startRow, startCol, endRow, endCol, early, late;
public Ride(int i, int sR, int sC, int eR, int eC, int e, int l) {
id = i;
startRow = sR;
startCol = sC;
endRow = eR;
endCol = eC;
early = e;
late = l;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getStartRow() {
return startRow;
}
public void setStartRow(int startRow) {
this.startRow = startRow;
}
public int getStartCol() {
return startCol;
}
public void setStartCol(int startCol) {
this.startCol = startCol;
}
public int getEndRow() {
return endRow;
}
public void setEndRow(int endRow) {
this.endRow = endRow;
}
public int getEndCol() {
return endCol;
}
public void setEndCol(int endCol) {
this.endCol = endCol;
}
public int getEarly() {
return early;
}
public void setEarly(int early) {
this.early = early;
}
public int getLate() {
return late;
}
public void setLate(int late) {
this.late = late;
}
public int compareTo(Ride o) {
return - o.getEarly() + this.getEarly();
}
public String toString() {
return id + " " + startRow + " " + startCol + " " + endRow + " " + endCol + " " + early + " " + late;
}
}