bdi4jade.goal

## Class BeliefValueGoal<K,V>

- java.lang.Object
- - bdi4jade.goal.BeliefValueGoal<K,V>

- Type Parameters:
    `K` - the type of the belief name.
    `V` - the type of the belief value.
  All Implemented Interfaces:
    BeliefGoal<K>, Goal, jade.content.Concept, jade.content.ContentElement, jade.content.Term, java.io.Serializable
  Direct Known Subclasses:
    PropositionalBeliefValueGoal

      public class BeliefValueGoal<K,V>
      extends java.lang.Object
      implements BeliefGoal<K>

  This class represents the goal of an agent to believe in a certain belief with an specific value, that is, the agent has a belief whose name and value are specified in this goal.
  Author:
    Ingrid Nunes
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BeliefValueGoal()` Default constructor.
    `BeliefValueGoal(K beliefName)` Creates a new BeliefValueGoal with the provided belief.
    `BeliefValueGoal(K beliefName, V value)` Creates a new BeliefValueGoal with the provided belief name and a value.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(java.lang.Object obj)`
    `K` | `getBeliefName()` Returns the name of the belief associated with this goal.
    `V` | `getValue()` The belief value associated with this goal.
    `int` | `hashCode()`
    `boolean` | `isAchieved(BeliefBase beliefBase)` Checks whether this goal is achieved by verifying if the provided belief has the value specified in this goal.
    `void` | `setBeliefName(K beliefName)` Sets the name of the belief associated with this goal.
    `void` | `setValue(V value)` Sets the value of this goal.
    `java.lang.String` | `toString()` Returns a string representation of this goal, in the form "BeliefValueGoal: BELIEF NAME should be BELIEF VALUE".

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### BeliefValueGoal

          public BeliefValueGoal()

      Default constructor.

    - #### BeliefValueGoal

          public BeliefValueGoal(K beliefName)

      Creates a new BeliefValueGoal with the provided belief. The value associated with this goal is initialized with null.
      Parameters:
        `beliefName` - the belief name.

    - #### BeliefValueGoal

          public BeliefValueGoal(K beliefName,
                                 V value)

      Creates a new BeliefValueGoal with the provided belief name and a value. This value represents the value that is aimed to be associated with the belief.
      Parameters:
        `beliefName` - the belief name.
        `value` - the value that is target of this goal.

  - ### Method Detail

    - #### equals

          public boolean equals(java.lang.Object obj)

      Overrides:
        `equals` in class `java.lang.Object`
      See Also:
        `Object.equals(java.lang.Object)`

    - #### getBeliefName

          @Parameter(direction=IN)
          public K getBeliefName()

      Returns the name of the belief associated with this goal.
      Specified by:
        `getBeliefName` in interface `BeliefGoal<K>`
      Returns:
        the belief name.

    - #### getValue

          @Parameter(direction=IN)
          public V getValue()

      The belief value associated with this goal.
      Returns:
        the belief value.

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`
      See Also:
        `Object.hashCode()`

    - #### isAchieved

          public boolean isAchieved(BeliefBase beliefBase)

      Checks whether this goal is achieved by verifying if the provided belief has the value specified in this goal.
      Specified by:
        `isAchieved` in interface `BeliefGoal<K>`
      Parameters:
        `beliefBase` - the belief base to be checked.
      Returns:
        true if the belief has the value specified in this goal, false otherwise.

    - #### setBeliefName

          public void setBeliefName(K beliefName)

      Sets the name of the belief associated with this goal.
      Parameters:
        `beliefName` - the belief name.

    - #### setValue

          public void setValue(V value)

      Sets the value of this goal.
      Parameters:
        `value` - the value.

    - #### toString

          public java.lang.String toString()

      Returns a string representation of this goal, in the form "BeliefValueGoal: BELIEF NAME should be BELIEF VALUE".
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        the string representation of this belief value goal.
      See Also:
        `Object.toString()`