|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectubiware.core.visualizer.BeliefContainerTreeModel
public class BeliefContainerTreeModel
Maps a belief container/context to a tree-like structure.
This is a tree structure whose nodes are complete subtrees. For more information, read SubtreesTreeModel.
A BeliefContainerTreeModel has one or more BeliefTreeModels as children of its. It is initialised only once and after that it only uses its own, local, final and unmutable storage of beliefs. It never asks the Agent about beliefs
ever again.
| Constructor Summary | |
|---|---|
BeliefContainerTreeModel(javax.swing.tree.TreeModel root,
ReusableAtomicBehavior rabi,
java.lang.String contextID)
Initialises a new instance of BeliefContainerTreeModel which will represent the context/container specified by this ID. |
|
| Method Summary | |
|---|---|
void |
addTreeModelListener(javax.swing.event.TreeModelListener l)
This method has no effect in this implementation. |
java.lang.Object |
getChild(java.lang.Object parent,
int index)
|
int |
getChildCount(java.lang.Object parent)
|
java.lang.String |
getContextID()
Returns the actual ID of the container that this node came from. |
int |
getIndexOfChild(java.lang.Object parent,
java.lang.Object child)
|
javax.swing.tree.TreeModel |
getRoot()
|
boolean |
isLeaf(java.lang.Object node)
|
void |
removeTreeModelListener(javax.swing.event.TreeModelListener l)
|
java.lang.String |
toString()
Returns a textual representation of this object, which is the ID of the belief context/container, surrounded by braces ({}) |
void |
valueForPathChanged(javax.swing.tree.TreePath path,
java.lang.Object newValue)
This method has no effect in this implementation. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public BeliefContainerTreeModel(javax.swing.tree.TreeModel root,
ReusableAtomicBehavior rabi,
java.lang.String contextID)
Initialises a new instance of BeliefContainerTreeModel which will represent the context/container specified by this ID.
The given ReusableAtomicBehavior, rabi, is used in order to acquire all beliefs in the belief context specified by
the given contextID. rabi is never used again, throughout the whole life cycle of this object. It is not even stored
in a field.
This model will create a whole tree-like substructure of the Agent's beliefs (as acquired by rabi). The children of this
model will be BeliefTreeModels, created according to the actual beliefs of the Agent. This locally re-created structure of
beliefs is used whenever queries are made to this model. The Agent's actual belief storage is never re-read.
root is the actual root element of this model. This could be any TreeModel which might cooperate with this
one. If root is null then the root of the tree is believed to be this! and this belief is being
passed accordingly to the children TreeModels created as the result of this model's initialisation.
root - the actual root of the whole tree (if null then root = this)rabi - a RAB to be used for accessing the Agent's beliefscontextID - the context id to be represented by this model| Method Detail |
|---|
public javax.swing.tree.TreeModel getRoot()
getRoot in interface javax.swing.tree.TreeModel
public java.lang.Object getChild(java.lang.Object parent,
int index)
getChild in interface javax.swing.tree.TreeModelpublic int getChildCount(java.lang.Object parent)
getChildCount in interface javax.swing.tree.TreeModelpublic boolean isLeaf(java.lang.Object node)
isLeaf in interface javax.swing.tree.TreeModel
public void valueForPathChanged(javax.swing.tree.TreePath path,
java.lang.Object newValue)
This method has no effect in this implementation.
valueForPathChanged in interface javax.swing.tree.TreeModelpath - ignorednewValue - ignored
public int getIndexOfChild(java.lang.Object parent,
java.lang.Object child)
getIndexOfChild in interface javax.swing.tree.TreeModelpublic void addTreeModelListener(javax.swing.event.TreeModelListener l)
This method has no effect in this implementation.
addTreeModelListener in interface javax.swing.tree.TreeModell - public void removeTreeModelListener(javax.swing.event.TreeModelListener l)
removeTreeModelListener in interface javax.swing.tree.TreeModelpublic java.lang.String toString()
Returns a textual representation of this object, which is the ID of the belief context/container, surrounded by braces ({})
toString in class java.lang.Objectpublic java.lang.String getContextID()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||