|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--prolog.implementation.FactList
FactList is the base implementation for a collection of relations. It can be compared with a database table containing rows of relations. The name of the factlist would be the tablename. That's why factlist extends IFact. So it inherits a name. The relation of the extended IFact are also used for factlists returned by queries. In this relation, parameters of the statements are stored.
prolog:
myFact(joe,dan).
myFact(joe,dan2).
In this example, the two facts "myFact" are stored in a factlist.
interpreter internal:
myFact(joe,dan).
myFact(joe,dan2).
myStatement(X,Y):-myFact(X,Y).
In this example, the results returned by myFact(X,Y) are stored in a factlist.
| Field Summary | |
protected int |
colCount
stores the number of columns stored in this factlist |
protected java.util.List |
facts
stores the relations |
protected int |
name
stores the name of this fact list |
protected Relation |
relation
stores the parameters of this fact list |
| Constructor Summary | |
FactList(FactList list)
copy constructor |
|
FactList(int name,
int colCount)
bean constructor |
|
| Method Summary | |
void |
addAttribute(java.lang.Object value)
adds a attribute to the relation |
void |
addRelation(IRelation relation)
adds a relation to this factlist |
void |
genXml(java.io.Writer out,
ISymbolTable table)
generates a xml representation of this class |
int |
getColCount()
|
IFactList |
getCopy()
|
IFactList |
getMatchings(IFact fact)
returns a new factlist with facts matching this given fact |
int |
getName()
returns the name of this fact |
IRelation |
getRelation()
returns the relalation this fact owns |
java.util.Iterator |
getRelations()
|
int |
getRowCount()
|
void |
setRelation(IRelation relation)
sets the relation format of this factlist |
java.lang.String |
toString()
|
java.lang.String |
toString(ISymbolTable table)
returns a string representation of this oject, if the parameter ISymbolTable is specified, the symbols are decoded |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
protected Relation relation
protected int name
protected int colCount
protected java.util.List facts
| Constructor Detail |
public FactList(int name,
int colCount)
name - is the name of this factlistpublic FactList(FactList list)
list - to copy| Method Detail |
public void addAttribute(java.lang.Object value)
value - is the attribute to be addedpublic int getName()
IFactgetName in interface IFactpublic int getColCount()
getColCount in interface IFactListpublic int getRowCount()
getRowCount in interface IFactListpublic void setRelation(IRelation relation)
setRelation in interface IFactListrelation - public IRelation getRelation()
IFactgetRelation in interface IFactpublic void addRelation(IRelation relation)
addRelation in interface IFactListprolog.model.IFactListatoms - to be addedpublic java.util.Iterator getRelations()
getRelations in interface IFactListpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toString(ISymbolTable table)
IFacttoString in interface IFacttable - is the ISymbolTable required to decode the symbols
public void genXml(java.io.Writer out,
ISymbolTable table)
throws java.io.IOException
genXml in interface IFactout - the writer to append the xmltable - is the ISymbolTable to decode the symbolsjava.io.IOException - public IFactList getCopy()
getCopy in interface IFactList
public IFactList getMatchings(IFact fact)
throws ParameterMatchingError
getMatchings in interface IFactListfact - is the fact to search for
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||