📄 countagent.java
字号:
package com.croftsoft.apps.vaft.agent;
import java.io.Serializable;
import com.croftsoft.core.role.actor.Actor;
/*********************************************************************
* <P>
* @author
* <A HREF="http://www.alumni.caltech.edu/~croft">David W. Croft</A>
* @version
* 1998-04-26
*********************************************************************/
public class CountAgent implements Actor, Runnable, Serializable {
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
public int max = -1;
//////////////////////////////////////////////////////////////////////
// Initializers
//////////////////////////////////////////////////////////////////////
static
//////////////////////////////////////////////////////////////////////
{
System.out.println ( "First time to load class CountAgent." );
}
//////////////////////////////////////////////////////////////////////
// Instance initializer
//////////////////////////////////////////////////////////////////////
{
System.out.println ( "Creating CountAgent instance in memory." );
}
//////////////////////////////////////////////////////////////////////
// Constructor method
//////////////////////////////////////////////////////////////////////
public CountAgent ( )
//////////////////////////////////////////////////////////////////////
{
this.max = 3;
}
//////////////////////////////////////////////////////////////////////
// Interface methods
//////////////////////////////////////////////////////////////////////
public String [ ] getRoles ( )
//////////////////////////////////////////////////////////////////////
{
return new String [ ] { "java.lang.Runnable" };
}
public void run ( )
//////////////////////////////////////////////////////////////////////
{
for ( int i = 0; i < max; i++ ) System.out.println ( "" + i );
}
//////////////////////////////////////////////////////////////////////
// Finalize method
//////////////////////////////////////////////////////////////////////
public void finalize ( ) throws Throwable
//////////////////////////////////////////////////////////////////////
{
System.out.println ( "Removing CountAgent instance from memory." );
super.finalize ( );
}
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -