Package com.oracle.truffle.api.strings
Class MutableTruffleString.SwitchEncodingNode
java.lang.Object
com.oracle.truffle.api.nodes.Node
com.oracle.truffle.api.strings.MutableTruffleString.SwitchEncodingNode
- All Implemented Interfaces:
NodeInterface
,Cloneable
- Enclosing class:
MutableTruffleString
Node to get a given string in a specific encoding. See
execute(AbstractTruffleString, TruffleString.Encoding, TranscodingErrorHandler)
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 newMutableTruffleString.SwitchEncodingNode
.final MutableTruffleString
execute
(AbstractTruffleString a, TruffleString.Encoding encoding) Returns a version of stringa
that is encoded in the given encoding, which may be the string itself or a converted version.abstract MutableTruffleString
execute
(AbstractTruffleString a, TruffleString.Encoding encoding, TranscodingErrorHandler errorHandler) Returns a version of stringa
that is encoded in the given encoding, which may be the string itself or a converted version.Get the uncached version ofMutableTruffleString.SwitchEncodingNode
.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
Returns a version of stringa
that is encoded in the given encoding, which may be the string itself or a converted version.If no lossless conversion is possible, the string is converted on a best-effort basis; no exception is thrown and characters which cannot be mapped in the target encoding are replaced by
'�'
(for UTF-*) or'?'
.- Since:
- 22.1
-
execute
public abstract MutableTruffleString execute(AbstractTruffleString a, TruffleString.Encoding encoding, TranscodingErrorHandler errorHandler) Returns a version of stringa
that is encoded in the given encoding, which may be the string itself or a converted version. Transcoding errors are handled witherrorHandler
.- Since:
- 23.1
-
create
Create a newMutableTruffleString.SwitchEncodingNode
.- Since:
- 22.1
-
getUncached
Get the uncached version ofMutableTruffleString.SwitchEncodingNode
.- Since:
- 22.1
-