Class TruffleString.CodePointLengthNode
java.lang.Object
com.oracle.truffle.api.nodes.Node
com.oracle.truffle.api.strings.TruffleString.CodePointLengthNode
- All Implemented Interfaces:
NodeInterface, Cloneable
- Enclosing class:
TruffleString
Node to get the number of codepoints in a string.
- 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.CodePointLengthNode
.abstract int
execute
(AbstractTruffleString a, TruffleString.Encoding expectedEncoding) Return the number of codepoints in the string.Get the uncached version ofTruffleString.CodePointLengthNode
.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
Return the number of codepoints in the string.If the string is not encoded correctly (if its coderange is
TruffleString.CodeRange.BROKEN
), every broken minimum-length sequence in the encoding (4 bytes for UTF-32, 2 bytes for UTF-16, 1 byte for other encodings) adds 1 to the length.- Since:
- 22.1
-
create
Create a newTruffleString.CodePointLengthNode
.- Since:
- 22.1
-
getUncached
Get the uncached version ofTruffleString.CodePointLengthNode
.- Since:
- 22.1
-