br.pucrio.inf.les.bdijade.belief
Class TransientBeliefSet<T>

java.lang.Object
  extended by br.pucrio.inf.les.bdijade.util.MetadataElement
      extended by br.pucrio.inf.les.bdijade.belief.Belief<java.util.Set<T>>
          extended by br.pucrio.inf.les.bdijade.belief.BeliefSet<T>
              extended by br.pucrio.inf.les.bdijade.belief.TransientBeliefSet<T>
All Implemented Interfaces:
jade.content.Concept, jade.content.Term, java.io.Serializable

public class TransientBeliefSet<T>
extends BeliefSet<T>

This class extends the BeliefSet and represents a transient belief set, which is not persisted in a permanent memory.

Author:
ingrid
See Also:
Serialized Form

Field Summary
private static long serialVersionUID
           
protected  java.util.Set<T> values
           
 
Fields inherited from class br.pucrio.inf.les.bdijade.belief.Belief
name
 
Fields inherited from class br.pucrio.inf.les.bdijade.util.MetadataElement
metadata
 
Constructor Summary
TransientBeliefSet(java.lang.String name)
          Creates a transient belief set.
TransientBeliefSet(java.lang.String name, java.util.Set<T> values)
          Creates a transient belief set.
 
Method Summary
 void addValue(T value)
          Adds a new value to this belief set.
 java.util.Set<T> getValue()
          Gets the current value of the Belief.
 boolean hasValue(T value)
          Checks if this belief set has the provided value.
 java.util.Iterator<T> iterator()
          Returns an iterator for this belief set.
 boolean remove(T value)
          Removes a value from this belief set.
 void setValue(java.util.Set<T> values)
          Sets a new value to the belief.
 java.lang.String toString()
           
 
Methods inherited from class br.pucrio.inf.les.bdijade.belief.Belief
addBeliefBase, equals, getBeliefBases, getName, hashCode, removeBeliefBase
 
Methods inherited from class br.pucrio.inf.les.bdijade.util.MetadataElement
getMetadata, getMetadata, hasMetadata, putMetadata, removeMetadata
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

values

protected java.util.Set<T> values
Constructor Detail

TransientBeliefSet

public TransientBeliefSet(java.lang.String name)
Creates a transient belief set.

Parameters:
name - the name of the belief set.

TransientBeliefSet

public TransientBeliefSet(java.lang.String name,
                          java.util.Set<T> values)
Creates a transient belief set.

Parameters:
name - the name of the belief set.
values - the initial values of this belief set.
Method Detail

addValue

public void addValue(T value)
Description copied from class: BeliefSet
Adds a new value to this belief set.

Specified by:
addValue in class BeliefSet<T>
Parameters:
value - the value to be added.
See Also:
BeliefSet.addValue(java.lang.Object)

getValue

public java.util.Set<T> getValue()
Description copied from class: Belief
Gets the current value of the Belief.

Specified by:
getValue in class Belief<java.util.Set<T>>
Returns:
the belief value.
See Also:
Belief.getValue()

hasValue

public boolean hasValue(T value)
Description copied from class: BeliefSet
Checks if this belief set has the provided value.

Specified by:
hasValue in class BeliefSet<T>
Parameters:
value - the value to be tested.
Returns:
true if the belief set contains this value.
See Also:
BeliefSet.hasValue(java.lang.Object)

iterator

public java.util.Iterator<T> iterator()
Description copied from class: BeliefSet
Returns an iterator for this belief set.

Specified by:
iterator in class BeliefSet<T>
Returns:
the iterator.
See Also:
BeliefSet.iterator()

remove

public boolean remove(T value)
Description copied from class: BeliefSet
Removes a value from this belief set.

Specified by:
remove in class BeliefSet<T>
Parameters:
value - the value to be removed.
Returns:
true if the value was removed.
See Also:
BeliefSet.remove(java.lang.Object)

setValue

public void setValue(java.util.Set<T> values)
Description copied from class: Belief
Sets a new value to the belief.

Specified by:
setValue in class Belief<java.util.Set<T>>
Parameters:
values - the new value.
See Also:
Belief.setValue(java.lang.Object)

toString

public java.lang.String toString()
Overrides:
toString in class Belief<java.util.Set<T>>
See Also:
Object.toString()