harpoon.Analysis.Realtime
Class PrintFactory

java.lang.Object
  extended by harpoon.Analysis.Realtime.PrintFactory
All Implemented Interfaces:
HCodeFactory

public class PrintFactory
extends Object
implements HCodeFactory

PrintFactory allows you to print the code as it's being converted for debugging purposes only. new PrintFactory(new Foo(new PrintFactory(parent, "BEFORE")), "AFTER") will produce an HCodeFactory which will print before and after code for the transformation Foo It doesn't care what type of HCodeFactory it's given.


Constructor Summary
PrintFactory(HCodeFactory parent, String comment)
          Construct a PrintFactory that will label the code produced by parent with comment.
 
Method Summary
 void clear(HMethod m)
          Removes representation of method m from all caches in this factory and its parents.
 HCode convert(HMethod m)
          Make an HCode from an HMethod.
 String getCodeName()
          Returns a string naming the type of the HCode that this factory produces.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrintFactory

public PrintFactory(HCodeFactory parent,
                    String comment)
Construct a PrintFactory that will label the code produced by parent with comment.

Method Detail

convert

public HCode convert(HMethod m)
Description copied from interface: HCodeFactory
Make an HCode from an HMethod.

convert is allowed to return null if the requested conversion is impossible; typically this is because it's attempt to convert a source representation failed -- for example, because m is a native method.

Specified by:
convert in interface HCodeFactory

getCodeName

public String getCodeName()
Description copied from interface: HCodeFactory
Returns a string naming the type of the HCode that this factory produces.

this.getCodeName() should equal this.convert(m).getName() for every HMethod m.

Specified by:
getCodeName in interface HCodeFactory

clear

public void clear(HMethod m)
Description copied from interface: HCodeFactory
Removes representation of method m from all caches in this factory and its parents.

Specified by:
clear in interface HCodeFactory