Elide GraalVM25.6.0-elide.4
All types
Versions and modules

TruffleString.StringSet

Javaclassin com.oracle.truffle.api.stringssince 25.1

public static final class TruffleString.StringSet
Inheritance
  1. Object
  2. StringSet
Enclosing type
TruffleString

Methods3

static TruffleString.StringSet fromArray(AbstractTruffleString[], TruffleString.Encoding)

fromArray

staticsince 25.1
public 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.BROKEN strings are unsupported.
encodingTruffleString.Encoding
strings' encoding. Must be a supported encoding, i.e. UTF-8/16/32, Encoding.ISO_8859_1 or Encoding.US_ASCII.

Returns

static TruffleString.StringSet fromArray(TruffleString.WithMask[], TruffleString.Encoding)

fromArray

staticsince 25.1
public 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

boolean isIntrinsicCandidate(TruffleString.CodeRange)

isIntrinsicCandidate

since 25.1
public 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.

Inherited members