Class Weather
- java.lang.Object
-
- de.kaffeemitkoffein.tinyweatherforecastgermany.Weather
-
public final class Weather extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Weather.Clouds
static class
Weather.DisplayLayout
static class
Weather.DistanceDisplayUnit
static class
Weather.WeatherInfo
class
Weather.WeatherItem
static class
Weather.WeatherLocation
static class
Weather.WeatherLocationFinder
static class
Weather.WindData
static class
Weather.WindDisplayType
static class
Weather.WindDisplayUnit
-
Field Summary
Fields Modifier and Type Field Description static int
DATA_SIZE
static int
DELTA_T
static double
KelvinConstant
static int
MILLIS_IN_HOUR
static int
PROB_OF_PRECIPITATION_ITEM_COUNT
static java.lang.String[]
SQL_COMMAND_QUERYTIMECOLUMN
-
Constructor Summary
Constructors Constructor Description Weather()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static long
getCivilTwilightEvening(Astronomy.Riseset riseset, long time)
static long
getCivilTwilightMorning(Astronomy.Riseset riseset, long time)
CurrentWeatherInfo
getCurrentWeatherInfo(Context context)
static Astronomy.Riseset
getRiseset(Weather.WeatherLocation weatherLocation, long time)
static long
getSunriseInUTC(Astronomy.Riseset riseset, long time)
static long
getSunsetInUTC(Astronomy.Riseset riseset, long time)
static java.lang.String
getWindString(Context context, CurrentWeatherInfo weatherCard)
static java.lang.String
getWindUnitString(int type)
static boolean
isDaytime(Weather.WeatherLocation weatherLocation, long time)
static boolean
isSunriseInIntervalUTC(Astronomy.Riseset riseset, long start, long stop)
static boolean
isSunsetInIntervalUTC(Astronomy.Riseset riseset, long start, long stop)
static void
sanitizeDatabase(Context context)
static java.lang.String
toFullDateTimeString(long time)
static java.lang.String
toHourMinuteString(long time)
static boolean
usePreciseIsDaytime(Weather.WeatherLocation weatherLocation)
Returns if a precise calculation of day/night time with the Astronomy class makes sense.
-
-
-
Field Detail
-
KelvinConstant
public static final double KelvinConstant
- See Also:
- Constant Field Values
-
MILLIS_IN_HOUR
public static final int MILLIS_IN_HOUR
- See Also:
- Constant Field Values
-
DELTA_T
public static final int DELTA_T
- See Also:
- Constant Field Values
-
PROB_OF_PRECIPITATION_ITEM_COUNT
public static final int PROB_OF_PRECIPITATION_ITEM_COUNT
- See Also:
- Constant Field Values
-
DATA_SIZE
public static final int DATA_SIZE
- See Also:
- Constant Field Values
-
SQL_COMMAND_QUERYTIMECOLUMN
public static final java.lang.String[] SQL_COMMAND_QUERYTIMECOLUMN
-
-
Method Detail
-
getCurrentWeatherInfo
public CurrentWeatherInfo getCurrentWeatherInfo(Context context)
-
sanitizeDatabase
public static void sanitizeDatabase(Context context)
-
getRiseset
public static Astronomy.Riseset getRiseset(Weather.WeatherLocation weatherLocation, long time)
-
isDaytime
public static boolean isDaytime(Weather.WeatherLocation weatherLocation, long time)
-
usePreciseIsDaytime
public static boolean usePreciseIsDaytime(Weather.WeatherLocation weatherLocation)
Returns if a precise calculation of day/night time with the Astronomy class makes sense. It makes sense between a latutide of -65° to +65°, but not further south or north.- Parameters:
weatherLocation
-- Returns:
-
getSunsetInUTC
public static long getSunsetInUTC(Astronomy.Riseset riseset, long time)
-
getSunriseInUTC
public static long getSunriseInUTC(Astronomy.Riseset riseset, long time)
-
getCivilTwilightMorning
public static long getCivilTwilightMorning(Astronomy.Riseset riseset, long time)
-
getCivilTwilightEvening
public static long getCivilTwilightEvening(Astronomy.Riseset riseset, long time)
-
isSunriseInIntervalUTC
public static boolean isSunriseInIntervalUTC(Astronomy.Riseset riseset, long start, long stop)
-
isSunsetInIntervalUTC
public static boolean isSunsetInIntervalUTC(Astronomy.Riseset riseset, long start, long stop)
-
toHourMinuteString
public static java.lang.String toHourMinuteString(long time)
-
toFullDateTimeString
public static java.lang.String toFullDateTimeString(long time)
-
getWindUnitString
public static java.lang.String getWindUnitString(int type)
-
getWindString
public static java.lang.String getWindString(Context context, CurrentWeatherInfo weatherCard)
-
-