/*
 * 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.config.jxb.userprop;

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

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

import java.util.ArrayList;

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

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

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

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

    public SreqUserProperties() {
        super();
        _sreqUserPropertyList = new ArrayList();
    } //-- com.queplix.core.modules.config.jxb.userprop.SreqUserProperties()

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

    /**
     * Method addSreqUserProperty
     *
     * @param vSreqUserProperty
     */
    public void addSreqUserProperty(
            com.queplix.core.modules.config.jxb.userprop.SreqUserProperty vSreqUserProperty)
            throws java.lang.IndexOutOfBoundsException {
        _sreqUserPropertyList.add(vSreqUserProperty);
    } //-- void addSreqUserProperty(com.queplix.core.modules.config.jxb.userprop.SreqUserProperty) 

    /**
     * Method addSreqUserProperty
     *
     * @param index
     * @param vSreqUserProperty
     */
    public void addSreqUserProperty(int index,
                                    com.queplix.core.modules.config.jxb.userprop.SreqUserProperty vSreqUserProperty)
            throws java.lang.IndexOutOfBoundsException {
        _sreqUserPropertyList.add(index, vSreqUserProperty);
    } //-- void addSreqUserProperty(int, com.queplix.core.modules.config.jxb.userprop.SreqUserProperty) 

    /**
     * Method clearSreqUserProperty
     */
    public void clearSreqUserProperty() {
        _sreqUserPropertyList.clear();
    } //-- void clearSreqUserProperty() 

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

    /**
     * Method getSreqUserProperty
     *
     * @param index
     * @return SreqUserProperty
     */
    public com.queplix.core.modules.config.jxb.userprop.SreqUserProperty getSreqUserProperty(
            int index)
            throws java.lang.IndexOutOfBoundsException {
        //-- check bounds for index
        if((index < 0) || (index > _sreqUserPropertyList.size())) {
            throw new IndexOutOfBoundsException();
        }

        return (com.queplix.core.modules.config.jxb.userprop.SreqUserProperty) _sreqUserPropertyList
                .get(index);
    } //-- com.queplix.core.modules.config.jxb.userprop.SreqUserProperty getSreqUserProperty(int) 

    /**
     * Method getSreqUserProperty
     *
     * @return SreqUserProperty
     */
    public com.queplix.core.modules.config.jxb.userprop.SreqUserProperty[] getSreqUserProperty() {
        int size = _sreqUserPropertyList.size();
        com.queplix.core.modules.config.jxb.userprop.SreqUserProperty[] mArray
                = new com.queplix.core.modules.config.jxb.userprop.SreqUserProperty[size];
        for(int index = 0; index < size; index++) {
            mArray[index]
                    = (com.queplix.core.modules.config.jxb.userprop.SreqUserProperty) _sreqUserPropertyList
                    .get(index);
        }
        return mArray;
    } //-- com.queplix.core.modules.config.jxb.userprop.SreqUserProperty[] getSreqUserProperty() 

    /**
     * Method getSreqUserPropertyCount
     *
     * @return int
     */
    public int getSreqUserPropertyCount() {
        return _sreqUserPropertyList.size();
    } //-- int getSreqUserPropertyCount() 

    /**
     * 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 removeSreqUserProperty
     *
     * @param vSreqUserProperty
     * @return boolean
     */
    public boolean removeSreqUserProperty(
            com.queplix.core.modules.config.jxb.userprop.SreqUserProperty vSreqUserProperty) {
        boolean removed = _sreqUserPropertyList.remove(vSreqUserProperty);
        return removed;
    } //-- boolean removeSreqUserProperty(com.queplix.core.modules.config.jxb.userprop.SreqUserProperty) 

    /**
     * Method setSreqUserProperty
     *
     * @param index
     * @param vSreqUserProperty
     */
    public void setSreqUserProperty(int index,
                                    com.queplix.core.modules.config.jxb.userprop.SreqUserProperty vSreqUserProperty)
            throws java.lang.IndexOutOfBoundsException {
        //-- check bounds for index
        if((index < 0) || (index > _sreqUserPropertyList.size())) {
            throw new IndexOutOfBoundsException();
        }
        _sreqUserPropertyList.set(index, vSreqUserProperty);
    } //-- void setSreqUserProperty(int, com.queplix.core.modules.config.jxb.userprop.SreqUserProperty) 

    /**
     * Method setSreqUserProperty
     *
     * @param sreqUserPropertyArray
     */
    public void setSreqUserProperty(
            com.queplix.core.modules.config.jxb.userprop.SreqUserProperty[] sreqUserPropertyArray) {
        //-- copy array
        _sreqUserPropertyList.clear();
        for(int i = 0; i < sreqUserPropertyArray.length; i++) {
            _sreqUserPropertyList.add(sreqUserPropertyArray[i]);
        }
    } //-- void setSreqUserProperty(com.queplix.core.modules.config.jxb.userprop.SreqUserProperty) 

    /**
     * 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.config.jxb.userprop.SreqUserProperties) Unmarshaller
                .unmarshal(
                        com.queplix.core.modules.config.jxb.userprop.SreqUserProperties.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() 

}
