prolog.implementation
Class Program

java.lang.Object
  |
  +--prolog.implementation.Program
All Implemented Interfaces:
IProgram
Direct Known Subclasses:
DemoProgram

public class Program
extends java.lang.Object
implements IProgram

Title: Programm

Descrpition: this class describes a prolog programm


Field Summary
protected  IFactDb facts
          this is the fact database with all facts in it
protected  ILogger logger
          the logger logs the output of all of the programm e.g. to Console
protected  IQueryList querys
          in this list, all queries found by the parser are inserted
protected  IStatementMap statements
          in this map, all statements are added with their name as key
protected  SymbolTable symbolTable
          this is the symboltable to decode the programm internal used integers to strings
 
Constructor Summary
Program()
          constructor
 
Method Summary
 void clear()
          clear the programm (clears all items found by the parser)
 void genXml(java.io.Writer out)
          generates xml describing the datamodel when in memory, e.g. the statementtrees...
 IFactDb getFacts()
          returns the fact database used to process a program
 IQueryList getQuerys()
          returns a list with all queries found by the parser
 IStatementMap getStatements()
          returns the statement map used to resolve queries
 ISymbolTable getSymbolTable()
          returns the used symboltable to en- and decode the names
protected  void logFinalResult(IRelation format, java.util.Iterator results)
          logs a final result found by a query in prolog syntax
 void run()
          the method processing the program
 void setFacts(IFactDb f)
          sets the fact database used to process a program
 void setLogger(ILogger logger)
          sets the logger used for processing the programm. all output will be routed over this logger
 void setStatements(IStatementMap sm)
          sets the statement map used to resolve queries
 void setSymbolTable(SymbolTable table)
          sets the symboltable
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

querys

protected IQueryList querys
in this list, all queries found by the parser are inserted

facts

protected IFactDb facts
this is the fact database with all facts in it

statements

protected IStatementMap statements
in this map, all statements are added with their name as key

symbolTable

protected SymbolTable symbolTable
this is the symboltable to decode the programm internal used integers to strings

logger

protected ILogger logger
the logger logs the output of all of the programm e.g. to Console
Constructor Detail

Program

public Program()
constructor
Method Detail

setLogger

public void setLogger(ILogger logger)
sets the logger used for processing the programm. all output will be routed over this logger

clear

public void clear()
clear the programm (clears all items found by the parser)
Specified by:
clear in interface IProgram

getSymbolTable

public ISymbolTable getSymbolTable()
returns the used symboltable to en- and decode the names
Specified by:
getSymbolTable in interface IProgram

setSymbolTable

public void setSymbolTable(SymbolTable table)
sets the symboltable

getQuerys

public IQueryList getQuerys()
returns a list with all queries found by the parser
Specified by:
getQuerys in interface IProgram

setFacts

public void setFacts(IFactDb f)
sets the fact database used to process a program

getFacts

public IFactDb getFacts()
returns the fact database used to process a program
Specified by:
getFacts in interface IProgram

setStatements

public void setStatements(IStatementMap sm)
sets the statement map used to resolve queries

getStatements

public IStatementMap getStatements()
returns the statement map used to resolve queries
Specified by:
getStatements in interface IProgram

genXml

public void genXml(java.io.Writer out)
            throws java.io.IOException
generates xml describing the datamodel when in memory, e.g. the statementtrees...

logFinalResult

protected void logFinalResult(IRelation format,
                              java.util.Iterator results)
logs a final result found by a query in prolog syntax
Parameters:
format -  
results -  

run

public void run()
         throws ParameterMatchingError
the method processing the program
Specified by:
run in interface IProgram
Throws:
ParameterMatchingError -