prolog.implementation
Class ProgramBuilder

java.lang.Object
  |
  +--prolog.implementation.ProgramBuilder
All Implemented Interfaces:
IProgramBuilder
Direct Known Subclasses:
DemoProgramBuilder

public class ProgramBuilder
extends java.lang.Object
implements IProgramBuilder

IProgramBuilder is a kind of class factory. It is required to be able to use different implementation of classed in the program. it is also usefull to seperate packages from each other. so a minimal set of import references into another package is required. !!! be ware of class cast exceptions !!! this is the default implementation of the IProgramBuilder. it creates instances from the prolog.implementation package


Field Summary
protected  ISymbolTable symbolTable
          the symbol table stored in the builder (HACK to be able to get the symboltable from everywhere)
 
Constructor Summary
ProgramBuilder()
          constructor
 
Method Summary
 IFact createAndStatement(IFact f)
          returns a implementation of a AndStatement
 IFact createAndStatement(int name)
          returns a implementation of a AndStatement
 IFact createConstraintStatement(int name)
          returns a implementation of a ConstraintStatement
 IFact createConstraintStatement(int name, IRelation relation)
          returns a implementation of a ConstraintStatement
 IFact createFact(int name)
          returns a implementation of a IFact
 IFact createFact(int name, IRelation relation)
          returns a implementation of a IFact
 IFactDb createFactDb()
          returns a implementation of a IFactDb
 IFactList createFactList(int name, int colCount)
          returns a implementation of a IFactList
 IFact createMatchingStatement(int name)
          returns a implementation of a MatchingStatement
 IFact createMatchingStatement(int name, IRelation relation)
          returns a implementation of a MatchingStatement
 IProgram createProgram()
          returns a implementation of a IProgram
 IFact createQuery(int name)
          returns a implementation of a Query
 IQueryList createQueryList()
          returns a implementation of a IQueryList
 IRelation createRelation()
          returns a implementation of a IRelation
 IStatementMap createStatementMap()
          returns a implementation of a IStatementMap
 IAtom createValue(int value)
          returns a implementation of a IAtom as Value
 IAtom createVariable(int value)
          returns a implementation of a IAtom as Variable
 ISymbolTable getSymbolTable()
          returns a implementation of a ISymbolTable
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

symbolTable

protected ISymbolTable symbolTable
the symbol table stored in the builder (HACK to be able to get the symboltable from everywhere)
Constructor Detail

ProgramBuilder

public ProgramBuilder()
constructor
Method Detail

createQueryList

public IQueryList createQueryList()
returns a implementation of a IQueryList
Specified by:
createQueryList in interface IProgramBuilder

createStatementMap

public IStatementMap createStatementMap()
returns a implementation of a IStatementMap
Specified by:
createStatementMap in interface IProgramBuilder

createFactDb

public IFactDb createFactDb()
returns a implementation of a IFactDb
Specified by:
createFactDb in interface IProgramBuilder

createProgram

public IProgram createProgram()
returns a implementation of a IProgram
Specified by:
createProgram in interface IProgramBuilder

createFactList

public IFactList createFactList(int name,
                                int colCount)
returns a implementation of a IFactList
Specified by:
createFactList in interface IProgramBuilder

createRelation

public IRelation createRelation()
returns a implementation of a IRelation
Specified by:
createRelation in interface IProgramBuilder

createAndStatement

public IFact createAndStatement(int name)
returns a implementation of a AndStatement
Specified by:
createAndStatement in interface IProgramBuilder

createAndStatement

public IFact createAndStatement(IFact f)
returns a implementation of a AndStatement
Specified by:
createAndStatement in interface IProgramBuilder

createConstraintStatement

public IFact createConstraintStatement(int name)
returns a implementation of a ConstraintStatement
Specified by:
createConstraintStatement in interface IProgramBuilder

createConstraintStatement

public IFact createConstraintStatement(int name,
                                       IRelation relation)
returns a implementation of a ConstraintStatement
Specified by:
createConstraintStatement in interface IProgramBuilder

createMatchingStatement

public IFact createMatchingStatement(int name)
returns a implementation of a MatchingStatement
Specified by:
createMatchingStatement in interface IProgramBuilder

createMatchingStatement

public IFact createMatchingStatement(int name,
                                     IRelation relation)
returns a implementation of a MatchingStatement
Specified by:
createMatchingStatement in interface IProgramBuilder

createQuery

public IFact createQuery(int name)
returns a implementation of a Query
Specified by:
createQuery in interface IProgramBuilder

createFact

public IFact createFact(int name,
                        IRelation relation)
returns a implementation of a IFact
Specified by:
createFact in interface IProgramBuilder

createFact

public IFact createFact(int name)
returns a implementation of a IFact
Specified by:
createFact in interface IProgramBuilder

createValue

public IAtom createValue(int value)
returns a implementation of a IAtom as Value
Specified by:
createValue in interface IProgramBuilder

createVariable

public IAtom createVariable(int value)
returns a implementation of a IAtom as Variable
Specified by:
createVariable in interface IProgramBuilder

getSymbolTable

public ISymbolTable getSymbolTable()
returns a implementation of a ISymbolTable
Specified by:
getSymbolTable in interface IProgramBuilder