public static final class TruffleString.CodePointSet extends Object
TruffleString.ByteIndexOfCodePointSetNode.execute(AbstractTruffleString, int, int, TruffleString.CodePointSet)
.Modifier and Type | Method and Description |
---|---|
static TruffleString.CodePointSet |
fromRanges(int[] ranges,
TruffleString.Encoding encoding)
Creates a new
TruffleString.CodePointSet from the given list of ranges. |
boolean |
isIntrinsicCandidate(TruffleString.CodeRange codeRange)
Returns
true if TruffleString.ByteIndexOfCodePointSetNode may implement the search for
this particular code point set in strings with the given code range by dispatching to a
compiler intrinsic. |
public static TruffleString.CodePointSet fromRanges(int[] ranges, TruffleString.Encoding encoding)
TruffleString.CodePointSet
from the given list of ranges. This operation is
expensive, it is recommended to cache the result.ranges
- a sorted list of non-adjacent codepoint ranges. For every two consecutive
array elements, the first is interpreted as the range's inclusive lower bound,
and the second element is the range's inclusive upper bound. Example: an array
[1, 4, 8, 10]
represents the inclusive ranges [1-4]
and
[8-10]
.public boolean isIntrinsicCandidate(TruffleString.CodeRange codeRange)
true
if TruffleString.ByteIndexOfCodePointSetNode
may implement the search for
this particular code point set in strings with the given code range by dispatching to a
compiler intrinsic.