Module org.kink_lang.kink
Record Class Insn.Case
java.lang.Object
java.lang.Record
org.kink_lang.kink.internal.compile.javaclassir.Insn.Case
- Record Components:
switchKey- the key of the switch.num- the num of the case label.
- All Implemented Interfaces:
Insn
- Enclosing interface:
Insn
Marks the case label for the table-switch.
InsnsGenerator assumes case nums for a switch key aren't sparse, because the implementation can be much simpler with the assumption, and sparse case nums don't appear in Kink bytecode generation.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.kink_lang.kink.internal.compile.javaclassir.Insn
Insn.AddInt, Insn.ArrayStore, Insn.Case, Insn.CheckCast, Insn.Default, Insn.Dup, Insn.GetField, Insn.GetStatic, Insn.GoTo, Insn.IfEq, Insn.IfEqInt, Insn.IfGeInt, Insn.IfGtInt, Insn.IfLtInt, Insn.IfNonNull, Insn.IfNonZero, Insn.InstanceOf, Insn.InvokeConstructor, Insn.InvokeDynamic, Insn.InvokeStatic, Insn.InvokeVirtual, Insn.LoadArg, Insn.LoadLocal, Insn.LoadThis, Insn.Mark, Insn.NewArray, Insn.NewInstance, Insn.PushInt, Insn.PushString, Insn.ReturnValue, Insn.StoreArg, Insn.StoreNewLocal, Insn.SubInt, Insn.Switch, Insn.Throw -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.voidGenerates a fragment of bytecode invoking GeneratorAdapter methods.final inthashCode()Returns a hash code value for this object.intnum()Returns the value of thenumrecord component.Returns the value of theswitchKeyrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
generateBytecodeSnippet
Description copied from interface:InsnGenerates a fragment of bytecode invoking GeneratorAdapter methods.- Specified by:
generateBytecodeSnippetin interfaceInsn- Parameters:
state- the state of bytecode generation.
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
switchKey
Returns the value of theswitchKeyrecord component.- Returns:
- the value of the
switchKeyrecord component
-
num
public int num()Returns the value of thenumrecord component.- Returns:
- the value of the
numrecord component
-