alphaagent.java

来自「CroftSoft Code Library是一个开源的可移植的纯Java游戏库」· Java 代码 · 共 78 行

JAVA
78
字号
     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  AlphaAgent implements Actor, Runnable, Serializable {
     //////////////////////////////////////////////////////////////////////
     //////////////////////////////////////////////////////////////////////

     public String  message;

     //////////////////////////////////////////////////////////////////////
     // Initializers
     //////////////////////////////////////////////////////////////////////

     static
     //////////////////////////////////////////////////////////////////////
     {
       System.out.println ( "First time to load class AlphaAgent." );
     }

     //////////////////////////////////////////////////////////////////////
     // Instance initializer
     //////////////////////////////////////////////////////////////////////
     {
       System.out.println ( "Creating AlphaAgent instance in memory." );
     }

     //////////////////////////////////////////////////////////////////////
     // Constructor method
     //////////////////////////////////////////////////////////////////////

     public  AlphaAgent ( )
     //////////////////////////////////////////////////////////////////////
     {
       message = "ABC";
     }

     //////////////////////////////////////////////////////////////////////
     // Interface methods
     //////////////////////////////////////////////////////////////////////

     public String [ ]  getRoles ( )
     //////////////////////////////////////////////////////////////////////
     {
       return new String [ ] { "java.lang.Runnable" };
     }

     public void  run ( )
     //////////////////////////////////////////////////////////////////////
     {
       System.out.println ( message );
     }

     //////////////////////////////////////////////////////////////////////
     // Finalize method
     //////////////////////////////////////////////////////////////////////

     public void finalize ( ) throws Throwable
     //////////////////////////////////////////////////////////////////////
     {
       System.out.println ( "Removing AlphaAgent instance from memory." );
       super.finalize ( );
     }

     //////////////////////////////////////////////////////////////////////
     //////////////////////////////////////////////////////////////////////
     }

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?