diff options
Diffstat (limited to 'src/org/traccar')
-rw-r--r-- | src/org/traccar/helper/PatternUtil.java | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/src/org/traccar/helper/PatternUtil.java b/src/org/traccar/helper/PatternUtil.java index 88c3f053b..f665eb30d 100644 --- a/src/org/traccar/helper/PatternUtil.java +++ b/src/org/traccar/helper/PatternUtil.java @@ -25,20 +25,13 @@ public final class PatternUtil { } public static class MatchResult { - private String pattern; - private String matched; - private String remaining; + private String patternMatch; + private String patternTail; + private String stringMatch; + private String stringTail; - public String getPattern() { - return this.pattern; - } - - public String getMatched() { - return this.matched; - } - - public String getRemaining() { - return this.remaining; + public String getPatternMatch() { + return patternMatch; } } @@ -50,9 +43,10 @@ public final class PatternUtil { try { Matcher matcher = Pattern.compile("(" + pattern.substring(0, i) + ").*").matcher(input); if (matcher.matches()) { - result.pattern = pattern.substring(0, i); - result.matched = matcher.group(1); - result.remaining = input.substring(matcher.group(1).length()); + result.patternMatch = pattern.substring(0, i); + result.patternTail = pattern.substring(i); + result.stringMatch = matcher.group(1); + result.stringTail = input.substring(matcher.group(1).length()); } } catch (PatternSyntaxException error) { Log.warning(error); |