|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--harpoon.ClassFile.HCode
HCode
is an abstract class that all views of a particular
method's executable code should extend.
An HCode
corresponds roughly to a "list of instructions".
HMethod
,
HCodeElement
,
Code
,
Instr
Nested Class Summary | |
static class |
HCode.PrintCallback
Callback interface for annotating pretty-prints of HCode s. |
Constructor Summary | |
HCode()
|
Method Summary | |
Object |
clone()
Clone this HCode and all associated
HCodeElement s. |
HCodeAndMaps |
clone(HMethod newMethod)
Clone this HCode , possibly moving it to a different method. |
abstract ArrayFactory |
elementArrayFactory()
Return an ArrayFactory for the HCodeElement s
composing this HCode . |
Indexer |
elementIndexer()
Return an Indexer for the HCodeElement s
composing this HCode . |
HCodeElement[] |
getElements()
Deprecated. use getElementsL() instead. |
Enumeration |
getElementsE()
Deprecated. use getElementsI() instead. |
Iterator |
getElementsI()
Return an Iterator over the component objects making up this code view. |
List |
getElementsL()
Return an ordered Collection (a List ) of
the component objects making up this code view. |
HCodeElement[] |
getLeafElements()
Return the 'leaves' of this code view; that is, the elements with no successors. |
abstract HMethod |
getMethod()
Return the HMethod to which this HCode
belongs. |
abstract String |
getName()
Return the name of this code view. |
HCodeElement |
getRootElement()
Return the 'root' element of this code view. |
void |
print(PrintWriter pw)
Pretty-print this code view using an empty callback. |
void |
print(PrintWriter pw,
HCode.PrintCallback callback)
Pretty-print this code view using the specified callback. |
String |
toString()
Returns a human-readable representation of this HCode . |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public HCode()
Method Detail |
public abstract HMethod getMethod()
HMethod
to which this HCode
belongs.
public abstract String getName()
"bytecode"
.
It is suggested that additional views be named in a similarly
human-friendly fashion.
public HCodeElement[] getElements()
HCodeElement
array.
Either getElementsI()
or getElementsE()
must have been implemented for the default implementation to work
properly.
Instr
public List getElementsL()
Collection
(a List
) of
the component objects making up this code view. If there is a
'root' to the code view, it should be the first element in the
List.
Either getElementsI()
or getElementsE()
must have been implemented for the default implementation to work
properly.
public Enumeration getElementsE()
Implementations must implement at least one of
getElementsE()
, or getElementsI()
.
Instr
public Iterator getElementsI()
Implementations must implement at least one of
getElementsE()
, or getElementsI()
.
public HCodeElement getRootElement()
null
if this notion
is not applicable.public HCodeElement[] getLeafElements()
null
if this notion
is not applicable.public abstract ArrayFactory elementArrayFactory()
ArrayFactory
for the HCodeElement
s
composing this HCode
.
public Indexer elementIndexer()
Indexer
for the HCodeElement
s
composing this HCode
. The default Indexer
returned does not implement Indexer.getByID()
.
public HCodeAndMaps clone(HMethod newMethod) throws CloneNotSupportedException
HCode
, possibly moving it to a different method.
Throws CloneNotSupportedException
if not overridden.
CloneNotSupportedException
- if it is not possible to clone
this HCode
.public Object clone() throws CloneNotSupportedException
HCode
and all associated
HCodeElement
s.
Calls clone(getMethod())
.
clone
in class Object
CloneNotSupportedException
public final void print(PrintWriter pw)
public void print(PrintWriter pw, HCode.PrintCallback callback)
public String toString()
HCode
.
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |