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


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

    /**
     * Field _ncb
     */
    private nz.co.cks.tms.xml.Ncb _ncb;

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

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


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

    public AdminUpdateType() {
        super();
        _ncbServiceList = new Vector();
        _ncbAddressList = new Vector();
    } //-- nz.co.cks.tms.xml.AdminUpdateType()


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

    /**
     * Method addNcbAddress
     * 
     * @param vNcbAddress
     */
    public void addNcbAddress(nz.co.cks.tms.xml.NcbAddress vNcbAddress)
        throws java.lang.IndexOutOfBoundsException
    {
        _ncbAddressList.addElement(vNcbAddress);
    } //-- void addNcbAddress(nz.co.cks.tms.xml.NcbAddress) 

    /**
     * Method addNcbAddress
     * 
     * @param index
     * @param vNcbAddress
     */
    public void addNcbAddress(int index, nz.co.cks.tms.xml.NcbAddress vNcbAddress)
        throws java.lang.IndexOutOfBoundsException
    {
        _ncbAddressList.insertElementAt(vNcbAddress, index);
    } //-- void addNcbAddress(int, nz.co.cks.tms.xml.NcbAddress) 

    /**
     * Method addNcbService
     * 
     * @param vNcbService
     */
    public void addNcbService(nz.co.cks.tms.xml.NcbService vNcbService)
        throws java.lang.IndexOutOfBoundsException
    {
        _ncbServiceList.addElement(vNcbService);
    } //-- void addNcbService(nz.co.cks.tms.xml.NcbService) 

    /**
     * Method addNcbService
     * 
     * @param index
     * @param vNcbService
     */
    public void addNcbService(int index, nz.co.cks.tms.xml.NcbService vNcbService)
        throws java.lang.IndexOutOfBoundsException
    {
        _ncbServiceList.insertElementAt(vNcbService, index);
    } //-- void addNcbService(int, nz.co.cks.tms.xml.NcbService) 

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

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

    /**
     * Method getNcbReturns the value of field 'ncb'.
     * 
     * @return the value of field 'ncb'.
     */
    public nz.co.cks.tms.xml.Ncb getNcb()
    {
        return this._ncb;
    } //-- nz.co.cks.tms.xml.Ncb getNcb() 

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

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

    /**
     * Method getNcbAddressCount
     */
    public int getNcbAddressCount()
    {
        return _ncbAddressList.size();
    } //-- int getNcbAddressCount() 

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

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

    /**
     * Method getNcbServiceCount
     */
    public int getNcbServiceCount()
    {
        return _ncbServiceList.size();
    } //-- int getNcbServiceCount() 

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

    /**
     * Method removeAllNcbAddress
     */
    public void removeAllNcbAddress()
    {
        _ncbAddressList.removeAllElements();
    } //-- void removeAllNcbAddress() 

    /**
     * Method removeAllNcbService
     */
    public void removeAllNcbService()
    {
        _ncbServiceList.removeAllElements();
    } //-- void removeAllNcbService() 

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

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

    /**
     * Method setNcbSets the value of field 'ncb'.
     * 
     * @param ncb the value of field 'ncb'.
     */
    public void setNcb(nz.co.cks.tms.xml.Ncb ncb)
    {
        this._ncb = ncb;
    } //-- void setNcb(nz.co.cks.tms.xml.Ncb) 

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

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

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

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

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

}
