com.techtrader.modules.tools.bytecode
Class TypedLocalVariableInstruction
java.lang.Object
|
+--com.techtrader.modules.tools.bytecode.Instruction
|
+--com.techtrader.modules.tools.bytecode.LocalVariableInstruction
|
+--com.techtrader.modules.tools.bytecode.TypedLocalVariableInstruction
- Direct Known Subclasses:
- LoadInstruction, StoreInstruction
- public abstract class TypedLocalVariableInstruction
- extends LocalVariableInstruction
An instruction manipulating a local variable that varies with the
variable type.
- Author:
- Abe White
Method Summary |
protected void |
copy(Instruction orig)
|
boolean |
equals(Object other)
Two local variable instructions are equal if the local index they
reference is equal and their types are equal,
or if either index is 0/unset. |
Class |
getType()
Get the type of variable to load; this is one of:
int, float, double, long, or Object.class. |
String |
getTypeName()
Get the type of variable to load; this is one of:
int, float, double, long, or java.lang.Object. |
TypedLocalVariableInstruction |
setType(Class type)
Set the type of variable to load; Object types other than Object.class
will be demoted to Object.class, and primitives that have no direct
support (byte, char, boolean) will be conerted to int.class. |
TypedLocalVariableInstruction |
setTypeName(String name)
Set the type to load by name. |
Methods inherited from class com.techtrader.modules.tools.bytecode.Instruction |
acceptVisit,
getByteIndex,
getLength,
getName,
getOpCode,
getOwner,
getStackChange,
invalidate,
readData,
setByteIndex,
setOpCode,
writeData |
_typeNames
protected static final Map _typeNames
_type
protected Class _type
TypedLocalVariableInstruction
protected TypedLocalVariableInstruction(Code owner)
getType
public Class getType()
- Get the type of variable to load; this is one of:
int, float, double, long, or Object.class.
getTypeName
public String getTypeName()
- Get the type of variable to load; this is one of:
int, float, double, long, or java.lang.Object.
setType
public TypedLocalVariableInstruction setType(Class type)
- Set the type of variable to load; Object types other than Object.class
will be demoted to Object.class, and primitives that have no direct
support (byte, char, boolean) will be conerted to int.class.
- Returns:
- this Instruction, for method chaining
setTypeName
public TypedLocalVariableInstruction setTypeName(String name)
- Set the type to load by name.
- Returns:
- this Instruction, for method chaining
- See Also:
setType(java.lang.Class)
equals
public boolean equals(Object other)
- Two local variable instructions are equal if the local index they
reference is equal and their types are equal,
or if either index is 0/unset.
- Overrides:
- equals in class LocalVariableInstruction
copy
protected void copy(Instruction orig)
- Overrides:
- copy in class LocalVariableInstruction