Class TruffleString.StringSet
java.lang.Object
com.oracle.truffle.api.strings.TruffleString.StringSet
- Enclosing class:
TruffleString
A set of strings in a given encoding. Used in
TruffleString.ByteIndexOfStringSetNode.execute(AbstractTruffleString, int, int, TruffleString.StringSet).- Since:
- 25.1
-
Method Summary
Modifier and TypeMethodDescriptionstatic TruffleString.StringSetfromArray(AbstractTruffleString[] strings, TruffleString.Encoding encoding) Creates a newTruffleString.StringSetfrom the given array of strings.static TruffleString.StringSetfromArray(TruffleString.WithMask[] strings, TruffleString.Encoding encoding) Creates a newTruffleString.StringSetfrom the given array of strings with masks.booleanisIntrinsicCandidate(TruffleString.CodeRange codeRange) ReturnstrueifTruffleString.ByteIndexOfStringSetNodemay implement the search for this particular string set in strings with the given code range by dispatching to a compiler intrinsic.
-
Method Details
-
fromArray
public static TruffleString.StringSet fromArray(AbstractTruffleString[] strings, TruffleString.Encoding encoding) Creates a newTruffleString.StringSetfrom the given array of strings. This operation is expensive, it is recommended to cache the result.- Parameters:
strings- list of strings to search for. Empty andTruffleString.CodeRange.BROKENstrings are unsupported.encoding-strings' encoding. Must be a supported encoding, i.e.UTF-8/16/32,TruffleString.Encoding.ISO_8859_1orTruffleString.Encoding.US_ASCII.- Since:
- 25.1
-
fromArray
public static TruffleString.StringSet fromArray(TruffleString.WithMask[] strings, TruffleString.Encoding encoding) Creates a newTruffleString.StringSetfrom the given array of strings with masks. This operation is expensive, it is recommended to cache the result. Matching uses the same semantics asTruffleString.WithMaskwith 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 areTruffleString.CodeRange.ASCII, the mask may not have a code unit0x80. The restrictions of the maskless variant also apply here.- Since:
- 25.1
-
isIntrinsicCandidate
ReturnstrueifTruffleString.ByteIndexOfStringSetNodemay 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.
- Since:
- 25.1
-