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

package nz.co.cks.tms.xml;

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

import java.io.Reader;
import java.io.Serializable;
import java.io.Writer;
import java.util.Enumeration;
import java.util.Vector;
import org.exolab.castor.xml.Marshaller;
import org.exolab.castor.xml.Unmarshaller;
import org.exolab.castor.xml.ValidationException;

/**
 * Class ResponseNcbType.
 * 
 * @version $Revision$ $Date$
 */
public abstract class ResponseNcbType implements java.io.Serializable {


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

    /**
     * Field _ncbList
     */
    private java.util.Vector _ncbList;


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

    public ResponseNcbType() {
        super();
        _ncbList = new Vector();
    } //-- nz.co.cks.tms.xml.ResponseNcbType()


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

    /**
     * Method addNcb
     * 
     * @param vNcb
     */
    public void addNcb(nz.co.cks.tms.xml.Ncb vNcb)
        throws java.lang.IndexOutOfBoundsException
    {
        _ncbList.addElement(vNcb);
    } //-- void addNcb(nz.co.cks.tms.xml.Ncb) 

    /**
     * Method addNcb
     * 
     * @param index
     * @param vNcb
     */
    public void addNcb(int index, nz.co.cks.tms.xml.Ncb vNcb)
        throws java.lang.IndexOutOfBoundsException
    {
        _ncbList.insertElementAt(vNcb, index);
    } //-- void addNcb(int, nz.co.cks.tms.xml.Ncb) 

    /**
     * Method enumerateNcb
     */
    public java.util.Enumeration enumerateNcb()
    {
        return _ncbList.elements();
    } //-- java.util.Enumeration enumerateNcb() 

    /**
     * Method getNcb
     * 
     * @param index
     */
    public nz.co.cks.tms.xml.Ncb getNcb(int index)
        throws java.lang.IndexOutOfBoundsException
    {
        //-- check bounds for index
        if ((index < 0) || (index > _ncbList.size())) {
            throw new IndexOutOfBoundsException();
        }
        
        return (nz.co.cks.tms.xml.Ncb) _ncbList.elementAt(index);
    } //-- nz.co.cks.tms.xml.Ncb getNcb(int) 

    /**
     * Method getNcb
     */
    public nz.co.cks.tms.xml.Ncb[] getNcb()
    {
        int size = _ncbList.size();
        nz.co.cks.tms.xml.Ncb[] mArray = new nz.co.cks.tms.xml.Ncb[size];
        for (int index = 0; index < size; index++) {
            mArray[index] = (nz.co.cks.tms.xml.Ncb) _ncbList.elementAt(index);
        }
        return mArray;
    } //-- nz.co.cks.tms.xml.Ncb[] getNcb() 

    /**
     * Method getNcbCount
     */
    public int getNcbCount()
    {
        return _ncbList.size();
    } //-- int getNcbCount() 

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

    /**
     * Method removeAllNcb
     */
    public void removeAllNcb()
    {
        _ncbList.removeAllElements();
    } //-- void removeAllNcb() 

    /**
     * Method removeNcb
     * 
     * @param index
     */
    public nz.co.cks.tms.xml.Ncb removeNcb(int index)
    {
        java.lang.Object obj = _ncbList.elementAt(index);
        _ncbList.removeElementAt(index);
        return (nz.co.cks.tms.xml.Ncb) obj;
    } //-- nz.co.cks.tms.xml.Ncb removeNcb(int) 

    /**
     * Method setNcb
     * 
     * @param index
     * @param vNcb
     */
    public void setNcb(int index, nz.co.cks.tms.xml.Ncb vNcb)
        throws java.lang.IndexOutOfBoundsException
    {
        //-- check bounds for index
        if ((index < 0) || (index > _ncbList.size())) {
            throw new IndexOutOfBoundsException();
        }
        _ncbList.setElementAt(vNcb, index);
    } //-- void setNcb(int, nz.co.cks.tms.xml.Ncb) 

    /**
     * Method setNcb
     * 
     * @param ncbArray
     */
    public void setNcb(nz.co.cks.tms.xml.Ncb[] ncbArray)
    {
        //-- copy array
        _ncbList.removeAllElements();
        for (int i = 0; i < ncbArray.length; i++) {
            _ncbList.addElement(ncbArray[i]);
        }
    } //-- void setNcb(nz.co.cks.tms.xml.Ncb) 

    /**
     * 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() 

}
