/*
 * 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.portal;

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

import java.io.IOException;
import java.io.Reader;
import java.io.Serializable;
import java.io.Writer;
import java.util.ArrayList;
import java.util.Enumeration;
import org.exolab.castor.xml.MarshalException;
import org.exolab.castor.xml.Marshaller;
import org.exolab.castor.xml.Unmarshaller;
import org.exolab.castor.xml.ValidationException;
import org.xml.sax.ContentHandler;

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


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

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


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

    public PortalConfigs() 
     {
        super();
        _portalConfigList = new ArrayList();
    } //-- com.queplix.core.modules.config.jxb.portal.PortalConfigs()


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

    /**
     * Method addPortalConfig
     * 
     * 
     * 
     * @param vPortalConfig
     */
    public void addPortalConfig(com.queplix.core.modules.config.jxb.portal.PortalConfig vPortalConfig)
        throws java.lang.IndexOutOfBoundsException
    {
        _portalConfigList.add(vPortalConfig);
    } //-- void addPortalConfig(com.queplix.core.modules.config.jxb.portal.PortalConfig) 

    /**
     * Method addPortalConfig
     * 
     * 
     * 
     * @param index
     * @param vPortalConfig
     */
    public void addPortalConfig(int index, com.queplix.core.modules.config.jxb.portal.PortalConfig vPortalConfig)
        throws java.lang.IndexOutOfBoundsException
    {
        _portalConfigList.add(index, vPortalConfig);
    } //-- void addPortalConfig(int, com.queplix.core.modules.config.jxb.portal.PortalConfig) 

    /**
     * Method clearPortalConfig
     * 
     */
    public void clearPortalConfig()
    {
        _portalConfigList.clear();
    } //-- void clearPortalConfig() 

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

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

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

    /**
     * Method getPortalConfigCount
     * 
     * 
     * 
     * @return int
     */
    public int getPortalConfigCount()
    {
        return _portalConfigList.size();
    } //-- int getPortalConfigCount() 

    /**
     * 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 removePortalConfig
     * 
     * 
     * 
     * @param vPortalConfig
     * @return boolean
     */
    public boolean removePortalConfig(com.queplix.core.modules.config.jxb.portal.PortalConfig vPortalConfig)
    {
        boolean removed = _portalConfigList.remove(vPortalConfig);
        return removed;
    } //-- boolean removePortalConfig(com.queplix.core.modules.config.jxb.portal.PortalConfig) 

    /**
     * Method setPortalConfig
     * 
     * 
     * 
     * @param index
     * @param vPortalConfig
     */
    public void setPortalConfig(int index, com.queplix.core.modules.config.jxb.portal.PortalConfig vPortalConfig)
        throws java.lang.IndexOutOfBoundsException
    {
        //-- check bounds for index
        if ((index < 0) || (index > _portalConfigList.size())) {
            throw new IndexOutOfBoundsException();
        }
        _portalConfigList.set(index, vPortalConfig);
    } //-- void setPortalConfig(int, com.queplix.core.modules.config.jxb.portal.PortalConfig) 

    /**
     * Method setPortalConfig
     * 
     * 
     * 
     * @param portalConfigArray
     */
    public void setPortalConfig(com.queplix.core.modules.config.jxb.portal.PortalConfig[] portalConfigArray)
    {
        //-- copy array
        _portalConfigList.clear();
        for (int i = 0; i < portalConfigArray.length; i++) {
            _portalConfigList.add(portalConfigArray[i]);
        }
    } //-- void setPortalConfig(com.queplix.core.modules.config.jxb.portal.PortalConfig) 

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

}
