prolog.model
Interface IFactList

All Superinterfaces:
IFact
All Known Implementing Classes:
FactList

public interface IFactList
extends IFact

IFactList is the base interface 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.

Copyright: Copyright (c) 2002

Organisation:


Method Summary
 void addRelation(IRelation atoms)
          adds a relation to this fact list
 int getColCount()
           
 IFactList getCopy()
           
 IFactList getMatchings(IFact fact)
           
 java.util.Iterator getRelations()
           
 int getRowCount()
           
 void setRelation(IRelation r)
          sets the relation
 
Methods inherited from interface prolog.model.IFact
genXml, getName, getRelation, toString
 

Method Detail

getColCount

public int getColCount()
Returns:
the number of atoms stored in a relation in this factlist

getRowCount

public int getRowCount()
Returns:
the number of relations in this factlist

addRelation

public void addRelation(IRelation atoms)
adds a relation to this fact list
Parameters:
atoms - to be added

getRelations

public java.util.Iterator getRelations()
Returns:
a iterator over all relations

setRelation

public void setRelation(IRelation r)
sets the relation

getMatchings

public IFactList getMatchings(IFact fact)
                       throws ParameterMatchingError
Parameters:
fact - the search pattern
Returns:
a collection of all relations matching the found relation in the given fact

getCopy

public IFactList getCopy()
Returns:
a copy of this fact list