Partilhar via


StringIndexType Class

public final class StringIndexType
extends ExpandableStringEnum<StringIndexType>

Method used to compute string offset and length.

Field Summary

Modifier and Type Field and Description
static final StringIndexType TEXT_ELEMENTS

User-perceived display character, or grapheme cluster, as defined by Unicode 8.0.0.

static final StringIndexType UNICODE_CODE_POINT

Character unit represented by a single unicode code point.

static final StringIndexType UTF16_CODE_UNIT

Character unit represented by a 16-bit Unicode code unit.

Constructor Summary

Constructor Description
StringIndexType()

Deprecated

Use the fromString(String name) factory method.

Creates a new instance of StringIndexType value.

Method Summary

Modifier and Type Method and Description
static StringIndexType fromString(String name)

Creates or finds a StringIndexType from its string representation.

static Collection<StringIndexType> values()

Gets known StringIndexType values.

Methods inherited from ExpandableStringEnum

Methods inherited from java.lang.Object

Field Details

TEXT_ELEMENTS

public static final StringIndexType TEXT_ELEMENTS

User-perceived display character, or grapheme cluster, as defined by Unicode 8.0.0.

UNICODE_CODE_POINT

public static final StringIndexType UNICODE_CODE_POINT

Character unit represented by a single unicode code point. Used by Python 3.

UTF16_CODE_UNIT

public static final StringIndexType UTF16_CODE_UNIT

Character unit represented by a 16-bit Unicode code unit. Used by JavaScript, Java, and .NET.

Constructor Details

StringIndexType

@Deprecated
public StringIndexType()

Deprecated

Use the fromString(String name) factory method.

Creates a new instance of StringIndexType value.

Method Details

fromString

public static StringIndexType fromString(String name)

Creates or finds a StringIndexType from its string representation.

Parameters:

name - a name to look for.

Returns:

the corresponding StringIndexType.

values

public static Collection values()

Gets known StringIndexType values.

Returns:

known StringIndexType values.

Applies to