public abstract class LocalTable extends Attribute implements InstructionPtr
Modifier and Type | Method and Description |
---|---|
Local |
addLocal()
Add a local to this table.
|
Local |
addLocal(Local local)
Import a local from another method/class.
|
Local |
addLocal(String name,
String type)
Add a local to this table.
|
void |
clear()
Clear all locals from this table.
|
Code |
getCode()
Returns the Code block that owns the Instruction(s) this
InstructionPtr points to.
|
Local |
getLocal(int local)
Return the local with the given locals index, or null if none.
|
Local |
getLocal(String name)
Return the local with the given name, or null if none.
|
Local[] |
getLocals()
Return all the locals of this method.
|
Local[] |
getLocals(String name)
Return all locals with the given name, or empty array if none.
|
protected abstract Local |
newLocal()
Create a new element of this table.
|
protected abstract Local[] |
newLocalArray(int size)
Create a new array.
|
boolean |
removeLocal(int local)
Removes the local with the given locals index from the table.
|
boolean |
removeLocal(Local local)
Removes a local from this method.
|
boolean |
removeLocal(String name)
Removes the local with the given name from this method.
|
void |
replaceTarget(Instruction oldTarget,
Instruction newTarget)
Replace the given old, likely invalid, target with a new target.
|
void |
setLocals(Local[] locals)
Set the locals of this table.
|
void |
updateTargets()
Use the byte indexes read from the class file to calculate and
set references to the target instruction(s) for this ptr.
|
getClassLoader, getName, getNameIndex, getOwner, getPool, getProject, isValid
addAttribute, addAttribute, clearAttributes, getAttribute, getAttributes, getAttributes, removeAttribute, removeAttribute, setAttributes
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
acceptVisit
public Local[] getLocals()
public Local getLocal(int local)
public Local getLocal(String name)
public Local[] getLocals(String name)
public void setLocals(Local[] locals)
public Local addLocal(Local local)
public Local addLocal()
protected abstract Local newLocal()
protected abstract Local[] newLocalArray(int size)
public void clear()
public boolean removeLocal(int local)
public boolean removeLocal(String name)
public boolean removeLocal(Local local)
public void updateTargets()
InstructionPtr
updateTargets
in interface InstructionPtr
public void replaceTarget(Instruction oldTarget, Instruction newTarget)
InstructionPtr
replaceTarget
in interface InstructionPtr
public Code getCode()
InstructionPtr
getCode
in interface InstructionPtr
Copyright © 2002–2019. All rights reserved.