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

public static enum TruffleString.CompactionLevel extends Enum<TruffleString.CompactionLevel>
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
  • Enum Constant Details

  • Method Details

    • values

      public static TruffleString.CompactionLevel[] 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

      public static TruffleString.CompactionLevel valueOf(String name)
      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 name
      NullPointerException - 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