com.techtrader.modules.tools.bytecode
Class ArrayInstruction
java.lang.Object
|
+--com.techtrader.modules.tools.bytecode.Instruction
|
+--com.techtrader.modules.tools.bytecode.ArrayInstruction
- Direct Known Subclasses:
- ArrayLoadInstruction, ArrayStoreInstruction
- public abstract class ArrayInstruction
- extends Instruction
Represents any array load or store instruction.
- Author:
- Abe White
Method Summary |
protected abstract void |
calculateOpCode()
Subclasses with variable opcodes can use this method to be
notified that information possibly affecting the opcode has been
changed. |
protected void |
copy(Instruction orig)
|
boolean |
equals(Object other)
Two array instructions are equal if the index and type they
reference are equal or if either index is 0/unset. |
Class |
getType()
Get the type of array to load; this is one of:
int, float, double, long, char, byte, short, or Object.class. |
String |
getTypeName()
Get the type of array to load; this is one of:
int, float, double, long, char, byte, short, or java.lang.Object. |
ArrayInstruction |
setType(Class type)
Set the type of array to load; Object types other than Object.class
will be demoted to Object.class, and primitives that have no direct
support (boolean) will be converted to int.class. |
ArrayInstruction |
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
ArrayInstruction
protected ArrayInstruction(Code owner)
ArrayInstruction
protected ArrayInstruction(Code owner,
int opcode,
Class type)
getType
public Class getType()
- Get the type of array to load; this is one of:
int, float, double, long, char, byte, short, or Object.class.
If the type has not been set, this method will return null.
getTypeName
public String getTypeName()
- Get the type of array to load; this is one of:
int, float, double, long, char, byte, short, or java.lang.Object.
If the type has not been set, this method will return null.
setType
public ArrayInstruction setType(Class type)
- Set the type of array to load; Object types other than Object.class
will be demoted to Object.class, and primitives that have no direct
support (boolean) will be converted to int.class.
- Returns:
- this Instruction, for method chaining
setTypeName
public ArrayInstruction 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 array instructions are equal if the index and type they
reference are equal or if either index is 0/unset.
- Overrides:
- equals in class Instruction
copy
protected void copy(Instruction orig)
- Overrides:
- copy in class Instruction
calculateOpCode
protected abstract void calculateOpCode()
- Subclasses with variable opcodes can use this method to be
notified that information possibly affecting the opcode has been
changed.