package com.jxml.quick.model.qjml;
import com.jxml.quick.ocm.*;
import com.jxml.quick.*;
import org.xml.sax.*;
import java.util.*;
import java.io.*;

/**
 * Models the elements element in QJML.
 * The elements element is used to describe the elements contained by the element being defined
 * by the bean element in which this elements element is contained.
 <pre>
DTD:

&lt;!ELEMENT elements <a href="#contentList">(item|selection|sequence)*</a>>

&lt;!ATTLIST elements
&nbsp;&nbsp;&nbsp;&nbsp;ID id #IMPLIED
>
 </pre> 
 */
public class QMElements extends QMCloneable
{
	/**
	 * A container for the QMContentModel objects (QMItem, QMSequence, and QMSelection)
	 * which model the contentModel elements (item, sequence, and selection) held by
	 * this elements element.
	 * The contentModel elements define the element content of the bean which contains
	 * this elements element.
	 */
	public ArrayList contentList=new ArrayList();

	/**
	 * Returns a deep copy of this object, but in an uninitialized form.
	 */
	public Object clone()
	{
		QMElements rv=(QMElements)super.clone();
		rv.contentList=clone(contentList);
		return rv;
	}

	/**
	 * Builds the maps.
	 * This method is called during initialization of the data model.
	 */
	public void buildMaps(Map coinMap, Map contentMap, QMCoin coin)
		throws SAXException
	{
		int s;
		int i;

		s=contentList.size();
		for (i=0;i<s;++i)
		{
			QMContentModel cm=(QMContentModel)contentList.get(i);
			cm.buildMaps(coinMap,contentMap,coin);
		}
	}

	/**
	 * Resolve references, inheritance.
	 * This method is called during initialization of the data model.
	 */
	public void init(Map coinMap, Map contentMap, QMCoin coin)
		throws SAXException
	{
		int s;
		int i;

		s=contentList.size();
		for (i=0;i<s;++i)
		{
			QMContentModel cm=(QMContentModel)contentList.get(i);
			cm.init(coinMap,contentMap);

		}
	}
}
