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


Field Summary
protected  IStatement expression
          the one and only child
 
Fields inherited from class prolog.implementation.Fact
name, relation
 
Constructor Summary
ConstraintStatement(int name)
          constructor
ConstraintStatement(int name, IRelation r)
          constructor 2
 
Method Summary
 void genXml(java.io.Writer out, ISymbolTable table)
          generates a xml representation
 IFactList query(IFact f, IFactDb l, IStatementMap constraints)
          querries the most top expression statement
 void setExpression(IStatement s)
          sets the child expression node
 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 prolog.implementation.AbstractStatement
generateFact, generateRelation
 
Methods inherited from class prolog.implementation.Fact
addAttribute, getName, getRelation
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 
Methods inherited from interface prolog.model.IFact
getName, getRelation
 

Field Detail

expression

protected IStatement expression
the one and only child
Constructor Detail

ConstraintStatement

public ConstraintStatement(int name)
constructor

ConstraintStatement

public ConstraintStatement(int name,
                           IRelation r)
constructor 2
Method Detail

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 for
l - - the fact database
constraints - - 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 xml
table - is the symboltable too decode symbols
Throws:
java.io.IOException -