Package jadex.bdiv3x.runtime
Class BeliefbaseWrapper
- java.lang.Object
-
- jadex.bdiv3x.runtime.BeliefbaseWrapper
-
- All Implemented Interfaces:
IBeliefbase
,IElement
,IMapAccess
public class BeliefbaseWrapper extends java.lang.Object implements IMapAccess, IBeliefbase
Prepend capability prefix to belief names.
-
-
Field Summary
Fields Modifier and Type Field Description protected IBeliefbase
beliefbase
The flat belief base.protected java.lang.String[]
names
The local belief names (cached on first access).protected java.lang.String
prefix
The full capability prefix.protected java.lang.String[]
setnames
The local belief set names (cached on first access).
-
Constructor Summary
Constructors Constructor Description BeliefbaseWrapper(IBeliefbase beliefbase, java.lang.String prefix)
Create a belief base wrapper.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsBelief(java.lang.String name)
Returnsboolean
containsBeliefSet(java.lang.String name)
Returnsjava.lang.Object
get(java.lang.Object name)
Get an object from the map.IBelief
getBelief(java.lang.String name)
Get a belief for a name.java.lang.String[]
getBeliefNames()
Returns the names of all beliefs.IBeliefSet
getBeliefSet(java.lang.String name)
Get a belief set for a name.java.lang.String[]
getBeliefSetNames()
Returns the names of all belief sets.long
getCount()
Get the element count.java.lang.String
getId()
Get the id.MElement
getModelElement()
Get the model element.
-
-
-
Field Detail
-
beliefbase
protected IBeliefbase beliefbase
The flat belief base.
-
prefix
protected java.lang.String prefix
The full capability prefix.
-
names
protected java.lang.String[] names
The local belief names (cached on first access).
-
setnames
protected java.lang.String[] setnames
The local belief set names (cached on first access).
-
-
Constructor Detail
-
BeliefbaseWrapper
public BeliefbaseWrapper(IBeliefbase beliefbase, java.lang.String prefix)
Create a belief base wrapper.
-
-
Method Detail
-
get
public java.lang.Object get(java.lang.Object name)
Get an object from the map.- Specified by:
get
in interfaceIMapAccess
- Parameters:
name
- The name- Returns:
- The value.
-
getModelElement
public MElement getModelElement()
Get the model element.- Specified by:
getModelElement
in interfaceIElement
- Returns:
- The model element.
-
getBelief
public IBelief getBelief(java.lang.String name)
Get a belief for a name.- Specified by:
getBelief
in interfaceIBeliefbase
- Parameters:
name
- The belief name.
-
getBeliefSet
public IBeliefSet getBeliefSet(java.lang.String name)
Get a belief set for a name.- Specified by:
getBeliefSet
in interfaceIBeliefbase
- Parameters:
name
- The belief set name.
-
containsBelief
public boolean containsBelief(java.lang.String name)
Returns- Specified by:
containsBelief
in interfaceIBeliefbase
- Parameters:
name
- the name of a belief.- Returns:
true
if contained,false
is not contained, or the specified name refer to a belief set.- See Also:
containsBeliefSet(java.lang.String)
-
containsBeliefSet
public boolean containsBeliefSet(java.lang.String name)
Returns- Specified by:
containsBeliefSet
in interfaceIBeliefbase
- Parameters:
name
- the name of a belief set.- Returns:
true
if contained,false
is not contained, or the specified name refer to a belief.- See Also:
containsBelief(java.lang.String)
-
getBeliefNames
public java.lang.String[] getBeliefNames()
Returns the names of all beliefs.- Specified by:
getBeliefNames
in interfaceIBeliefbase
- Returns:
- the names of all beliefs.
-
getBeliefSetNames
public java.lang.String[] getBeliefSetNames()
Returns the names of all belief sets.- Specified by:
getBeliefSetNames
in interfaceIBeliefbase
- Returns:
- the names of all belief sets.
-
getCount
public long getCount()
Get the element count.
-
-