Package net.loomchild.segment.srx
Class RuleMatcher
java.lang.Object
net.loomchild.segment.srx.RuleMatcher
Represents matcher finding subsequent occurrences of one rule.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Matcher
private Matcher
private SrxDocument
(package private) boolean
private Rule
private CharSequence
-
Constructor Summary
ConstructorsConstructorDescriptionRuleMatcher
(SrxDocument document, Rule rule, CharSequence text) Creates matcher. -
Method Summary
-
Field Details
-
document
-
rule
-
text
-
beforeMatcher
-
afterMatcher
-
found
boolean found
-
-
Constructor Details
-
RuleMatcher
Creates matcher.- Parameters:
rule
- rule which will be searched in the texttext
-
-
-
Method Details
-
find
public boolean find()Finds next rule match after previously found.- Returns:
- true if rule has been matched
-
find
public boolean find(int start) Finds next rule match after given start position.- Parameters:
start
- start position- Returns:
- true if rule has been matched
-
hitEnd
public boolean hitEnd()- Returns:
- true if end of text has been reached while searching
-
getStartPosition
public int getStartPosition()- Returns:
- position in text where the last matching starts
-
getBreakPosition
public int getBreakPosition()- Returns:
- position in text where text should be splitted according to last matching
-
getEndPosition
public int getEndPosition()- Returns:
- position in text where the last matching ends
-
getRule
- Returns:
- matcher rule
-