putplacecommand.java

来自「一个agent 工具包,可以开发移动设备应用,考虑了安全措施」· Java 代码 · 共 38 行

JAVA
38
字号
package SOMA.naming.place;

import SOMA.network.connection.Command;

/** Comando di aggiornamento di un {@link PlaceNameService PNS}.
*
* <P>Viene aggiunto o modificato un place.
*
* @author Livio Profiri
*/
public class PutPlaceCommand extends Command
{
  // Attenzione: funziona sia per place aggiunti, che per place modificati.
  /** @serial*/
  PlaceInfo toPut;

  /** Costruttore. */
  public PutPlaceCommand( PlaceInfo toPut )
  {
    this.toPut = toPut;
    System.out.println( toString() + " created " );
  }

  /** Aggiunge o modifica il place. */
  public void run()
  {
    env.placeNameService.putPlace( toPut );

    env.out.println( toString() + " Completed!" );
  }

  public String toString()
  {
    return "[PutPlaceCommand " + toPut + "]";
  }
}

⌨️ 快捷键说明

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