-
Notifications
You must be signed in to change notification settings - Fork 0
/
BusArrivalNode.java
67 lines (58 loc) · 1.63 KB
/
BusArrivalNode.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
package MMN15;
/**
* This class bild bus arrival node.
*
* @author Aleksey Yurovskiy
* @ID 327153904
*/
public class BusArrivalNode
{
private BusArrival _busArr;
private BusArrivalNode _tail;
/** This is constructor for BusArrivalNode.
* @param BusArrival b - object.
*/
public BusArrivalNode (BusArrival b){
_busArr = b;
_tail = null;
}
/** This constructor for BusArrivalNode.
* @param BusArrival b - object;
* BusArrivalNode n - next object.
*/
public BusArrivalNode (BusArrival b, BusArrivalNode n){
_busArr = b;
_tail = n;
}
/** This copy constructor for BusArrivalNode.
* @param BusArrivalNode b - object.
*/
public BusArrivalNode (BusArrivalNode b){
this._tail = b._tail;
this._busArr = b._busArr;
}
/** This method return bus arrival object from BusArrivalNode.Time complexity O(1)
* @return BusArrival object
*/
public BusArrival getBusArr(){
return new BusArrival(_busArr);
}
/** This method return bus arrival object from next BusArrivalNode. Time complexity O(1)
* @return BusArrival object.
*/
public BusArrivalNode getNext(){
return _tail;
}
/** This method set new arrival bus in BusArrivalNode. Time complexity O(1)
* @param BusArrival b - object.
*/
public void setBusArr (BusArrival b){
this._busArr = b;
}
/** This method set new arrival for next bus. Time complexity O(1)
* @param BusArrivalNode next
*/
public void setNext (BusArrivalNode next){
this._tail = next;
}
}