Package com.oracle.truffle.api.strings
Class TruffleString.ForceEncodingNode
java.lang.Object
com.oracle.truffle.api.nodes.Node
com.oracle.truffle.api.strings.TruffleString.ForceEncodingNode
- All Implemented Interfaces:
NodeInterface
,Cloneable
- Enclosing class:
TruffleString
Node to forcibly assign any encoding to a string. See
execute(AbstractTruffleString, TruffleString.Encoding, TruffleString.Encoding)
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.ForceEncodingNode
.abstract TruffleString
execute
(AbstractTruffleString a, TruffleString.Encoding expectedEncoding, TruffleString.Encoding targetEncoding) Returns a version of stringa
assigned to the given encoding, which may be the string itself or a new string.Get the uncached version ofTruffleString.ForceEncodingNode
.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
public abstract TruffleString execute(AbstractTruffleString a, TruffleString.Encoding expectedEncoding, TruffleString.Encoding targetEncoding) Returns a version of stringa
assigned to the given encoding, which may be the string itself or a new string. The string itself may be returned even if it was originally created using a different encoding, if the string is byte-equivalent in both encodings. If the string is not byte-equivalent in both encodings, a new string containing the same bytes but assigned to the new encoding is returned. This node does not transcode the string's contents in any way, it is the "encoding-equivalent" to a C-style reinterpret-cast.- Since:
- 22.1
-
create
Create a newTruffleString.ForceEncodingNode
.- Since:
- 22.1
-
getUncached
Get the uncached version ofTruffleString.ForceEncodingNode
.- Since:
- 22.1
-