From d63c993dc1a97d5c8d67fdbee5a3b71ec4088a73 Mon Sep 17 00:00:00 2001 From: Anton Smirnov Date: Wed, 10 Mar 2021 11:09:03 +0500 Subject: [PATCH] `Matcher` to implement `MatchResult`. --- src/main/java/com/humio/jitrex/Matcher.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/humio/jitrex/Matcher.java b/src/main/java/com/humio/jitrex/Matcher.java index 7560c5a..3f30cee 100644 --- a/src/main/java/com/humio/jitrex/Matcher.java +++ b/src/main/java/com/humio/jitrex/Matcher.java @@ -8,8 +8,9 @@ import com.humio.jitrex.util.Regex; import java.util.*; +import java.util.regex.MatchResult; -public class Matcher { +public class Matcher implements MatchResult { private final Pattern pattern; protected CharSequence input; protected final Regex re; @@ -54,6 +55,10 @@ public int compare(Pattern.VarEntry o1, Pattern.VarEntry o2) { private static Map EMPTY_MAP = new HashMap<>(); + public Pattern pattern() { + return pattern; + } + public void reset() { reset(input, EMPTY_MAP); }