TruffleString.StringSet
public static final class TruffleString.StringSet- Inheritance
ObjectStringSet
- Enclosing type
TruffleString
A set of strings in a given encoding. Used in ByteIndexOfStringSetNode.execute(AbstractTruffleString, int, int, TruffleString.StringSet).
Methods3
static TruffleString.StringSet fromArray(AbstractTruffleString[], TruffleString.Encoding)
fromArray
staticsince 25.1public static TruffleString.StringSet fromArray(
AbstractTruffleString[] strings,
TruffleString.Encoding encoding
)Creates a new StringSet from the given array of strings. This operation is expensive, it is recommended to cache the result.
Parameters
stringsAbstractTruffleString[]- list of strings to search for. Empty and
CodeRange.BROKENstrings are unsupported. encodingTruffleString.Encodingstrings' encoding. Must be a supported encoding, i.e.UTF-8/16/32,Encoding.ISO_8859_1orEncoding.US_ASCII.
Returns
TruffleString.StringSet- No description.
static TruffleString.StringSet fromArray(TruffleString.WithMask[], TruffleString.Encoding)
fromArray
staticsince 25.1public static TruffleString.StringSet fromArray(
TruffleString.WithMask[] strings,
TruffleString.Encoding encoding
)Creates a new StringSet from the given array of strings with masks. This operation is expensive, it is recommended to cache the result. Matching uses the same semantics as WithMask with some additional restrictions: a pattern code unit matches a haystack code unit if (haystack | mask) == pattern, but the mask may only have one set bit per code unit, and it may not have a larger code range than all search patterns, e.g. if all strings are CodeRange.ASCII, the mask may not have a code unit 0x80. The restrictions of the maskless variant also apply here.
Parameters
stringsTruffleString.WithMask[]- No description.
encodingTruffleString.Encoding- No description.
Returns
TruffleString.StringSet- No description.
boolean isIntrinsicCandidate(TruffleString.CodeRange)
isIntrinsicCandidate
since 25.1public boolean isIntrinsicCandidate(TruffleString.CodeRange codeRange)Returns true if ByteIndexOfStringSetNode may implement the search for this particular string set in strings with the given code range by dispatching to a compiler intrinsic.
This is useful for use cases where the caller has a faster implementation for non-intrinsified paths.
Parameters
codeRangeTruffleString.CodeRange- No description.
Returns
boolean- No description.