bdi4jade.belief

## Class TransientBeliefSet<T>

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

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

      public class TransientBeliefSet<T>
      extends AbstractBeliefSet<T>
      implements BeliefSet<T>

  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
    Modifier | Constructor and Description
    --- | ---
    `protected` | `TransientBeliefSet()` The default constructor.
    `` | `TransientBeliefSet(java.lang.String name)` Initializes a belief set with its name.
    `` | `TransientBeliefSet(java.lang.String name, java.util.Set<T> values)` Initializes a belief set with its name and an initial set of values.

  - ### Method Summary

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

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

      `addValue, removeValue`

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

      `addBeliefBase, 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

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

    - ### Methods inherited from interface bdi4jade.belief.BeliefSet

      `addValue, removeValue`

    - ### Methods inherited from interface bdi4jade.belief.Belief

      `addBeliefBase, getBeliefBases, getName, removeBeliefBase, setValue`

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

      `getMetadata, getMetadata, hasMetadata, putMetadata, removeMetadata`

- - ### Constructor Detail

    - #### TransientBeliefSet

          protected TransientBeliefSet()

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

    - #### TransientBeliefSet

          public TransientBeliefSet(java.lang.String name)

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

    - #### TransientBeliefSet

          public TransientBeliefSet(java.lang.String name,
                            java.util.Set<T> 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(T 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<T>`
      Parameters:
        `value` - the value to be added.
      See Also:
        `AbstractBeliefSet.addSetValue(Object)`

    - #### getValue

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

      Description copied from interface: `Belief`
      Gets the current value of the belief.
      Specified by:
        `getValue` in interface `Belief<java.util.Set<T>>`
      Returns:
        the belief value.
      See Also:
        `Belief.getValue()`

    - #### hasValue

          public boolean hasValue(T value)

      Description copied from interface: `BeliefSet`
      Checks whether this belief set has the provided value.
      Specified by:
        `hasValue` in interface `BeliefSet<T>`
      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<T> iterator()

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

    - #### removeSetValue

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