bdi4jade.belief

## Class TransientBeliefSet<K,V>

- java.lang.Object
- - bdi4jade.core.MetadataElementImpl
  - - bdi4jade.belief.AbstractBelief<K,java.util.Set<V>>
    - - bdi4jade.belief.AbstractBeliefSet<K,V>
      - - bdi4jade.belief.TransientBeliefSet<K,V>

- Type Parameters:
    `K` - the type of the belief name.
    `V` - the type of the belief set values.
  All Implemented Interfaces:
    Belief<K,java.util.Set<V>>, BeliefSet<K,V>, MetadataElement, jade.content.Concept, jade.content.ContentElement, jade.content.Term, java.io.Serializable, java.lang.Cloneable

      public class TransientBeliefSet<K,V>
      extends AbstractBeliefSet<K,V>

  This class extends the `AbstractBeliefSet` class and implements `BeliefSet` interface, representing a transient belief set, which is not persisted in a permanent memory.
  Author:
    Ingrid Nunes
  See Also:
    Serialized Form

- - ### Field Summary

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

      `metadata`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TransientBeliefSet()` The default constructor.
    `TransientBeliefSet(K name)` Initializes a belief set with its name.
    `TransientBeliefSet(K name, java.util.Set<V> values)` Initializes a belief set with its name and an initial set of values.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `addSetValue(V value)` Adds a value of this belief set.
    `java.util.Set<V>` | `getValue()` Gets the current value of the belief.
    `boolean` | `hasValue(V value)` Checks whether this belief set has the provided value.
    `java.util.Iterator<V>` | `iterator()` Returns an iterator for this belief set.
    `protected boolean` | `removeSetValue(V value)` Removes a value of this belief set.
    `protected void` | `updateValue(java.util.Set<V> value)` Sets the value of this belief.

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

      `addValue, removeValue`

    - ### 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.belief.Belief

      `addBeliefBase, clone, getBeliefBases, getName, removeBeliefBase, setValue`

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

      `getMetadata, getMetadata, hasMetadata, putMetadata, removeMetadata`

- - ### Constructor Detail

    - #### TransientBeliefSet

          public TransientBeliefSet()

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

    - #### TransientBeliefSet

          public TransientBeliefSet(K name)

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

    - #### TransientBeliefSet

          public TransientBeliefSet(K name,
                                    java.util.Set<V> values)

      Initializes a belief set with its name and an initial set of values.
      Parameters:
        `name` - the name of the belief set.
        `values` - the initial values of this belief set.

  - ### Method Detail

    - #### addSetValue

          protected void addSetValue(V value)

      Description copied from class: `AbstractBeliefSet`
      Adds a value of this belief set. It is invoked by the `AbstractBeliefSet.addValue(Object)` method.
      Specified by:
        `addSetValue` in class `AbstractBeliefSet<K,V>`
      Parameters:
        `value` - the value to be added.
      See Also:
        `AbstractBeliefSet.addSetValue(Object)`

    - #### getValue

          public java.util.Set<V> getValue()

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

    - #### hasValue

          public boolean hasValue(V value)

      Description copied from interface: `BeliefSet`
      Checks whether this belief set has the provided value.
      Parameters:
        `value` - the value to be checked.
      Returns:
        true if the belief set contains this value, false otherwise.
      See Also:
        `BeliefSet.hasValue(java.lang.Object)`

    - #### iterator

          public java.util.Iterator<V> iterator()

      Description copied from interface: `BeliefSet`
      Returns an iterator for this belief set.
      Returns:
        the iterator to iterate the values of the belief set.
      See Also:
        `BeliefSet.iterator()`

    - #### removeSetValue

          protected boolean removeSetValue(V value)

      Description copied from class: `AbstractBeliefSet`
      Removes a value of this belief set. It is invoked by the `AbstractBeliefSet.removeValue(Object)` method.
      Specified by:
        `removeSetValue` in class `AbstractBeliefSet<K,V>`
      Parameters:
        `value` - the value to be added.
      Returns:
        true if the value was removed, false otherwise.
      See Also:
        `AbstractBeliefSet.removeSetValue(Object)`

    - #### updateValue

          protected void updateValue(java.util.Set<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,java.util.Set<V>>`
      Parameters:
        `value` - the value to set.
      See Also:
        `AbstractBelief.updateValue(java.lang.Object)`