public abstract static class TruffleString.ByteLengthOfCodePointNode extends Node
TruffleString.ByteLengthOfCodePointNode.execute(AbstractTruffleString, int, TruffleString.Encoding) for details.Node.Child, Node.Children| Modifier and Type | Method and Description |
|---|---|
static TruffleString.ByteLengthOfCodePointNode |
create()
Create a new
TruffleString.ByteLengthOfCodePointNode. |
int |
execute(AbstractTruffleString a,
int byteIndex,
TruffleString.Encoding expectedEncoding)
Get the number of bytes occupied by the codepoint starting at
byteIndex, with
best-effort error handling. |
abstract int |
execute(AbstractTruffleString a,
int byteIndex,
TruffleString.Encoding expectedEncoding,
TruffleString.ErrorHandling errorHandling)
Get the number of bytes occupied by the codepoint starting at
byteIndex. |
static TruffleString.ByteLengthOfCodePointNode |
getUncached()
Get the uncached version of
TruffleString.ByteLengthOfCodePointNode. |
accept, adoptChildren, atomic, atomic, copy, deepCopy, getChildren, getCost, getDebugProperties, getDescription, getEncapsulatingSourceSection, getLock, getParent, getRootNode, getSourceSection, insert, insert, isAdoptable, isSafelyReplaceableBy, notifyInserted, onReplace, replace, replace, reportPolymorphicSpecialize, toStringpublic final int execute(AbstractTruffleString a, int byteIndex, TruffleString.Encoding expectedEncoding)
byteIndex, with
best-effort error handling.public abstract int execute(AbstractTruffleString a, int byteIndex, TruffleString.Encoding expectedEncoding, TruffleString.ErrorHandling errorHandling)
byteIndex.errorHandling - if set to TruffleString.ErrorHandling.BEST_EFFORT, this node will return
the encoding's minimum number of bytes per codepoint if an error occurs while
reading the codepoint. If set to TruffleString.ErrorHandling.RETURN_NEGATIVE, a
negative value will be returned instead, where two error cases are
distinguished: if the codepoint is invalid, the return value is -1. If the
codepoint is an unfinished, possibly valid byte sequence at the end of the
string, the return value is -1 - (number of missing bytes). This
parameter is expected to be
partial evaluation
constant.public static TruffleString.ByteLengthOfCodePointNode create()
TruffleString.ByteLengthOfCodePointNode.public static TruffleString.ByteLengthOfCodePointNode getUncached()
TruffleString.ByteLengthOfCodePointNode.