Package jadex.bdiv3.model
Class MParameter
- java.lang.Object
-
- jadex.bdiv3.model.MElement
-
- jadex.bdiv3.model.MParameter
-
- Direct Known Subclasses:
MPlanParameter
public class MParameter extends MElement
Parameter model.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MParameter.Direction
The message direction.static class
MParameter.EvaluationMode
The message direction.
-
Field Summary
Fields Modifier and Type Field Description protected UnparsedExpression
bindingoptions
The binding options.protected ClassInfo
clazz
The type (if explicitly specified).protected MParameter.Direction
direction
The direction.static java.util.Map<java.lang.String,MParameter.Direction>
dirs
protected MParameter.EvaluationMode
evaluationmode
The direction.static java.util.Map<java.lang.String,MParameter.EvaluationMode>
evas
protected java.util.List<jadex.rules.eca.EventType>
events
The ECA events that may denote changes in the parameter value(s).protected FieldInfo
ftarget
The field target.protected MethodInfo
mgetter
The method targets.protected MethodInfo
msetter
protected java.lang.Boolean
multi
Flag if is multi.protected boolean
optional
The optional flag.protected java.util.List<java.lang.String>
servicemappings
The service mappings.protected UnparsedExpression
updaterate
The update rate.protected UnparsedExpression
value
The default value.protected java.util.List<UnparsedExpression>
values
The default values (multi).-
Fields inherited from class jadex.bdiv3.model.MElement
CAPABILITY_SEPARATOR, description, name
-
-
Constructor Summary
Constructors Constructor Description MParameter()
Bean Constructor.MParameter(FieldInfo ftarget)
Create a new parameter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDefaultValues(UnparsedExpression fact)
The value to set.void
addEvent(jadex.rules.eca.EventType event)
Add an event.void
addServiceMapping(java.lang.String mapping)
Add a service mapping.UnparsedExpression
getBindingOptions()
Get the bindingOptions.ClassInfo
getClazz()
Get the clazz.UnparsedExpression
getDefaultValue()
Get the value.java.util.List<UnparsedExpression>
getDefaultValues()
Get the value.MParameter.Direction
getDirection()
Get the direction.MParameter.EvaluationMode
getEvaluationMode()
Get the evaluationmode.java.util.List<jadex.rules.eca.EventType>
getEvents()
Get the events.FieldInfo
getField()
Get the field (for field-backed beliefs).MethodInfo
getGetter()
Get the getter method (for method-backed beliefs).java.util.List<java.lang.String>
getServiceMappings()
Get the service mappings.MethodInfo
getSetter()
Get the setter method (for method-backed beliefs).java.lang.Class<?>
getType(java.lang.ClassLoader cl)
Get the class of the belief.UnparsedExpression
getUpdateRate()
Get the updaterate.long
getUpdaterateValue(IInternalAccess agent)
Get/Evaluate the updaterate value.java.lang.Object
getValue(java.lang.Object object, java.lang.ClassLoader cl)
Get the value of the belief.void
initEvents(MParameterElement owner)
Init the event, when loaded from xml.boolean
isArray()
Test if parameter is of array type.boolean
isFieldParameter()
Test if this belief refers to a field.boolean
isMulti(java.lang.ClassLoader cl)
Get the multi.boolean
isOptional()
Get the optional flag.void
setBindingOptions(UnparsedExpression bindingoptions)
The binding options to set.void
setClazz(ClassInfo clazz)
The clazz to set.void
setDefaultValue(UnparsedExpression value)
The value to set.void
setDefaultValues(java.util.List<UnparsedExpression> values)
The value to set.void
setDirection(MParameter.Direction direction)
The direction to set.void
setEvaluationMode(MParameter.EvaluationMode evaluationmode)
The evaluationmode to set.void
setEvents(java.util.List<jadex.rules.eca.EventType> events)
The events to set.void
setGetter(MethodInfo mgetter)
Set the mgetter.void
setMulti(boolean multi)
The multi to set.void
setOptional(boolean optional)
Set the optional flag.void
setServiceMappings(java.util.List<java.lang.String> servicemappings)
Set the service mappings.void
setSetter(MethodInfo msetter)
Set the msetter.void
setUpdateRate(UnparsedExpression updaterate)
The updaterate to set.boolean
setValue(java.lang.Object object, java.lang.Object value, java.lang.ClassLoader cl)
Set the value of the parameter.-
Methods inherited from class jadex.bdiv3.model.MElement
equals, getCapabilityName, getDescription, getElementName, getName, hashCode, internalName, setDescription, setFlatName, setName, toString
-
-
-
-
Field Detail
-
dirs
public static java.util.Map<java.lang.String,MParameter.Direction> dirs
-
evas
public static java.util.Map<java.lang.String,MParameter.EvaluationMode> evas
-
ftarget
protected FieldInfo ftarget
The field target.
-
mgetter
protected MethodInfo mgetter
The method targets.
-
msetter
protected MethodInfo msetter
-
multi
protected java.lang.Boolean multi
Flag if is multi.
-
direction
protected MParameter.Direction direction
The direction.
-
clazz
protected ClassInfo clazz
The type (if explicitly specified).
-
value
protected UnparsedExpression value
The default value.
-
values
protected java.util.List<UnparsedExpression> values
The default values (multi).
-
optional
protected boolean optional
The optional flag.
-
bindingoptions
protected UnparsedExpression bindingoptions
The binding options.
-
evaluationmode
protected MParameter.EvaluationMode evaluationmode
The direction.
-
updaterate
protected UnparsedExpression updaterate
The update rate.
-
events
protected java.util.List<jadex.rules.eca.EventType> events
The ECA events that may denote changes in the parameter value(s).
-
servicemappings
protected java.util.List<java.lang.String> servicemappings
The service mappings.
-
-
Constructor Detail
-
MParameter
public MParameter()
Bean Constructor.
-
MParameter
public MParameter(FieldInfo ftarget)
Create a new parameter.
-
-
Method Detail
-
setGetter
public void setGetter(MethodInfo mgetter)
Set the mgetter.- Parameters:
mgetter
- The mgetter to set.
-
setSetter
public void setSetter(MethodInfo msetter)
Set the msetter.- Parameters:
msetter
- The msetter to set.
-
isFieldParameter
public boolean isFieldParameter()
Test if this belief refers to a field.- Returns:
- True if is a field belief.
-
getValue
public java.lang.Object getValue(java.lang.Object object, java.lang.ClassLoader cl)
Get the value of the belief.- Parameters:
object
- The rparameterelement (such as goal).cl
- The classloader.
-
setValue
public boolean setValue(java.lang.Object object, java.lang.Object value, java.lang.ClassLoader cl)
Set the value of the parameter.- Parameters:
object
- The rparameterelement (such as goal).value
- The value.cl
- The classloader.
-
getType
public java.lang.Class<?> getType(java.lang.ClassLoader cl)
Get the class of the belief.
-
getField
public FieldInfo getField()
Get the field (for field-backed beliefs).
-
getGetter
public MethodInfo getGetter()
Get the getter method (for method-backed beliefs).
-
getSetter
public MethodInfo getSetter()
Get the setter method (for method-backed beliefs).
-
isMulti
public boolean isMulti(java.lang.ClassLoader cl)
Get the multi.- Returns:
- The multi.
-
setMulti
public void setMulti(boolean multi)
The multi to set.- Parameters:
multi
- The multi to set
-
isArray
public boolean isArray()
Test if parameter is of array type.
-
getDirection
public MParameter.Direction getDirection()
Get the direction.- Returns:
- The direction
-
setDirection
public void setDirection(MParameter.Direction direction)
The direction to set.- Parameters:
direction
- The direction to set
-
getClazz
public ClassInfo getClazz()
Get the clazz.- Returns:
- The clazz
-
setClazz
public void setClazz(ClassInfo clazz)
The clazz to set.- Parameters:
clazz
- The clazz to set
-
getDefaultValue
public UnparsedExpression getDefaultValue()
Get the value.- Returns:
- The value
-
setDefaultValue
public void setDefaultValue(UnparsedExpression value)
The value to set.- Parameters:
value
- The value to set
-
getDefaultValues
public java.util.List<UnparsedExpression> getDefaultValues()
Get the value.- Returns:
- The value
-
setDefaultValues
public void setDefaultValues(java.util.List<UnparsedExpression> values)
The value to set.- Parameters:
value
- The value to set
-
addDefaultValues
public void addDefaultValues(UnparsedExpression fact)
The value to set.- Parameters:
value
- The value to set
-
isOptional
public boolean isOptional()
Get the optional flag.- Returns:
- The otpional flag
-
setOptional
public void setOptional(boolean optional)
Set the optional flag.- Parameters:
optional
- The value to set
-
getBindingOptions
public UnparsedExpression getBindingOptions()
Get the bindingOptions.- Returns:
- The bindingOptions
-
setBindingOptions
public void setBindingOptions(UnparsedExpression bindingoptions)
The binding options to set.- Parameters:
bindingoptions
- The bindingOptions to set
-
getEvaluationMode
public MParameter.EvaluationMode getEvaluationMode()
Get the evaluationmode.- Returns:
- The evaluationmode
-
setEvaluationMode
public void setEvaluationMode(MParameter.EvaluationMode evaluationmode)
The evaluationmode to set.- Parameters:
evaluationmode
- The evaluationmode to set
-
getUpdateRate
public UnparsedExpression getUpdateRate()
Get the updaterate.- Returns:
- The updaterate
-
setUpdateRate
public void setUpdateRate(UnparsedExpression updaterate)
The updaterate to set.- Parameters:
updaterate
- The updaterate to set
-
getUpdaterateValue
public long getUpdaterateValue(IInternalAccess agent)
Get/Evaluate the updaterate value.- Parameters:
agent
- The agent.- Returns:
- The update rate.
-
getEvents
public java.util.List<jadex.rules.eca.EventType> getEvents()
Get the events.- Returns:
- The events.
-
initEvents
public void initEvents(MParameterElement owner)
Init the event, when loaded from xml.
-
setEvents
public void setEvents(java.util.List<jadex.rules.eca.EventType> events)
The events to set.- Parameters:
events
- The events to set
-
addEvent
public void addEvent(jadex.rules.eca.EventType event)
Add an event.- Parameters:
event
- The event.
-
getServiceMappings
public java.util.List<java.lang.String> getServiceMappings()
Get the service mappings.
-
setServiceMappings
public void setServiceMappings(java.util.List<java.lang.String> servicemappings)
Set the service mappings.
-
addServiceMapping
public void addServiceMapping(java.lang.String mapping)
Add a service mapping.
-
-