public class MBelief extends MElement
Modifier and Type | Field and Description |
---|---|
protected java.util.Set<java.lang.String> |
beliefevents
The events this belief depends on.
|
protected ClassInfo |
clazz
The type (if explicitly specified).
|
protected MParameter.EvaluationMode |
evaluationmode
The direction.
|
protected java.util.List<EventType> |
events
The aggregated/inited events.
|
protected boolean |
exported
The exported / argument flag.
|
protected UnparsedExpression |
fact
The default fact.
|
protected java.util.List<UnparsedExpression> |
facts
The default facts (multi).
|
protected FieldInfo |
ftarget
The field target.
|
protected java.lang.String |
impl
The collection implementation class.
|
protected MethodInfo |
mgetter
The method targets.
|
protected MethodInfo |
msetter |
protected java.lang.Boolean |
multi
Flag if is multi.
|
protected java.util.Collection<EventType> |
rawevents
The raw events.
|
protected java.lang.String |
ref
The reference.
|
protected boolean |
result
The result flag.
|
protected UnparsedExpression |
updaterate
The update rate.
|
CAPABILITY_SEPARATOR, description, name
Constructor and Description |
---|
MBelief()
Bean Constructor.
|
MBelief(FieldInfo target,
java.lang.String impl,
boolean dynamic,
long updaterate,
java.util.Set<java.lang.String> beliefevents,
java.util.Collection<EventType> rawevents)
Create a new belief.
|
MBelief(FieldInfo target,
java.lang.String impl,
boolean dynamic,
long updaterate,
java.lang.String[] beliefevents,
java.util.Collection<EventType> rawevents)
Create a new belief.
|
MBelief(FieldInfo target,
java.lang.String impl,
boolean dynamic,
UnparsedExpression updaterate,
java.util.Set<java.lang.String> beliefevents,
java.util.Collection<EventType> rawevents)
Create a new belief.
|
MBelief(MethodInfo target,
java.lang.String impl,
boolean dynamic,
long updaterate,
java.util.Set<java.lang.String> beliefevents,
java.util.Collection<EventType> rawevents)
Create a new belief.
|
MBelief(MethodInfo target,
java.lang.String impl,
boolean dynamic,
long updaterate,
java.lang.String[] beliefevents,
java.util.Collection<EventType> rawevents)
Create a new belief.
|
MBelief(MethodInfo target,
java.lang.String impl,
boolean dynamic,
UnparsedExpression updaterate,
java.util.Set<java.lang.String> beliefevents,
java.util.Collection<EventType> rawevents)
Create a new belief.
|
Modifier and Type | Method and Description |
---|---|
protected void |
adaptEvaluationMode()
Adapt the evaluation mode according to the
|
void |
addDefaultFacts(UnparsedExpression fact)
The value to set.
|
void |
addEvent(EventType event)
Add an event.
|
java.util.Set<java.lang.String> |
getBeliefEvents()
Get the events.
|
ClassInfo |
getClazz()
Get the clazz.
|
UnparsedExpression |
getDefaultFact()
Get the value.
|
java.util.List<UnparsedExpression> |
getDefaultFacts()
Get the value.
|
MParameter.EvaluationMode |
getEvaluationMode()
Get the evaluationmode.
|
java.util.List<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.lang.String |
getImplClassName()
Get the impl.
|
java.util.Collection<EventType> |
getRawEvents()
Get the rawevents.
|
java.lang.String |
getRef()
Get the reference.
|
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(IInternalAccess agent)
Get the value of the belief.
|
java.lang.Object |
getValue(java.lang.Object object,
java.lang.ClassLoader cl)
Get the value of the belief.
|
void |
initEvents(IBDIModel model,
java.lang.ClassLoader cl)
Init the event, when loaded from xml.
|
boolean |
isArrayBelief()
Test if belief is of array type.
|
boolean |
isDynamic()
Get the dynamic.
|
boolean |
isExported()
Get the exported flag.
|
boolean |
isFieldBelief()
Test if this belief refers to a field.
|
boolean |
isMulti(java.lang.ClassLoader cl)
Get the multi.
|
boolean |
isResult()
Get the result flag.
|
void |
setBeliefEvents(java.util.Set<java.lang.String> events)
Set the events.
|
void |
setClazz(ClassInfo clazz)
The clazz to set.
|
void |
setDefaultFact(UnparsedExpression fact)
The value to set.
|
void |
setDefaultFacts(java.util.List<UnparsedExpression> facts)
Set the value.
|
void |
setEvaluationMode(MParameter.EvaluationMode evaluationmode)
The evaluationmode to set.
|
void |
setEvents(java.util.List<EventType> events)
The events to set.
|
void |
setExported(boolean exported)
Set the exported flag.
|
void |
setGetter(MethodInfo mgetter)
Set the mgetter.
|
void |
setImplClassName(java.lang.String impl)
Set the impl.
|
void |
setMulti(boolean multi)
The multi to set.
|
void |
setRawEvents(java.util.Set<EventType> rawevents)
Set the rawevents.
|
void |
setRef(java.lang.String reference)
Set the reference.
|
void |
setResult(boolean result)
Set the result flag.
|
void |
setSetter(MethodInfo msetter)
Set the msetter.
|
void |
setUpdateRate(UnparsedExpression updaterate)
The updaterate to set.
|
boolean |
setValue(IInternalAccess agent,
java.lang.Object value)
Set the value of the belief.
|
boolean |
setValue(java.lang.Object object,
java.lang.Object value,
java.lang.ClassLoader cl)
Set the value of the belief.
|
equals, getCapabilityName, getDescription, getElementName, getName, hashCode, internalName, setDescription, setFlatName, setName, toString
protected FieldInfo ftarget
protected MethodInfo mgetter
protected MethodInfo msetter
protected java.lang.String impl
protected UnparsedExpression updaterate
protected java.lang.Boolean multi
protected java.util.Set<java.lang.String> beliefevents
protected java.util.Collection<EventType> rawevents
protected java.util.List<EventType> events
protected UnparsedExpression fact
protected java.util.List<UnparsedExpression> facts
protected ClassInfo clazz
protected boolean exported
protected boolean result
protected java.lang.String ref
protected MParameter.EvaluationMode evaluationmode
public MBelief()
public MBelief(FieldInfo target, java.lang.String impl, boolean dynamic, UnparsedExpression updaterate, java.util.Set<java.lang.String> beliefevents, java.util.Collection<EventType> rawevents)
public MBelief(FieldInfo target, java.lang.String impl, boolean dynamic, long updaterate, java.util.Set<java.lang.String> beliefevents, java.util.Collection<EventType> rawevents)
public MBelief(FieldInfo target, java.lang.String impl, boolean dynamic, long updaterate, java.lang.String[] beliefevents, java.util.Collection<EventType> rawevents)
public MBelief(MethodInfo target, java.lang.String impl, boolean dynamic, UnparsedExpression updaterate, java.util.Set<java.lang.String> beliefevents, java.util.Collection<EventType> rawevents)
public MBelief(MethodInfo target, java.lang.String impl, boolean dynamic, long updaterate, java.util.Set<java.lang.String> beliefevents, java.util.Collection<EventType> rawevents)
public MBelief(MethodInfo target, java.lang.String impl, boolean dynamic, long updaterate, java.lang.String[] beliefevents, java.util.Collection<EventType> rawevents)
protected void adaptEvaluationMode()
public java.lang.String getImplClassName()
public void setImplClassName(java.lang.String impl)
impl
- The impl to set.public boolean isDynamic()
public boolean isExported()
public void setExported(boolean exported)
exported
- The exported to set.public boolean isResult()
public void setResult(boolean result)
result
- The result to set.public java.lang.String getRef()
public void setRef(java.lang.String reference)
reference
- The reference to set.public UnparsedExpression getUpdateRate()
public void setUpdateRate(UnparsedExpression updaterate)
updaterate
- The updaterate to setpublic long getUpdaterateValue(IInternalAccess agent)
agent
- The agent.public void setGetter(MethodInfo mgetter)
mgetter
- The mgetter to set.public void setSetter(MethodInfo msetter)
msetter
- The msetter to set.public ClassInfo getClazz()
public void setClazz(ClassInfo clazz)
clazz
- The clazz to setpublic boolean isFieldBelief()
public boolean isMulti(java.lang.ClassLoader cl)
public void setMulti(boolean multi)
multi
- The multi to setpublic java.lang.Object getValue(IInternalAccess agent)
public java.lang.Object getValue(java.lang.Object object, java.lang.ClassLoader cl)
public boolean setValue(IInternalAccess agent, java.lang.Object value)
public boolean setValue(java.lang.Object object, java.lang.Object value, java.lang.ClassLoader cl)
public java.lang.Class<?> getType(java.lang.ClassLoader cl)
public FieldInfo getField()
public MethodInfo getGetter()
public MethodInfo getSetter()
public boolean isArrayBelief()
public UnparsedExpression getDefaultFact()
public void setDefaultFact(UnparsedExpression fact)
value
- The value to setpublic java.util.List<UnparsedExpression> getDefaultFacts()
public void setDefaultFacts(java.util.List<UnparsedExpression> facts)
public void addDefaultFacts(UnparsedExpression fact)
value
- The value to setpublic MParameter.EvaluationMode getEvaluationMode()
public void setEvaluationMode(MParameter.EvaluationMode evaluationmode)
evaluationmode
- The evaluationmode to setpublic java.util.Collection<EventType> getRawEvents()
public void setRawEvents(java.util.Set<EventType> rawevents)
rawevents
- The rawevents to set.public java.util.Set<java.lang.String> getBeliefEvents()
public void setBeliefEvents(java.util.Set<java.lang.String> events)
events
- The events to set.public java.util.List<EventType> getEvents()
public void initEvents(IBDIModel model, java.lang.ClassLoader cl)
public void setEvents(java.util.List<EventType> events)
events
- The events to setpublic void addEvent(EventType event)
event
- The event.