-
Notifications
You must be signed in to change notification settings - Fork 287
/
ObaSituation.java
161 lines (130 loc) · 4.1 KB
/
ObaSituation.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
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
/*
* Copyright (C) 2010 Paul Watts (paulcwatts@gmail.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onebusaway.android.io.elements;
import java.util.List;
public interface ObaSituation extends ObaElement {
String SEVERITY_UNKNOWN = "unknown";
String SEVERITY_NO_IMPACT = "noImpact";
String SEVERITY_VERY_SLIGHT = "verySlight";
String SEVERITY_SLIGHT = "slight";
String SEVERITY_NORMAL = "normal";
String SEVERITY_SEVERE = "severe";
String SEVERITY_VERY_SEVERE = "verySevere";
public interface AllAffects {
/**
* The list of affected direction IDs.
*
* @return The affected direction ID, if any.
*/
public String getDirectionId();
/**
* @return The affected stop ID, if any.
*/
public String getStopId();
/**
* @return The affected trip ID, if any.
*/
public String getTripId();
/**
* @return The affected application ID, if any.
*/
public String getApplicationId();
/**
* @return The affected route ID, if any.
*/
public String getRouteId();
/**
* @return The affected agency ID, if any.
*/
public String getAgencyId();
}
public interface ConditionDetails {
/**
* @return For diversion conditions, this specifies the stop IDs
* that are diverted.
*/
public List<String> getDiversionStopIds();
/**
* @return For diversion conditions, this specifies the optional
* path that the vehicle will take in the diversion.
*/
public ObaShape getDiversionPath();
}
public interface Consequence {
public static final String CONDITION_DIVERSION = "diversion";
public static final String CONDITION_ALTERED = "altered";
public static final String CONDITION_DETOUR = "detour";
/**
* @return The string describing the consequence condition.
*/
public String getCondition();
/**
* @return Optional details of the consequence condition.
*/
public ConditionDetails getDetails();
}
public interface ActiveWindow {
/**
* @return the starting time of the active window for this situation
*/
public long getFrom();
/**
*
* @return the ending time of the active window for this situation
*/
public long getTo();
}
/**
* @return Optional short summary of the situation.
*/
public String getSummary();
/**
* @return Optional longer description of the situation.
*/
public String getDescription();
/**
* @return Optional advice to the rider.
*/
public String getAdvice();
/**
* @return The service alert code.
*/
public String getReason();
/**
* @return The Unix timestamp of when this situation was created.
*/
public long getCreationTime();
/**
* @return Information on what stops and routes this situation affects.
*/
public AllAffects[] getAllAffects();
/**
* @return An array of consequences of this situation
*/
public Consequence[] getConsequences();
/**
* @return The severity of the situation.
*/
public String getSeverity();
/*
* @return An array of active windows of this situation
*/
public ActiveWindow[] getActiveWindows();
/**
* @return A URL to a human-readable website with more details on the alert
*/
public String getUrl();
}