/*
 * 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.eql.jxb.eqlagent;

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

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

import java.util.ArrayList;

/**
 * Entity schema root element
 *
 * @version $Revision$ $Date$
 */
public class Entityschemas extends com.queplix.core.utils.jxb.JXBObject
        implements java.io.Serializable {

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

    /**
     * Field _default
     */
    private java.lang.String _default;

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

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

    public Entityschemas() {
        super();
        _entityschemaList = new ArrayList();
    } //-- com.queplix.core.modules.eql.jxb.eqlagent.Entityschemas()

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

    /**
     * Method addEntityschema
     *
     * @param vEntityschema
     */
    public void addEntityschema(
            com.queplix.core.modules.eql.jxb.eqlagent.Entityschema vEntityschema)
            throws java.lang.IndexOutOfBoundsException {
        _entityschemaList.add(vEntityschema);
    } //-- void addEntityschema(com.queplix.core.modules.eql.jxb.eqlagent.Entityschema) 

    /**
     * Method addEntityschema
     *
     * @param index
     * @param vEntityschema
     */
    public void addEntityschema(int index,
                                com.queplix.core.modules.eql.jxb.eqlagent.Entityschema vEntityschema)
            throws java.lang.IndexOutOfBoundsException {
        _entityschemaList.add(index, vEntityschema);
    } //-- void addEntityschema(int, com.queplix.core.modules.eql.jxb.eqlagent.Entityschema) 

    /**
     * Method clearEntityschema
     */
    public void clearEntityschema() {
        _entityschemaList.clear();
    } //-- void clearEntityschema() 

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

    /**
     * Returns the value of field 'default'.
     *
     * @return the value of field 'default'.
     */
    public java.lang.String getDefault() {
        return this._default;
    } //-- java.lang.String getDefault() 

    /**
     * Method getEntityschema
     *
     * @param index
     * @return Entityschema
     */
    public com.queplix.core.modules.eql.jxb.eqlagent.Entityschema getEntityschema(
            int index)
            throws java.lang.IndexOutOfBoundsException {
        //-- check bounds for index
        if((index < 0) || (index > _entityschemaList.size())) {
            throw new IndexOutOfBoundsException();
        }

        return (com.queplix.core.modules.eql.jxb.eqlagent.Entityschema) _entityschemaList
                .get(index);
    } //-- com.queplix.core.modules.eql.jxb.eqlagent.Entityschema getEntityschema(int) 

    /**
     * Method getEntityschema
     *
     * @return Entityschema
     */
    public com.queplix.core.modules.eql.jxb.eqlagent.Entityschema[] getEntityschema() {
        int size = _entityschemaList.size();
        com.queplix.core.modules.eql.jxb.eqlagent.Entityschema[] mArray
                = new com.queplix.core.modules.eql.jxb.eqlagent.Entityschema[size];
        for(int index = 0; index < size; index++) {
            mArray[index]
                    = (com.queplix.core.modules.eql.jxb.eqlagent.Entityschema) _entityschemaList
                    .get(index);
        }
        return mArray;
    } //-- com.queplix.core.modules.eql.jxb.eqlagent.Entityschema[] getEntityschema() 

    /**
     * Method getEntityschemaCount
     *
     * @return int
     */
    public int getEntityschemaCount() {
        return _entityschemaList.size();
    } //-- int getEntityschemaCount() 

    /**
     * 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 removeEntityschema
     *
     * @param vEntityschema
     * @return boolean
     */
    public boolean removeEntityschema(
            com.queplix.core.modules.eql.jxb.eqlagent.Entityschema vEntityschema) {
        boolean removed = _entityschemaList.remove(vEntityschema);
        return removed;
    } //-- boolean removeEntityschema(com.queplix.core.modules.eql.jxb.eqlagent.Entityschema) 

    /**
     * Sets the value of field 'default'.
     *
     * @param _default
     * @param default  the value of field 'default'.
     */
    public void setDefault(java.lang.String _default) {
        this._default = _default;
    } //-- void setDefault(java.lang.String) 

    /**
     * Method setEntityschema
     *
     * @param index
     * @param vEntityschema
     */
    public void setEntityschema(int index,
                                com.queplix.core.modules.eql.jxb.eqlagent.Entityschema vEntityschema)
            throws java.lang.IndexOutOfBoundsException {
        //-- check bounds for index
        if((index < 0) || (index > _entityschemaList.size())) {
            throw new IndexOutOfBoundsException();
        }
        _entityschemaList.set(index, vEntityschema);
    } //-- void setEntityschema(int, com.queplix.core.modules.eql.jxb.eqlagent.Entityschema) 

    /**
     * Method setEntityschema
     *
     * @param entityschemaArray
     */
    public void setEntityschema(
            com.queplix.core.modules.eql.jxb.eqlagent.Entityschema[] entityschemaArray) {
        //-- copy array
        _entityschemaList.clear();
        for(int i = 0; i < entityschemaArray.length; i++) {
            _entityschemaList.add(entityschemaArray[i]);
        }
    } //-- void setEntityschema(com.queplix.core.modules.eql.jxb.eqlagent.Entityschema) 

    /**
     * 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.eql.jxb.eqlagent.Entityschemas) Unmarshaller
                .unmarshal(
                        com.queplix.core.modules.eql.jxb.eqlagent.Entityschemas.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() 

}
