Package io.quarkus.gizmo
Class EnumSwitchImpl<E extends java.lang.Enum<E>>
- java.lang.Object
-
- io.quarkus.gizmo.BytecodeCreatorImpl
-
- io.quarkus.gizmo.AbstractSwitch<E>
-
- io.quarkus.gizmo.EnumSwitchImpl<E>
-
- All Implemented Interfaces:
BytecodeCreator,Switch<E>,Switch.EnumSwitch<E>,java.lang.AutoCloseable
- Direct Known Subclasses:
ClassTransfromerMethodCreatorImpl.ClassTransformerEnumSwitchImpl
class EnumSwitchImpl<E extends java.lang.Enum<E>> extends AbstractSwitch<E> implements Switch.EnumSwitch<E>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class io.quarkus.gizmo.BytecodeCreatorImpl
BytecodeCreatorImpl.AssignOperation, BytecodeCreatorImpl.BlockOperation, BytecodeCreatorImpl.IfOperation, BytecodeCreatorImpl.InvokeOperation, BytecodeCreatorImpl.JumpOperation, BytecodeCreatorImpl.NewInstanceOperation, BytecodeCreatorImpl.Operation
-
Nested classes/interfaces inherited from interface io.quarkus.gizmo.Switch
Switch.EnumSwitch<E extends java.lang.Enum<E>>, Switch.StringSwitch
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.Integer,BytecodeCreatorImpl>ordinalToCaseBlocks-
Fields inherited from class io.quarkus.gizmo.AbstractSwitch
defaultBlock, fallThrough
-
Fields inherited from class io.quarkus.gizmo.BytecodeCreatorImpl
MAX_STRING_LENGTH, operations
-
-
Constructor Summary
Constructors Constructor Description EnumSwitchImpl(ResultHandle value, java.lang.Class<E> enumClass, BytecodeCreatorImpl enclosing)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidaddCaseBlock(E value, java.util.function.Consumer<BytecodeCreator> caseBlockConsumer)protected ResultHandlecallSwitchTableMethod(java.lang.String methodName, java.lang.Class<E> enumClass, MethodDescriptor enumOrdinal)voidcaseOf(E value, java.util.function.Consumer<BytecodeCreator> caseBlockConsumer)Adds a case block.voidcaseOf(java.util.List<E> values, java.util.function.Consumer<BytecodeCreator> caseBlockConsumer)Adds multiple case labels for a single block.(package private) voidfindActiveResultHandles(java.util.Set<ResultHandle> handlesToAllocate)private MethodCreatorImplfindMethodCreator(BytecodeCreatorImpl enclosing)protected ResultHandlegenerateSwitchTable(java.lang.Class<E> enumClass, BytecodeCreator bytecodeCreator, MethodDescriptor enumOrdinal)-
Methods inherited from class io.quarkus.gizmo.AbstractSwitch
defaultCase, doBreak, fallThrough
-
Methods inherited from class io.quarkus.gizmo.BytecodeCreatorImpl
add, allocateLocalVariables, arrayLength, assign, bitwiseAnd, bitwiseOr, bitwiseXor, breakScope, checkCast, checkScope, checkScope, compareDouble, compareFloat, compareLong, continueScope, convertPrimitive, createFunction, createNewInstanceOp, createScope, createVariable, divide, enumSwitch, forEach, getBottom, getMethod, getMethodParam, getOwner, getThis, getTop, ifFalse, ifGreaterEqualZero, ifGreaterThanZero, ifIntegerEqual, ifIntegerGreaterEqual, ifIntegerGreaterThan, ifIntegerLessEqual, ifIntegerLessThan, ifLessEqualZero, ifLessThanZero, ifNonZero, ifNotNull, ifNull, ifReferencesEqual, ifReferencesNotEqual, ifThenElse, ifTrue, ifZero, instanceOf, invokeInterfaceMethod, invokeSpecialInterfaceMethod, invokeSpecialMethod, invokeStaticInterfaceMethod, invokeStaticMethod, invokeVirtualMethod, isScopedWithin, jumpTo, load, load, load, load, load, load, load, load, load, loadClass, loadClassFromTCCL, loadNull, loadResultHandle, loadResultHandle, multiply, newArray, newInstance, readArrayValue, readInstanceField, readStaticField, remainder, resolve, resolve, resolve, resolve, returnValue, storeResultHandle, stringSwitch, subtract, throwException, tryBlock, whileLoop, writeArrayValue, writeInstanceField, writeInteriorOperations, writeOperations, writeStaticField
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.quarkus.gizmo.BytecodeCreator
breakScope, checkCast, close, continueScope, createVariable, increment, instanceOf, invokeInterfaceMethod, invokeSpecialInterfaceMethod, invokeSpecialMethod, invokeStaticInterfaceMethod, invokeStaticMethod, invokeVirtualMethod, load, loadClass, loadClass, loadClassFromTCCL, loadClassFromTCCL, marshalAsArray, newArray, newArray, newArray, newInstance, readArrayValue, readInstanceField, readStaticField, returnBoolean, returnInt, returnNull, returnVoid, throwException, throwException, writeArrayValue, writeInstanceField, writeStaticField
-
Methods inherited from interface io.quarkus.gizmo.Switch
defaultCase, doBreak, fallThrough
-
-
-
-
Field Detail
-
ordinalToCaseBlocks
private final java.util.Map<java.lang.Integer,BytecodeCreatorImpl> ordinalToCaseBlocks
-
-
Constructor Detail
-
EnumSwitchImpl
public EnumSwitchImpl(ResultHandle value, java.lang.Class<E> enumClass, BytecodeCreatorImpl enclosing)
-
-
Method Detail
-
caseOf
public void caseOf(E value, java.util.function.Consumer<BytecodeCreator> caseBlockConsumer)
Description copied from interface:SwitchAdds a case block.
-
caseOf
public void caseOf(java.util.List<E> values, java.util.function.Consumer<BytecodeCreator> caseBlockConsumer)
Description copied from interface:SwitchAdds multiple case labels for a single block.
-
findActiveResultHandles
void findActiveResultHandles(java.util.Set<ResultHandle> handlesToAllocate)
- Overrides:
findActiveResultHandlesin classBytecodeCreatorImpl
-
addCaseBlock
private void addCaseBlock(E value, java.util.function.Consumer<BytecodeCreator> caseBlockConsumer)
-
findMethodCreator
private MethodCreatorImpl findMethodCreator(BytecodeCreatorImpl enclosing)
-
callSwitchTableMethod
protected ResultHandle callSwitchTableMethod(java.lang.String methodName, java.lang.Class<E> enumClass, MethodDescriptor enumOrdinal)
-
generateSwitchTable
protected final ResultHandle generateSwitchTable(java.lang.Class<E> enumClass, BytecodeCreator bytecodeCreator, MethodDescriptor enumOrdinal)
-
-