public enum FloatConstant extends Enum<FloatConstant> implements StackManipulation
float
constant onto the operand stack.Modifier and Type | Class and Description |
---|---|
protected static class |
FloatConstant.ConstantPool
A stack manipulation for loading a
float 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
float constant of value 1.0f . |
TWO
A
float constant of value 2.0f . |
ZERO
A
float constant of value 0.0f . |
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(float value)
Creates a stack manipulation for loading a
float value onto the operand stack. |
boolean |
isValid()
Determines if this stack manipulation is valid.
|
static FloatConstant |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static FloatConstant[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final FloatConstant ZERO
float
constant of value 0.0f
.public static final FloatConstant ONE
float
constant of value 1.0f
.public static final FloatConstant TWO
float
constant of value 2.0f
.public static FloatConstant[] values()
for (FloatConstant c : FloatConstant.values()) System.out.println(c);
public static FloatConstant valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic static StackManipulation forValue(float value)
float
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 float
value to load onto the stack.float
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.Copyright © 2014–2018. All rights reserved.