/*
 * 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 ResponseBlkType.
 * 
 * @version $Revision$ $Date$
 */
public abstract class ResponseBlkType implements java.io.Serializable {


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

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

    /**
     * Field _responseReport
     */
    private nz.co.cks.tms.xml.ResponseReport _responseReport;

    /**
     * Field _responseNcb
     */
    private nz.co.cks.tms.xml.ResponseNcb _responseNcb;

    /**
     * Field _responseEnquiryNcbService
     */
    private nz.co.cks.tms.xml.ResponseEnquiryNcbService _responseEnquiryNcbService;

    /**
     * Field _responseEnquiryNcbAddress
     */
    private nz.co.cks.tms.xml.ResponseEnquiryNcbAddress _responseEnquiryNcbAddress;

    /**
     * Field _responseEnquiryItem
     */
    private nz.co.cks.tms.xml.ResponseEnquiryItem _responseEnquiryItem;


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

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


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

    /**
     * Method addResponseGeneral
     * 
     * @param vResponseGeneral
     */
    public void addResponseGeneral(nz.co.cks.tms.xml.ResponseGeneral vResponseGeneral)
        throws java.lang.IndexOutOfBoundsException
    {
        _responseGeneralList.addElement(vResponseGeneral);
    } //-- void addResponseGeneral(nz.co.cks.tms.xml.ResponseGeneral) 

    /**
     * Method addResponseGeneral
     * 
     * @param index
     * @param vResponseGeneral
     */
    public void addResponseGeneral(int index, nz.co.cks.tms.xml.ResponseGeneral vResponseGeneral)
        throws java.lang.IndexOutOfBoundsException
    {
        _responseGeneralList.insertElementAt(vResponseGeneral, index);
    } //-- void addResponseGeneral(int, nz.co.cks.tms.xml.ResponseGeneral) 

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

    /**
     * Method getResponseEnquiryItemReturns the value of field
     * 'responseEnquiryItem'.
     * 
     * @return the value of field 'responseEnquiryItem'.
     */
    public nz.co.cks.tms.xml.ResponseEnquiryItem getResponseEnquiryItem()
    {
        return this._responseEnquiryItem;
    } //-- nz.co.cks.tms.xml.ResponseEnquiryItem getResponseEnquiryItem() 

    /**
     * Method getResponseEnquiryNcbAddressReturns the value of
     * field 'responseEnquiryNcbAddress'.
     * 
     * @return the value of field 'responseEnquiryNcbAddress'.
     */
    public nz.co.cks.tms.xml.ResponseEnquiryNcbAddress getResponseEnquiryNcbAddress()
    {
        return this._responseEnquiryNcbAddress;
    } //-- nz.co.cks.tms.xml.ResponseEnquiryNcbAddress getResponseEnquiryNcbAddress() 

    /**
     * Method getResponseEnquiryNcbServiceReturns the value of
     * field 'responseEnquiryNcbService'.
     * 
     * @return the value of field 'responseEnquiryNcbService'.
     */
    public nz.co.cks.tms.xml.ResponseEnquiryNcbService getResponseEnquiryNcbService()
    {
        return this._responseEnquiryNcbService;
    } //-- nz.co.cks.tms.xml.ResponseEnquiryNcbService getResponseEnquiryNcbService() 

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

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

    /**
     * Method getResponseGeneralCount
     */
    public int getResponseGeneralCount()
    {
        return _responseGeneralList.size();
    } //-- int getResponseGeneralCount() 

    /**
     * Method getResponseNcbReturns the value of field
     * 'responseNcb'.
     * 
     * @return the value of field 'responseNcb'.
     */
    public nz.co.cks.tms.xml.ResponseNcb getResponseNcb()
    {
        return this._responseNcb;
    } //-- nz.co.cks.tms.xml.ResponseNcb getResponseNcb() 

    /**
     * Method getResponseReportReturns the value of field
     * 'responseReport'.
     * 
     * @return the value of field 'responseReport'.
     */
    public nz.co.cks.tms.xml.ResponseReport getResponseReport()
    {
        return this._responseReport;
    } //-- nz.co.cks.tms.xml.ResponseReport getResponseReport() 

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

    /**
     * Method removeAllResponseGeneral
     */
    public void removeAllResponseGeneral()
    {
        _responseGeneralList.removeAllElements();
    } //-- void removeAllResponseGeneral() 

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

    /**
     * Method setResponseEnquiryItemSets the value of field
     * 'responseEnquiryItem'.
     * 
     * @param responseEnquiryItem the value of field
     * 'responseEnquiryItem'.
     */
    public void setResponseEnquiryItem(nz.co.cks.tms.xml.ResponseEnquiryItem responseEnquiryItem)
    {
        this._responseEnquiryItem = responseEnquiryItem;
    } //-- void setResponseEnquiryItem(nz.co.cks.tms.xml.ResponseEnquiryItem) 

    /**
     * Method setResponseEnquiryNcbAddressSets the value of field
     * 'responseEnquiryNcbAddress'.
     * 
     * @param responseEnquiryNcbAddress the value of field
     * 'responseEnquiryNcbAddress'.
     */
    public void setResponseEnquiryNcbAddress(nz.co.cks.tms.xml.ResponseEnquiryNcbAddress responseEnquiryNcbAddress)
    {
        this._responseEnquiryNcbAddress = responseEnquiryNcbAddress;
    } //-- void setResponseEnquiryNcbAddress(nz.co.cks.tms.xml.ResponseEnquiryNcbAddress) 

    /**
     * Method setResponseEnquiryNcbServiceSets the value of field
     * 'responseEnquiryNcbService'.
     * 
     * @param responseEnquiryNcbService the value of field
     * 'responseEnquiryNcbService'.
     */
    public void setResponseEnquiryNcbService(nz.co.cks.tms.xml.ResponseEnquiryNcbService responseEnquiryNcbService)
    {
        this._responseEnquiryNcbService = responseEnquiryNcbService;
    } //-- void setResponseEnquiryNcbService(nz.co.cks.tms.xml.ResponseEnquiryNcbService) 

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

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

    /**
     * Method setResponseNcbSets the value of field 'responseNcb'.
     * 
     * @param responseNcb the value of field 'responseNcb'.
     */
    public void setResponseNcb(nz.co.cks.tms.xml.ResponseNcb responseNcb)
    {
        this._responseNcb = responseNcb;
    } //-- void setResponseNcb(nz.co.cks.tms.xml.ResponseNcb) 

    /**
     * Method setResponseReportSets the value of field
     * 'responseReport'.
     * 
     * @param responseReport the value of field 'responseReport'.
     */
    public void setResponseReport(nz.co.cks.tms.xml.ResponseReport responseReport)
    {
        this._responseReport = responseReport;
    } //-- void setResponseReport(nz.co.cks.tms.xml.ResponseReport) 

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

}
