]> gitweb.fperrin.net Git - GpsPrune.git/blobdiff - tim/prune/function/deletebydate/DateInfo.java
Version 19, May 2018
[GpsPrune.git] / tim / prune / function / deletebydate / DateInfo.java
index 0c2cedb54f5743af654466f8afdb06399916a4e4..3e36d75a448491d5de056a9ddf6833655c85d67b 100644 (file)
@@ -2,6 +2,7 @@ package tim.prune.function.deletebydate;
 
 import java.text.DateFormat;
 import java.util.Date;
+import java.util.TimeZone;
 
 /**
  * Class to hold the information about a date,
@@ -12,7 +13,7 @@ public class DateInfo implements Comparable<DateInfo>
 {
        /** Date, or null for no date - used for earlier/later comparison */
        private Date _date = null;
-       /** String representation of date, for equality comparison */
+       /** String representation of date */
        private String _dateString = null;
        /** Number of points with this date */
        private int _numPoints = 0;
@@ -22,6 +23,15 @@ public class DateInfo implements Comparable<DateInfo>
        // Doesn't really matter what format is used here, as long as dates are different
        private static final DateFormat DEFAULT_DATE_FORMAT = DateFormat.getDateInstance();
 
+
+       /**
+        * @param inZone Timezone to use for the date identification
+        */
+       public static void setTimezone(TimeZone inZone)
+       {
+               DEFAULT_DATE_FORMAT.setTimeZone(inZone);
+       }
+
        /**
         * Constructor
         * @param inDate date object from timestamp
@@ -47,10 +57,10 @@ public class DateInfo implements Comparable<DateInfo>
        }
 
        /**
-        * @return date object, or null
+        * @return string representation of date
         */
-       public Date getDate() {
-               return _date;
+       public String getString() {
+               return _dateString;
        }
 
        /**