Package com.oracle.truffle.api.strings
Class TruffleString.CompareBytesNode
java.lang.Object
com.oracle.truffle.api.nodes.Node
com.oracle.truffle.api.strings.TruffleString.CompareBytesNode
- All Implemented Interfaces:
NodeInterface
,Cloneable
- Enclosing class:
TruffleString
Node to compare two strings byte-by-byte. See
execute(AbstractTruffleString, AbstractTruffleString, 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.CompareBytesNode
.abstract int
execute
(AbstractTruffleString a, AbstractTruffleString b, TruffleString.Encoding expectedEncoding) Compare stringsa
andb
byte-by-byte.Get the uncached version ofTruffleString.CompareBytesNode
.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 int execute(AbstractTruffleString a, AbstractTruffleString b, TruffleString.Encoding expectedEncoding) Compare stringsa
andb
byte-by-byte. Returns zero ifa
andb
are equal. Ifa
is equal tob
up to its length, butb
is longer thana
, a negative value is returned. In the inverse case, a positive value is returned. Otherwise, elementsa[i]
andb[i]
at a byte indexi
are different. Ifa[i]
is greater thanb[i]
, a positive value is returned, otherwise a negative value is returned.- Since:
- 22.1
-
create
Create a newTruffleString.CompareBytesNode
.- Since:
- 22.1
-
getUncached
Get the uncached version ofTruffleString.CompareBytesNode
.- Since:
- 22.1
-