Class ActionCommandRegion
java.lang.Object
com.iohao.net.framework.core.ActionCommandRegion
A command region holding all
ActionCommand entries for a single cmd value, keyed by subCmd.- Author:
- 渔民小镇
- date:
- 2022-05-15
-
Field Summary
FieldsModifier and TypeFieldDescriptionClass<?> actionControllerClazzfinal intSource file documentation info for the action controller classkey: subCmd -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(ActionCommand subActionCommand) Register an action command in this region.Convert the subCmd map to a dense array indexed by subCmd.booleancontainsKey(int subCmd) Check if a subCmd is registered in this region.intGet the maximum subCmd value registered in this region.values()Get all action commands in this region.
-
Field Details
-
cmd
public final int cmd -
actionControllerClazz
actionControllerClazz -
javaClassDocInfo
Source file documentation info for the action controller class -
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:
trueif the subCmd is registered
-
add
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
Get all action commands in this region.- Returns:
- collection of registered action commands
-
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
-