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 a selection element in QJML.
 * The contentModel elements held by a selection element defines alternative content
 * sub-models within the element content of another element.
 <pre>
DTD:

&lt;!ELEMENT selection (<a href="QMContentModel.html#remList">rem*</a>,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(<a href="QMContentModel.html#aref">aref</a>|<a href="QMContentModel.html#access">id|identity|ignore|field|property|accessClass)?</a>,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#contentList">(item|selection|sequence)</a>+)>

&lt;!ATTLIST selection
&nbsp;&nbsp;&nbsp;&nbsp;<a href="QMContentModel.html#label">label</a> CDATA #IMPLIED
&nbsp;&nbsp;&nbsp;&nbsp;<a href="QMContentModel.html#cref">cref</a> CDATA #IMPLIED
&nbsp;&nbsp;&nbsp;&nbsp;<a href="QMContentModel.html#optional">optional</a> CDATA "False"
&nbsp;&nbsp;&nbsp;&nbsp;<a href="QMContentModel.html#repeating">repeating</a> CDATA "False"
&nbsp;&nbsp;&nbsp;&nbsp;ID id #IMPLIED
>
 </pre>
 */
public class QMSelection extends QMSequence 
{
	public void init(Map coinMap, Map contentMap)
		throws SAXException
	{
		if (initialized)
			return;
		cminit(coinMap,contentMap);
		int s;
		int i;

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

		if (content!=null && (content instanceof QMSequence))
		{
			QMSequence seq=(QMSequence)content;
			contentList.addAll(seq.contentList);
		}
	}
}
