public enum Duplication extends java.lang.Enum<Duplication> implements StackManipulation
| Modifier and Type | Class and Description |
|---|---|
protected static class |
Duplication.WithFlip
A duplication that flips a value over the second value on the operand stack.
|
StackManipulation.Compound, StackManipulation.Illegal, StackManipulation.Size, StackManipulation.Trivial| Enum Constant and Description |
|---|
DOUBLE
A duplication of a double-sized stack value.
|
SINGLE
A duplication of a single-sized stack values.
|
ZERO
A duplication of no values.
|
| Modifier and Type | Field and Description |
|---|---|
private int |
opcode
The opcode that represents the manipulation.
|
protected StackManipulation.Size |
size
The size representing the impact of applying the duplication onto the operand stack.
|
| Modifier and Type | Method and Description |
|---|---|
StackManipulation.Size |
apply(org.objectweb.asm.MethodVisitor methodVisitor,
Implementation.Context implementationContext)
Applies the stack manipulation that is described by this instance.
|
abstract StackManipulation |
flipOver(TypeDefinition typeDefinition)
Creates a duplication that flips the stack's top value over the second stack element.
|
boolean |
isValid()
Determines if this stack manipulation is valid.
|
static Duplication |
of(TypeDefinition typeDefinition)
Duplicates a value given its type.
|
static Duplication |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static Duplication[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Duplication ZERO
public static final Duplication SINGLE
public static final Duplication DOUBLE
protected final StackManipulation.Size size
private final int opcode
public static Duplication[] values()
for (Duplication c : Duplication.values()) System.out.println(c);
public static Duplication valueOf(java.lang.String name)
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is nullpublic static Duplication of(TypeDefinition typeDefinition)
typeDefinition - The type to be duplicated.public abstract StackManipulation flipOver(TypeDefinition typeDefinition)
typeDefinition - The type of the second element on the operand stack.public boolean isValid()
isValid in interface StackManipulationfalse, this manipulation cannot be applied and should throw an exception.public StackManipulation.Size apply(org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext)
apply in interface StackManipulationmethodVisitor - The method visitor used to write the method implementation to.implementationContext - The context of the current implementation.