summaryrefslogtreecommitdiff
path: root/libjava/classpath/gnu/java/util/regex/RETokenAny.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/classpath/gnu/java/util/regex/RETokenAny.java')
-rw-r--r--libjava/classpath/gnu/java/util/regex/RETokenAny.java84
1 files changed, 50 insertions, 34 deletions
diff --git a/libjava/classpath/gnu/java/util/regex/RETokenAny.java b/libjava/classpath/gnu/java/util/regex/RETokenAny.java
index b99a54717c9..c002d050423 100644
--- a/libjava/classpath/gnu/java/util/regex/RETokenAny.java
+++ b/libjava/classpath/gnu/java/util/regex/RETokenAny.java
@@ -38,62 +38,78 @@ exception statement from your version. */
package gnu.java.util.regex;
-final class RETokenAny extends REToken {
+import gnu.java.lang.CPStringBuilder;
+
+final class RETokenAny extends REToken
+{
/** True if '.' can match a newline (RE_DOT_NEWLINE) */
- private boolean newline;
+ private boolean newline;
/** True if '.' can't match a null (RE_DOT_NOT_NULL) */
- private boolean matchNull;
-
- RETokenAny(int subIndex, boolean newline, boolean matchNull) {
- super(subIndex);
+ private boolean matchNull;
+
+ RETokenAny (int subIndex, boolean newline, boolean matchNull)
+ {
+ super (subIndex);
this.newline = newline;
this.matchNull = matchNull;
}
- int getMinimumLength() {
+ int getMinimumLength ()
+ {
return 1;
}
- int getMaximumLength() {
+ int getMaximumLength ()
+ {
return 1;
}
- REMatch matchThis(CharIndexed input, REMatch mymatch) {
- char ch = input.charAt(mymatch.index);
- boolean retval = matchOneChar(ch);
- if (retval) {
- ++mymatch.index;
- return mymatch;
+ REMatch matchThis (CharIndexed input, REMatch mymatch)
+ {
+ char ch = input.charAt (mymatch.index);
+ boolean retval = matchOneChar (ch);
+ if (retval)
+ {
+ ++mymatch.index;
+ return mymatch;
}
- return null;
- }
-
- boolean matchOneChar(char ch) {
- if ((ch == CharIndexed.OUT_OF_BOUNDS)
- || (!newline && (ch == '\n'))
- || (matchNull && (ch == 0))) {
- return false;
+ return null;
+ }
+
+ boolean matchOneChar (char ch)
+ {
+ if ((ch == CharIndexed.OUT_OF_BOUNDS)
+ || (!newline && (ch == '\n')) || (matchNull && (ch == 0)))
+ {
+ return false;
}
- return true;
+ return true;
}
- boolean returnsFixedLengthMatches() { return true; }
+ boolean returnsFixedLengthMatches ()
+ {
+ return true;
+ }
- int findFixedLengthMatches(CharIndexed input, REMatch mymatch, int max) {
+ int findFixedLengthMatches (CharIndexed input, REMatch mymatch, int max)
+ {
int index = mymatch.index;
int numRepeats = 0;
- while (true) {
- if (numRepeats >= max) break;
- char ch = input.charAt(index++);
- if (! matchOneChar(ch)) break;
- numRepeats++;
- }
+ while (true)
+ {
+ if (numRepeats >= max)
+ break;
+ char ch = input.charAt (index++);
+ if (!matchOneChar (ch))
+ break;
+ numRepeats++;
+ }
return numRepeats;
}
- void dump(StringBuffer os) {
- os.append('.');
+ void dump (CPStringBuilder os)
+ {
+ os.append ('.');
}
}
-