FileDocCategorySizeDatePackage
Employees.javaAPI DocExample5663Thu Mar 07 09:58:26 GMT 2002javajaxb.generated.hr

Employees.java

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

package javajaxb.generated.hr;

  //---------------------------------/
 //- 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.*;
import org.exolab.castor.xml.MarshalException;
import org.exolab.castor.xml.ValidationException;
import org.xml.sax.DocumentHandler;

/**
 * 
 * @version $Revision$ $Date$
**/
public class Employees implements java.io.Serializable {


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

    /**
     * Employee representation
    **/
    private java.util.Vector _employeeList;


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

    public Employees() {
        super();
        _employeeList = new Vector();
    } //-- javajaxb.generated.hr.Employees()


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

    /**
     * 
     * @param vEmployee
    **/
    public void addEmployee(Employee vEmployee)
        throws java.lang.IndexOutOfBoundsException
    {
        _employeeList.addElement(vEmployee);
    } //-- void addEmployee(Employee) 

    /**
     * 
     * @param index
     * @param vEmployee
    **/
    public void addEmployee(int index, Employee vEmployee)
        throws java.lang.IndexOutOfBoundsException
    {
        _employeeList.insertElementAt(vEmployee, index);
    } //-- void addEmployee(int, Employee) 

    /**
    **/
    public java.util.Enumeration enumerateEmployee()
    {
        return _employeeList.elements();
    } //-- java.util.Enumeration enumerateEmployee() 

    /**
     * 
     * @param index
    **/
    public Employee getEmployee(int index)
        throws java.lang.IndexOutOfBoundsException
    {
        //-- check bounds for index
        if ((index < 0) || (index > _employeeList.size())) {
            throw new IndexOutOfBoundsException();
        }
        
        return (Employee) _employeeList.elementAt(index);
    } //-- Employee getEmployee(int) 

    /**
    **/
    public Employee[] getEmployee()
    {
        int size = _employeeList.size();
        Employee[] mArray = new Employee[size];
        for (int index = 0; index < size; index++) {
            mArray[index] = (Employee) _employeeList.elementAt(index);
        }
        return mArray;
    } //-- Employee[] getEmployee() 

    /**
    **/
    public int getEmployeeCount()
    {
        return _employeeList.size();
    } //-- int getEmployeeCount() 

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

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

    /**
     * 
     * @param handler
    **/
    public void marshal(org.xml.sax.DocumentHandler handler)
        throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
    {
        
        Marshaller.marshal(this, handler);
    } //-- void marshal(org.xml.sax.DocumentHandler) 

    /**
    **/
    public void removeAllEmployee()
    {
        _employeeList.removeAllElements();
    } //-- void removeAllEmployee() 

    /**
     * 
     * @param index
    **/
    public Employee removeEmployee(int index)
    {
        Object obj = _employeeList.elementAt(index);
        _employeeList.removeElementAt(index);
        return (Employee) obj;
    } //-- Employee removeEmployee(int) 

    /**
     * 
     * @param index
     * @param vEmployee
    **/
    public void setEmployee(int index, Employee vEmployee)
        throws java.lang.IndexOutOfBoundsException
    {
        //-- check bounds for index
        if ((index < 0) || (index > _employeeList.size())) {
            throw new IndexOutOfBoundsException();
        }
        _employeeList.setElementAt(vEmployee, index);
    } //-- void setEmployee(int, Employee) 

    /**
     * 
     * @param employeeArray
    **/
    public void setEmployee(Employee[] employeeArray)
    {
        //-- copy array
        _employeeList.removeAllElements();
        for (int i = 0; i < employeeArray.length; i++) {
            _employeeList.addElement(employeeArray[i]);
        }
    } //-- void setEmployee(Employee) 

    /**
     * 
     * @param reader
    **/
    public static javajaxb.generated.hr.Employees unmarshal(java.io.Reader reader)
        throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
    {
        return (javajaxb.generated.hr.Employees) Unmarshaller.unmarshal(javajaxb.generated.hr.Employees.class, reader);
    } //-- javajaxb.generated.hr.Employees unmarshal(java.io.Reader) 

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

}