Class TruffleString.CodePointAtIndexNode
java.lang.Object
com.oracle.truffle.api.nodes.Node
com.oracle.truffle.api.strings.TruffleString.CodePointAtIndexNode
- All Implemented Interfaces:
NodeInterface, Cloneable
- Enclosing class:
TruffleString
Node to read a codepoint at a given codepoint index. See
execute(AbstractTruffleString, int, TruffleString.Encoding) for details.- Since:
- 22.1
-
Nested Class Summary
Nested classes/interfaces inherited from class Node
Node.Child, Node.Children -
Method Summary
Modifier and TypeMethodDescriptioncreate()Create a newTruffleString.CodePointAtIndexNode.final intexecute(AbstractTruffleString a, int i, TruffleString.Encoding expectedEncoding) Decode and return the codepoint at codepoint indexi, withbest-efforterror handling.abstract intexecute(AbstractTruffleString a, int i, TruffleString.Encoding expectedEncoding, TruffleString.ErrorHandling errorHandling) Decode and return the codepoint at codepoint indexi.Get the uncached version ofTruffleString.CodePointAtIndexNode.Methods inherited from class Node
accept, adoptChildren, atomic, atomic, copy, deepCopy, getChildren, getCost, getDebugProperties, getDescription, getEncapsulatingSourceSection, getLock, getParent, getRootNode, getSourceSection, insert, insert, isAdoptable, isSafelyReplaceableBy, notifyInserted, onReplace, replace, replace, reportPolymorphicSpecialize, reportReplace, toString
-
Method Details
-
execute
Decode and return the codepoint at codepoint indexi, withbest-efforterror handling.- Since:
- 22.1
-
execute
public abstract int execute(AbstractTruffleString a, int i, TruffleString.Encoding expectedEncoding, TruffleString.ErrorHandling errorHandling) Decode and return the codepoint at codepoint indexi.- Parameters:
errorHandling- if set toTruffleString.ErrorHandling.BEST_EFFORT, the return value on invalid codepoints depends onexpectedEncoding:TruffleString.Encoding.UTF_8: Unicode Replacement character0xFFFDTruffleString.Encoding.UTF_16: the (16-bit)charvalue read at indexiTruffleString.Encoding.UTF_32: the (32-bit)intvalue read at indexiTruffleString.Encoding.US_ASCII,TruffleString.Encoding.ISO_8859_1,TruffleString.Encoding.BYTES: the (8-bit) unsignedbytevalue read at indexi- All other Encodings: Unicode Replacement character
0xFFFD
TruffleString.ErrorHandling.RETURN_NEGATIVE,-1will be returned instead. This parameter is expected to bepartial evaluation constant.- Since:
- 22.3
-
create
Create a newTruffleString.CodePointAtIndexNode.- Since:
- 22.1
-
getUncached
Get the uncached version ofTruffleString.CodePointAtIndexNode.- Since:
- 22.1
-