Class TruffleString.FromJavaStringNode
java.lang.Object
com.oracle.truffle.api.nodes.Node
com.oracle.truffle.api.strings.TruffleString.FromJavaStringNode
- All Implemented Interfaces:
NodeInterface,Cloneable
- Enclosing class:
TruffleString
Node to create a new
TruffleString from a Java string. See
execute(String, int, int, TruffleString.Encoding, boolean) for details.- Since:
- 22.1
-
Nested Class Summary
Nested classes/interfaces inherited from class com.oracle.truffle.api.nodes.Node
Node.Child, Node.Children -
Method Summary
Modifier and TypeMethodDescriptioncreate()Create a newTruffleString.FromJavaStringNode.abstract TruffleStringexecute(String value, int charOffset, int length, TruffleString.Encoding encoding, boolean copy) Creates aTruffleStringfrom a given region in a Java string, re-using its internal byte array if possible and the region covers the entire string.final TruffleStringexecute(String value, TruffleString.Encoding encoding) Creates aTruffleStringfrom a Java string, re-using its internal byte array if possible.Get the uncached version ofTruffleString.FromJavaStringNode.Methods inherited from class com.oracle.truffle.api.nodes.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, toString
-
Method Details
-
execute
Creates aTruffleStringfrom a Java string, re-using its internal byte array if possible.- Since:
- 22.1
-
execute
public abstract TruffleString execute(String value, int charOffset, int length, TruffleString.Encoding encoding, boolean copy) Creates aTruffleStringfrom a given region in a Java string, re-using its internal byte array if possible and the region covers the entire string. Ifcopyisfalse, the Java string's internal byte array will be re-used even if the region does not cover the entire string. Note that this will keep the Java string's byte array alive as long as the resultingTruffleStringis alive.- Since:
- 22.1
-
create
Create a newTruffleString.FromJavaStringNode.- Since:
- 22.1
-
getUncached
Get the uncached version ofTruffleString.FromJavaStringNode.- Since:
- 22.1
-