bdi4jade.belief

## Class Belief<T>

- java.lang.Object
- - bdi4jade.util.MetadataElement
  - - bdi4jade.belief.Belief<T>

- All Implemented Interfaces:
    jade.content.Concept, jade.content.Term, java.io.Serializable
  Direct Known Subclasses:
    BeliefSet, PersistentBelief, TransientBelief

      public abstract class Belief<T>
      extends MetadataElement
      implements java.io.Serializable, jade.content.Concept

  Represents a belief of the belief base. It has a name and a value associate with it.
  Author:
    ingrid
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Belief(java.lang.String name)` Initializes a belief with its name.
    `Belief(java.lang.String name, T value)` Initializes a belief with its name.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addBeliefBase(BeliefBase beliefBase)` Adds a belief base that contains this belief.
    `boolean` | `equals(java.lang.Object obj)`
    `java.util.Set<BeliefBase>` | `getBeliefBases()`
    `java.lang.String` | `getName()` Gets the name of the Belief.
    `abstract T` | `getValue()` Gets the current value of the Belief.
    `int` | `hashCode()`
    `void` | `removeBeliefBase(BeliefBase beliefBases)` Removes a belief base that does not contain this belief anymore.
    `abstract void` | `setValue(T value)` Sets a new value to the belief.
    `java.lang.String` | `toString()`

    - ### Methods inherited from class bdi4jade.util.MetadataElement

      `getMetadata, getMetadata, hasMetadata, putMetadata, removeMetadata`

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

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### Belief

          public Belief(java.lang.String name)

      Initializes a belief with its name.
      Parameters:
        `name` - the belief name.

    - #### Belief

          public Belief(java.lang.String name,
                T value)

      Initializes a belief with its name.
      Parameters:
        `name` - the belief name.
        `value` - the belief initial value.

  - ### Method Detail

    - #### addBeliefBase

          public void addBeliefBase(BeliefBase beliefBase)

      Adds a belief base that contains this belief. The agent whose capability contains this belief in the belief base believes in this belief.
      Parameters:
        `beliefBase` - the belief base to be added.

    - #### equals

          public final boolean equals(java.lang.Object obj)

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

    - #### getBeliefBases

          public java.util.Set<BeliefBase> getBeliefBases()

      Returns:
        the beliefBases

    - #### getName

          public final java.lang.String getName()

      Gets the name of the Belief.
      Returns:
        the belief name.

    - #### getValue

          public abstract T getValue()

      Gets the current value of the Belief.
      Returns:
        the belief value.

    - #### hashCode

          public int hashCode()

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

    - #### removeBeliefBase

          public void removeBeliefBase(BeliefBase beliefBases)

      Removes a belief base that does not contain this belief anymore. The agent whose capability does not contain this belief in the belief base does not believe in this belief anymore.
      Parameters:
        `beliefBases` - the belief base to be removed.

    - #### setValue

          public abstract void setValue(T value)

      Sets a new value to the belief.
      Parameters:
        `value` - the new value.

    - #### toString

          public java.lang.String toString()

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