Top Description Methods
java.lang.classfile.instruction

public sealed Interface SwitchCase

Known Direct Implementers
jdk.internal.classfile.impl.AbstractInstruction.SwitchCaseImpl
Annotations
@PreviewFeature
feature:CLASSFILE_API
Imports
java.lang.classfile.Label, jdk.internal.classfile.impl.AbstractInstruction, jdk.internal.javac.PreviewFeature

Preview

Second Preview of ClassFile API (JEP 466).

Programs can only use SwitchCase when preview features are enabled.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.

Models a single case in a lookupswitch or tableswitch instruction.
Since
22
See Also
LookupSwitchInstruction, TableSwitchInstruction

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the integer value corresponding to this case
caseValue
()

Returns the integer value corresponding to this case.

public static SwitchCase

Returns:

the SwitchCase
of
(int
the integer value for the case
caseValue
,
Label
the branch target for the case
target
)

Create a SwitchCase

public Label

Returns:

the branch target corresponding to this case
target
()

Returns the branch target corresponding to this case.

Method Detail

caseValueback to summary
public int caseValue()

Returns the integer value corresponding to this case.

Returns:int

the integer value corresponding to this case

ofback to summary
public static SwitchCase of(int caseValue, Label target)

Create a SwitchCase

Parameters
caseValue:int

the integer value for the case

target:Label

the branch target for the case

Returns:SwitchCase

the SwitchCase

targetback to summary
public Label target()

Returns the branch target corresponding to this case.

Returns:Label

the branch target corresponding to this case