madkit.action

## Enum KernelAction

- java.lang.Object
- - java.lang.Enum<KernelAction>
  - - madkit.action.KernelAction

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<KernelAction>

      public enum KernelAction
      extends java.lang.Enum<KernelAction>

  Enum representing kernel actions. This especially could be used to communicate with the kernel in order to trigger kernel's actions. It could be used by any agent to interact with the kernel by creating `Action` using `getActionFor(AbstractAgent, Object...)`.
  Since:
    MaDKit 5.0.0.14
  Version:
    0.92
  Author:
    Fabien Michel

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant and Description
    `CONNECT_TO_IP` For connecting kernels in a wide area network.
    `CONNECT_WEB_REPO` Connection to the MaDKit web repository
    `CONSOLE` Makes a redirection of the out and err to a MaDKit agent.
    `COPY` Clone the kernel with its initial options
    `EXIT` Close the kernel
    `KILL_AGENT` Kill an agent
    `LAUNCH_AGENT` Launch an agent
    `LAUNCH_MAS` Launch a MAS configuration
    `LAUNCH_NETWORK` Start the network
    `LAUNCH_XML` Launch an XML configuration
    `RESTART` Restart the kernel with its initial options
    `STOP_NETWORK` Stop the network

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `javax.swing.Action` | `getActionFor(AbstractAgent agent, java.lang.Object... parameters)` Builds an action that will make the kernel do the corresponding operation if possible.
    `ActionInfo` | `getActionInfo()`
    `static KernelAction` | `valueOf(java.lang.String name)` Returns the enum constant of this type with the specified name.
    `static KernelAction[]` | `values()` Returns an array containing the constants of this enum type, in the order they are declared.

    - ### Methods inherited from class java.lang.Enum

      `clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Enum Constant Detail

    - #### EXIT

          public static final KernelAction EXIT

      Close the kernel

    - #### COPY

          public static final KernelAction COPY

      Clone the kernel with its initial options

    - #### RESTART

          public static final KernelAction RESTART

      Restart the kernel with its initial options

    - #### LAUNCH_NETWORK

          public static final KernelAction LAUNCH_NETWORK

      Start the network

    - #### STOP_NETWORK

          public static final KernelAction STOP_NETWORK

      Stop the network

    - #### CONSOLE

          public static final KernelAction CONSOLE

      Makes a redirection of the out and err to a MaDKit agent.

    - #### LAUNCH_AGENT

          public static final KernelAction LAUNCH_AGENT

      Launch an agent

    - #### LAUNCH_MAS

          public static final KernelAction LAUNCH_MAS

      Launch a MAS configuration

    - #### LAUNCH_XML

          public static final KernelAction LAUNCH_XML

      Launch an XML configuration

    - #### KILL_AGENT

          public static final KernelAction KILL_AGENT

      Kill an agent

    - #### CONNECT_WEB_REPO

          public static final KernelAction CONNECT_WEB_REPO

      Connection to the MaDKit web repository

    - #### CONNECT_TO_IP

          public static final KernelAction CONNECT_TO_IP

      For connecting kernels in a wide area network. It requires a parameter of type `InetAddress`.

  - ### Method Detail

    - #### values

          public static KernelAction[] values()

      Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

          for (KernelAction c : KernelAction.values())
              System.out.println(c);

      Returns:
        an array containing the constants of this enum type, in the order they are declared

    - #### valueOf

          public static KernelAction valueOf(java.lang.String name)

      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
        `name` - the name of the enum constant to be returned.
      Returns:
        the enum constant with the specified name
      Throws:
        `java.lang.IllegalArgumentException` - if this enum type has no constant with the specified name
        `java.lang.NullPointerException` - if the argument is null

    - #### getActionFor

          public javax.swing.Action getActionFor(AbstractAgent agent,
                                        java.lang.Object... parameters)

      Builds an action that will make the kernel do the corresponding operation if possible.
      Parameters:
        `agent` - the agent that will send the message to the kernel
        `parameters` - the info
      Returns:
        the new corresponding action

    - #### getActionInfo

          public ActionInfo getActionInfo()

      Returns:
        the actionInfo

Fabien Michel, Olivier Gutknecht, Jacques Ferber - November 18 2014