Class 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.
  • Field Details

    • exception

      protected Exception exception
      The exception.
    • listeners

      protected List<jadex.future.IResultListener<Void>> listeners
      The listeners.
  • Constructor Details

  • Method Details

    • addListener

      public void addListener(jadex.future.IResultListener<Void> listener)
      Add a new listener to get notified when the goal is finished.
      Specified by:
      addListener in interface IFinishableElement<Void>
      Parameters:
      listener - The listener.
    • removeListener

      public void removeListener(jadex.future.IResultListener<Void> listener)
      Remove a listener.
      Specified by:
      removeListener in interface IFinishableElement<Void>
      Parameters:
      listener - The listener.
    • getListeners

      public List<jadex.future.IResultListener<Void>> getListeners()
      Get the listeners.
      Returns:
      The listeners.
    • getException

      public Exception getException()
      Get the exception.
      Specified by:
      getException in interface IFinishableElement<Void>
      Returns:
      The exception.
    • setException

      public void setException(Exception exception)
      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:
      isSucceeded in interface IFinishableElement<Void>
      Returns:
      True, if is succeeded.
    • isFailed

      public abstract boolean isFailed()
      Test if element is failed.
      Specified by:
      isFailed in interface IFinishableElement<Void>
      Returns:
      True, if is failed.
    • isFinished

      public boolean isFinished()
      Test if goal is finished.
      Specified by:
      isFinished in interface IFinishableElement<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:
      isAdopted in class RParameterElement