public class ConstantInstruction extends TypedInstruction
iconst5; if later
incremented to 6, the opcode will be changed to bipush(6).| Modifier and Type | Method and Description |
|---|---|
void |
acceptVisit(BCVisitor visit)
Accept a visit from a
BCVisitor, calling the appropriate methods
to notify the visitor that it has entered this entity, and
to provide it with the proper callbacks for each sub-entity owned
by this one. |
boolean |
equalsInstruction(Instruction other)
ConstantInstructions are equal if the const they reference is the same,
or if the const of either is unset.
|
String |
getClassNameValue()
Return the class value of this constant, or null if not set.
|
double |
getDoubleValue()
Return the double value of this constant, or 0 if not set.
|
float |
getFloatValue()
Return the float value of this constant, or 0 if not set.
|
int |
getIntValue()
Return the int value of this constant, or 0 if not set.
|
int |
getLogicalStackChange()
Return the logical number of stack positions changed by this
instruction.
|
long |
getLongValue()
Return the long value of this constant, or 0 if not set.
|
int |
getStackChange()
Return the number of stack positions this instruction pushes
or pops during its execution.
|
String |
getStringValue()
Return the string value of this constant, or null if not set.
|
String |
getTypeName()
Return the type name for this instruction.
|
Object |
getValue()
Return the value of the constant as its wrapper type, or null if
not set.
|
ConstantInstruction |
setNull()
Set this constant to null.
|
TypedInstruction |
setType(String type)
Set the type of this instruction.
|
ConstantInstruction |
setValue(BCClass value)
Set the value of this constant.
|
ConstantInstruction |
setValue(boolean value)
Set the value of this constant; note that this type is converted to int.
|
ConstantInstruction |
setValue(char value)
Set the value of this constant; note that this type is converted to int.
|
ConstantInstruction |
setValue(Class value)
Set the value of this constant.
|
ConstantInstruction |
setValue(double value)
Set the value of this constant.
|
ConstantInstruction |
setValue(float value)
Set the value of this constant.
|
ConstantInstruction |
setValue(int value)
Set the value of this constant.
|
ConstantInstruction |
setValue(long value)
Set the value of this constant.
|
ConstantInstruction |
setValue(Object value)
Set the constant to the given value.
|
ConstantInstruction |
setValue(short value)
Set the value of this constant; note that this type is converted to int.
|
ConstantInstruction |
setValue(String value)
Set the value of this constant.
|
ConstantInstruction |
setValue(String value,
boolean clsName) |
getType, getTypeBC, setType, setTypegetByteIndex, getClassLoader, getCode, getLineNumber, getName, getOpcode, getPool, getProject, isValidpublic int getStackChange()
InstructiongetStackChange in class Instructionpublic int getLogicalStackChange()
InstructiongetLogicalStackChange in class Instructionpublic String getTypeName()
TypedInstructiongetTypeName in class TypedInstructionpublic TypedInstruction setType(String type)
TypedInstructionsetType in class TypedInstructionpublic Object getValue()
public ConstantInstruction setValue(Object value)
public String getStringValue()
public int getIntValue()
public long getLongValue()
public float getFloatValue()
public double getDoubleValue()
public String getClassNameValue()
public ConstantInstruction setNull()
public ConstantInstruction setValue(String value)
public ConstantInstruction setValue(String value, boolean clsName)
public ConstantInstruction setValue(Class value)
public ConstantInstruction setValue(BCClass value)
public ConstantInstruction setValue(int value)
public ConstantInstruction setValue(long value)
public ConstantInstruction setValue(float value)
public ConstantInstruction setValue(double value)
public ConstantInstruction setValue(boolean value)
public ConstantInstruction setValue(short value)
public ConstantInstruction setValue(char value)
public boolean equalsInstruction(Instruction other)
equalsInstruction in class Instructionpublic void acceptVisit(BCVisitor visit)
VisitAcceptorBCVisitor, calling the appropriate methods
to notify the visitor that it has entered this entity, and
to provide it with the proper callbacks for each sub-entity owned
by this one.acceptVisit in interface VisitAcceptoracceptVisit in class InstructionCopyright © 2002–2015. All rights reserved.