prolog.implementation
Class ConstraintStatement
java.lang.Object
|
+--prolog.implementation.Fact
|
+--prolog.implementation.AbstractStatement
|
+--prolog.implementation.ConstraintStatement
- All Implemented Interfaces:
- IFact, IStatement
- Direct Known Subclasses:
- DemoConstraintStatement
- public class ConstraintStatement
- extends AbstractStatement
- implements IStatement
A ConstraintStatement is a expression to query. It has only one child,
the most top statement in the expression tree
| Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait |
expression
protected IStatement expression
- the one and only child
ConstraintStatement
public ConstraintStatement(int name)
- constructor
ConstraintStatement
public ConstraintStatement(int name,
IRelation r)
- constructor 2
setExpression
public void setExpression(IStatement s)
- sets the child expression node
query
public IFactList query(IFact f,
IFactDb l,
IStatementMap constraints)
throws ParameterMatchingError
- querries the most top expression statement
- Specified by:
query in interface IStatement
- Parameters:
f - - the fact to search forl - - the fact databaseconstraints - - the statements to resolve unfound facts- Returns:
- all relations matching the given fact
- Throws:
ParameterMatchingError -
toString
public java.lang.String toString()
- Overrides:
toString in class Fact
- Returns:
- a string representation of this class
toString
public java.lang.String toString(ISymbolTable table)
- Description copied from interface:
IFact
- returns a string representation of this oject,
if the parameter ISymbolTable is specified,
the symbols are decoded
- Specified by:
toString in interface IFact- Overrides:
toString in class Fact
- Parameters:
table - is the ISymbolTable to decode the symbols- Returns:
- a string representation of this object with decoded symbols
genXml
public void genXml(java.io.Writer out,
ISymbolTable table)
throws java.io.IOException
- generates a xml representation
- Specified by:
genXml in interface IFact- Overrides:
genXml in class Fact
- Parameters:
out - is the writer to append the xmltable - is the symboltable too decode symbols- Throws:
java.io.IOException -