Package org.apache.commons.jexl3
Class JexlArithmetic.InterruptibleCharSequence
java.lang.Object
org.apache.commons.jexl3.JexlArithmetic.InterruptibleCharSequence
- All Implemented Interfaces:
CharSequence
- Enclosing class:
- JexlArithmetic
private static final class JexlArithmetic.InterruptibleCharSequence
extends Object
implements CharSequence
A CharSequence wrapper that throws ArithmeticException if the current thread is interrupted.
Used as the input to
Pattern.matcher() so that catastrophic-backtracking regex matches
remain responsive to JEXL cancellation (which sets the thread interrupt flag).
The interrupt flag is checked every 256 charAt calls to limit overhead.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncharcharAt(int index) intlength()subSequence(int start, int end) toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.CharSequence
chars, codePoints
-
Field Details
-
seq
-
count
private int count
-
-
Constructor Details
-
InterruptibleCharSequence
-
-
Method Details
-
charAt
public char charAt(int index) - Specified by:
charAtin interfaceCharSequence
-
length
public int length()- Specified by:
lengthin interfaceCharSequence
-
subSequence
- Specified by:
subSequencein interfaceCharSequence
-
toString
- Specified by:
toStringin interfaceCharSequence- Overrides:
toStringin classObject
-