package prolog.model;

import java.io.*;
import java.util.*;

/**
 * <p>A query list stores statementtrees having a Query as root</p>
 * <p>prolog:</p>
 * <p>?-myQuery1(X,Y):-superman1(Y,X),superwomen1(X,Y).</p>
 * <p>?-myQuery2(X,Y):-superman2(Y,X),superwomen2(X,Y).</p>
 * <p>In this example, the two queries "myQuery1" and "myQuery2" are
 * stored in a querylist</p>
 */
public interface IQueryList
{
	/**
	 * clears the query list
	 */
	public void clear();

	/**
	 * adds a query to the list
	 */
	public void addQuery( IFact f );

	/**
	 * returns a iterator over all queries
	 */
	public Iterator getQueries();

	/**
	 * returns a string representation of this query list with decoded symbols
	 */
	public String toString( ISymbolTable table );

	/**
	 * generates xml describing this object
	 * @param out the writer to append the xml
	 * @param table the symboltable to decode the symbols
	 * @throws IOException
	 */
	public void genXml( Writer out, ISymbolTable table )
	   throws IOException;
}
