/*
 * This class was automatically generated with 
 * <a href="http://www.castor.org">Castor 0.9.7</a>, using an XML
 * Schema.
 * $Id$
 */

package com.queplix.core.modules.eqlext.jxb.sr;

//---------------------------------/
//- Imported classes and packages -/
//---------------------------------/

import org.exolab.castor.xml.Marshaller;
import org.exolab.castor.xml.Unmarshaller;

import java.util.ArrayList;

/**
 * Class ExtSreqs.
 *
 * @version $Revision$ $Date$
 */
public class ExtSreqs extends com.queplix.core.utils.jxb.JXBObject
        implements java.io.Serializable {

    //--------------------------/
    //- Class/Member Variables -/
    //--------------------------/

    /**
     * Field _sreqList
     */
    private java.util.ArrayList _sreqList;

    //----------------/
    //- Constructors -/
    //----------------/

    public ExtSreqs() {
        super();
        _sreqList = new ArrayList();
    } //-- com.queplix.core.modules.eqlext.jxb.sr.ExtSreqs()

    //-----------/
    //- Methods -/
    //-----------/

    /**
     * Method addSreq
     *
     * @param vSreq
     */
    public void addSreq(com.queplix.core.modules.eqlext.jxb.sr.Sreq vSreq)
            throws java.lang.IndexOutOfBoundsException {
        _sreqList.add(vSreq);
    } //-- void addSreq(com.queplix.core.modules.eqlext.jxb.sr.Sreq) 

    /**
     * Method addSreq
     *
     * @param index
     * @param vSreq
     */
    public void addSreq(int index,
                        com.queplix.core.modules.eqlext.jxb.sr.Sreq vSreq)
            throws java.lang.IndexOutOfBoundsException {
        _sreqList.add(index, vSreq);
    } //-- void addSreq(int, com.queplix.core.modules.eqlext.jxb.sr.Sreq) 

    /**
     * Method clearSreq
     */
    public void clearSreq() {
        _sreqList.clear();
    } //-- void clearSreq() 

    /**
     * Method enumerateSreq
     *
     * @return Enumeration
     */
    public java.util.Enumeration enumerateSreq() {
        return new org.exolab.castor.util.IteratorEnumeration(
                _sreqList.iterator());
    } //-- java.util.Enumeration enumerateSreq() 

    /**
     * Method getSreq
     *
     * @param index
     * @return Sreq
     */
    public com.queplix.core.modules.eqlext.jxb.sr.Sreq getSreq(int index)
            throws java.lang.IndexOutOfBoundsException {
        //-- check bounds for index
        if((index < 0) || (index > _sreqList.size())) {
            throw new IndexOutOfBoundsException();
        }

        return (com.queplix.core.modules.eqlext.jxb.sr.Sreq) _sreqList.get(
                index);
    } //-- com.queplix.core.modules.eqlext.jxb.sr.Sreq getSreq(int) 

    /**
     * Method getSreq
     *
     * @return Sreq
     */
    public com.queplix.core.modules.eqlext.jxb.sr.Sreq[] getSreq() {
        int size = _sreqList.size();
        com.queplix.core.modules.eqlext.jxb.sr.Sreq[] mArray
                = new com.queplix.core.modules.eqlext.jxb.sr.Sreq[size];
        for(int index = 0; index < size; index++) {
            mArray[index]
                    = (com.queplix.core.modules.eqlext.jxb.sr.Sreq) _sreqList
                    .get(index);
        }
        return mArray;
    } //-- com.queplix.core.modules.eqlext.jxb.sr.Sreq[] getSreq() 

    /**
     * Method getSreqCount
     *
     * @return int
     */
    public int getSreqCount() {
        return _sreqList.size();
    } //-- int getSreqCount() 

    /**
     * Method isValid
     *
     * @return boolean
     */
    public boolean isValid() {
        try {
            validate();
        }
        catch (org.exolab.castor.xml.ValidationException vex) {
            return false;
        }
        return true;
    } //-- boolean isValid() 

    /**
     * Method marshal
     *
     * @param out
     */
    public void marshal(java.io.Writer out)
            throws org.exolab.castor.xml.MarshalException,
            org.exolab.castor.xml.ValidationException {

        Marshaller.marshal(this, out);
    } //-- void marshal(java.io.Writer) 

    /**
     * Method marshal
     *
     * @param handler
     */
    public void marshal(org.xml.sax.ContentHandler handler)
            throws java.io.IOException, org.exolab.castor.xml.MarshalException,
            org.exolab.castor.xml.ValidationException {

        Marshaller.marshal(this, handler);
    } //-- void marshal(org.xml.sax.ContentHandler) 

    /**
     * Method removeSreq
     *
     * @param vSreq
     * @return boolean
     */
    public boolean removeSreq(
            com.queplix.core.modules.eqlext.jxb.sr.Sreq vSreq) {
        boolean removed = _sreqList.remove(vSreq);
        return removed;
    } //-- boolean removeSreq(com.queplix.core.modules.eqlext.jxb.sr.Sreq) 

    /**
     * Method setSreq
     *
     * @param index
     * @param vSreq
     */
    public void setSreq(int index,
                        com.queplix.core.modules.eqlext.jxb.sr.Sreq vSreq)
            throws java.lang.IndexOutOfBoundsException {
        //-- check bounds for index
        if((index < 0) || (index > _sreqList.size())) {
            throw new IndexOutOfBoundsException();
        }
        _sreqList.set(index, vSreq);
    } //-- void setSreq(int, com.queplix.core.modules.eqlext.jxb.sr.Sreq) 

    /**
     * Method setSreq
     *
     * @param sreqArray
     */
    public void setSreq(
            com.queplix.core.modules.eqlext.jxb.sr.Sreq[] sreqArray) {
        //-- copy array
        _sreqList.clear();
        for(int i = 0; i < sreqArray.length; i++) {
            _sreqList.add(sreqArray[i]);
        }
    } //-- void setSreq(com.queplix.core.modules.eqlext.jxb.sr.Sreq) 

    /**
     * Method unmarshal
     *
     * @param reader
     * @return Object
     */
    public static java.lang.Object unmarshal(java.io.Reader reader)
            throws org.exolab.castor.xml.MarshalException,
            org.exolab.castor.xml.ValidationException {
        return (com.queplix.core.modules.eqlext.jxb.sr.ExtSreqs) Unmarshaller
                .unmarshal(
                        com.queplix.core.modules.eqlext.jxb.sr.ExtSreqs.class,
                        reader);
    } //-- java.lang.Object unmarshal(java.io.Reader) 

    /**
     * Method validate
     */
    public void validate()
            throws org.exolab.castor.xml.ValidationException {
        org.exolab.castor.xml.Validator validator
                = new org.exolab.castor.xml.Validator();
        validator.validate(this);
    } //-- void validate() 

}
