bdi4jade.belief

## Class TransientBelief<K,V>

- java.lang.Object
- - bdi4jade.core.MetadataElementImpl
  - - bdi4jade.belief.AbstractBelief<K,V>
    - - bdi4jade.belief.TransientBelief<K,V>

- Type Parameters:
    `K` - the type of the belief name.
    `V` - the type of the belief value.
  All Implemented Interfaces:
    Belief<K,V>, MetadataElement, jade.content.Concept, jade.content.ContentElement, jade.content.Term, java.io.Serializable, java.lang.Cloneable
  Direct Known Subclasses:
    TransientPredicate

      public class TransientBelief<K,V>
      extends AbstractBelief<K,V>

  This class extends the `AbstractBelief` class and represents a transient belief, which is not persisted in a permanent memory.
  Author:
    Ingrid Nunes
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected V` | `value`

    - ### Fields inherited from class bdi4jade.core.MetadataElementImpl

      `metadata`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TransientBelief()` The default constructor.
    `TransientBelief(K name)` Initializes a transient belief with its name.
    `TransientBelief(K name, V value)` Initializes a transient belief with its name and a initial value.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `V` | `getValue()` Gets the current value of the belief.
    `protected void` | `updateValue(V value)` Sets the value of this belief.

    - ### Methods inherited from class bdi4jade.belief.AbstractBelief

      `addBeliefBase, clone, equals, getBeliefBases, getName, hashCode, notifyBeliefBases, removeBeliefBase, setName, setValue, toString`

    - ### Methods inherited from class bdi4jade.core.MetadataElementImpl

      `getMetadata, getMetadata, hasMetadata, putMetadata, removeMetadata`

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

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

    - ### Methods inherited from interface bdi4jade.core.MetadataElement

      `getMetadata, getMetadata, hasMetadata, putMetadata, removeMetadata`

- - ### Field Detail

    - #### value

          protected V value

  - ### Constructor Detail

    - #### TransientBelief

          public TransientBelief()

      The default constructor. It should be only used if persistence frameworks are used.

    - #### TransientBelief

          public TransientBelief(K name)

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

    - #### TransientBelief

          public TransientBelief(K name,
                                 V value)

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

  - ### Method Detail

    - #### getValue

          public V getValue()

      Description copied from interface: `Belief`
      Gets the current value of the belief.
      Returns:
        the belief value.
      See Also:
        `Belief.getValue()`

    - #### updateValue

          protected void updateValue(V value)

      Description copied from class: `AbstractBelief`
      Sets the value of this belief. It is invoked by the `AbstractBelief.setValue(Object)` method.
      Specified by:
        `updateValue` in class `AbstractBelief<K,V>`
      Parameters:
        `value` - the value to set.
      See Also:
        `AbstractBelief.updateValue(java.lang.Object)`