blob: 3fcca701523cdfccde1c88fb45544ddc6a26acfb (
plain)
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
|
package Q10;
import java.text.*;
import java.util.*;
public class Station {
private Date arrival;
private Date departure;
private int day;
private String city;
public Station(String city, Date arrival, Date departure, int day) {
this.city = city;
this.arrival = arrival;
this.departure = departure;
this.day = day;
}
public Date getArrivalDate() {
return this.arrival;
}
public Date getDepartureDate() {
return this.departure;
}
public int getDay() {
return day;
}
public String getCity() {
return this.city;
}
public void setArrivalDate(Date arrival) {
this.arrival = arrival;
}
public void setCity(String city) {
this.city = city;
}
public void setDay(int day) {
this.day = day;
}
public void setDepartureDate(Date departure) {
this.departure = departure;
}
public String getArrival() {
return formatDate(this.arrival);
}
public String getDeparture() {
return formatDate(this.departure);
}
private String formatDate(Date date) {
DateFormat format = new SimpleDateFormat("HH:mm");
format.setTimeZone(TimeZone.getTimeZone("UTC"));
return format.format(date);
}
}
|