A
- attribute@FunctionalInterface
public interface PatternMatcher<A>
Modifier and Type | Method and Description |
---|---|
default PatternResult<A> |
match(java.lang.String match,
A attribute)
matches the given string starts with 0.
returns an instance of PatternResult if it matches, or returns null if it does not match. |
PatternResult<A> |
match(java.lang.String match,
int index,
A attribute)
matches the given string starts with the given index.
returns an instance of PatternResult if it matches, or returns null if it does not match. |
default PatternResult<A> |
parse(java.lang.String match,
A attribute)
An alias of match.
|
default PatternResult<A> |
parsePart(java.lang.String match,
A attribute)
searches this pattern in the given string.
returns an instance of PatternResult if the pattern found in the string. |
default PatternResult<A> |
parsePart(java.lang.String match,
int index,
A attribute)
searches this pattern in the given string from the given index.
returns an instance of PatternResult if the pattern found in the string from the index. |
default A |
parsePartGlobal(java.lang.String match,
A init,
java.util.function.BiFunction<A,A,A> action)
searches all patterns in the given string.
returns accumulated attribute by the given action. |
default A |
parsePartGlobal(java.lang.String match,
int index,
A init,
java.util.function.BiFunction<A,A,A> action)
searches all patterns in the given string from the given index.
returns accumulated attribute by the given action. |
default java.util.List<A> |
parsePartGlobalList(java.lang.String match)
searches all patterns in the given string.
returns a list of all attributes. |
default java.util.List<A> |
parsePartGlobalList(java.lang.String match,
int index)
searches all patterns in the given string from the given index.
returns a list of all attributes. |
PatternResult<A> match(java.lang.String match, int index, A attribute)
match
- a string to be matchedindex
- an index to start matchingattribute
- inherited attributedefault PatternResult<A> match(java.lang.String match, A attribute)
match
- a string to be matchedattribute
- inherited attributedefault PatternResult<A> parse(java.lang.String match, A attribute)
match
- a string to be matchedattribute
- inherited attributedefault PatternResult<A> parsePart(java.lang.String match, int index, A attribute)
match
- a string to be matchedindex
- an index to start matchingattribute
- inherited attributedefault PatternResult<A> parsePart(java.lang.String match, A attribute)
match
- a string to be matchedattribute
- inherited attributedefault A parsePartGlobal(java.lang.String match, int index, A init, java.util.function.BiFunction<A,A,A> action)
match
- a string to be matchedindex
- an index to start matchinginit
- initial attributeaction
- an accumulatordefault A parsePartGlobal(java.lang.String match, A init, java.util.function.BiFunction<A,A,A> action)
match
- a string to be matchedinit
- initial attributeaction
- an accumulatordefault java.util.List<A> parsePartGlobalList(java.lang.String match, int index)
match
- a string to be matchedindex
- an index to start matchingdefault java.util.List<A> parsePartGlobalList(java.lang.String match)
match
- a string to be matched