Class SplitFastPath

java.lang.Object
org.teavm.classlib.impl.regex.SplitFastPath

public final class SplitFastPath extends Object
  • Method Summary

    Modifier and Type
    Method
    Description
    static int
    Checks whether splitting by the given regular expression is equivalent to splitting by a single character, i.e. whether regex is either a single character without special meaning, or a backslash followed by a character which is neither ASCII letter nor digit.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • singleChar

      public static int singleChar(String regex)
      Checks whether splitting by the given regular expression is equivalent to splitting by a single character, i.e. whether regex is either a single character without special meaning, or a backslash followed by a character which is neither ASCII letter nor digit. Used both by String.split at run time and by PatternCompileTransformer at compile time.
      Returns:
      the character to split by, or -1 if fast path is not applicable.