- All Known Implementing Classes:
UnboundAttribute.UnboundCharacterRangeInfo
Models a single character range in the
CharacterRangeTableAttribute.- Since:
- 22
-
Method Summary
Modifier and TypeMethodDescriptionintReturns the encoded end of the character range region (exclusive).intReturns the encoded start of the character range region (inclusive).intendPc()Returns the end of the character range region (exclusive).intflags()The value of the flags item describes the kind of range.static CharacterRangeInfoof(int startPc, int endPc, int characterRangeStart, int characterRangeEnd, int flags) Returns a character range description.intstartPc()Returns the start of the character range region (inclusive).
-
Method Details
-
startPc
int startPc()Returns the start of the character range region (inclusive). This is the index into the code array at which the code for this character range begins.- Returns:
- the start of the character range region (inclusive)
-
endPc
int endPc()Returns the end of the character range region (exclusive). This is the index into the code array after which the code for this character range ends.- Returns:
- the end of the character range region (exclusive)
-
characterRangeStart
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 byline_number << 10 + column_number, where the source file is viewed as an array of (possibly multi-byte) characters.- Returns:
- the encoded start of the character range region (inclusive)
-
characterRangeEnd
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 byline_number << 10 + column_number, where the source file is viewed as an array of (possibly multi-byte) characters.- Returns:
- the encoded end of the character range region (exclusive)
-
flags
int flags()The value of the flags item describes the kind of range. Multiple flags may be set within flags.ClassFile.CRT_STATEMENTRange is a Statement (except ExpressionStatement), StatementExpression , as well as each VariableDeclaratorId = VariableInitializer of LocalVariableDeclarationStatement or FieldDeclaration in the grammar.ClassFile.CRT_BLOCKRange is a Block in the grammar.ClassFile.CRT_ASSIGNMENTRange is an assignment expression - Expression1 AssignmentOperator Expression1 in the grammar as well as increment and decrement expressions (both prefix and postfix).ClassFile.CRT_FLOW_CONTROLLERAn expression whose value will effect control flow.Flowconin the following:if ( Flowcon ) Statement [else Statement] for ( ForInitOpt ; [Flowcon] ; ForUpdateOpt ) Statement while ( Flowcon ) Statement do Statement while ( Flowcon ) ; switch ( Flowcon ) { SwitchBlockStatementGroups } Flowcon || Expression3 Flowcon && Expression3 Flowcon ? Expression : Expression1ClassFile.CRT_FLOW_TARGETStatement or expression effected by a CRT_FLOW_CONTROLLER.Flowtargin the following:if ( Flowcon ) Flowtarg [else Flowtarg] for ( ForInitOpt ; [Flowcon] ; ForUpdateOpt ) Flowtarg while ( Flowcon ) Flowtarg do Flowtarg while ( Flowcon ) ; Flowcon || Flowtarg Flowcon && Flowtarg Flowcon ? Flowtarg : Flowtarg
ClassFile.CRT_INVOKEMethod invocation. For example: Identifier Arguments.ClassFile.CRT_CREATENew object creation. For example: new Creator.ClassFile.CRT_BRANCH_TRUEA condition encoded in the branch instruction immediately contained in the code range for this item is not inverted towards the corresponding branch condition in the source code. I.e. actual jump occurs if and only if the the source code branch condition evaluates to true. Entries of this type are produced only for conditions that are listed in the description of CRT_FLOW_CONTROLLER flag. The source range for the entry contains flow controlling expression. start_pc field for an entry of this type must point to a branch instruction: if_acmp<cond>, if_icmp<cond>, if<cond>, ifnonull, ifnull or goto. CRT_BRANCH_TRUE and CRT_BRANCH_FALSE are special kinds of entries that can be used to determine what branch of a condition was chosen during the runtime.ClassFile.CRT_BRANCH_FALSEA condition encoded in the branch instruction immediately contained in the code range for this item is inverted towards the corresponding branch condition in the source code. I.e. actual jump occurs if and only if the the source code branch condition evaluates to false. Entries of this type are produced only for conditions that are listed in the description of CRT_FLOW_CONTROLLER flag. The source range for the entry contains flow controlling expression. start_pc field for an entry of this type must point to a branch instruction: if_acmp<cond>, if_icmp<cond>, if<cond>, ifnonull, ifnull or goto.
All bits of the flags item not assigned above are reserved for future use. They should be set to zero in generated class files and should be ignored by Java virtual machine implementations.
- Returns:
- the flags
-
of
static CharacterRangeInfo of(int startPc, int endPc, int characterRangeStart, int characterRangeEnd, int flags) Returns a character range description.- Parameters:
startPc- the start of the bytecode range, inclusiveendPc- the end of the bytecode range, exclusivecharacterRangeStart- the start of the character range, inclusive, encoded asline_number << 10 + column_numbercharacterRangeEnd- the end of the character range, exclusive, encoded asline_number << 10 + column_numberflags- the range flags- Returns:
- a character range description
-