Package cmion.level3
Class MindAction
java.lang.Object
cmion.level3.MindAction
the base class for mind actions, different minds (e.g. fatima) can implement different subclasses of this
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotected constructor for subclasses to useMindAction(String subject, String name, List<String> parameters) create a new mind action with the specified name and parameters, if the action has no parameters, the second parameter of this constructor may be nullMindAction(Node domNode) create a mindAction from a DOM Node (used when parsing rules file) -
Method Summary
Modifier and TypeMethodDescriptionbooleancompareMatch(MindAction matchAction) compares whether this mindAction (part of a rule with "*" allowed as name or parameter) produces a match with the mind action that is passed to this function.booleanoverride equals to allow comparisons between 2 mind actionsreturns the name, subject and parameters of this action in a map, indexed by "$subject" "$action" "$parameter1", "$parameter2", etcgetName()returns the name/identifier of this actionreturns the parameters of this actionreturns the name/identifier of the agent/ user who has performed this actioninthashCode()define hash code for mind actionstoString()returns a textual representation of this mind action
-
Field Details
-
name
the name/identifier of the action -
subject
the name/identifier of the agent/ user who has performed this action -
parameters
the parameters of this action
-
-
Constructor Details
-
MindAction
create a new mind action with the specified name and parameters, if the action has no parameters, the second parameter of this constructor may be null -
MindAction
protected MindAction()protected constructor for subclasses to use -
MindAction
create a mindAction from a DOM Node (used when parsing rules file)- Throws:
Exception
-
-
Method Details
-
compareMatch
compares whether this mindAction (part of a rule with "*" allowed as name or parameter) produces a match with the mind action that is passed to this function. A match occurs, when all of the following 3 conditions are fulfilled: 1) the names are equal, or this.name == "*", 2.) both actions have the same number of parameters. 3) all parameters have either the same value or the value of the parameter in this is "*" -
equals
override equals to allow comparisons between 2 mind actions -
hashCode
public int hashCode()define hash code for mind actions -
getName
returns the name/identifier of this action -
getSubject
returns the name/identifier of the agent/ user who has performed this action -
getParameters
returns the parameters of this action -
getMappings
returns the name, subject and parameters of this action in a map, indexed by "$subject" "$action" "$parameter1", "$parameter2", etc -
toString
returns a textual representation of this mind action
-