APIdia Launch Partner
Top Description Fields Methods
java.lang.classfile.instruction

public sealed Interface CharacterRange

extends PseudoInstruction
permits UnboundCharacterRange, BoundCharacterRange
Known Direct Implementers
jdk.internal.classfile.impl.AbstractPseudoInstruction.UnboundCharacterRange, jdk.internal.classfile.impl.BoundCharacterRange
Imports
java.lang.classfile.ClassFile, .CodeBuilder, .CodeElement, .CodeModel, .Label, .PseudoInstruction, java.lang.classfile.attribute.CharacterRangeInfo, .CharacterRangeTableAttribute, jdk.internal.classfile.impl.AbstractPseudoInstruction, .BoundCharacterRange

A pseudo-instruction which models a single entry in the CharacterRangeTable attribute. Delivered as a CodeElement during traversal of the elements of a CodeModel, according to the setting of the ClassFile.DebugElementsOption option.

A character range entry is composite:

CharacterRange( Label startScope, Label endScope, int characterRangeStart, int characterRangeEnd, int flags )
CharacterRange(
    Label startScope,
    Label endScope,
    int characterRangeStart,
    int characterRangeEnd,
    int flags
)

Another model, CharacterRangeInfo, also models a character range entry; it has no dependency on a CodeModel and represents of bci values as ints instead of Labels, and is used as components of a CharacterRangeTableAttribute.

Since
24
See Also
CharacterRangeInfo, CodeBuilder::characterRange, ClassFile.DebugElementsOption

Field Summary

Modifier and TypeField and Description
public static final int
FLAG_ASSIGNMENT

The bit mask of ASSIGNMENT CharacterRangeInfo kind.

public static final int
FLAG_BLOCK

The bit mask of BLOCK CharacterRangeInfo kind.

public static final int
FLAG_BRANCH_FALSE

The bit mask of BRANCH_FALSE CharacterRangeInfo kind.

public static final int
FLAG_BRANCH_TRUE

The bit mask of BRANCH_TRUE CharacterRangeInfo kind.

public static final int
FLAG_CREATE

The bit mask of CREATE CharacterRangeInfo kind.

public static final int
FLAG_FLOW_CONTROLLER

The bit mask of FLOW_CONTROLLER CharacterRangeInfo kind.

public static final int
FLAG_FLOW_TARGET

The bit mask of FLOW_TARGET CharacterRangeInfo kind.

public static final int
FLAG_INVOKE

The bit mask of INVOKE CharacterRangeInfo kind.

public static final int
FLAG_STATEMENT

The bit mask of STATEMENT CharacterRangeInfo kind.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the encoded end of the character range region (exclusive)
characterRangeEnd
()

Returns the encoded end of the character range region (exclusive).

public int

Returns:

the encoded start of the character range region (inclusive)
characterRangeStart
()

Returns the encoded start of the character range region (inclusive).

public Label

Returns:

the end of the instruction range
endScope
()

Returns the end of the instruction range.

public int

Returns:

the flags
flags
()

A flags word, indicating the kind of range.

public static CharacterRange

Returns:

a character range pseudo-instruction
of
(Label
the start of the instruction range
startScope
,
Label
the end of the instruction range
endScope
,
int
the encoded start of the character range region (inclusive)
characterRangeStart
,
int
the encoded end of the character range region (exclusive)
characterRangeEnd
,
int
a flags word, indicating the kind of range
flags
)

Returns a character range pseudo-instruction.

public Label

Returns:

the start of the instruction range
startScope
()

Returns the start of the instruction range.

Field Detail

FLAG_ASSIGNMENTback to summary
public static final int FLAG_ASSIGNMENT

The bit mask of ASSIGNMENT CharacterRangeInfo kind.

FLAG_BLOCKback to summary
public static final int FLAG_BLOCK

The bit mask of BLOCK CharacterRangeInfo kind.

FLAG_BRANCH_FALSEback to summary
public static final int FLAG_BRANCH_FALSE

The bit mask of BRANCH_FALSE CharacterRangeInfo kind.

FLAG_BRANCH_TRUEback to summary
public static final int FLAG_BRANCH_TRUE

The bit mask of BRANCH_TRUE CharacterRangeInfo kind.

FLAG_CREATEback to summary
public static final int FLAG_CREATE

The bit mask of CREATE CharacterRangeInfo kind.

FLAG_FLOW_CONTROLLERback to summary
public static final int FLAG_FLOW_CONTROLLER

The bit mask of FLOW_CONTROLLER CharacterRangeInfo kind.

FLAG_FLOW_TARGETback to summary
public static final int FLAG_FLOW_TARGET

The bit mask of FLOW_TARGET CharacterRangeInfo kind.

FLAG_INVOKEback to summary
public static final int FLAG_INVOKE

The bit mask of INVOKE CharacterRangeInfo kind.

FLAG_STATEMENTback to summary
public static final int FLAG_STATEMENT

The bit mask of STATEMENT CharacterRangeInfo kind.

Method Detail

characterRangeEndback to summary
public int characterRangeEnd()

Returns the encoded end of the character range region (exclusive). . The value is constructed from the line_number/column_number pair as given by line_number << 10 + column_number, where the source file is viewed as an array of (possibly multi-byte) characters.

Returns:int

the encoded end of the character range region (exclusive)

characterRangeStartback to summary
public int characterRangeStart()

Returns the encoded start of the character range region (inclusive). The value is constructed from the line_number/column_number pair as given by line_number << 10 + column_number, where the source file is viewed as an array of (possibly multi-byte) characters.

Returns:int

the encoded start of the character range region (inclusive)

endScopeback to summary
public Label endScope()

Returns the end of the instruction range.

Returns:Label

the end of the instruction range

flagsback to summary
public int flags()

A flags word, indicating the kind of range. Multiple flag bits may be set. Valid flags include:

Returns:int

the flags

See Also
CharacterRangeInfo#flags()
ofback to summary
public static CharacterRange of(Label startScope, Label endScope, int characterRangeStart, int characterRangeEnd, int flags)

Returns a character range pseudo-instruction.

Parameters
startScope:Label

the start of the instruction range

endScope:Label

the end of the instruction range

characterRangeStart:int

the encoded start of the character range region (inclusive)

characterRangeEnd:int

the encoded end of the character range region (exclusive)

flags:int

a flags word, indicating the kind of range

Returns:CharacterRange

a character range pseudo-instruction

Exceptions
IllegalArgumentException:
if flags is not u2
startScopeback to summary
public Label startScope()

Returns the start of the instruction range.

Returns:Label

the start of the instruction range