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

java.lang.Object
  extended by br.pucrio.inf.les.bdijade.util.MetadataElement
      extended by br.pucrio.inf.les.bdijade.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

Field Summary
private  java.util.Set<BeliefBase> beliefBases
           
protected  java.lang.String name
           
private static long serialVersionUID
           
 
Fields inherited from class br.pucrio.inf.les.bdijade.util.MetadataElement
metadata
 
Constructor Summary
Belief(java.lang.String name)
          Initializes a belief with its name.
 
Method Summary
 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 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

beliefBases

private final java.util.Set<BeliefBase> beliefBases

name

protected final java.lang.String name
Constructor Detail

Belief

public Belief(java.lang.String name)
Initializes a belief with its name.

Parameters:
name - the belief name.
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()