public enum LongConstant extends java.lang.Enum<LongConstant> implements StackManipulation
long
constant onto the operand stack.Modifier and Type | Class and Description |
---|---|
protected static class |
LongConstant.ConstantPool
A stack manipulation for loading a
long value from a class's constant pool onto the operand stack. |
StackManipulation.Compound, StackManipulation.Illegal, StackManipulation.Size, StackManipulation.Trivial
Enum Constant and Description |
---|
ONE
A
long constant of value 1L . |
ZERO
A
long constant of value 0L . |
Modifier and Type | Field and Description |
---|---|
private int |
opcode
The shortcut opcode for loading a
long constant. |
private static StackManipulation.Size |
SIZE
The size impact of loading a
double constant 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.
|
static StackManipulation |
forValue(long value)
Creates a stack manipulation for loading a
long value onto the operand stack. |
boolean |
isValid()
Determines if this stack manipulation is valid.
|
static LongConstant |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static LongConstant[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final LongConstant ZERO
long
constant of value 0L
.public static final LongConstant ONE
long
constant of value 1L
.private static final StackManipulation.Size SIZE
double
constant onto the operand stack.private final int opcode
long
constant.public static LongConstant[] values()
for (LongConstant c : LongConstant.values()) System.out.println(c);
public static LongConstant 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 StackManipulation forValue(long value)
long
value onto the operand stack.
This is achieved either by invoking a specific opcode, if any, or by creating a constant pool entry.
value
- The long
value to load onto the stack.long
value.public boolean isValid()
isValid
in interface StackManipulation
false
, 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 StackManipulation
methodVisitor
- The method visitor used to write the method implementation to.implementationContext
- The context of the current implementation.