1 |
package dk.thoerup.traininfo; |
package dk.thoerup.traininfo; |
2 |
|
|
3 |
import java.io.Serializable; |
import java.io.Serializable; |
4 |
|
import java.util.ArrayList; |
5 |
import android.content.Context; |
|
6 |
|
public class DepartureBean implements Serializable{ |
7 |
|
private static final long serialVersionUID = 1L; |
8 |
public class DepartureBean implements Serializable |
|
9 |
{ |
public ArrayList<String> notifications = new ArrayList<String>(); |
10 |
private static final long serialVersionUID = 1L; |
public ArrayList<DepartureEntry> entries = new ArrayList<DepartureEntry>(); |
11 |
|
|
12 |
public static final int UPDATE_LESSTHAN3 = 1; |
} |
|
public static final int UPDATE_3TO10 = 2; |
|
|
public static final int UPDATE_MORETHAN10 = 3; |
|
|
public static final int UPDATE_UNKNOWN = 4; |
|
|
|
|
|
private String time = ""; |
|
|
private String lastUpdate = ""; |
|
|
private String trainNumber = ""; |
|
|
private String destination = ""; |
|
|
private String origin = ""; |
|
|
private String location = ""; |
|
|
private String status = ""; |
|
|
private String note = ""; |
|
|
private String type = ""; |
|
|
|
|
|
|
|
|
public String getTime() { |
|
|
return time; |
|
|
} |
|
|
public void setTime(String time) { |
|
|
this.time = time; |
|
|
} |
|
|
public String getLastUpdate() { |
|
|
return lastUpdate; |
|
|
} |
|
|
public void setLastUpdate(String lastUpdate) { |
|
|
this.lastUpdate = lastUpdate; |
|
|
} |
|
|
public String getTrainNumber() { |
|
|
return trainNumber; |
|
|
} |
|
|
public void setTrainNumber(String trainNumber) { |
|
|
this.trainNumber = trainNumber; |
|
|
} |
|
|
public String getDestination() { |
|
|
return destination; |
|
|
} |
|
|
public void setDestination(String destination) { |
|
|
this.destination = destination; |
|
|
} |
|
|
public String getOrigin() { |
|
|
return origin; |
|
|
} |
|
|
public void setOrigin(String origin) { |
|
|
this.origin = origin; |
|
|
} |
|
|
public String getLocation() { |
|
|
return location; |
|
|
} |
|
|
public void setLocation(String location) { |
|
|
this.location = location; |
|
|
} |
|
|
public String getStatus() { |
|
|
return status; |
|
|
} |
|
|
public void setStatus(String status) { |
|
|
this.status = status; |
|
|
} |
|
|
public String getNote() { |
|
|
return note; |
|
|
} |
|
|
public void setNote(String note) { |
|
|
this.note = note; |
|
|
} |
|
|
public String getType() { |
|
|
return type; |
|
|
} |
|
|
public void setType(String type) { |
|
|
this.type = type; |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public String getLastUpdateString(Context cntx) { |
|
|
String minutes = cntx.getString(R.string.departurebean_minutes); |
|
|
String unknown = cntx.getString(R.string.departurebean_unknown); |
|
|
switch (lastUpdate.charAt(0)) { |
|
|
case '1': |
|
|
return "<3 " + minutes; |
|
|
case '2': |
|
|
return "3-10 " + minutes; |
|
|
case '3': |
|
|
return ">3 " + minutes; |
|
|
case '4': |
|
|
return unknown; |
|
|
default: |
|
|
return ""; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|