/* 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()");}
}
右鍵點(diǎn)擊CarModel.java,這時(shí)會(huì)在彈出菜單中顯示出Profile As ->Java Application
運(yùn)行.
同時(shí)切換視圖到”Profiling and logging”,這樣可以得到正在運(yùn)行中程序的Profile
在這個(gè)視圖中如果設(shè)置得當(dāng)?shù)脑捒梢圆榭吹饺缦陆Y(jié)果:
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