aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/helper
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/helper')
-rw-r--r--src/org/traccar/helper/DateBuilder.java5
-rw-r--r--src/org/traccar/helper/Parser.java14
-rw-r--r--src/org/traccar/helper/PatternBuilder.java4
3 files changed, 20 insertions, 3 deletions
diff --git a/src/org/traccar/helper/DateBuilder.java b/src/org/traccar/helper/DateBuilder.java
index 9a75d90fc..5d2ee8e0a 100644
--- a/src/org/traccar/helper/DateBuilder.java
+++ b/src/org/traccar/helper/DateBuilder.java
@@ -84,6 +84,11 @@ public class DateBuilder {
return this;
}
+ public DateBuilder addMinute(int minute) {
+ calendar.add(Calendar.MINUTE, minute);
+ return this;
+ }
+
public DateBuilder setSecond(int second) {
calendar.set(Calendar.SECOND, second);
return this;
diff --git a/src/org/traccar/helper/Parser.java b/src/org/traccar/helper/Parser.java
index 107ae7bff..7694a9623 100644
--- a/src/org/traccar/helper/Parser.java
+++ b/src/org/traccar/helper/Parser.java
@@ -80,7 +80,8 @@ public class Parser {
public enum CoordinateFormat {
DEG_MIN_HEM,
- HEM_DEG
+ HEM_DEG,
+ HEM_DEG_MIN_HEM
}
public double nextCoordinate(CoordinateFormat format) {
@@ -92,9 +93,16 @@ public class Parser {
hemisphere = next();
coordinate = nextDouble();
break;
- case DEG_MIN_HEM:
+ case HEM_DEG_MIN_HEM:
+ hemisphere = next();
+ coordinate = nextInt();
+ coordinate += nextDouble() / 60;
+ if (hasNext()) {
+ hemisphere = next();
+ }
+ break;
default:
- coordinate = nextDouble();
+ coordinate = nextInt();
coordinate += nextDouble() / 60;
hemisphere = next();
break;
diff --git a/src/org/traccar/helper/PatternBuilder.java b/src/org/traccar/helper/PatternBuilder.java
index fbef144e6..a0e24e017 100644
--- a/src/org/traccar/helper/PatternBuilder.java
+++ b/src/org/traccar/helper/PatternBuilder.java
@@ -82,6 +82,10 @@ public class PatternBuilder {
}
}
+ public PatternBuilder or() {
+ return xpr("|");
+ }
+
public Pattern compile() {
return Pattern.compile(pattern.toString(), Pattern.DOTALL);
}