Package com.oracle.truffle.api.strings
Enum Class TruffleString.CompactionLevel
java.lang.Object
java.lang.Enum<TruffleString.CompactionLevel>
com.oracle.truffle.api.strings.TruffleString.CompactionLevel
- All Implemented Interfaces:
Serializable
,Comparable<TruffleString.CompactionLevel>
,Constable
- Enclosing class:
TruffleString
Represents a string's compaction level, i.e. the internal number of bytes per array element.
This is relevant only for
TruffleString.Encoding.UTF_16
and TruffleString.Encoding.UTF_32
, since
TruffleString doesn't support string compaction on any other encoding.- Since:
- 23.0
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal int
getBytes()
Get the number of bytes per internal array element.final int
getLog2()
Get the number of bytes per internal array element in log2 format.Returns the enum constant of this class with the specified name.static TruffleString.CompactionLevel[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
S1
One byte per array element.- Since:
- 23.0
-
S2
Two bytes per array element.- Since:
- 23.0
-
S4
Four bytes per array element.- Since:
- 23.0
-
-
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
-
getBytes
public final int getBytes()Get the number of bytes per internal array element.- Since:
- 23.0
-
getLog2
public final int getLog2()Get the number of bytes per internal array element in log2 format.- Since:
- 23.0
-