|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--prolog.implementation.FactDb
the fact database stores all data found in the prolog program. it stores all facts in factlists that are sorted by their name, so it gets a database representation with a table for every fact type found.
| Field Summary | |
protected java.util.Map |
factCollections
the map storing all factlists under their name |
protected java.util.List |
listeners
list of listeners to be informed about changes |
| Constructor Summary | |
FactDb()
constructor |
|
| Method Summary | |
void |
add(IFact f)
adds a fact to this database. this fact is stored in the factlist having the same name with the fact itself. |
void |
add(IFactList l)
adds a factlist to the database |
void |
add(IRelation relation,
int name)
adds a relation into the factlist with the specified name |
void |
addListener(IFactDbListener l)
adds a fact db listener |
void |
clear()
clears the whole fact database |
protected void |
fireFactListAdded(IFactList l)
fires a fact list added notification |
protected void |
fireModelChanged()
fires a model changed notification |
protected void |
fireRelationAdded(IRelation l,
int name)
fires a fact added notification |
void |
genXml(java.io.Writer out,
ISymbolTable table)
generates xml representing this object |
IFactList |
getFactList(int key)
returns the factlist with the specified name |
java.util.Iterator |
getFactLists()
returns a iterator over all facts stored in this factlist |
boolean |
isFact(IFact f)
returns true if the given fact can be found in the database |
void |
removeListener(IFactDbListener l)
removes a fact db listener |
java.lang.String |
toString()
returns a string representation of this class |
java.lang.String |
toString(ISymbolTable table)
returns a string representation of this class with decoded symbols |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
protected java.util.List listeners
protected java.util.Map factCollections
| Constructor Detail |
public FactDb()
| Method Detail |
public void clear()
clear in interface IFactDbpublic void add(IFact f)
add in interface IFactDbprolog.model.IFactDbf - is the fact to be added
public void add(IRelation relation,
int name)
add in interface IFactDbrelation - - the relation to be addedname - - the name of the relationpublic void add(IFactList l)
public IFactList getFactList(int key)
getFactList in interface IFactDbkey - - the name of the factlistpublic java.util.Iterator getFactLists()
getFactLists in interface IFactDbprolog.model.IFactDb
public boolean isFact(IFact f)
throws ParameterMatchingError
isFact in interface IFactDbpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toString(ISymbolTable table)
toString in interface IFactDbprolog.model.IFactDbtable - is the symboltable to decode
public void genXml(java.io.Writer out,
ISymbolTable table)
throws java.io.IOException
genXml in interface IFactDbout - table - java.io.IOException - public void addListener(IFactDbListener l)
public void removeListener(IFactDbListener l)
protected void fireModelChanged()
protected void fireFactListAdded(IFactList l)
protected void fireRelationAdded(IRelation l,
int name)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||