summaryrefslogtreecommitdiff
path: root/gnu/java/util/regex/CharIndexedCharSequence.java
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/java/util/regex/CharIndexedCharSequence.java')
-rw-r--r--gnu/java/util/regex/CharIndexedCharSequence.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/gnu/java/util/regex/CharIndexedCharSequence.java b/gnu/java/util/regex/CharIndexedCharSequence.java
index 2eb753b0f..8a0578eb8 100644
--- a/gnu/java/util/regex/CharIndexedCharSequence.java
+++ b/gnu/java/util/regex/CharIndexedCharSequence.java
@@ -62,6 +62,10 @@ class CharIndexedCharSequence implements CharIndexed, Serializable {
return ((anchor += index) < len);
}
+ public boolean move1(int index) {
+ return ((anchor += index) <= len);
+ }
+
public CharIndexed lookBehind(int index, int length) {
if (length > (anchor + index)) length = anchor + index;
return new CharIndexedCharSequence(s, anchor + index - length);
@@ -77,6 +81,15 @@ class CharIndexedCharSequence implements CharIndexed, Serializable {
lastMatch.anchor = anchor;
}
public REMatch getLastMatch() { return lastMatch; }
+
+ private int rightmostTriedPosition = 0;
+ public void setHitEnd(REMatch match) {
+ int pos = anchor + match.index;
+ if (pos > rightmostTriedPosition) rightmostTriedPosition = pos;
+ }
+ public boolean hitEnd() { return rightmostTriedPosition >= len; }
+
public int getAnchor() { return anchor; }
public void setAnchor(int anchor) { this.anchor = anchor; }
+
}