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


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

    /**
     * Field _ncbId
     */
    private int _ncbId;

    /**
     * keeps track of state for field: _ncbId
     */
    private boolean _has_ncbId;

    /**
     * Field _ncbConnectionLimit
     */
    private int _ncbConnectionLimit;

    /**
     * keeps track of state for field: _ncbConnectionLimit
     */
    private boolean _has_ncbConnectionLimit;

    /**
     * Field _ncbServiceAuthDateTime
     */
    private java.util.Date _ncbServiceAuthDateTime;

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

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


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

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


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

    /**
     * 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 enumerateNcbService
     */
    public java.util.Enumeration enumerateNcbService()
    {
        return _ncbServiceList.elements();
    } //-- java.util.Enumeration enumerateNcbService() 

    /**
     * Method getNcbConnectionLimitReturns the value of field
     * 'ncbConnectionLimit'.
     * 
     * @return the value of field 'ncbConnectionLimit'.
     */
    public int getNcbConnectionLimit()
    {
        return this._ncbConnectionLimit;
    } //-- int getNcbConnectionLimit() 

    /**
     * Method getNcbIdReturns the value of field 'ncbId'.
     * 
     * @return the value of field 'ncbId'.
     */
    public int getNcbId()
    {
        return this._ncbId;
    } //-- int getNcbId() 

    /**
     * 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 getNcbServiceAuthCommentReturns the value of field
     * 'ncbServiceAuthComment'.
     * 
     * @return the value of field 'ncbServiceAuthComment'.
     */
    public java.lang.String getNcbServiceAuthComment()
    {
        return this._ncbServiceAuthComment;
    } //-- java.lang.String getNcbServiceAuthComment() 

    /**
     * Method getNcbServiceAuthDateTimeReturns the value of field
     * 'ncbServiceAuthDateTime'.
     * 
     * @return the value of field 'ncbServiceAuthDateTime'.
     */
    public java.util.Date getNcbServiceAuthDateTime()
    {
        return this._ncbServiceAuthDateTime;
    } //-- java.util.Date getNcbServiceAuthDateTime() 

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

    /**
     * Method hasNcbConnectionLimit
     */
    public boolean hasNcbConnectionLimit()
    {
        return this._has_ncbConnectionLimit;
    } //-- boolean hasNcbConnectionLimit() 

    /**
     * Method hasNcbId
     */
    public boolean hasNcbId()
    {
        return this._has_ncbId;
    } //-- boolean hasNcbId() 

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

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

    /**
     * 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 setNcbConnectionLimitSets the value of field
     * 'ncbConnectionLimit'.
     * 
     * @param ncbConnectionLimit the value of field
     * 'ncbConnectionLimit'.
     */
    public void setNcbConnectionLimit(int ncbConnectionLimit)
    {
        this._ncbConnectionLimit = ncbConnectionLimit;
        this._has_ncbConnectionLimit = true;
    } //-- void setNcbConnectionLimit(int) 

    /**
     * Method setNcbIdSets the value of field 'ncbId'.
     * 
     * @param ncbId the value of field 'ncbId'.
     */
    public void setNcbId(int ncbId)
    {
        this._ncbId = ncbId;
        this._has_ncbId = true;
    } //-- void setNcbId(int) 

    /**
     * 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 setNcbServiceAuthCommentSets the value of field
     * 'ncbServiceAuthComment'.
     * 
     * @param ncbServiceAuthComment the value of field
     * 'ncbServiceAuthComment'.
     */
    public void setNcbServiceAuthComment(java.lang.String ncbServiceAuthComment)
    {
        this._ncbServiceAuthComment = ncbServiceAuthComment;
    } //-- void setNcbServiceAuthComment(java.lang.String) 

    /**
     * Method setNcbServiceAuthDateTimeSets the value of field
     * 'ncbServiceAuthDateTime'.
     * 
     * @param ncbServiceAuthDateTime the value of field
     * 'ncbServiceAuthDateTime'.
     */
    public void setNcbServiceAuthDateTime(java.util.Date ncbServiceAuthDateTime)
    {
        this._ncbServiceAuthDateTime = ncbServiceAuthDateTime;
    } //-- void setNcbServiceAuthDateTime(java.util.Date) 

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

}
