Class WeatherWarnings


  • public class WeatherWarnings
    extends java.lang.Object
    • Field Detail

      • simpleDateFormat

        public static final java.text.SimpleDateFormat simpleDateFormat
      • simpleDateFormat2

        public static final java.text.SimpleDateFormat simpleDateFormat2
    • Constructor Detail

      • WeatherWarnings

        public WeatherWarnings()
    • Method Detail

      • writeWarningsToDatabase

        public static void writeWarningsToDatabase​(Context context,
                                                   java.util.ArrayList<WeatherWarning> warnings)
      • getCurrentWarnings

        public static java.util.ArrayList<WeatherWarning> getCurrentWarnings​(Context context,
                                                                             boolean initPolygons)
      • cleanWeatherWarningsDatabase

        public static void cleanWeatherWarningsDatabase​(Context context)
      • isMoreThan24hAway

        public static boolean isMoreThan24hAway​(long start)
      • getTimeMiniString

        public static java.lang.String getTimeMiniString​(long time)
      • getOnsetMiniString

        public static java.lang.String getOnsetMiniString​(Context context,
                                                          WeatherWarning weatherWarning)
      • getExpiresMiniString

        public static java.lang.String getExpiresMiniString​(Context context,
                                                            WeatherWarning weatherWarning)
      • getMiniWarningsString

        public static SpannableStringBuilder getMiniWarningsString​(Context context,
                                                                   java.util.ArrayList<WeatherWarning> applicableWarnings,
                                                                   long itemStartTime,
                                                                   long itemStopTime,
                                                                   boolean multiLine,
                                                                   int textType)
      • addToNotified

        public static long addToNotified​(Context context,
                                         WeatherWarning warning,
                                         int id)
      • getExpiredWarningIds

        public static java.util.ArrayList<java.lang.Integer> getExpiredWarningIds​(Context context)
      • alreadyNotified

        public static boolean alreadyNotified​(Context context,
                                              WeatherWarning weatherWarning)
      • clearNotified

        public static int clearNotified​(Context context)
      • clearAllNotified

        public static int clearAllNotified​(Context context)
      • getFirstNotificationCancelTimeInMillis

        public static long getFirstNotificationCancelTimeInMillis​(Context context)
      • getFirstWarningPosition

        public static int getFirstWarningPosition​(java.util.ArrayList<WeatherWarning> fullList,
                                                  java.util.ArrayList<WeatherWarning> applyingList)
        Determines first position in fullList that corresponds to the items in applyingList, defined by "identifier". As both warning lists are sorted by serverity, it also returns the 1st item of the highest severity. If more than one item has the highest severity, simply the first one found is retured. Both lists may not be null! Returns 0 if no warnings are found.
        Parameters:
        fullList -
        applyingList -
        Returns: