// copyright => http://www.jxml.com/mdsax/License.txt

package com.jxml.quick;
import java.util.*;

public class QSeqFactory extends QListFactory
{
    protected QFilter newFilter()
	throws QE
    {
	return new QSeq();
    }

    public class QSeq extends QList
    {
	public QSeq()
	    throws QE
	{
	}

	public void startDocument()
	    throws QPE
	{
            if (started)
		return;
	    super.startDocument();
	    int s=filters.size();
	    int i;
	    for (i=0;i<s;++i)
		{
		    QFilter f=(QFilter)filters.get(i);
		    f.startDocument();
		}
	}
	
	public void endDocument()
	    throws QPE
	{
	    if (ended)
		return;
	    super.endDocument();
	    int s=filters.size();
	    int i;
	    for (i=0;i<s;++i)
		{
		    QFilter f=(QFilter)filters.get(i);
		    f.endDocument();
		}
	}
	
	public void startElement(String name)
	    throws QPE
	{
	    int s=filters.size();
	    int i;
	    for (i=0;i<s;++i)
		{
		    QFilter f=(QFilter)filters.get(i);
		    f.startElement(name);
		}
	}
	
	public void endElement(String name, String text, boolean cdata)
	    throws QPE
	{
	    int s=filters.size();
	    int i;
	    for (i=0;i<s;++i)
		{
		    QFilter f=(QFilter)filters.get(i);
		    f.endElement(name,text,cdata);
		}
	}

	public void walk(Object object, QContext outputContext)
	    throws QPE
	{
	    int s=filters.size();
	    int i;
	    for (i=0;i<s;++i)
		{
		    QFilter f=(QFilter)filters.get(i);
		    f.walk(object,outputContext);
		}
	}
    }
}
