prolog.implementation
Class QueryList

java.lang.Object
  |
  +--prolog.implementation.QueryList
All Implemented Interfaces:
IQueryList

public class QueryList
extends java.lang.Object
implements IQueryList

A query list stores statementtrees having a Query as root

prolog:

?-myQuery1(X,Y):-superman1(Y,X),superwomen1(X,Y).

?-myQuery2(X,Y):-superman2(Y,X),superwomen2(X,Y).

In this example, the two queries "myQuery1" and "myQuery2" are stored in a querylist


Field Summary
protected  java.util.List listeners
          list of IQueryListListeners
protected  java.util.List queries
          the list storing the queries
 
Constructor Summary
QueryList()
          constructor
 
Method Summary
 void addListener(IQueryListListener l)
          registers a listener
 void addQuery(IFact f)
          adds the given query to the fact list
 void clear()
          clears this query list
protected  void fireChange()
          fires a content changed notify
 void genXml(java.io.Writer out, ISymbolTable table)
          generates xml describing this object
 java.util.Iterator getQueries()
          returns a iterator over all stored queries
 void removeListener(IQueryListListener l)
          unregisters a listener
 java.lang.String toString(ISymbolTable table)
          returns a string representation of this class
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

listeners

protected java.util.List listeners
list of IQueryListListeners

queries

protected java.util.List queries
the list storing the queries
Constructor Detail

QueryList

public QueryList()
constructor
Method Detail

clear

public void clear()
clears this query list
Specified by:
clear in interface IQueryList

getQueries

public java.util.Iterator getQueries()
returns a iterator over all stored queries
Specified by:
getQueries in interface IQueryList

addQuery

public void addQuery(IFact f)
adds the given query to the fact list
Specified by:
addQuery in interface IQueryList

toString

public java.lang.String toString(ISymbolTable table)
returns a string representation of this class
Specified by:
toString in interface IQueryList

genXml

public void genXml(java.io.Writer out,
                   ISymbolTable table)
            throws java.io.IOException
generates xml describing this object
Specified by:
genXml in interface IQueryList
Parameters:
out - the writer to append the xml
table - the symboltable to decode the symbols
Throws:
java.io.IOException -  

addListener

public void addListener(IQueryListListener l)
registers a listener

removeListener

public void removeListener(IQueryListListener l)
unregisters a listener

fireChange

protected void fireChange()
fires a content changed notify