Package jadex.bdi.runtime.impl
Class RFinishableElement
java.lang.Object
jadex.bdi.runtime.impl.RElement
jadex.bdi.runtime.impl.RParameterElement
jadex.bdi.runtime.impl.RProcessableElement
jadex.bdi.runtime.impl.RFinishableElement
- All Implemented Interfaces:
IElement,IFinishableElement<Void>,IParameterElement,jadex.javaparser.IMapAccess
- Direct Known Subclasses:
RGoal
public abstract class RFinishableElement
extends RProcessableElement
implements IFinishableElement<Void>
Element that can be finished with processing.
-
Nested Class Summary
Nested classes/interfaces inherited from class jadex.bdi.runtime.impl.RProcessableElement
RProcessableElement.StateNested classes/interfaces inherited from class jadex.bdi.runtime.impl.RParameterElement
RParameterElement.RParameter, RParameterElement.RParameterSet -
Field Summary
FieldsFields inherited from class jadex.bdi.runtime.impl.RProcessableElement
apl, pojoelement, state, triedplansFields inherited from class jadex.bdi.runtime.impl.RParameterElement
parameters, parametersetsFields inherited from class jadex.bdi.runtime.impl.RElement
cnt, id, modelelement -
Constructor Summary
ConstructorsConstructorDescriptionRFinishableElement(MProcessableElement modelelement, Object pojoelement, Map<String, Object> vals, MConfigParameterElement config) Create a new element. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(jadex.future.IResultListener<Void> listener) Add a new listener to get notified when the goal is finished.Get the exception.Get the listeners.booleanCheck if the element is currently part of the agent's reasoning.abstract booleanisFailed()Test if element is failed.booleanTest if goal is finished.abstract booleanTest if element is succeeded.voidNotify the listeners.voidremoveListener(jadex.future.IResultListener<Void> listener) Remove a listener.voidsetException(Exception exception) Set the exception.Methods inherited from class jadex.bdi.runtime.impl.RProcessableElement
addTriedPlan, getApplicablePlanList, getPojoElement, getState, getTriedPlans, planFinished, setApplicablePlanList, setPojoElement, setState, setTriedPlans, testWriteOK, toStringMethods inherited from class jadex.bdi.runtime.impl.RParameterElement
addParameter, addParameterSet, createParameter, createParameter, createParameterSet, createParameterSet, get, getFetcherName, getParameter, getParameters, getParameterSet, getParameterSets, getType, hasParameter, hasParameterSet, initParameters, wrapFetcherMethods inherited from class jadex.bdi.runtime.impl.RElement
getAgent, getCapability, getCount, getId, getMCapability, getModelElement, getRuleSystem, setId, setModelElementMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface jadex.bdi.runtime.IElement
getCount, getId, getModelElement
-
Field Details
-
exception
The exception. -
listeners
The listeners.
-
-
Constructor Details
-
RFinishableElement
public RFinishableElement(MProcessableElement modelelement, Object pojoelement, Map<String, Object> vals, MConfigParameterElement config) Create a new element.
-
-
Method Details
-
addListener
Add a new listener to get notified when the goal is finished.- Specified by:
addListenerin interfaceIFinishableElement<Void>- Parameters:
listener- The listener.
-
removeListener
Remove a listener.- Specified by:
removeListenerin interfaceIFinishableElement<Void>- Parameters:
listener- The listener.
-
getListeners
Get the listeners.- Returns:
- The listeners.
-
getException
Get the exception.- Specified by:
getExceptionin interfaceIFinishableElement<Void>- Returns:
- The exception.
-
setException
Set the exception.- Parameters:
exception- The exception to set.
-
notifyListeners
public void notifyListeners()Notify the listeners. -
isSucceeded
public abstract boolean isSucceeded()Test if element is succeeded.- Specified by:
isSucceededin interfaceIFinishableElement<Void>- Returns:
- True, if is succeeded.
-
isFailed
public abstract boolean isFailed()Test if element is failed.- Specified by:
isFailedin interfaceIFinishableElement<Void>- Returns:
- True, if is failed.
-
isFinished
public boolean isFinished()Test if goal is finished.- Specified by:
isFinishedin interfaceIFinishableElement<Void>- Returns:
- True, if is finished.
-
isAdopted
public boolean isAdopted()Check if the element is currently part of the agent's reasoning. E.g. the bases are always adopted and all of their contents such as goals, plans and beliefs.- Specified by:
isAdoptedin classRParameterElement
-