Package org.basex.util
Class InterruptibleString
- java.lang.Object
-
- org.basex.util.InterruptibleString
-
- All Implemented Interfaces:
CharSequence
public class InterruptibleString extends Object implements CharSequence
Interruptible string implementation. Inspired by https://stackoverflow.com/questions/910740/cancelling-a-long-running-regex-match- Author:
- BaseX Team 2005-23, BSD License, Christian Gruen, gojomo
-
-
Constructor Summary
Constructors Constructor Description InterruptibleString(String string)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description char
charAt(int index)
static void
checkStop()
Checks if search should be interrupted.int
length()
InterruptibleString
subSequence(int start, int end)
String
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.CharSequence
chars, codePoints
-
-
-
-
Constructor Detail
-
InterruptibleString
public InterruptibleString(String string)
Constructor.- Parameters:
string
- string
-
-
Method Detail
-
charAt
public char charAt(int index)
- Specified by:
charAt
in interfaceCharSequence
-
length
public int length()
- Specified by:
length
in interfaceCharSequence
-
subSequence
public InterruptibleString subSequence(int start, int end)
- Specified by:
subSequence
in interfaceCharSequence
-
toString
public String toString()
- Specified by:
toString
in interfaceCharSequence
- Overrides:
toString
in classObject
-
checkStop
public static void checkStop()
Checks if search should be interrupted.
-
-