Changeset View
Changeset View
Standalone View
Standalone View
src/it/reyboz/bustorino/backend/mato/MapiArrivalRequest.java
Show All 25 Lines | |||||
import com.android.volley.Response; | import com.android.volley.Response; | ||||
import com.android.volley.VolleyError; | import com.android.volley.VolleyError; | ||||
import com.android.volley.toolbox.HttpHeaderParser; | import com.android.volley.toolbox.HttpHeaderParser; | ||||
import org.json.JSONArray; | import org.json.JSONArray; | ||||
import org.json.JSONException; | import org.json.JSONException; | ||||
import org.json.JSONObject; | import org.json.JSONObject; | ||||
import java.nio.charset.StandardCharsets; | |||||
import java.util.Date; | import java.util.Date; | ||||
import java.util.HashMap; | |||||
import java.util.Map; | |||||
import java.util.concurrent.atomic.AtomicReference; | import java.util.concurrent.atomic.AtomicReference; | ||||
import it.reyboz.bustorino.backend.Fetcher; | import it.reyboz.bustorino.backend.Fetcher; | ||||
import it.reyboz.bustorino.backend.Palina; | import it.reyboz.bustorino.backend.Palina; | ||||
public class MapiArrivalRequest extends MapiVolleyRequest<Palina> { | public class MapiArrivalRequest extends MapiVolleyRequest<Palina> { | ||||
private final String stopName; | private final String stopName; | ||||
private final Date startingTime; | private final Date startingTime; | ||||
private final int timeRange, numberOfDepartures; | private final int timeRange, numberOfDepartures; | ||||
private final AtomicReference<Fetcher.Result> reqRes; | private final AtomicReference<Fetcher.Result> reqRes; | ||||
private final String DEBUG_TAG = "BusTO-MAPIArrivalReq"; | private final String DEBUG_TAG = "BusTO-MAPIArrivalReq"; | ||||
public MapiArrivalRequest(String stopName, Date startingTime, int timeRange, | public MapiArrivalRequest(String stopName, Date startingTime, int timeRange, | ||||
int numberOfDepartures, | int numberOfDepartures, | ||||
AtomicReference<Fetcher.Result> res, | AtomicReference<Fetcher.Result> res, | ||||
Response.Listener<Palina> listener, | Response.Listener<Palina> listener, | ||||
@Nullable Response.ErrorListener errorListener) { | @Nullable Response.ErrorListener errorListener) { | ||||
super(MatoAPIFetcher.QueryType.ARRIVALS, listener, errorListener); | super(MatoQueries.QueryType.ARRIVALS, listener, errorListener); | ||||
this.stopName = stopName; | this.stopName = stopName; | ||||
this.startingTime = startingTime; | this.startingTime = startingTime; | ||||
this.timeRange = timeRange; | this.timeRange = timeRange; | ||||
this.numberOfDepartures = numberOfDepartures; | this.numberOfDepartures = numberOfDepartures; | ||||
this.reqRes = res; | this.reqRes = res; | ||||
} | } | ||||
public MapiArrivalRequest(String stopName, Date startingTime, int timeRange, | public MapiArrivalRequest(String stopName, Date startingTime, int timeRange, | ||||
int numberOfDepartures, | int numberOfDepartures, | ||||
▲ Show 20 Lines • Show All 91 Lines • Show Last 20 Lines |
Public contents are in Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) or GNU Free Documentation License (at your option) unless otherwise noted. · Contact / Register