/* Inner classes used to model car parts */
class Engine
{
public void start()
{ System.out.println("Start the car.");}
public void rev()
{System.out.println("Rev the engine.");}
public void stop()
{System.out.println("Car stopped.");}
}
class Wheel
{
public void align()
{System.out.println("Tires aligned.");}
}
class Window
{
public void rollup()
{System.out.println("Rollup the window.");}
public void rolldown()
{System.out.println("Rolldown the window.");}
}
class Door
{
public Window window = new Window();
public void open()
{System.out.println("Open()");}
public void close()
{System.out.println("Close()");}
}
右键点击CarModel.java,这时会在弹出菜单中显示出Profile As ->Java Application
运行.
同时切换视图到”Profiling and logging”,这样可以得到正在运行中程序的Profile
在这个视图中如果设置得当的话可以查看到如下结果:
1. Coverage
2. Execution flow
3. Memory
4. Object Reference
5. UML2 object/class/Thread Interaction
下载地址:
Eclipse SDK 3.1.0(Win32): www.eclipse.com/downloads/index.php
JDK 1.4(Win32): java.sun.com
EMF SDK 2.1.0(Win32): www.eclipse.com/downloads/index.php
XSD 2.1.0(Win32):http://download.eclipse.org/tools/emf/downloads/drops/2.1.0/R200507070200/xsd-SDK-2.1.0.zip:TPTP(Win32)
http://download.eclipse.org/tptp/4.1.0/TPTP-4.1.0-200511150100/tptp.runtime-TPTP-4.1.0-200511150100.zip
Agent Controller(Win32):http://download.eclipse.org/tptp/4.1.0/TPTP-4.1.0-200511150100/tptpdc.win_ia32-TPTP-4.1.0-200511150100.zip