Class StationsManager
- java.lang.Object
-
- de.kaffeemitkoffein.tinyweatherforecastgermany.StationsManager
-
public class StationsManager extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
StationsManager.StationsReader
-
Field Summary
Fields Modifier and Type Field Description boolean
loaded
java.util.ArrayList<Weather.WeatherLocation>
stations
-
Constructor Summary
Constructors Constructor Description StationsManager(Context context)
StationsManager(Context context, java.util.ArrayList<Weather.WeatherLocation> stations)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getAltitude(int position)
java.lang.String
getDescription(int position)
Weather.WeatherLocation
getFromName(java.lang.String name)
double
getLatitude(int position)
Weather.WeatherLocation
getLocationFromDescription(java.lang.String description)
double
getLongitude(int position)
java.lang.String
getName(int position)
java.lang.Integer
getPositionFromDescription(java.lang.String description)
java.lang.Integer
getPositionFromDescription(java.lang.String description, boolean lenient)
java.lang.Integer
getPositionFromName(java.lang.String name)
int
getStationCount()
java.util.ArrayList<Weather.WeatherLocation>
getStations()
java.util.ArrayList<Weather.WeatherLocation>
getStationsInPolygon(Polygon polygon)
void
readStations()
static java.util.ArrayList<Weather.WeatherLocation>
readStations(Context context)
static java.util.ArrayList<Weather.WeatherLocation>
sortStationsByDistance(java.util.ArrayList<Weather.WeatherLocation> stations, Location targetLocation)
-
-
-
Field Detail
-
stations
public java.util.ArrayList<Weather.WeatherLocation> stations
-
loaded
public boolean loaded
-
-
Constructor Detail
-
StationsManager
public StationsManager(Context context)
-
StationsManager
public StationsManager(Context context, java.util.ArrayList<Weather.WeatherLocation> stations)
-
-
Method Detail
-
readStations
public static java.util.ArrayList<Weather.WeatherLocation> readStations(Context context)
-
readStations
public void readStations()
-
getStations
public java.util.ArrayList<Weather.WeatherLocation> getStations()
-
getName
public java.lang.String getName(int position)
-
getDescription
public java.lang.String getDescription(int position)
-
getLongitude
public double getLongitude(int position)
-
getLatitude
public double getLatitude(int position)
-
getAltitude
public double getAltitude(int position)
-
getStationCount
public int getStationCount()
-
getPositionFromDescription
public java.lang.Integer getPositionFromDescription(java.lang.String description)
-
getPositionFromDescription
public java.lang.Integer getPositionFromDescription(java.lang.String description, boolean lenient)
-
getPositionFromName
public java.lang.Integer getPositionFromName(java.lang.String name)
-
getFromName
public Weather.WeatherLocation getFromName(java.lang.String name)
-
getLocationFromDescription
public Weather.WeatherLocation getLocationFromDescription(java.lang.String description)
-
getStationsInPolygon
public java.util.ArrayList<Weather.WeatherLocation> getStationsInPolygon(Polygon polygon)
-
sortStationsByDistance
public static java.util.ArrayList<Weather.WeatherLocation> sortStationsByDistance(java.util.ArrayList<Weather.WeatherLocation> stations, Location targetLocation)
-
-