Class ActionCommandRegion

java.lang.Object
com.iohao.net.framework.core.ActionCommandRegion

public final class ActionCommandRegion extends Object
A command region holding all ActionCommand entries for a single cmd value, keyed by subCmd.
Author:
渔民小镇
date:
2022-05-15
  • Field Details

    • cmd

      public final int cmd
    • actionControllerClazz

      public Class<?> actionControllerClazz
      actionControllerClazz
    • javaClassDocInfo

      public JavaClassDocInfo javaClassDocInfo
      Source file documentation info for the action controller class
    • subActionCommandMap

      public Map<Integer, ActionCommand> subActionCommandMap
      key: subCmd
  • Constructor Details

    • ActionCommandRegion

      public ActionCommandRegion(int cmd)
  • Method Details

    • containsKey

      public boolean containsKey(int subCmd)
      Check if a subCmd is registered in this region.
      Parameters:
      subCmd - the sub-command ID to look up
      Returns:
      true if the subCmd is registered
    • add

      public void add(ActionCommand subActionCommand)
      Register an action command in this region.
      Parameters:
      subActionCommand - the action command to register
    • getMaxSubCmd

      public int getMaxSubCmd()
      Get the maximum subCmd value registered in this region.
      Returns:
      the highest subCmd key, or 0 if the region is empty
    • values

      public Collection<ActionCommand> values()
      Get all action commands in this region.
      Returns:
      collection of registered action commands
    • arrayActionCommand

      public ActionCommand[] arrayActionCommand()
      Convert the subCmd map to a dense array indexed by subCmd.
      Returns:
      array of action commands where the index corresponds to the subCmd value