com.oracle.truffle.api.strings
Truffle String related APIs. Please see the tutorial for further usage instructions.
Interfaces
public interface NativeAllocatorAn allocation function for native buffers.
public interface TranscodingErrorHandlerAn error handler for transcoding operations such as
TruffleString.SwitchEncodingNode.
Classes
public abstract sealed class AbstractTruffleStringAbstract base class for Truffle strings.
public final class InternalByteArrayWrapper object containing a
TruffleString's internal byte array, along with a byte offset and length defining the region in use.public final class MutableTruffleStringRepresents a mutable variant of a
TruffleString.public abstract static class .AsManagedNodeNode to get the given
AbstractTruffleStringas a managedMutableTruffleString, meaning that the resulting string's backing memory is not a native pointer.public abstract static class .AsMutableTruffleStringNodeNode to get a
AbstractTruffleStringas aMutableTruffleString.public abstract static class .ConcatNodeNode to create a new
MutableTruffleStringby concatenating two strings.public abstract static class .ForceEncodingNodeNode to forcibly assign any encoding to a string.
public abstract static class .FromByteArrayNodeNode to create a new
MutableTruffleStringfrom a byte array.public abstract static class .FromNativePointerNodeNode to create a new
MutableTruffleStringfrom an interop object representing a native pointer.public abstract static class .SubstringByteIndexNodeSubstringNode, but with byte indices.public abstract static class .SubstringNodeNode to create a new mutable substring of a string.
public abstract static class .SwitchEncodingNodeNode to get a given string in a specific encoding.
public abstract static class .WriteByteNodeNode to write a byte into a mutable string.
public final class MutableTruffleStringFactoryNo description.
public final class TruffleStringRepresents a primitive String type, which can be reused across languages.
public abstract static class .AsManagedNodeNode to get the given
AbstractTruffleStringas a managedTruffleString, meaning that the resulting string's backing memory is not a native pointer.public abstract static class .AsNativeNodeNode to convert a potentially
managedTruffleStringto anativestring.public abstract static class .AsTruffleStringNodeNode to get the given
AbstractTruffleStringas aTruffleString.public abstract static class .ByteIndexOfAnyByteNodeNode to find the index of the first occurrence of any byte from a given array.
public abstract static class .ByteIndexOfCodePointNodeIndexOfCodePointNode, but with byte indices.public abstract static class .ByteIndexOfCodePointSetNodeNode to find the byte index of the first occurrence of a codepoint present in a given codepoint set.
public abstract static class .ByteIndexOfStringNodeIndexOfStringNode, but with byte indices.public abstract static class .ByteIndexOfStringSetNodeNode to find the byte index of the first occurrence of any string contained in a given string set.
public abstract static class .ByteIndexToCodePointIndexNodeNode to convert a given byte index to a codepoint index.
public abstract static class .ByteLengthOfCodePointNodeNode to get the number of bytes occupied by the codepoint starting at a given byte index.
public abstract static class .CharIndexOfAnyCharUTF16NodeNode to find the index of the first occurrence of any
charfrom a given array.public abstract static class .CodePointAtByteIndexNodeNode to read a codepoint at a given byte index.
public abstract static class .CodePointAtIndexNodeNode to read a codepoint at a given codepoint index.
public abstract static class .CodePointAtIndexUTF32NodeNode to read a codepoint at a given codepoint index from a UTF-32 string.
public abstract static class .CodePointIndexToByteIndexNodeNode to convert a given codepoint index to a byte index.
public abstract static class .CodePointLengthNodeNode to get the number of codepoints in a string.
public static final class .CodePointSetA set of codepoints in a given encoding.
public enum .CodeRangeProvides information about a string's content.
public abstract static class .CodeRangeEqualsNodeNode to check if a string's code range is equal to the given
CodeRange.public enum .CompactionLevelRepresents a string's compaction level, i.e.
public abstract static class .CompareBytesNodeNode to compare two strings byte-by-byte.
public abstract static class .CompareCharsUTF16NodeNode to compare two UTF-16 strings.
public abstract static class .CompareIntsUTF32NodeNode to compare two UTF-32 strings.
public abstract static class .ConcatNodeNode to concatenate two strings.
public abstract static class .CopyToByteArrayNodeNode to copy a region of a string into a byte array.
public abstract static class .CopyToNativeMemoryNodeNode to copy a region of a string into native memory.
public abstract static class .CreateBackwardCodePointIteratorNodeNode to create a
TruffleStringIterator.public abstract static class .CreateCodePointIteratorNodeNode to create a
TruffleStringIterator.public enum .EncodingThe list of encodings supported by
TruffleString.public abstract static class .EqualNodeNode to check two strings for equality.
public enum .ErrorHandlingError handling instructions for operations that return integer values, such as indices or code points.
public abstract static class .ForceEncodingNodeNode to forcibly assign any encoding to a string.
public abstract static class .FromByteArrayNodeNode to create a new
TruffleStringfrom a byte array.public abstract static class .FromByteArrayWithCompactionUTF32NodeNode to create a new
TruffleStringfrom a byte array.public abstract static class .FromCharArrayUTF16NodeNode to create a new UTF-16
TruffleStringfrom a char array.public abstract static class .FromCodePointNodeNode to create a new
TruffleStringfrom a single codepoint.public abstract static class .FromIntArrayUTF32NodeNode to create a new UTF-32
TruffleStringfrom an int-array.public abstract static class .FromJavaStringNodeNode to create a new
TruffleStringfrom a Java string.public abstract static class .FromLongNodeNode to create a new
TruffleStringfrom alongvalue.public abstract static class .FromNativePointerNodeNode to create a new
TruffleStringfrom an interop object representing a native pointer.public abstract static class .FromNativePointerWithCompactionUTF32NodeNode to create a new
TruffleStringfrom an interop object representing a native pointer.public abstract static class .FromZeroTerminatedNativePointerNodeEquivalent to
FromNativePointerNodefor zero-terminated buffers, i.e.public abstract static class .GetByteCodeRangeNodeNode to get a string's "byte-based"
CodeRange.public abstract static class .GetCodeRangeImpreciseNodeNode to get a string's possibly imprecise
CodeRange.public abstract static class .GetCodeRangeNodeNode to get a string's precise
CodeRange.public abstract static class .GetInternalByteArrayNodeNode to get a string's internal byte array.
public abstract static class .GetInternalNativePointerNodeNode to get a
nativestring's pointer object or raw pointer.public abstract static class .GetStringCompactionLevelNodeNode to get a string's
CompactionLevel.public abstract static class .HashCodeNodeNode to get a string's hash code.
public static final class .IllegalByteArrayLengthExceptionThis exception is thrown when any operation tries to create a
UTF-16orUTF-32string with an invalid byte length (not a multiple of 2/4 bytes).public abstract static class .IndexOfCodePointNodeNode to find the index of the first occurrence of a given code point.
public abstract static class .IndexOfStringNodeNode to find the index of the first occurrence of a given string.
public abstract static class .IntIndexOfAnyIntUTF32NodeNode to find the index of the first occurrence of any
intfrom a given array.public abstract static class .IsValidNodeNode to check if a string is encoded correctly.
public abstract static class .LastByteIndexOfCodePointNodeLastIndexOfCodePointNode, but with byte indices.public abstract static class .LastByteIndexOfStringNodeLastIndexOfStringNode, but with byte indices.public abstract static class .LastIndexOfCodePointNodeNode to find the codepoint index of the last occurrence of a given code point.
public abstract static class .LastIndexOfStringNodeNode to find the index of the last occurrence of a given string.
public abstract static class .MaterializeNodeNode to force materialization of any lazy internal data.
public abstract static class .MaterializeSubstringNodeExtended version of
MaterializeNodethat also materializes substrings/string views created via e.g.public static final class .NumberFormatExceptionThis exception may be thrown by
ParseIntNode,ParseLongNodeorParseDoubleNodeto indicate that the given string cannot be parsed as an integer, long or double value.public abstract static class .ParseDoubleNodeNode to parse a given string as a double value.
public abstract static class .ParseIntNodeNode to parse a given string as an int value.
public abstract static class .ParseLongNodeNode to parse a given string as a long value.
public abstract static class .ReadByteNodeNode to read a single byte from a string.
public abstract static class .ReadCharUTF16NodeNode to read a single char from a UTF-16 string.
public abstract static class .RegionEqualByteIndexNodeNode to check for a region match, byte-by-byte.
public abstract static class .RegionEqualNodeNode to check codepoint equality of two string regions.
public abstract static class .RepeatNodeNode to repeat a given string
Ntimes.public static final class .StringSetA set of strings in a given encoding.
public abstract static class .SubstringByteIndexNodeSubstringNode, but with byte indices.public abstract static class .SubstringNodeNode to create a substring of a given string.
public abstract static class .SwitchEncodingNodeNode to get a given string in a specific encoding.
public abstract static class .ToJavaStringNodeNode to get a
Stringrepresentation of aTruffleString.public abstract static class .ToValidStringNodeNode to replace all invalid bytes in a given string, such that the resulting string is
valid.public static final class .WithMaskExtended parameter type for the operations
ByteIndexOfStringNode,LastByteIndexOfStringNodeandRegionEqualByteIndexNode.
public abstract sealed class TruffleStringBuilderThe
TruffleStringequivalent toStringBuilder.public abstract static class .AppendByteNodeNode to append a single byte to a string builder.
public abstract static class .AppendCharUTF16NodeNode to append a single char to a string builder.
public abstract static class .AppendCodePointNodeNode to append a codepoint to a string builder.
public abstract static class .AppendIntNumberNodeNode to append an integer to a string builder.
public abstract static class .AppendJavaStringUTF16NodeNode to append a substring of a given
Stringto a string builder.public abstract static class .AppendLongNumberNodeNode to append a
longvalue to a string builder.public abstract static class .AppendStringNodeNode to append a given
TruffleStringto a string builder.public abstract static class .AppendSubstringByteIndexNodeNode to append a substring of a given
TruffleStringto a string builder.public abstract static class .ToStringNodeNode to materialize a string builder as a
TruffleString.
public final class TruffleStringBuilderFactoryNo description.
public final class TruffleStringBuilderUTF16The UTF-16-specific variant of
TruffleStringBuilder.public final class TruffleStringBuilderUTF32The UTF-32-specific variant of
TruffleStringBuilder.public final class TruffleStringBuilderUTF8The UTF-8-specific variant of
TruffleStringBuilder.public final class TruffleStringFactoryNo description.
public static final class .WithMaskFactoryNo description.
public final class TruffleStringIteratorAn iterator object that allows iterating over a
TruffleString's codepoints, without having to re-calculate codepoint indices on every access.public abstract static class .NextNodeReturns the next codepoint in the string.
public abstract static class .PreviousNodeReturns the previous codepoint in the string.
public final class TruffleStringIteratorFactoryNo description.