Package com.oracle.truffle.api.strings
Enum Class TruffleString.ErrorHandling
java.lang.Object
java.lang.Enum<TruffleString.ErrorHandling>
com.oracle.truffle.api.strings.TruffleString.ErrorHandling
- All Implemented Interfaces:
Serializable
,Comparable<TruffleString.ErrorHandling>
,Constable
- Enclosing class:
TruffleString
Error handling instructions for operations that return integer values, such as indices or
code points.
- Since:
- 22.3
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionThis mode generally means that the operation will try to determine the "most reasonable" or "most useful" return value in respect to the expected encoding and the error that occurred.This mode will cause a negative value to be returned in all error cases. -
Method Summary
Modifier and TypeMethodDescriptionstatic TruffleString.ErrorHandling
Returns the enum constant of this class with the specified name.static TruffleString.ErrorHandling[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
BEST_EFFORT
This mode generally means that the operation will try to determine the "most reasonable" or "most useful" return value in respect to the expected encoding and the error that occurred. For example: best-effort error handling will causeTruffleString.CodePointAtByteIndexNode
to return the value of the integer read when reading an invalid codepoint from aTruffleString.Encoding.UTF_32
string.- Since:
- 22.3
-
RETURN_NEGATIVE
This mode will cause a negative value to be returned in all error cases. For example: return-negative error handling will causeTruffleString.CodePointAtByteIndexNode
to return a negative value when reading an invalid codepoint from aTruffleString.Encoding.UTF_32
string.- Since:
- 22.3
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-